@duplicati/ngclient 0.0.220 → 0.0.223

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 (125) hide show
  1. package/assets/dest-icons/drime.png +0 -0
  2. package/{chunk-22AR7ES3.js → chunk-22JSUCD3.js} +1 -1
  3. package/{chunk-EADZVBRA.js → chunk-2CKH2RVA.js} +1 -1
  4. package/{chunk-IQL3REGJ.js → chunk-2KD757N6.js} +1 -1
  5. package/{chunk-X276XFCH.js → chunk-2VLJLCTO.js} +1 -1
  6. package/{chunk-OPHQNXYO.js → chunk-2YUSBRXY.js} +1 -1
  7. package/{chunk-RRDLQLTM.js → chunk-35ZRBDWM.js} +1 -1
  8. package/{chunk-NHS6CQO2.js → chunk-3BIHFX4H.js} +1 -1
  9. package/chunk-3D6EL52D.js +1 -0
  10. package/chunk-4IRGFIAU.js +1 -0
  11. package/chunk-4J64RICN.js +1 -0
  12. package/{chunk-DSYNIXJF.js → chunk-5E3B4AEF.js} +1 -1
  13. package/{chunk-ANSV4G2K.js → chunk-5W4BSVZJ.js} +1 -1
  14. package/chunk-6JGOGUIX.js +1 -0
  15. package/chunk-6RIKNAXD.js +1 -0
  16. package/{chunk-KDV2OE64.js → chunk-6V4CDRLK.js} +1 -1
  17. package/{chunk-P4R3ERID.js → chunk-7AXKIK5Z.js} +1 -1
  18. package/{chunk-RLWICOKH.js → chunk-7SP45FHP.js} +1 -1
  19. package/chunk-AFHEXZUZ.js +1 -0
  20. package/{chunk-RJ2JM7C7.js → chunk-AXG7WHBS.js} +1 -1
  21. package/{chunk-WOKYULBU.js → chunk-AXLO5KWF.js} +1 -1
  22. package/{chunk-EKVZKEQJ.js → chunk-B4QFOJXL.js} +1 -1
  23. package/{chunk-TCXCC5BM.js → chunk-BPHX6VXP.js} +1 -1
  24. package/{chunk-GN7AO4B6.js → chunk-CEDH3C4K.js} +1 -1
  25. package/{chunk-VKQQDCUN.js → chunk-CJKZ27FM.js} +1 -1
  26. package/{chunk-YCJYEQF7.js → chunk-COEGVUM3.js} +1 -1
  27. package/chunk-CQJRBQ6I.js +1 -0
  28. package/{chunk-5RNU5BNO.js → chunk-CUYURNCQ.js} +1 -1
  29. package/{chunk-ELCA5MKF.js → chunk-CWBB6FON.js} +1 -1
  30. package/{chunk-PXI3UZ4R.js → chunk-DT3A5ZZG.js} +1 -1
  31. package/{chunk-ACTJSKQZ.js → chunk-EAVDZEBJ.js} +1 -1
  32. package/{chunk-FD5CKX3J.js → chunk-F5RBSCC2.js} +1 -1
  33. package/{chunk-ZP3QZ43W.js → chunk-FNWC6U3F.js} +1 -1
  34. package/{chunk-QDDVZ4CR.js → chunk-FQINMZH2.js} +1 -1
  35. package/chunk-FXBX5QMR.js +1 -0
  36. package/{chunk-23SRH7FI.js → chunk-GA3CAVSK.js} +1 -1
  37. package/chunk-GBSP3YAH.js +2 -0
  38. package/{chunk-2J2554EV.js → chunk-GBUTPGY5.js} +1 -1
  39. package/{chunk-JPCUISZG.js → chunk-GNKCBZMS.js} +1 -1
  40. package/{chunk-N2AU7VKX.js → chunk-HDDAGHHE.js} +1 -1
  41. package/{chunk-ZYRB2TUK.js → chunk-HDGXP6C6.js} +1 -1
  42. package/chunk-HLHUPBCV.js +1 -0
  43. package/chunk-HPXIWKIK.js +1 -0
  44. package/chunk-HWOUAWOE.js +1 -0
  45. package/{chunk-IFSZJSGH.js → chunk-JB26UVQP.js} +1 -1
  46. package/chunk-JLANSXSK.js +1 -0
  47. package/chunk-JYRKUYG6.js +1 -0
  48. package/chunk-K5XGRFWJ.js +4 -0
  49. package/{chunk-XXVDL5TR.js → chunk-KI2HT2TI.js} +1 -1
  50. package/{chunk-37ODVJFS.js → chunk-LNKXSLIG.js} +1 -1
  51. package/chunk-MJPEKJ3T.js +2 -0
  52. package/{chunk-RGFJ5UMA.js → chunk-N3TVNDVH.js} +1 -1
  53. package/chunk-NDOIWI7D.js +1 -0
  54. package/chunk-NFATJ2CP.js +1 -0
  55. package/{chunk-UCHK3SHH.js → chunk-O5RZGVMD.js} +1 -1
  56. package/chunk-OETM3ZQK.js +1 -0
  57. package/chunk-OQGMZ5Z4.js +1 -0
  58. package/{chunk-M3PW6DLD.js → chunk-PDGW22XJ.js} +1 -1
  59. package/{chunk-IMQUTGIK.js → chunk-PEOYNJJM.js} +1 -1
  60. package/{chunk-CAQ3XMFP.js → chunk-PNQ5BDQN.js} +1 -1
  61. package/chunk-PVSB5UU6.js +1 -0
  62. package/chunk-QGAOYLQU.js +1 -0
  63. package/chunk-QLW7KAXY.js +1 -0
  64. package/chunk-QZEIAQ3M.js +1 -0
  65. package/chunk-R6FKSUPU.js +1 -0
  66. package/{chunk-FBU3EBFO.js → chunk-RDT3GMNM.js} +1 -1
  67. package/{chunk-UTXZPAY6.js → chunk-RM2KGG7J.js} +1 -1
  68. package/chunk-RTGUYIWH.js +11 -0
  69. package/{chunk-PIGMTUUT.js → chunk-SKLSR5GH.js} +1 -1
  70. package/{chunk-EDLHTWBA.js → chunk-SL34UKL5.js} +1 -1
  71. package/{chunk-4OJPTRZJ.js → chunk-SZLRIYOM.js} +1 -1
  72. package/chunk-TI76HSL2.js +1 -0
  73. package/{chunk-5KJPC3V5.js → chunk-TOV6NJCD.js} +1 -1
  74. package/chunk-TPKKLIFK.js +1 -0
  75. package/{chunk-IG7XUEED.js → chunk-UOMUNAOT.js} +1 -1
  76. package/chunk-UXIWNORE.js +1 -0
  77. package/{chunk-KZTFESBJ.js → chunk-V2M5YF4E.js} +1 -1
  78. package/{chunk-O2SMJYPC.js → chunk-V2UO7ES2.js} +1 -1
  79. package/{chunk-6JS7B4FW.js → chunk-VNXFTYQQ.js} +1 -1
  80. package/{chunk-4E7D5F6K.js → chunk-WJVFREPL.js} +1 -1
  81. package/{chunk-NX35OQ3V.js → chunk-WKQ3ICDB.js} +1 -1
  82. package/{chunk-BZXBH4CN.js → chunk-WULWYGYR.js} +1 -1
  83. package/chunk-X5W2K6AN.js +2 -0
  84. package/{chunk-GKGMP6VF.js → chunk-XWML36YQ.js} +1 -1
  85. package/{chunk-BKEJZADV.js → chunk-XXXS73XL.js} +1 -1
  86. package/{chunk-ZC23RK4J.js → chunk-YF6JHIN5.js} +1 -1
  87. package/{chunk-7C2YZVSQ.js → chunk-YFA6MJ2B.js} +1 -1
  88. package/{chunk-IRT2UBDI.js → chunk-YKF5ZW55.js} +1 -1
  89. package/{chunk-I6MIXWIT.js → chunk-ZKIZ7IIA.js} +1 -1
  90. package/{chunk-BLSV7CNZ.js → chunk-ZTENLO77.js} +1 -1
  91. package/{chunk-XDBSTUYC.js → chunk-ZYYLNYSK.js} +1 -1
  92. package/index.html +1 -1
  93. package/main-NENDDABN.js +1 -0
  94. package/package.json +1 -1
  95. package/chunk-3RCF6UT4.js +0 -1
  96. package/chunk-4J6L5OV3.js +0 -1
  97. package/chunk-4OA2FFS5.js +0 -1
  98. package/chunk-ACTATISC.js +0 -1
  99. package/chunk-AIAUP7OE.js +0 -1
  100. package/chunk-BACKG7KA.js +0 -1
  101. package/chunk-C3PQFWVO.js +0 -1
  102. package/chunk-C6PICAXB.js +0 -1
  103. package/chunk-DJXLNIMV.js +0 -11
  104. package/chunk-DSZ644JT.js +0 -1
  105. package/chunk-EPIYGHPM.js +0 -1
  106. package/chunk-EXMYBMGI.js +0 -1
  107. package/chunk-GRE6GKVP.js +0 -2
  108. package/chunk-N3NJW75G.js +0 -1
  109. package/chunk-NKUA7I47.js +0 -2
  110. package/chunk-NPFPMA4P.js +0 -1
  111. package/chunk-OHYENIPP.js +0 -1
  112. package/chunk-PG4G4RLP.js +0 -1
  113. package/chunk-QOWXL7ZL.js +0 -1
  114. package/chunk-QZQS7M3D.js +0 -1
  115. package/chunk-TQTOIWBK.js +0 -4
  116. package/chunk-VC55KFAX.js +0 -1
  117. package/chunk-XEG3CP74.js +0 -1
  118. package/chunk-XWTB7XRI.js +0 -1
  119. package/chunk-YWBZLU6M.js +0 -1
  120. package/chunk-YWUUX3S6.js +0 -1
  121. package/chunk-ZEFSBETQ.js +0 -2
  122. package/chunk-ZHQI6LYB.js +0 -1
  123. package/chunk-ZNYN6ES6.js +0 -1
  124. package/chunk-ZNYRWXQR.js +0 -1
  125. package/main-7J2QXC6H.js +0 -1
@@ -1 +1 @@
1
- import{Y as o}from"./chunk-TQTOIWBK.js";var d=new o("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});export{d as a};
1
+ import{Z as o}from"./chunk-K5XGRFWJ.js";var d=new o("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});export{d as a};
@@ -0,0 +1,11 @@
1
+ import{a as $n,b as qt,c as vn}from"./chunk-PNQ5BDQN.js";import{a as et,b as $t,c as vt,d as Gn}from"./chunk-TPKKLIFK.js";import{a as On,b as Mn,c as Re,d as wt,e as xn,f as Rn,g as Gt,i as Ln,j as bn,k as wn}from"./chunk-X5W2K6AN.js";import{a as Pn}from"./chunk-QGAOYLQU.js";import{a as ie}from"./chunk-PEOYNJJM.js";import{a as bt}from"./chunk-QZEIAQ3M.js";import{a as jt,b as Be,c as In}from"./chunk-2KD757N6.js";import{a as Ee}from"./chunk-JYRKUYG6.js";import{B as Z,C as Dn,E as Pt,F as An,H as pe,K as Ze,L as Ot,O as Mt,P as ke,V as xt,W as Ve,Y as Rt,a as fn,b as Et,c as te,d as ft,e as ne,f as ht,h as hn,i as se,j as Ft,k as Nt,n as Fn,o as Nn,p as Dt,q as At,r as yt,s as _e,t as Ye,v as Y,w as It,z as Ue}from"./chunk-CJKZ27FM.js";import{c as yn,d as Lt}from"./chunk-5E3B4AEF.js";import{b as Qe,d as ve,e as En}from"./chunk-CQJRBQ6I.js";import{aa as Sn}from"./chunk-YF6JHIN5.js";import{$ as x,$c as Ge,Ac as Tn,B as cn,Bb as Ne,Bc as Me,Cb as De,Cc as re,Db as u,Dc as ge,Eb as l,Ec as St,F as un,Fb as r,G as Xe,Gb as P,Kb as me,Kc as We,Lb as ce,M as ut,Mb as le,Nb as I,O as pn,P as mn,Q as pt,Qa as mt,R as gn,Rc as R,Ta as d,Ub as O,Vb as M,W as Ie,Wb as A,Wc as we,Xc as G,Ya as gt,Yc as xe,Zb as ze,_b as T,a as sn,ac as s,bc as qe,cc as Ae,ea as S,f as ct,fa as E,hb as X,hc as Pe,ia as je,ic as Oe,jc as ee,kc as Tt,l as Je,lc as ye,mb as H,oc as p,pb as Cn,pc as Ht,q as at,qa as F,qc as V,rc as lt,sa as Q,tc as v,uc as w,vc as U,w as _n,wb as Ct,wc as ue,xb as g,xc as q,y as dn,yb as C,yc as f,zb as Fe}from"./chunk-K5XGRFWJ.js";import{a as W,b as ae}from"./chunk-7CGTOI24.js";var Ut=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=Ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function rt(i){if(Cn(i))return i();if(Array.isArray(i))return i.map(t=>rt(t));if(typeof i=="object"&&i!==null){let t={};for(let e in i)i.hasOwnProperty(e)&&(t[e]=rt(i[e]));return t}return i}var Jn=i=>i;function Un(i,t){let e=mn(i,Jn,t?.equal),n=e[sn],o=e;return o.set=a=>{let _=e();return pt(n,a),()=>{pt(n,_)}},o.update=a=>{let _=e();return gn(n,a),()=>{pt(n,_)}},e}var tt=class i{#e=x(yn);isSaving=F(!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(Xe(()=>{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=Ie({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),A(3,7),r(),l(4,"input",28,0),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),E(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),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),E(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),A(18,8),r(),l(19,"input",34),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),E(o)}),r()(),l(20,"sh-select",35)(21,"input",36),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),E(o)}),r()()(),l(22,"sh-toggle-card",37),me(23,38),A(24,9),ce(),l(25,"div",39)(26,"sh-toggle",24),O(27,10),l(28,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),E(o)}),r(),M(),r(),l(29,"sh-toggle",24),O(30,11),l(31,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),E(o)}),r(),M(),r(),l(32,"sh-toggle",24),O(33,12),l(34,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),E(o)}),r(),M(),r(),l(35,"sh-toggle",24),O(36,13),l(37,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),E(o)}),r(),M(),r(),l(38,"sh-toggle",24),O(39,14),l(40,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),E(o)}),r(),M(),r(),l(41,"sh-toggle",24),O(42,15),l(43,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),E(o)}),r(),M(),r(),l(44,"sh-toggle",24),O(45,16),l(46,"input",25),U("ngModelChange",function(o){S(e);let a=s(2);return w(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),E(o)}),r(),M(),r()()()}if(i&2){let e=s(2);d(4),v("ngModel",e.scheduleFields.nextTime.time),d(7),v("ngModel",e.scheduleFields.nextTime.date),d(8),v("ngModel",e.scheduleFields.runAgain.repeatValue),d(),u("options",e.unitOptions)("isClearable",!1),d(),v("ngModel",e.scheduleFields.runAgain.repeatUnit),d(),u("disableToggle",!0),d(6),v("ngModel",e.scheduleFields.runAgain.allowedDays.mon),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.tue),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.wed),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.thu),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.fri),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.sat),d(3),v("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function zn(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-toggle",24),O(2,5),l(3,"input",25),U("ngModelChange",function(o){S(e);let a=s();return w(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),E(o)}),r(),M(),r(),l(4,"p"),A(5,6),r()(),g(6,Xn,47,14)}if(i&2){let e=s();d(3),v("ngModel",e.scheduleFields.autoRun),d(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`}],kt=[{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 Yt=()=>({autoRun:F(!0),nextTime:{time:F("13:00"),date:F(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:F(1),repeatUnit:F("D"),allowedDays:{mon:F(!0),tue:F(!0),wed:F(!0),thu:F(!0),fri:F(!0),sat:F(!0),sun:F(!0)}}}),Qt=class i{#e=x(Le);#t=x(ve);#n=x(Qe);unitOptions=Wn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=kt;updateScheduleType(t){let e=kt.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=X({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 c;c=$localize`Next time`;let m;m=$localize`Run again every`;let N;N=$localize`Allowed days`;let h;h=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let D;D=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let K;return K=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,o,a,_,c,m,N,h,y,b,$,D,B,K,[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),A(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()}),O(7,3),P(8,"sh-icon"),M(),r(),l(9,"button",22),T("click",function(){return n.next()}),O(10,4),P(11,"sh-icon"),M(),r()()),e&2&&(d(2),u("isClearable",!1)("options",n.scheduleOptions),d(),u("ngModel",n.scheduleType()),d(),C(n.scheduleType()==="custom"?4:-1))},dependencies:[_e,te,Nt,Et,ne,se,pe,Ve,Y,Z,ke,xt,An],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 He=class i{isActive=Ge(!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=X({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&ye("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&&(qe(jn),l(0,"header")(1,"div",0)(2,"h3",1),T("click",function(){return n.disableToggle()||n.toggle()}),Ae(3,0,null,Qn,1,0),g(5,Yn,2,0,"sh-icon"),r(),Ae(6,1),r(),l(7,"div",2),Ae(8,2),r()(),l(9,"div",3),Ae(10,3),r()),e&2&&(d(5),C(n.disableToggle()?-1:5))},dependencies:[Y],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;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),U("ngModelChange",function(o){S(e);let a=s();return w(a.internalPath,o)||(a.internalPath=o),E(o)}),T("ngModelChange",function(){S(e);let o=s();return E(o.updateFilter())}),r()()}if(i&2){let e=s();u("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),d(),v("ngModel",e.internalPath)}}function ti(i,t){if(i&1&&(l(0,"div",8),p(1),r()),i&2){let e,n=s(2);d(),Ht((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);d(),Ht((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),U("ngModelChange",function(o){S(e);let a=s();return w(a.internalPath,o)||(a.internalPath=o),E(o)}),T("ngModelChange",function(){S(e);let o=s();return E(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();d(),v("ngModel",o.internalPath),d(2),C(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?3:-1),d(),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"}],Vt=class i{#e=x(je);path=G.required();osType=G();isNew=G(!1);pathChange=we();remove=we();internalPath=F("");pathType=F("-Expression");textInput=xe("textInput");currentExpressionOption=R(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=F(oi);expressionOptions=R(()=>{let e=this.osType()==="Windows"?"\\":"/";return ai.map(n=>n.value==="-Folder"||n.value==="+Folder"?ae(W({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?ae(W({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?ae(W({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?ae(W({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?ae(W({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?ae(W({},n),{startsWith:"*.",endsWith:""}):ae(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()&&gt(()=>{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=X({type:i,selectors:[["app-new-filter"]],viewQuery:function(e,n){e&1&&Pe(n.textInput,Zn,5),e&2&&Oe()},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),U("ngModelChange",function(a){return w(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),d(),v("ngModel",n.pathType),d(),C(((o=n.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=n.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[_e,te,ne,se,ke,pe,Y],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var 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 E(o.addFilter())}),O(1,3),P(2,"sh-icon"),M(),r()}}function _i(i,t){i&1&&A(0,2,1)}function di(i,t){i&1&&A(0,2,2)}function ci(i,t){i&1&&(l(0,"p",13),A(1,4),r())}function ui(i,t){i&1&&(l(0,"p",13),A(1,5),r())}function pi(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",16),U("ngModelChange",function(o){S(e);let a=s();return w(a.bulkFilters,o)||(a.bulkFilters=o),E(o)}),T("ngModelChange",function(){S(e);let o=s();return E(o.saveBulkFilterEdit())}),r()()}if(i&2){let e=s();d(),v("ngModel",e.bulkFilters),u("ngModelOptions",Me(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 E(_.updateFilterAt(o,a))})("remove",function(){let o=S(e).$index,a=s(2);return E(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),Ne(2,mi,1,3,"app-new-filter",17,Fe),r()),i&2){let e=s();d(2),De(e.filters())}}var Bt=class i{#e=x(je);filters=Ge.required();osType=G("");disableToggle=G(!0);bulkFilterEditMode=F(!1);bulkFilters=F("");lastAddedIndex=F(null);filtersContainer=xe.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),gt(()=>{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=X({type:i,selectors:[["app-filters"]],viewQuery:function(e,n){e&1&&Pe(n.filtersContainer,li,5),e&2&&Oe()},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),me(1,7),l(2,"span"),A(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()(),me(10,11),l(11,"button",12),T("click",function(){return n.toggleBulkFilterEdit()}),O(12,2),P(13,"sh-icon"),g(14,_i,1,0)(15,di,1,0),M(),r(),ce(),r(),ce(),g(16,ci,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()),d(5),C(n.bulkFilterEditMode()?-1:5),d(9),C(n.bulkFilterEditMode()?14:15),d(2),C(n.bulkFilterEditMode()?17:16),d(2),C(n.bulkFilterEditMode()?18:19))},dependencies:[_e,te,ne,se,Z,Y,Ze,pe,He,Vt],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}sh-menu[_ngcontent-%COMP%]{margin-left:.25rem}"],changeDetection:0})};var st=class i{data=G();closed=we();path=F("");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=X({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),A(2,0),r()(),l(3,"section",5)(4,"app-file-tree",6)(5,"label",7),A(6,1),r(),l(7,"input",8),U("ngModelChange",function(a){return w(n.path,a)||(n.path=a),a}),r()()(),l(8,"footer",9)(9,"button",10),T("click",function(){return n.closed.emit(null)}),A(10,2),r(),l(11,"button",11),T("click",function(){return n.submit()}),A(12,3),r()()),e&2&&(d(4),u("customRemoteMode","diskimage"),d(3),v("ngModel",n.path),d(4),u("disabled",!n.isValid()))},dependencies:[Z,et,_e,te,ne,se],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=f(1);V(" ",e.Name," ")}}function Ei(i,t){if(i&1&&p(0),i&2){s(2);let e=f(0);V(" ",e.displayName," ")}}function fi(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=f(16);V(" ",e," ")}}function Di(i,t){if(i&1&&p(0),i&2){s(2);let e=f(0);V(" ",e.description," ")}}function Ai(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),Ae(5),r(),l(6,"div",5),g(7,Si,1,1)(8,Ei,1,1),g(9,fi,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),Ae(14,1),r(),l(15,"div",5),ue(16),g(17,Ni,1,1)(18,Di,1,1),r()(),l(19,"div",9),Ae(20,2),r()()),i&2){let e=s(),n=f(0),o=f(1);u("variant",e.variant()),d(2),u("src",n.icon,mt),Ct("alt",n.displayName),d(5),C(o&&o.Name?7:8),d(2),C((n.sortOrder??0)==-3?9:(n.sortOrder??0)==-2?10:(n.sortOrder??0)<0?11:-1),d(7);let a=q(e.getSimplePath(o==null?null:o.BaseUrl));d(),C(a&&a.length>0?17:18)}}var nt=class i{destination=G();targetUrl=G();variant=G("type-b");connectionStringId=G();#e=x(tt);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?Re(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=X({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&&(qe(Ci),ue(0)(1),g(2,Ai,21,7,"sh-card",0)),e&2){let o=q(n.destinationItem());d(),q(n.connectionString()),d(),C(o?2:-1)}},dependencies:[Dn,Pt],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 it=class i{#e=x(Ee);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let n=xn(e.Key);if(n.length<=1){let o=wt(e.Key);return o.isDefaultEntry===!0?[ae(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=Ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function yi(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 E(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),O(2,1),P(3,"sh-icon"),M(),r()()}if(i&2){let e=t.$implicit;u("destination",e)}}var Kt=class i{#e=x(it);#t=x(Ee);showAsSources=G(!1);moduleType=G("Backend");setDestination=we();destinationSearchTerm=F("");showAllDestinations=F(!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 c=t.find(m=>m.Key==_.key);return c&&(_=ae(W({},_),{sortOrder:c.IsDeprecated?-1:c.IsUntested?-3:_.sortOrder})),_}),n=this.destinationSearchTerm().toLowerCase(),o=this.showAllDestinations(),a=[...e].sort((_,c)=>{let m=_.sortOrder??0,N=c.sortOrder??0;return m!==N?N-m:_.displayName.localeCompare(c.displayName)}).filter(_=>{if(o)return!0;let c=_.sortOrder??0;return c<0&&n?.length&&(_.key.toLocaleLowerCase()===n.toLocaleLowerCase()||_.customKey?.toLocaleLowerCase()===n.toLocaleLowerCase())?!0:c>=0});return n?a.filter(_=>_.searchTerms.toLowerCase().includes(n)):a});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=X({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),U("ngModelChange",function(a){return w(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),r()(),l(3,"sh-toggle",4),U("checkedChange",function(a){return w(n.showAllDestinations,a)||(n.showAllDestinations=a),a}),A(4,0),r()(),l(5,"div",5),Ne(6,yi,4,1,"app-destination-list-item",6,Fe),r()),e&2&&(d(2),v("ngModel",n.destinationSearchTerm),d(),v("checked",n.showAllDestinations),d(3),De(n.destinationTypeOptionsFocused()))},dependencies:[nt,_e,te,ne,se,pe,Z,Y,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"],Jt=class i{customId=G();content=F("");readonly=F(!1);placeholder=G($localize`Drop a file here or use the browse button`);fileInputRef=xe("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=X({type:i,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,n){e&1&&Pe(n.fileInputRef,Ii,5),e&2&&Oe()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Tn([{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();qe(Pi),Ae(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),U("ngModelChange",function(_){return S(o),w(n.content,_)||(n.content=_),E(_)}),r()(),l(7,"input",5,0),T("change",function(_){return n.onFileSelected(_)}),r()}e&2&&(d(6),u("placeholder",n.placeholder()),v("ngModel",n.content),u("disabled",n.readonly()))},dependencies:[_e,te,ne,se,Y,Z],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}),de=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}),he=(i,t)=>({fieldGroup:i,formView:t}),bi=()=>["/connect/logon"];function wi(i,t){i&1&&le(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=ee(15);s();let a=f(0),_=f(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",re(7,de,St(2,Mi,n,e,a,_.oauthField)))}}function $i(i,t){i&1&&le(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=ee(15);s();let a=f(0),_=f(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",re(7,de,St(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 E(o.showTextArea.set(!1))}),O(1,8),P(2,"sh-icon"),M(),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 E(a.addAdvancedOption(o))}),p(2),r()}if(i&2){let e=t.$implicit;d(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),O(3,9),P(4,"sh-icon"),M(),r(),me(5,29),Ne(6,ki,3,1,"button",30,Fe),ce(),r(),l(8,"sh-menu")(9,"button",31)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),me(12,29),l(13,"button",32),T("click",function(){S(e);let o=s(2);return E(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=f(9);d(),u("searchable",!0),d(),u("disabled",e.length===0),d(4),De(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 E(a.updateSettingsFromText(o))}),r()}if(i&2){let e=s(2);u("ngModel",e.settingsAsText())("ngModelOptions",Me(2,Ri))}}function Ki(i,t){i&1&&le(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=ee(15),a=s(),_=f(0),c=f(1),m=a.getFormView("advanced",e)??a.getDefaultFormView(e);u("ngTemplateOutlet",o)("ngTemplateOutletContext",re(7,de,St(2,Li,n,m,_,c.oauthField)))}}function Xi(i,t){if(i&1&&Ne(0,Ji,1,9,"ng-container",null,Fe),i&2){let e=s(2);De(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 E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=f(1),o=f(2),a=f(3),_=f(4),c=f(5);u("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),d(),u("for",c),d(),C(e.formView.isMandatory&&_?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("id",c)("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 E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=f(1),o=f(2),a=f(3),_=f(4),c=f(5);u("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a)("resolvePaths",!0),d(),u("for",c),d(),C(e.formView.isMandatory&&_?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("id",c)("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&&le(0)}function no(i,t){if(i&1&&(l(0,"sh-icon",52),p(1," link "),r()),i&2){s();let e=f(8),n=f(9);ye("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 E(_.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),ue(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=f(1),o=f(2),a=f(3),_=f(4),c=f(5);s();let m=ee(17);d(),u("for",c),d(),C(e.formView.isMandatory&&_?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),C(_&&e.formView.type==="Path"?5:-1),d(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",re(16,de,ge(13,he,e.fieldGroup,e.formView))),d(),u("type",e.formView.type==="Email"?"email":"text")("id",c)("ngModel",o);let N=a,h=s().hasLeadingSlash(N??"");d(),q(h&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),d(),q(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),d(),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&&le(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 E(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 E(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 E(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 E(_.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=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17);d(),u("for",_),d(),C(e.formView.isMandatory&&a?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(14,de,ge(11,he,e.fieldGroup,e.formView))),d(),u("type",e.formView.showPassword?"text":"password")("id",_)("ngModel",o),d(),C(e.oauthField===e.formView.name?7:8),d(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 Eo(i,t){i&1&&le(0)}function fo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;lt(" ",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,Eo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,fo,1,2,"ng-template",null,3,We)}if(i&2){let e=ee(8);s();let n=f(0),o=s().$implicit,a=f(1),_=f(2),c=f(4),m=f(5);s();let N=ee(17);u("options",n)("isClearable",!1)("optionTemplate",e),d(),u("for",m),d(),C(o.formView.isMandatory&&c?2:-1),d(),V(" ",a," "),d(),C(o.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",re(14,de,ge(11,he,o.fieldGroup,o.formView))),d(),u("id",m)("ngModel",_)}}function Fo(i,t){if(i&1&&(ue(0),g(1,ho,9,16)),i&2){let e=s().$implicit,n=q(s(2).mapOptions(e.formView));d(),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 Ao(i,t){i&1&&le(0)}function yo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;lt(" ",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,Ao,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,yo,1,2,"ng-template",null,4,We)}if(i&2){let e=ee(8);s();let n=f(0),o=s().$implicit,a=f(1),_=f(2),c=f(4),m=f(5);s();let N=ee(17);u("options",n)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),d(),u("for",m),d(),C(o.formView.isMandatory&&c?2:-1),d(),V(" ",a," "),d(),C(o.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",re(15,de,ge(12,he,o.fieldGroup,o.formView))),d(),u("id",m)("ngModel",_)}}function Po(i,t){i&1&&P(0,"sh-progress-bar",61)}function Oo(i,t){if(i&1&&(ue(0),g(1,Io,9,17)(2,Po,1,0,"sh-progress-bar",61)),i&2){let e=s().$implicit,n=f(2),o=q(s(2).mapOptionsWithFreeText(e.formView,n));d(),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&&le(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 E(_.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=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17);u("inputType",e.Name)("ngModel",o)("customId",_),d(),u("for",_),d(),C(e.formView.isMandatory&&a?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(12,de,ge(9,he,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&&le(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 E(_.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=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17);d(),u("for",_),d(),C(e.formView.isMandatory&&a?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(11,de,ge(8,he,e.fieldGroup,e.formView))),d(),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&&le(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 E(_.updateFieldValue(a.fieldGroup,a.formView.name,o.target.checked?"true":"false"))}),r()()}if(i&2){let e=s().$implicit,n=f(1),o=f(2),a=f(5);s();let _=ee(17),c=s();d(),u("for",a),d(),V(" ",n," "),d(),C(e.formView.longDescription?3:-1),d(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",re(9,de,ge(6,he,e.fieldGroup,e.formView))),d(),u("checked",c.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&&le(0)}function Jo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;lt(" ",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 E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Jo,1,2,"ng-template",null,5,We)}if(i&2){let e=ee(8);s();let n=f(0),o=s().$implicit,a=f(1),_=f(2),c=f(4),m=f(5);s();let N=ee(17);u("options",n)("selectMultiple",!0)("optionTemplate",e),d(),u("for",m),d(),C(o.formView.isMandatory&&c?2:-1),d(),V(" ",a," "),d(),C(o.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",re(13,de,ge(10,he,o.fieldGroup,o.formView))),d(),u("ngModel",_)}}function zo(i,t){if(i&1&&(ue(0),g(1,Xo,9,15)),i&2){let e=s().$implicit,n=q(s(2).mapOptions(e.formView));d(),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&&le(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 E(_.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=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17);u("inputType",e.formView.name)("ngModel",o)("customId",_),d(),u("for",_),d(),C(e.formView.isMandatory&&a?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(12,de,ge(9,he,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&&le(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 E(_.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=f(2),o=f(4),a=f(5);s();let _=ee(17);u("ngModel",n)("customId",a)("placeholder",e.formView.longDescription),d(2),C(e.formView.isMandatory&&o?2:-1),d(),V(" ",e.formView.shortDescription??e.formView.name," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",re(11,de,ge(8,he,e.fieldGroup,e.formView)))}}function ta(i,t){i&1&&(P(0,"sh-spinner"),l(1,"span"),A(2,10),r()),i&2&&Tt("--spinner-size","16px")("--spinner-thickness","2px")}function na(i,t){if(i&1){let e=I();l(0,"div",77)(1,"span"),A(2,11),r(),l(3,"button",32),T("click",function(){S(e);let o=s(6);return E(o.reloadTrigger.set(!o.reloadTrigger()))}),A(4,12),r()()}}function ia(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;lt(" ",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"),A(5,13),r()(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(4).$implicit,_=s(2);return E(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,ia,1,2,"ng-template",null,6,We)}if(i&2){s(4);let e=f(2),n=f(5),o=s(2);u("options",o.restoreBackupIdOptions())("isClearable",!1),d(),u("for",n),d(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&&le(0)}function _a(i,t){if(i&1){let e=I();l(0,"button",82),T("click",function(){S(e),s(4);let o=f(5),a=s(2);return E(a.toggleDisabled(o))}),O(1,14),P(2,"sh-icon"),M(),r()}}function da(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 E(_.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=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17),m=s();d(),u("for",_),d(),C(e.formView.isMandatory&&a?2:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?4:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(15,de,ge(12,he,e.fieldGroup,e.formView))),d(),u("type","text")("id",_)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),d(3),C(m.getIsDisabled(_)?9:-1)}}function ca(i,t){if(i&1&&(l(0,"div",75),g(1,aa,3,1)(2,da,10,17),r()),i&2){let e=s(4);d(),C(e.isRestoreFlow()?1:2)}}function ua(i,t){if(i&1){let e=I();l(0,"div",83),O(1,15),P(2,"div")(3,"div"),M(),r(),l(4,"button",82),T("click",function(){S(e);let o=s(5);return E(o.openConsole())}),O(5,16),P(6,"sh-icon"),M(),r()}}function pa(i,t){i&1&&(l(0,"div",83),A(1,17),r(),l(2,"button",84),O(3,18),P(4,"sh-icon"),M(),r()),i&2&&(d(2),u("routerLink",Me(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);d(),C(e.isConnectedToConsole()?1:2)}}function ga(i,t){if(i&1&&g(0,ca,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&&le(0)}function Ea(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 E(_.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 E(o.authenticateFilen())}),O(11,19),P(12,"sh-icon"),M(),r()()}if(i&2){let e=s(2).$implicit,n=f(1),o=f(2),a=f(4),_=f(5);s();let c=ee(17),m=s();d(2),u("for",_),d(),C(e.formView.isMandatory&&a?3:-1),d(),V(" ",n," "),d(),C(e.formView.longDescription?5:-1),d(),u("ngTemplateOutlet",c)("ngTemplateOutletContext",re(12,de,ge(9,he,e.fieldGroup,e.formView))),d(),u("id",_)("ngModel",o),d(3),u("disabled",m.isAuthenticatingFilen())}}function fa(i,t){if(i&1&&g(0,Ea,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 E(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),ue(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,fa,1,1),g(20,ha,3,0,"button",41),r()),i&2){let e=t.$implicit;s();let n=f(0),o=s();ye("single-field",e.fieldGroup!=="advanced"),d(),q(e.formView.shortDescription??e.formView.name),d(),q(o.getFieldGroup(n,e.fieldGroup)[e.formView.name]),d();let a=q(o.getFieldValue(e.fieldGroup,e.formView.name));d(),q((a??"").toString().trim()===""),d(),q("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),d(),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),d(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=f(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=f(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Aa(i,t){if(i&1&&(ue(0),g(1,Na,2,1,"sh-icon",89)(2,Da,2,1,"sh-icon",90)),i&2){let e=s().$implicit,n=f(0),o=q(e.formView.validate(n));d(),C((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function ya(i,t){if(i&1&&(ue(0),g(1,Aa,3,2)),i&2){let e=t.$implicit,o=(q(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";d(),C(!o&&e.formView.validate?1:-1)}}function Ia(i,t){if(i&1&&(ue(0),Ne(1,Gi,1,9,"ng-container",null,Fe),Ne(3,vi,1,9,"ng-container",null,Fe),l(5,"sh-toggle-card",20),me(6,21)(7),A(8,7),ce(),ue(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,We)(16,ya,2,2,"ng-template",null,1,We)),i&2){let e=s(),n=f(1);q(e.destinationForm()),d(),De(n.custom),d(2),De(n.dynamic),d(2),u("disableToggle",!0),d(4),q(e.nonSelectedAdvancedFormViews()),d(),C(e.showTextArea()?10:11),d(2),C(e.showTextArea()?12:13)}}var Xt=class i{#e=x(Le);#t=x(Ee);#n=x(bt);#i=x(it);#o=x(Pn);#s=x(On);#a=x(Ue);injector=x(je);targetUrl=Ge.required();useBackupState=G(!1);#l=null;destinationType=R(()=>{let t=this.targetUrl();if(!t)return null;let e=Re(t);return this.#l=e?.customKey??e?.key,this.#l});refreshView=F(!1);destinationForm=F({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=R(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=F(null);showTextArea=F(!1);isLoadingRestoreBackupIdOptions=F(!1);isRestoreFlow=R(()=>!this.useBackupState());reloadTrigger=F(!1);hasLoadedBackupIdOptions=F(!1);restoreBackupIdOptions=Be(dn(jt(this.targetUrl).pipe(un(),at(t=>({url:t,isReload:!1}))),jt(this.reloadTrigger).pipe(at(()=>({url:this.targetUrl(),isReload:!0})))).pipe(ut(({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),Je([]))),Xe(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Je([]))),{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=F(!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=Re(t??""),n=e.key,o=e.customKey??n,a=this.#i.allModules().find($=>$.Key===n)??{Key:n,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!n)return;let _=e&&e.oauthField?e.oauthField:null,c=e&&e.customFields?e.customFields:{},m=e&&e.dynamicFields?e.dynamicFields:[],N=e&&e.advancedFields?e.advancedFields:[],h=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],y={destinationType:o,oauthField:_,custom:[],dynamic:[],advanced:[]};c&&Object.entries(c).forEach(([$,D],B)=>{let K=D.order??B,L=D.validate;!L&&D.type==="Bucketname"&&(L=j=>bn(j)?null:{type:"error",message:$localize`Invalid bucket name.`}),L&&D.type==="Hostname"&&(L=j=>wn(j)?null:{type:"error",message:$localize`Invalid hostname.`}),y.custom.push(W({order:900+K,validate:L},D))});for(let $=0;$<a.Options.length;$++){let D=a.Options[$];if(D.Deprecated)continue;let B=m.find(K=>K===D.Name||D.Aliases?.includes(K.name)||K.name===D.Name);if(B){let K=D.Aliases?.indexOf(B.name)??-1,L=D.Aliases&&K>-1?D.Aliases[K]:D.Name,j=B&&typeof B!="string",Ce=j?B?.defaultValue??D.DefaultValue:D.DefaultValue,Te=j&&B?.order!==void 0?B.order:$,k={name:L,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+Te},be=j?W(W({},k),B):k;y.dynamic.push(be)}else{let K=D.Name;if(h.find(Se=>Se===K))continue;let j=N.find(Se=>Se===K||Se.name===K),Ce=j&&typeof j!="string",Te=Ce&&j?.order!==void 0?j.order:$,k={name:K,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:D.DefaultValue,order:900+Te},be=Ce?W(W({},k),j):k;y.advanced.push(be)}}if(y.custom.sort(($,D)=>$.order-D.order),y.dynamic.sort(($,D)=>$.order-D.order),y.advanced.sort(($,D)=>$.order-D.order),this.destinationFormConfig.set(y),!t)return;let b=Gt(t);b&&this.destinationForm.set({custom:b.custom,dynamic:b.dynamic,advanced:b.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=F(!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(B=>B.Name==="--oauth-url")?.Value;D&&D.length>0&&(a=D)}let c=this.destinationForm().advanced["oauth-url"];c&&c.length>0&&(a=c);let m=`${a}?type=${t}`,N=450,h=600,y=screen.width/2-N/2,b=screen.height/2-h/2,$=window.open(m,"_blank","height="+h+",width="+N+",menubar=0,status=0,titlebar=0,toolbar=0,left="+y+",top="+b);return window.addEventListener("message",D=>{let B=D.data.startsWith("authid:"),K=B?D.data.replace("authid:",""):null;B&&(this.destinationForm.update(L=>(L[e][n]=K,L)),this.#r.set(!1),this.refreshView.set(!this.refreshView()),$?.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=>ae(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(Xe(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:n=>{if(n.length===0){this.#a.open(ie,{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(ie,{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(ie,{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=X({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 c;c=$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 h;h=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let b;b=$localize`This field is mandatory`;let $;$=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let B;B=$localize`This field is mandatory`;let K;K=$localize`Loading available backups...`;let L;L=$localize`No backups found from this machine, contact support`;let j;j=$localize` Try again `;let Ce;Ce=$localize`This field is mandatory`;let Te;Te=$localize`Pick the backup to restore from`;let k;k=$localize`This field is mandatory`;let be;be=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Se;Se=$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:`,Se=ze(Se);let z;z=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let on;on=$localize`Connect to the console to use Duplicati storage.`;let an;an=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ln;ln=$localize`This field is mandatory`;let rn;return rn=$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,K,L,j,Te,be,Se,z,on,an,rn,[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",c,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",h],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",y],["shTooltip",b],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"change","checked"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",$],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",B],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",Ce],["shTooltip",k],["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",ln],["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&&(ue(0)(1),g(2,Ia,18,5)),e&2){let o=q(n.destinationType());d();let a=q(n.destinationFormConfig());d(),C(o&&a?2:-1)}},dependencies:[Ye,te,Nt,ne,_e,se,Sn,En,et,vt,Gn,Jt,pe,Z,Y,xt,Ze,ke,Rt,Ve,Ot,Mt],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 zt=class i{#e=x(Lt);#t=x(Ue);#n=x(Ee);testDestination(t,e,n,o,a,_,c,m){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,n,o,a,_,c,m):this.testDestinationv1(t,e,n,o,a,_,c,m)}testDestinationv2(t,e,n,o,a,_,c,m){return new ct(N=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,ConnectionStringId:n??null,BackupId:e=="new"?null:e,AutoCreate:m==="create",Options:null,DestinationType:_,SourcePrefix:e=="new"?null:o}}).subscribe({next:h=>{if(h.Success){this.emitSuccessV2(N,t,a,h);return}this.handleGenericError(N,t,a,h.Error??"Unknown error",c)},error:h=>{let y=h?.error?.body??h?.error?.requestBody;if(y?.Data?.FolderExists===!1||y?.StatusCode==="missing-folder"){this.handleMissingFolder(N,t,e,n,a,c,m);return}if(y?.Data?.HostCertificate){this.handleMissingCertificate(N,t,a,y.Data?.HostCertificate,c);return}if(y?.Data?.ReportedHostKey){this.handleIncorrectKey(N,t,a,y.Data.ReportedHostKey,y.Data.AcceptedHostKey??null,c);return}this.handleGenericError(N,t,a,h?.message??"Unknown error",c)}})})}testDestinationv1(t,e,n,o,a,_,c,m){return new ct(N=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e,connectionStringId:n??null,sourcePrefix:e=="new"?null:o},type:_}).subscribe({next:h=>{N.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:a}),N.complete()},error:h=>{this.handleDestinationErrorv1(h.message,t,e,n,a,c,m).subscribe(y=>{N.next(y)})}})})}handleMissingFolder(t,e,n,o,a,_,c){function m(){t.next({action:"missing-folder",targetUrl:e,testAgain:!1,destinationIndex:a,errorMessage:$localize`The remote destination folder does not exist.`}),t.complete()}if(_||c==="error"){m();return}this.#t.open(ie,{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:N=>{if(!N){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,Options:null,BackupId:n=="new"?null:n}}).subscribe({next:h=>{if(h.Success){this.emitSuccessV2(t,e,a,h);return}else this.handleFolderCreateFailure(t,e,a,h.Error??$localize`Unknown error`)},error:h=>{this.handleFolderCreateFailure(t,e,a,h.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:n=="new"?null:n}}).subscribe({next:()=>{this.handleFolderCreated(t,e,a)},error:h=>{this.handleFolderCreateFailure(t,e,a,h.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,n,o){this.#t.open(ie,{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(ie,{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}`,c=e.includes("?");function m(){t.next({action:"trust-cert",targetUrl:e,suggestedUrl:e+`${c?"&":"?"}accept-specified-ssl-hash=${o}`,testAgain:!0,certData:o,errorMessage:_,destinationIndex:n}),t.complete()}if(a){m();return}this.#t.open(ie,{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 h=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:N,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var c=h;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 b=new URL(e);b.searchParams.set("ssh-fingerprint",o),N=b.toString()}catch{let b=e.replace(/([?&])ssh-fingerprint=[^&]*/,""),$=b.includes("?");N=b+`${$?"&":"?"}ssh-fingerprint=${o}`}if(_){h();return}this.#t.open(ie,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:b=>{if(!b){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}h()}})}else{let h=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 c=h;let m=$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,N=e.includes("?");if(_){h();return}this.#t.open(ie,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:y=>{if(!y){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}h()}})}}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(ie,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:c=>_()})}handleDestinationErrorv1(t,e,n,o,a,_,c){return new ct(m=>{if(t==="missing-folder"){this.handleMissingFolder(m,e,n,o,a,_,c);return}if(t.startsWith("incorrect-cert:")){let N=t.split("incorrect-cert:")[1];this.handleMissingCertificate(m,e,a,N,_);return}if(t.startsWith("incorrect-host-key:")){let N=t.split('incorrect-host-key:"')[1].split('",')[0],h=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(m,e,a,N,h,_);return}this.handleGenericError(m,e,a,t,_)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ie({token:i,factory:i.\u0275fac,providedIn:"root"})};function Pa(i,t){if(i&1){let e=I();l(0,"sh-alert",13),O(1,0),l(2,"button",14),T("click",function(){S(e);let o=s(2);return E(o.testDestinationClick())}),r(),M(),r()}}function Oa(i,t){i&1&&(l(0,"sh-alert",13),O(1,1),P(2,"sh-icon"),l(3,"div",15),P(4,"sh-spinner"),r(),M(),r()),i&2&&(d(4),Tt("--spinner-size","16px")("--spinner-thickness","2px"))}function Ma(i,t){i&1&&(l(0,"sh-alert",17),A(1,2),r())}function xa(i,t){i&1&&(l(0,"sh-alert",16),A(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),A(1,4),r())}function ba(i,t){i&1&&(l(0,"sh-alert",16),A(1,5),r())}function wa(i,t){i&1&&(l(0,"sh-alert",17),A(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),A(1,7),r())}function va(i,t){i&1&&(l(0,"sh-alert",16),A(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),A(1,9),r())}function Va(i,t){i&1&&(l(0,"sh-alert",17),A(1,10),r())}function Ba(i,t){i&1&&(l(0,"sh-alert",17),A(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();O(0,12,1),l(1,"button",14),T("click",function(){S(e);let o=s(4);return E(o.createFolder())}),r(),M()}}function za(i,t){if(i&1&&(l(0,"sh-alert",16),O(1,12),g(2,Xa,2,0,"button",19),M(),r()),i&2){let e=s(3);d(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 E(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);d(),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 E(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);d(),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 E(o.testDestinationClick())}),p(3,"Test again"),r()()}if(i&2){let e,n=s(3);d(),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 Wt=class i{#e=x(zt);targetUrl=Ge.required();testSignal=Ge.required();connectionStringId=G(null);backupId=G.required();sourcePrefix=G.required();suppressErrorDialogs=G.required();askToCreate=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||!Gt(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)?.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)?.subscribe({next:c=>{this.testSignal.set(c),o(c)}})}else this.testSignal.set(a),o(a)}})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=X({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"],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 c;c=$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 h;h=$localize`Success! Test completed, backup found.`;let y;y=$localize`Success! Test completed, destination contains files.`;let b;b=$localize`Success! Test completed, destination is empty.`;let $;return $=$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,_,c,m,N,h,y,b,$,[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:[It,Z,Y,Mt],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 E(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 E(o.removeDestination())}),A(2,3),r()(),l(3,"app-test-url",12),U("targetUrlChange",function(o){S(e);let a=s();return w(a.targetUrlModel,o)||(a.targetUrlModel=o),E(o)})("testSignalChange",function(o){S(e);let a=s();return w(a.testSignal,o)||(a.testSignal=o),E(o)}),r(),l(4,"app-single-destination",13),U("targetUrlChange",function(o){S(e);let a=s();return w(a.targetUrlModel,o)||(a.targetUrlModel=o),E(o)}),r()}if(i&2){let e=s();u("targetUrl",e.targetUrlModel()),d(3),v("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),u("backupId",e.backupId())("sourcePrefix",e.sourcePrefix())("suppressErrorDialogs",e.suppressErrorDialogs())("askToCreate",e.askToCreate())("testExpectation",e.expectedResult())("moduleType",e.moduleType()),d(),v("targetUrl",e.targetUrlModel)}}function el(i,t){i&1&&A(0,2,1)}function tl(i,t){i&1&&A(0,2,2)}function nl(i,t){i&1&&A(0,2,3)}function il(i,t){i&1&&A(0,2,4)}var _t=class i{data=G();closed=we();targetUrlModel=F(null);moduleType=F("Backend");askToCreate=F(!1);expectedResult=F("any");suppressErrorDialogs=F(!1);backupId=F(null);sourcePrefix=F(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=F(null);setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=wt(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=X({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=ze(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","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,n){if(e&1&&(l(0,"header")(1,"h3",4),A(2,0),r()(),l(3,"section",5),g(4,Ya,1,2,"app-destination-list",6),g(5,Za,5,10),r(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),A(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),O(10,2),g(11,el,1,0)(12,tl,1,0)(13,nl,1,0)(14,il,1,0),M(),r()()),e&2){let o=!!n.targetUrlModel();d(4),C(o?-1:4),d(),C(o?5:-1),d(4),ye("loading",n.testSignal()==="testing"),u("disabled",!o||n.testSignal()===null||n.testSignal()==="testing"),d(2),C(n.moduleType()==="Backend"?11:n.moduleType()==="SourceProvider"?12:n.moduleType()==="RestoreDestinationProvider"?13:14)}},dependencies:[Xt,Kt,nt,Z,Wt],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}),en=()=>({standalone:!0});function ll(i,t){if(i&1){let e=I();l(0,"button",48),T("click",function(){S(e);let o=s(2);return E(o.openLocalDiskDialog())}),O(1,15),P(2,"sh-icon"),M(),r()}}function rl(i,t){if(i&1){let e=I();g(0,ll,3,0,"button",47),l(1,"button",48),T("click",function(){S(e);let o=s();return E(o.openRemoteDestinationDialog())}),O(2,14),P(3,"sh-icon"),M(),r()}if(i&2){let e=s();C(e.isLocalDiskSupported()?0:-1)}}function sl(i,t){i&1&&A(0,7,1)}function _l(i,t){i&1&&A(0,7,2)}function dl(i,t){i&1&&(l(0,"p",37),A(1,16),r())}function cl(i,t){i&1&&(l(0,"p",37),A(1,17),r())}function ul(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",49),U("ngModelChange",function(o){S(e);let a=s();return w(a.bulkPaths,o)||(a.bulkPaths=o),E(o)}),T("ngModelChange",function(){S(e);let o=s();return E(o.savePathBulkEdit())}),r()()}if(i&2){let e=s();d(),v("ngModel",e.bulkPaths),u("ngModelOptions",Me(2,al))}}function pl(i,t){if(i&1){let e=I();l(0,"sh-form-field",53)(1,"input",54),U("ngModelChange",function(o){S(e);let a=s(3);return w(a.editingPath,o)||(a.editingPath=o),E(o)}),r()(),l(2,"button",27),T("click",function(){S(e);let o=s(3);return E(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",27),T("click",function(){S(e);let o=s(3);return E(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(i&2){let e=s(3);d(),v("ngModel",e.editingPath),u("ngModelOptions",Me(2,en))}}function ml(i,t){if(i&1&&(l(0,"sh-chip"),P(1,"img",55),p(2),r()),i&2){let e=s(2).$implicit,n=s(2);d(),u("src",n.getBackendIcon(e),mt),d(),V(" ",n.getRemotePathDisplayName(e)," ")}}function gl(i,t){if(i&1&&(l(0,"sh-form-field",53),P(1,"input",56),r()),i&2){let e=s(2).$implicit;Ct("readonly",!0),d(),u("ngModel",e)("ngModelOptions",Me(3,en))}}function Cl(i,t){if(i&1){let e=I();g(0,ml,3,2,"sh-chip")(1,gl,2,4,"sh-form-field",53),l(2,"button",27),T("click",function(){S(e);let o=s().$implicit,a=s(2);return E(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",27),T("click",function(){S(e);let o=s().$implicit,a=s(2);return E(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",50),g(1,pl,8,3)(2,Cl,8,1),r()),i&2){let e=t.$implicit,n=s(2);d(),C(n.oldPath()===e?1:2)}}function Sl(i,t){if(i&1){let e=I();Ne(0,Tl,3,1,"div",50,Fe),l(2,"div",46)(3,"sh-form-field"),P(4,"input",51),r(),l(5,"button",52),T("click",function(){S(e);let o=s();return E(o.addNewPath())}),l(6,"sh-icon"),p(7,"plus"),r()()()}if(i&2){let e=s();De(e.nonFilterPaths()),d(4),u("formControl",e.newPathCtrl)}}function El(i,t){if(i&1){let e=I();l(0,"div",46)(1,"app-size",57),T("ngModelChange",function(o){S(e);let a=s();return E(a.updateFilesLargerThan(o))}),r()()}if(i&2){let e=s();d(),u("ngModel",e.filesLargerThan())("ngModelOptions",Me(2,en))}}var $e=new yt,Vn=(i={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>$e.group({path:$e.control(i.path),excludes:$e.group({hidden:$e.control(i.excludes.hidden),system:$e.control(i.excludes.system),temporary:$e.control(i.excludes.temporary),filesLargerThan:$e.group({size:$e.control(null),unit:$e.control(null)})})}),Zt=class i{#e=x(Le);#t=x(Ue);#n=x(ve);#i=x(Qe);#o=x(Ee);formRef=xe.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=Be(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=F(null);editingPath=F(null);addingNewPath=F(!1);bulkPathEditMode=F(!1);bulkPaths=F("");mobileMenuOpen=F(!1);isLocalDiskSupported=R(()=>this.#o.systemInfo()?.SourceProviderModules?.find(t=>t.Key=="diskimage"));filters=F([]);#s=Q(()=>{let e=this.pathSignal()?.split("\0").filter(n=>n!=="___none___"&&(n.startsWith("-")||n.startsWith("+")))??[];this.filters.set(e)});openRemoteDestinationDialog(){this.#t.open(_t,{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(st,{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(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:n}}).closed.subscribe(a=>{if(!a)return;let _=`${e}|diskimage://${a}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,_)??"")})}editTargetUrlPath(t,e,n){this.#t.open(_t,{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}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,_)??"")})}updateFilesLargerThan(t){let{size:e,unit:n}=$t(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":Re(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];if(e.startsWith("diskimage:"))return $localize`Local disk`;let n=Re(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=X({type:i,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&Pe(n.formRef,ol,5),e&2&&Oe()},decls:66,vars:16,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Hidden files`;let n;n=$localize`System files`;let o;o=$localize`Temporary files`;let a;a=$localize`Source Data`;let _;_=$localize`Folder path`;let c;c=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let m;m=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let N;N=$localize`Options`;let h;h=$localize`Paths`;let y;y=$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 b;b=$localize`Exclude`;let $;$=$localize`Choose if there’s any files you want to exclude.`;let D;D=$localize` Files with the Hidden attribute ${"\uFFFD#56\uFFFD\uFFFD/#56\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Files with the System attribute ${"\uFFFD#59\uFFFD\uFFFD/#59\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Files with the Temporary attribute ${"\uFFFD#62\uFFFD\uFFFD/#62\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Files larger than `;let j;j=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let Ce;Ce=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let Te;Te=$localize`Manually add a path.`;let k;k=$localize`Edit paths as text, one per line.`;let be;be=$localize`Add a direct path`;let Se;return Se=$localize`Edit path`,[["formRef",""],a,_,c,m,N,h,y,b,$,D,B,K,L,j,Ce,Te,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"],["type","checkbox","placeholder",e,"formControlName","hidden"],["type","checkbox","placeholder",n,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[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",be,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",Se,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",18,0),T("submit",function(){return n.next()}),l(2,"div",19)(3,"div",20)(4,"h3",21),A(5,1),r(),l(6,"button",22),T("click",function(){return n.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",23)(10,"label",24),A(11,2),r(),P(12,"input",25),r(),l(13,"div",26)(14,"button",27),T("click",function(){return n.goBack()}),O(15,3),P(16,"sh-icon"),M(),r(),l(17,"button",28),O(18,4),P(19,"sh-icon"),M(),r()()(),l(20,"div",29)(21,"div",30)(22,"span",21),A(23,5),r(),l(24,"button",31),T("click",function(){return n.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",32),me(28,33),l(29,"span"),A(30,6),r(),P(31,"div",34),g(32,rl,4,1),l(33,"sh-menu")(34,"button",35)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),me(37,36),l(38,"button",27),T("click",function(){return n.togglePathBulkEdit()}),O(39,7),P(40,"sh-icon"),g(41,sl,1,0)(42,_l,1,0),M(),r(),ce(),r(),ce(),g(43,dl,2,0,"p",37)(44,cl,2,0,"p",37),l(45,"div",38),g(46,ul,2,3,"sh-form-field")(47,Sl,8,1),r()(),l(48,"app-filters",39),U("filtersChange",function(_){return S(o),w(n.filters,_)||(n.filters=_),E(_)}),T("filtersChange",function(_){return n.updateFilters(_)}),r(),l(49,"app-toggle-card",40),me(50,33),A(51,8),ce(),l(52,"p",37),A(53,9),r(),l(54,"sh-toggle",41),O(55,10),P(56,"input",42),M(),r(),l(57,"sh-toggle",41),O(58,11),P(59,"input",43),M(),r(),l(60,"sh-toggle",41),O(61,12),P(62,"input",44),M(),r(),l(63,"sh-toggle",45),T("checkedChange",function(_){return n.toggleFilesLargerThan(_)}),A(64,13),r(),g(65,El,2,3,"div",46),r()()()}e&2&&(u("formGroup",n.sourceDataForm),d(9),u("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),d(11),ye("open",n.mobileMenuOpen()),d(7),u("disableToggle",!0),d(5),C(n.bulkPathEditMode()?-1:32),d(9),C(n.bulkPathEditMode()?41:42),d(2),C(n.bulkPathEditMode()?44:43),d(3),C(n.bulkPathEditMode()?46:47),d(2),v("filters",n.filters),u("osType",n.osType()??""),d(),u("disableToggle",!0),d(14),u("checked",n.filesLargerThan()!==null),d(2),C(n.filesLargerThan()?65:-1))},dependencies:[_e,Ft,te,Et,ne,ht,se,Ye,Fn,At,Dt,Nn,pe,Y,Z,Ve,Ze,Bt,et,He,vt,Pt],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}.rowbutton[_ngcontent-%COMP%]{margin-left:.25rem}"],changeDetection:0})};var Bn="1W:1D,4W:1W,12M:1M",tn=!1,Le=class i{#e=x(ve);#t=x(Ee);#n=x(Ue);#i=x(Lt);#o=x(bt);#s=x(Ut);#a=x(tt);generalForm=Kn();sourceDataForm=Vn();scheduleFields=Yt();scheduleType=F("daily");settings=F([]);optionsFields={backupRetention:F("all"),backupRetentionTime:F(""),backupRetentionVersions:F(0),backupRetentionCustom:F("")};targetUrls=F([]);targetUrlModel=R(()=>this.targetUrls()[0]?.url??null);connectionStringId=R(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=F(null);backupMetadata=F(null);isDraft=F(!1);backupId=F(null);backupName=R(()=>this.generalFormSignal()?.name??"");isSubmitting=F(!1);finishedLoading=F(!1);backupDefaults=F(null);applicationOptions=F(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=F([]);sourceDataFormSignal=Be(this.sourceDataForm.valueChanges);generalFormSignal=Be(this.generalForm.valueChanges);encryptionFieldSignal=Be(this.generalForm.controls.encryption.valueChanges);advancedOptions=R(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=F(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[dt,...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(ut(e=>{let n=this.#d(),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 c=this.targetUrls().slice(1).map((m,N)=>{let h=e[N+1];return{TargetUrl:m.url,ConnectionStringID:h??void 0,UrlKey:m.urlKey}});c.length>0&&(a.Backup.AdditionalTargetURLs=c)}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})}),Xe(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#d(),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(ie,{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(ie,{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 c=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!c||!this.sourceDataForm.valid?(this.#n.open(ie,{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.#c(),this.#e.navigate(["/"]);return}this.#n.open(ie,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#c(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"+":"-"}${c.Expression}`)??[],o=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,_={path:[...e,...n].join("\0"),excludes:{hidden:o.includes("hidden"),system:o.includes("system"),temporary:o.includes("temporary"),filesLargerThan:a===null?void 0:$t(a)}};this.sourceDataForm.patchValue(_)}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(c=>({url:c.TargetUrl,urlKey:c.UrlKey,connectionStringId:c.ConnectionStringID??null,save:!!c.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:"",c={name:t.Name??"",description:t.Description??""};e&&e!==""&&(c.name=e),n&&n!==""&&(c.description=n),_&&_!==""&&(c.encryption=_),a&&a!==""&&(c.password=a,c.repeatPassword=a),this.generalForm.patchValue(c)}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=rt(this.scheduleFields),a=kt.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","--exclude-files-attributes","--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(y=>y.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 c="all";_?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Bn)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(c)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=rt(this.scheduleFields);return kn(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,a=this.targetUrls()[0],_=a?.url??null,c=n.path?.split("\0")??[],m=this.mapFormsToSettings(),N=Object.entries(n.excludes??{}).filter(([y,b])=>b&&y!=="filesLargerThan").map(([y])=>y),h=n.excludes?.filesLargerThan;return N.length&&m.push({Name:"--exclude-files-attributes",Value:N.join(",")}),h&&h.size!==null&&h.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${h.size}${h.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:_??null,ConnectionStringID:a?.connectionStringId??null,Sources:c.filter(y=>!(y.startsWith("-")||y.startsWith("+"))),Settings:m,Filters:c.filter(y=>y.startsWith("-")||y.startsWith("+")).map((y,b)=>({Order:b,Include:y.startsWith("+"),Expression:y.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(h=>`--${h}`)],a=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==dt.Key&&(a=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let _=n.map(h=>{let y=this.settings().find(b=>b.Name===h||b.Name==="--"+h);return y?{Name:h,Value:y.Value}:null}).filter(h=>h!==null),c=[];switch(this.optionsFields.backupRetention()){case"time":c.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":c.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":c.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":c.push({Name:"retention-policy",Value:Bn});break}let m=[...t,...o],N=this.settings().filter(h=>!m.includes(h.Name)).map(h=>{let y=h.Value;return typeof h.Value=="number"&&(y=h.Value.toString()),typeof h.Value=="boolean"&&(y=h.Value?"True":"False"),{Name:h.Name?.startsWith("--")?h.Name:`--${h.Name}`,Value:y}});return[...a,..._,...c,...N]}#p(){let t=this.targetUrls();if(t.length===0)return Je([]);let e=t.map(n=>{if(n.connectionStringId)return Je(n.connectionStringId);if(!n.save)return Je(null);let o=n.url,_=Re(o)?.displayName??"Destination",m=this.#a.destinations().filter(y=>y.Name?.startsWith(_)).length,h={Name:`${_} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",h).pipe(at(y=>y.Data?.ID??null))});return _n(e).pipe(pn(n=>{let o=this.targetUrls();n.forEach((a,_)=>{if(a&&_<o.length&&(this.#a.reload(),o[_].connectionStringId!==a)){let c=o[_].urlKey;this.updateTargetUrl(_,o[_].url,a,c)}})}))}#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:tn}):_[0]={url:t,urlKey:o,connectionStringId:n,save:n?!0:tn},_})}addTargetUrl(t,e,n){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:n,save:e?!0:tn}])}updateTargetUrl(t,e,n,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let _=[...a],c=_[t].save;return _[t]={url:e,connectionStringId:n,urlKey:o,save:n?!0:c},_})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let n=[...e];return n[t]=ae(W({},n[t]),{save:!n[t].save}),n})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((n,o)=>o!==t))}#c(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Yt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ie({token:i,factory:i.\u0275fac,providedIn:"root"})};var fl=["formRef"];function hl(i,t){i&1&&(l(0,"sh-alert",17),O(1,5),P(2,"sh-icon",26),M(),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);ye("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),A(1,10),r())}function Al(i,t){i&1&&(O(0,8,1),P(1,"sh-icon"),M())}function yl(i,t){i&1&&(O(0,8,2),P(1,"sh-icon"),M())}function Il(i,t){i&1&&(O(0,11,1),P(1,"sh-icon",42),M())}function Pl(i,t){i&1&&(O(0,11,2),P(1,"sh-icon"),M())}function Ol(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(3);return E(o.copyPassword())}),O(1,11),g(2,Il,2,0)(3,Pl,2,0),M(),r()}if(i&2){let e=s(3);d(2),C(e.copiedPassword()?2:3)}}function Ml(i,t){i&1&&(l(0,"sh-alert",39),A(1,12),r())}function xl(i,t){if(i&1){let e=I();l(0,"div",30)(1,"sh-form-field")(2,"label",31),O(3,7),P(4,"sup"),M(),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 E(o.showPassword.set(!o.showPassword()))}),O(12,8),g(13,Al,2,0)(14,yl,2,0),M(),r(),l(15,"button",37),T("click",function(){S(e);let o=s(2);return E(o.generatePassword())}),O(16,9),P(17,"sh-icon"),M(),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);d(5),u("type",e.showPassword()?"text":"password"),d(),C(e.generalForm.value.password?6:-1),d(2),u("type",e.showPassword()?"text":"password"),d(),C(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),d(4),C(e.showPassword()?13:14),d(5),C(e.showCopyPassword()?18:-1),d(),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),A(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),d(5),C(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Ll(i,t){if(i&1&&(l(0,"button",24),O(1,13),P(2,"sh-icon"),M(),r()),i&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function bl(i,t){if(i&1&&(l(0,"button",25),O(1,14),P(2,"sh-icon"),M(),r()),i&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ot=new yt,Kn=(i={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ot.group({name:ot.control(i.name,[ft.required]),description:ot.control(i.description),encryption:ot.control(i.encryption,[vn()]),password:ot.control(i.password,[qt(t=>t?.value.encryption!=="-",[ft.required])]),repeatPassword:ot.control(i.repeatPassword,[qt(t=>t?.value.encryption!=="-",[ft.required])])}),dt={Key:"-",DisplayName:"None"},nn=class i{#e=x(ve);#t=x(Qe);#n=x($n);#i=x(Le);formRef=xe.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=F(!1);copiedPassword=F(!1);showCopyPassword=F(!1);noneOptionKey=dt.Key;encryptionEffect=Q(()=>{this.encryptionFieldSignal()===dt.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=X({type:i,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&Pe(n.formRef,fl,5),e&2&&Oe()},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 c;c=$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 h;h=$localize`Encryption`;let y;y=$localize`Password`;let b;b=$localize`Repeat password`;let $;$=$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=ze(D);let B;B=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let K;K=$localize`Passwords do not match`;let L;L=$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:`,L=ze(L);let j;j=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let Ce;Ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Te;return Te=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,_,c,m,h,$,D,B,K,L,j,Ce,Te,["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",y,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",b,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1&&(l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"h3",16),A(3,1),r(),g(4,hl,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),O(7,2),P(8,"sup"),M(),r(),P(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),A(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()}),O(17,4),P(18,"sh-icon"),M(),r(),g(19,Ll,3,1,"button",24)(20,bl,3,1,"button",25),r()()),e&2){let o;u("formGroup",n.generalForm),d(4),C(!n.isNew()&&((o=n.generalFormSignal())==null?null:o.encryption)!==""?4:-1),d(10),C(n.isNew()?14:-1),d(5),C(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Ye,Ft,te,ne,ht,At,Dt,pe,ke,Z,Y,Ot,It,Rt],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{tt as a,nt as b,Kt as c,Kn as d,dt as e,nn as f,kt as g,kn as h,Yt as i,Qt as j,He as k,Bt as l,Wt as m,_t as n,Vn as o,Zt as p,Le as q,Xt as r};