@duplicati/ngclient 0.0.193 → 0.0.195

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 (128) hide show
  1. package/assets/sh-bold.woff2 +0 -0
  2. package/assets/sh.woff2 +0 -0
  3. package/{chunk-SFR3XMV4.js → chunk-2CGFRRWO.js} +1 -1
  4. package/chunk-2JMS6ROE.js +1 -0
  5. package/chunk-3462PHUY.js +1 -0
  6. package/{chunk-DCMY3QXM.js → chunk-3BCOQAXR.js} +1 -1
  7. package/chunk-3OE7TSMW.js +60 -0
  8. package/{chunk-FOQJA6X2.js → chunk-44IYHRP5.js} +1 -1
  9. package/{chunk-LP4W35DJ.js → chunk-4FWSDHOG.js} +1 -1
  10. package/chunk-4SMU6FWN.js +1 -0
  11. package/{chunk-B2Y54P3R.js → chunk-4ZJ2CTPL.js} +1 -1
  12. package/{chunk-C2SNLPZY.js → chunk-5YPLB2HT.js} +1 -1
  13. package/{chunk-HTPLC7IW.js → chunk-5ZAN5YLF.js} +1 -1
  14. package/{chunk-DGKNUD3G.js → chunk-6GTXSMAH.js} +1 -1
  15. package/chunk-6JS32BWJ.js +2 -0
  16. package/chunk-6NFCRY7O.js +1 -0
  17. package/chunk-6U37VGIP.js +1 -0
  18. package/chunk-6XFXDO6Y.js +7 -0
  19. package/{chunk-BJ4LD474.js → chunk-AOMCREUU.js} +1 -1
  20. package/chunk-AZHCUEP6.js +1 -0
  21. package/{chunk-ZPDK2GFB.js → chunk-CLRYJLBH.js} +1 -1
  22. package/{chunk-5DJAX2HH.js → chunk-D45OX6NR.js} +1 -1
  23. package/chunk-DCSAOEZR.js +1 -0
  24. package/{chunk-NNCQNVQC.js → chunk-DIJYLB6O.js} +1 -1
  25. package/{chunk-7EB3FVZI.js → chunk-DZCAUCS4.js} +1 -1
  26. package/{chunk-O4OTZE5N.js → chunk-E24DEHPH.js} +1 -1
  27. package/{chunk-NBQQSADE.js → chunk-E2Z56LIA.js} +1 -1
  28. package/{chunk-K3VAYERA.js → chunk-EBH2BDUS.js} +1 -1
  29. package/chunk-EEG6BJZA.js +1 -0
  30. package/{chunk-VYJNNEM5.js → chunk-ENMA37SI.js} +1 -1
  31. package/chunk-F35HIVN6.js +2 -0
  32. package/chunk-FKMUWCFT.js +1 -0
  33. package/{chunk-JWO4FPWJ.js → chunk-FO4M5ZRY.js} +1 -1
  34. package/{chunk-G4VDCGMW.js → chunk-FUQM5D63.js} +1 -1
  35. package/{chunk-7XS6T6TX.js → chunk-GBXJU6OY.js} +1 -1
  36. package/{chunk-VEWX3KXN.js → chunk-GEBBLUCV.js} +1 -1
  37. package/chunk-H47NYSA5.js +1 -0
  38. package/chunk-HG3JMGZT.js +1 -0
  39. package/{chunk-HSUSP2MR.js → chunk-IXIH5IF7.js} +1 -1
  40. package/{chunk-2YEG7JK3.js → chunk-J6BDQXGM.js} +1 -1
  41. package/chunk-JB4BH5FG.js +3 -0
  42. package/{chunk-HHYYLYET.js → chunk-JKZHZHVK.js} +1 -1
  43. package/{chunk-WHQUOABU.js → chunk-JOPFYW6K.js} +1 -1
  44. package/chunk-JU3IJWLQ.js +1 -0
  45. package/{chunk-DAODMGAD.js → chunk-KANLHRTR.js} +1 -1
  46. package/chunk-L4B2T7UE.js +1 -0
  47. package/chunk-LYYUFZ36.js +1 -0
  48. package/{chunk-5JYCHNFV.js → chunk-LZCZIUIC.js} +1 -1
  49. package/chunk-M2VB6FGE.js +1 -0
  50. package/chunk-MPUY3ELB.js +1 -0
  51. package/{chunk-FK7JFD5B.js → chunk-MRTE3AG7.js} +1 -1
  52. package/chunk-NMC6ODBC.js +1 -0
  53. package/{chunk-ZXVCNNR6.js → chunk-NSGMUBKR.js} +1 -1
  54. package/{chunk-5RULL5XV.js → chunk-O6J2CI2F.js} +1 -1
  55. package/{chunk-3C5RKSMK.js → chunk-OH4MM62T.js} +1 -1
  56. package/{chunk-VHOAXFIJ.js → chunk-OMCDVUR6.js} +1 -1
  57. package/chunk-ONXV5IRS.js +1 -0
  58. package/{chunk-MHRECQ5Y.js → chunk-ONYKQCZU.js} +1 -1
  59. package/{chunk-TELPJYLN.js → chunk-P42HQ2IS.js} +1 -1
  60. package/chunk-PF77AJOA.js +1 -0
  61. package/chunk-PSU4AIIW.js +1 -0
  62. package/{chunk-UE5VHUV6.js → chunk-PT5SA5DK.js} +1 -1
  63. package/{chunk-6GC4UPHS.js → chunk-RUMIANYF.js} +1 -1
  64. package/{chunk-FQZFKTPW.js → chunk-RZUDIPEJ.js} +1 -1
  65. package/{chunk-HVFZUJ2H.js → chunk-S64V7K5F.js} +1 -1
  66. package/{chunk-WA2IHWIU.js → chunk-S7K2HURB.js} +1 -1
  67. package/{chunk-KDJCL6HE.js → chunk-SFDEJ4KT.js} +1 -1
  68. package/chunk-T5MJYYYR.js +1 -0
  69. package/{chunk-KRXQDBGB.js → chunk-TCB2ZD6T.js} +1 -1
  70. package/{chunk-H6ABNEPW.js → chunk-TIQEZECZ.js} +1 -1
  71. package/{chunk-DW332N2S.js → chunk-TNJ2RJ2V.js} +1 -1
  72. package/chunk-V4SUZRAG.js +1 -0
  73. package/chunk-VIFNOUPQ.js +1 -0
  74. package/{chunk-WUL6NS6B.js → chunk-VIHMVAQG.js} +1 -1
  75. package/{chunk-A4LPGPDU.js → chunk-VRXOIVWD.js} +1 -1
  76. package/{chunk-OTPG7USH.js → chunk-WC6RBAAY.js} +1 -1
  77. package/{chunk-2EIDUF2P.js → chunk-WVRISZPB.js} +1 -1
  78. package/chunk-WYIQINGL.js +1 -0
  79. package/{chunk-ME77WZZI.js → chunk-X52R5Q6W.js} +1 -1
  80. package/chunk-XADU2VUM.js +1 -0
  81. package/{chunk-ZDILEG7V.js → chunk-XBDCSV3I.js} +1 -1
  82. package/{chunk-44TUAFTV.js → chunk-XMEVHAAW.js} +1 -1
  83. package/{chunk-XGIZ7XYY.js → chunk-XR3MBCW5.js} +1 -1
  84. package/{chunk-TT3S63BX.js → chunk-XUDS7MYD.js} +1 -1
  85. package/{chunk-QPTSKQZ2.js → chunk-XURQUV7B.js} +2 -2
  86. package/chunk-YP4LWQJG.js +4 -0
  87. package/chunk-YPP2KQ47.js +1 -0
  88. package/{chunk-PDAA26RM.js → chunk-ZY46ZFXQ.js} +1 -1
  89. package/index.html +2 -2
  90. package/locale/dayjs/it.js +1 -1
  91. package/{main-P5KAOOPB.js → main-EGVXKK35.js} +1 -1
  92. package/package.json +1 -1
  93. package/styles-H32RJLOU.css +1 -0
  94. package/chunk-2PAQOFN3.js +0 -1
  95. package/chunk-2XK5TFRS.js +0 -1
  96. package/chunk-2XXH473G.js +0 -1
  97. package/chunk-3SHOBVX6.js +0 -2
  98. package/chunk-4CELGWVJ.js +0 -1
  99. package/chunk-4YM23PM6.js +0 -1
  100. package/chunk-7BMCHZU3.js +0 -1
  101. package/chunk-AS6Z56AD.js +0 -1
  102. package/chunk-ATPBBNLG.js +0 -1
  103. package/chunk-BGTK25UG.js +0 -1
  104. package/chunk-BOZ44QUT.js +0 -1
  105. package/chunk-BR4LUBSP.js +0 -1
  106. package/chunk-ECRDYEF2.js +0 -1
  107. package/chunk-G22PSFMM.js +0 -7
  108. package/chunk-HPNLQHW6.js +0 -1
  109. package/chunk-KEE3H2WJ.js +0 -1
  110. package/chunk-KETMZS6P.js +0 -1
  111. package/chunk-LSXNHFLE.js +0 -3
  112. package/chunk-MRAKGZE6.js +0 -1
  113. package/chunk-OCQNG4JU.js +0 -1
  114. package/chunk-PEHM5KSY.js +0 -2
  115. package/chunk-PKPBSTZA.js +0 -1
  116. package/chunk-S3K2SIX7.js +0 -1
  117. package/chunk-T2WO6CVD.js +0 -4
  118. package/chunk-T7WSF7RL.js +0 -60
  119. package/chunk-VIONVZIF.js +0 -1
  120. package/chunk-VTKKVX26.js +0 -1
  121. package/chunk-W3543UFN.js +0 -1
  122. package/chunk-WIVARGP6.js +0 -1
  123. package/chunk-XFDHZX44.js +0 -1
  124. package/chunk-XR7KQQO4.js +0 -1
  125. package/chunk-XZ37OAYY.js +0 -1
  126. package/chunk-YDDSLDHZ.js +0 -1
  127. package/chunk-ZAFP5TX6.js +0 -1
  128. package/styles-CY5DE4O7.css +0 -1
@@ -0,0 +1,7 @@
1
+ import{a as Nn}from"./chunk-E24DEHPH.js";import{b as ft,c as ht,d as Nt,e as Fn}from"./chunk-2JMS6ROE.js";import{a as mn,b as Ye,c as St,d as Cn,e as gn,f as Et,h as Tn,i as Sn,j as En}from"./chunk-6GTXSMAH.js";import{a as fn,b as Rt,c as hn}from"./chunk-ONYKQCZU.js";import{a as pn}from"./chunk-ONXV5IRS.js";import{a as re}from"./chunk-D45OX6NR.js";import{a as Tt}from"./chunk-PT5SA5DK.js";import{a as un,b as xe}from"./chunk-TNJ2RJ2V.js";import{a as Fe}from"./chunk-P42HQ2IS.js";import{B as Z,C as rn,E as sn,F as _n,H as Te,K as cn,L as pt,O as dn,P as Me,V as mt,W as Ke,Y as Ct,a as nn,b as ot,c as oe,d as at,e as ae,f as lt,h as on,i as Ce,j as rt,k as st,n as an,o as ln,p as _t,q as ct,r as dt,s as ge,t as Be,u as le,w as ut,z as Oe}from"./chunk-V4SUZRAG.js";import{c as gt}from"./chunk-4SMU6FWN.js";import{b as ke,d as Pe,e as tn}from"./chunk-VRXOIVWD.js";import{_ as en}from"./chunk-WC6RBAAY.js";import{$ as C,Ab as r,Ac as it,Bb as A,D as Jt,E as ve,Fb as se,Gb as ie,Gc as Le,Hb as Y,Ib as D,K as Xt,M as Wt,Ma as jt,Mc as M,Pa as _,Pb as I,Qb as y,Qc as $e,R as ye,Rb as x,Rc as te,Sc as Ue,Ub as We,Uc as qe,Vb as f,W as P,Xb as s,Yb as tt,Zb as nt,aa as g,cb as W,cc as be,da as Ht,dc as Ve,ec as H,f as et,fc as Qt,gc as Ne,hb as K,jc as p,kb as qt,kc as He,l as Kt,la as N,lc as J,mc as je,na as ee,oc as U,p as zt,pc as b,qc as k,rb as Yt,rc as _e,sb as S,sc as j,tb as E,tc as T,ub as Ee,uc as wt,wb as fe,wc as Zt,xb as he,xc as Re,yb as d,yc as Q,zb as l,zc as ce}from"./chunk-YP4LWQJG.js";import{a as X,b as me}from"./chunk-7CGTOI24.js";var Ft=class n{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||n)};static \u0275prov=ye({token:n,factory:n.\u0275fac,providedIn:"root"})};function Qe(n){if(qt(n))return n();if(Array.isArray(n))return n.map(t=>Qe(t));if(typeof n=="object"&&n!==null){let t={};for(let e in n)n.hasOwnProperty(e)&&(t[e]=Qe(n[e]));return t}return n}function Pn(n,t){if(n&1){let e=D();l(0,"div",26)(1,"sh-form-field")(2,"label",27),x(3,7),r(),l(4,"input",28,0),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),g(o)}),r(),l(6,"sh-icon",29),p(7,"clock"),r()(),l(8,"sh-datepicker-input",30)(9,"label",31),p(10,"\xA0"),r(),l(11,"input",32,1),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),g(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),x(18,8),r(),l(19,"input",34),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),g(o)}),r()(),l(20,"sh-select",35)(21,"input",36),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),g(o)}),r()()(),l(22,"sh-toggle-card",37),se(23,38),x(24,9),ie(),l(25,"div",39)(26,"sh-toggle",24),I(27,10),l(28,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),g(o)}),r(),y(),r(),l(29,"sh-toggle",24),I(30,11),l(31,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),g(o)}),r(),y(),r(),l(32,"sh-toggle",24),I(33,12),l(34,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),g(o)}),r(),y(),r(),l(35,"sh-toggle",24),I(36,13),l(37,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),g(o)}),r(),y(),r(),l(38,"sh-toggle",24),I(39,14),l(40,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),g(o)}),r(),y(),r(),l(41,"sh-toggle",24),I(42,15),l(43,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),g(o)}),r(),y(),r(),l(44,"sh-toggle",24),I(45,16),l(46,"input",25),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),g(o)}),r(),y(),r()()()}if(n&2){let e=s(2);_(4),U("ngModel",e.scheduleFields.nextTime.time),_(7),U("ngModel",e.scheduleFields.nextTime.date),_(8),U("ngModel",e.scheduleFields.runAgain.repeatValue),_(),d("options",e.unitOptions)("isClearable",!1),_(),U("ngModel",e.scheduleFields.runAgain.repeatUnit),_(),d("disallowToggle",!0),_(6),U("ngModel",e.scheduleFields.runAgain.allowedDays.mon),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.tue),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.wed),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.thu),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.fri),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sat),_(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function On(n,t){if(n&1){let e=D();l(0,"div",23)(1,"sh-toggle",24),I(2,5),l(3,"input",25),k("ngModelChange",function(o){C(e);let a=s();return b(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),g(o)}),r(),y(),r(),l(4,"p"),x(5,6),r()(),S(6,Pn,47,14)}if(n&2){let e=s();_(3),U("ngModel",e.scheduleFields.autoRun),_(3),E(e.scheduleFields.autoRun()?6:-1)}}var Mn=[{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`}],Dt=[{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:xn().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 Dn(n){if(!n.autoRun)return null;let t=[n.runAgain.allowedDays.mon?"Monday":null,n.runAgain.allowedDays.tue?"Tuesday":null,n.runAgain.allowedDays.wed?"Wednesday":null,n.runAgain.allowedDays.thu?"Thursday":null,n.runAgain.allowedDays.fri?"Friday":null,n.runAgain.allowedDays.sat?"Saturday":null,n.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=n.nextTime.time.split(":"),i=new Date(n.nextTime.date);i.setHours(parseInt(e[0])),i.setMinutes(parseInt(e[1]));let o=n.runAgain.repeatValue,a=n.runAgain.repeatUnit;return{Time:i.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function xn(){let n=new Date,t=n.getDay(),e=t===1?7:(8-t)%7;return n.setDate(n.getDate()+e),n.setHours(12,0,0,0),n}var $t=()=>({autoRun:N(!0),nextTime:{time:N("13:00"),date:N(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:N(1),repeatUnit:N("D"),allowedDays:{mon:N(!0),tue:N(!0),wed:N(!0),thu:N(!0),fri:N(!0),sat:N(!0),sun:N(!0)}}}),Lt=class n{#e=P(De);#t=P(Pe);#n=P(ke);unitOptions=Mn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Dt;updateScheduleType(t){let e=Dt.find(i=>i.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let i=e.data;this.scheduleFields.autoRun.set(i.autoRun??!1),this.scheduleFields.nextTime.time.set(i.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(i.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(i.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(i.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(i.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(i.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(i.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(i.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(i.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(i.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(i.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let i;i=$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 c;c=$localize`If a date was missed, the job will run as soon as possible.`;let u;u=$localize`Next time`;let m;m=$localize`Run again every`;let h;h=$localize`Allowed days`;let $;$=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let F;F=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let G;G=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let v;return v=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,i,o,a,c,u,m,h,$,B,q,L,F,G,v,[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,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,i){e&1&&(l(0,"h3",17),x(1,2),r(),l(2,"sh-select",18)(3,"input",19),f("ngModelChange",function(a){return i.updateScheduleType(a)}),r()(),S(4,On,7,2),l(5,"div",20)(6,"button",21),f("click",function(){return i.goBack()}),I(7,3),A(8,"sh-icon"),y(),r(),l(9,"button",22),f("click",function(){return i.next()}),I(10,4),A(11,"sh-icon"),y(),r()()),e&2&&(_(2),d("isClearable",!1)("options",i.scheduleOptions),_(),d("ngModel",i.scheduleType()),_(),E(i.scheduleType()==="custom"?4:-1))},dependencies:[ge,oe,st,ot,ae,Ce,Te,Ke,le,Z,Me,mt,_n],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})};function wn(n,t){if(n&1){let e=D();l(0,"sh-select",2)(1,"input",6),k("ngModelChange",function(o){C(e);let a=s();return b(a.internalPath,o)||(a.internalPath=o),g(o)}),f("ngModelChange",function(){C(e);let o=s();return g(o.updateFilter())}),r()()}if(n&2){let e=s();d("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),U("ngModel",e.internalPath)}}function Rn(n,t){if(n&1&&(se(0,7),p(1),ie()),n&2){let e,i=s(2);_(),He((e=i.currentExpressionOption())==null?null:e.startsWith)}}function Ln(n,t){if(n&1&&(se(0,8),p(1),ie()),n&2){let e,i=s(2);_(),He((e=i.currentExpressionOption())==null?null:e.endsWith)}}function $n(n,t){if(n&1){let e=D();l(0,"sh-form-field",3)(1,"input",6),k("ngModelChange",function(o){C(e);let a=s();return b(a.internalPath,o)||(a.internalPath=o),g(o)}),f("ngModelChange",function(){C(e);let o=s();return g(o.updateFilter())}),r(),S(2,Rn,2,1,"ng-container",7),S(3,Ln,2,1,"ng-container",8),r()}if(n&2){let e,i,o=s();_(),U("ngModel",o.internalPath),_(),E(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),E(!((i=o.currentExpressionOption())==null||i.endsWith==null)&&i.endsWith.length?3:-1)}}var Gn=[{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"}],vn=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],At=class n{path=te.required();osType=te();pathChange=$e();remove=$e();internalPath=N("");pathType=N("-Expression");currentExpressionOption=M(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=N(Gn);expressionOptions=M(()=>{let e=this.osType()==="Windows"?"\\":"/";return vn.map(i=>i.value==="-Folder"||i.value==="+Folder"?me(X({},i),{startsWith:"",endsWith:""}):i.value==="-FolderName"||i.value==="+FolderName"?me(X({},i),{startsWith:"*",endsWith:`*${e}`}):i.value==="-FileName"||i.value==="+FileName"?me(X({},i),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):i.value==="-FileGroup"||i.value==="+FileGroup"?me(X({},i),{startsWith:"{",endsWith:"}"}):i.value==="-Regex"||i.value==="+Regex"?me(X({},i),{startsWith:"[",endsWith:"]"}):i.value==="-Extension"||i.value==="+Extension"?me(X({},i),{startsWith:"*.",endsWith:""}):me(X({},i),{startsWith:"",endsWith:""}))});pathEffect=ee(()=>{let t=this.path(),e=t.slice(1),i=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(`${i}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${i}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${i}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${i}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${i}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${i}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${i}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();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||n)};static \u0275cmp=W({type:n,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["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"],["prefix",""],["suffix",""]]},template:function(e,i){if(e&1&&(l(0,"sh-select",0)(1,"input",1),k("ngModelChange",function(a){return b(i.pathType,a)||(i.pathType=a),a}),f("ngModelChange",function(){return i.updateFilter()}),r()(),S(2,wn,2,4,"sh-select",2)(3,$n,4,3,"sh-form-field",3),l(4,"div",4),f("click",function(){return i.removeFilter()}),l(5,"sh-icon",5),p(6,"x-circle"),r()()),e&2){let o;d("options",i.expressionOptions())("isClearable",!1),_(),U("ngModel",i.pathType),_(),E(((o=i.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=i.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[ge,oe,ae,Ce,Me,Te,le],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 bn=["*"];function Vn(n,t){n&1&&(l(0,"sh-chip",4),p(1,"Special"),r())}function Un(n,t){n&1&&(l(0,"sh-chip",5),p(1,"Deprecated"),r())}function kn(n,t){if(n&1&&(l(0,"sh-card",0)(1,"div",1),A(2,"img",2),r(),l(3,"div",3),p(4),S(5,Vn,2,0,"sh-chip",4)(6,Un,2,0,"sh-chip",5),r(),l(7,"div",6),p(8),r(),l(9,"div",7),nt(10),r()()),n&2){s();let e=T(0);_(2),d("src",wt(e.icon),jt)("alt",wt(e.displayName)),_(2),J(" ",e.displayName," "),_(),E((e.sortOrder??0)==-2?5:(e.sortOrder??0)<0?6:-1),_(3),He(e.description)}}var Je=class n{destination=te();targetUrl=te();selectedDestinationType=M(()=>{let t=this.targetUrl();return t?Ye(t)??null:null});destinationFromTargetUrl=M(()=>{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=M(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"]},ngContentSelectors:bn,decls:2,vars:2,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,i){if(e&1&&(tt(),_e(0),S(1,kn,11,7,"sh-card",0)),e&2){let o=j(i.destinationItem());_(),E(o?1:-1)}},dependencies:[rn,sn],styles:['[_nghost-%COMP%]{display:block}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%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};var Xe=class n{#e=P(Fe);supportedDestinationTypes=M(()=>this.#e.backendModules().flatMap(t=>{if(!t?.Key)return null;let e=Cn(t.Key);if(e.length<=1){let i=St(t.Key);return i.isDefaultEntry===!0?[me(X({},i),{displayName:t.DisplayName||i.displayName||t.Key,description:t.Description||i.description||""})]:i}else return e}).filter(t=>t!==null));destinationTypeOptions=M(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon,searchTerms:[t.displayName,t.description,t.key,t.searchTerms??"",t.customKey??""].join(" "),sortOrder:t.sortOrder??0})));backendModules=M(()=>this.#e.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=ye({token:n,factory:n.\u0275fac,providedIn:"root"})};function Bn(n,t){if(n&1){let e=D();l(0,"app-destination-list-item",3)(1,"button",4),f("click",function(){let o=C(e).$implicit,a=s();return g(a.setDestination.emit(o.customKey??o.key))}),I(2,0),A(3,"sh-icon"),y(),r()()}if(n&2){let e=t.$implicit;d("destination",e)}}var It=class n{#e=P(Xe);showAsSources=te(!1);setDestination=$e();destinationSearchTerm=N("");destinationTypeOptions=this.#e.destinationTypeOptions;destinationTypeOptionsFocused=M(()=>{let t=this.destinationTypeOptions(),e=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((o,a)=>{let c=o.sortOrder??0,u=a.sortOrder??0;return c!==u?u-c:o.displayName.localeCompare(a.displayName)}).filter(o=>{let a=o.sortOrder??0;return a<0&&e?.length&&(o.key.toLocaleLowerCase()===e.toLocaleLowerCase()||o.customKey?.toLocaleLowerCase()===e.toLocaleLowerCase())?!0:a>=0});return e?i.filter(o=>o.searchTerms.toLowerCase().includes(e)):i});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"]},outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let t;t=$localize`Search for destination...`;let e;return e=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(e,i){e&1&&(l(0,"sh-form-field")(1,"input",1),k("ngModelChange",function(a){return b(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),r()(),l(2,"div",2),fe(3,Bn,4,1,"app-destination-list-item",3,Ee),r()),e&2&&(_(),U("ngModel",i.destinationSearchTerm),_(2),he(i.destinationTypeOptionsFocused()))},dependencies:[Je,ge,oe,ae,Ce,Te,Z,le],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Kn=["fileInput"],zn=[[["label"]]],Jn=["label"],yt=class n{customId=te();content=N("");readonly=N(!1);placeholder=te("Drop a file here or use the browse button");fileInputRef=Ue("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=ee(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,i){e&1&&be(i.fileInputRef,Kn,5),e&2&&Ve()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Zt([{provide:nn,useExisting:n,multi:!0}])],ngContentSelectors:Jn,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,i){if(e&1){let o=D();tt(zn),nt(0,0,["ngProjectAs","label",5,["label"]]),l(1,"div",1)(2,"button",2),f("click",function(){return C(o),g(i.triggerBrowse())}),l(3,"sh-icon"),p(4,"upload"),r()()(),l(5,"div",3),f("drop",function(c){return C(o),g(i.onFileDrop(c))})("dragover",function(c){return C(o),g(i.onDragOver(c))}),l(6,"textarea",4),k("ngModelChange",function(c){return C(o),b(i.content,c)||(i.content=c),g(c)}),r()(),l(7,"input",5,0),f("change",function(c){return C(o),g(i.onFileSelected(c))}),r()}e&2&&(_(6),d("placeholder",i.placeholder()),U("ngModel",i.content),d("disabled",i.readonly()))},dependencies:[ge,oe,ae,Ce,le,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 Xn=(n,t,e,i)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:i}),ne=n=>({$implicit:n}),Wn=(n,t,e,i)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:i}),Hn=()=>({updateOn:"blur"}),jn=(n,t,e,i)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:i}),Se=(n,t)=>({fieldGroup:n,formView:t}),qn=()=>["/connect/logon"];function Yn(n,t){n&1&&Y(0)}function Qn(n,t){if(n&1&&K(0,Yn,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s();let o=H(15);s();let a=T(0),c=T(1);d("ngTemplateOutlet",o)("ngTemplateOutletContext",Q(7,ne,it(2,Xn,i,e,a,c.oauthField)))}}function Zn(n,t){n&1&&Y(0)}function ei(n,t){if(n&1&&K(0,Zn,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s();let o=H(15);s();let a=T(0),c=T(1);d("ngTemplateOutlet",o)("ngTemplateOutletContext",Q(7,ne,it(2,Wn,i,e,a,c.oauthField)))}}function ti(n,t){if(n&1){let e=D();l(0,"button",25),f("click",function(){C(e);let o=s(2);return g(o.showTextArea.set(!1))}),I(1,8),A(2,"sh-icon"),y(),r()}}function ni(n,t){if(n&1){let e=D();l(0,"button",32,2),f("click",function(){let o=C(e).$implicit,a=s(3);return g(a.addAdvancedOption(o))}),p(2),r()}if(n&2){let e=t.$implicit;_(2),J(" ",e.name," ")}}function ii(n,t){if(n&1){let e=D();l(0,"div",22)(1,"sh-menu",26)(2,"button",27),I(3,9),A(4,"sh-icon"),y(),r(),se(5,28),fe(6,ni,3,1,"button",29,Ee),ie(),r(),l(8,"sh-menu")(9,"button",30)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),se(12,28),l(13,"button",31),f("click",function(){C(e);let o=s(2);return g(o.showTextArea.set(!0))}),l(14,"sh-icon"),p(15,"link"),r(),p(16," Edit contents as text "),r(),ie(),r()()}if(n&2){s();let e=T(9);_(),d("searchable",!0),_(),d("disabled",e.length===0),_(4),he(e)}}function oi(n,t){if(n&1){let e=D();l(0,"textarea",33),f("ngModelChange",function(o){C(e);let a=s(2);return g(a.updateSettingsFromText(o))}),r()}if(n&2){let e=s(2);d("ngModel",e.settingsAsText())("ngModelOptions",Re(2,Hn))}}function ai(n,t){n&1&&Y(0)}function li(n,t){if(n&1&&K(0,ai,1,0,"ng-container",24),n&2){let e=t.$implicit,i=t.$index;s(2);let o=H(15),a=s(),c=T(0),u=T(1),m=a.getFormView("advanced",e)??a.getDefaultFormView(e);d("ngTemplateOutlet",o)("ngTemplateOutletContext",Q(7,ne,it(2,jn,i,m,c,u.oauthField)))}}function ri(n,t){if(n&1&&fe(0,li,1,9,"ng-container",null,Ee),n&2){let e=s(2);he(e.advancedFormFieldNames())}}function si(n,t){n&1&&(l(0,"sup",42),p(1,"*"),r())}function _i(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function ci(n,t){if(n&1){let e=D();l(0,"app-file-tree",35)(1,"label",41),S(2,si,2,0,"sup",42),p(3),S(4,_i,2,1,"sh-icon",43),r(),l(5,"input",44),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(3),c=T(4),u=T(5);d("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),_(),d("for",u),_(),E(e.formView.isMandatory&&c?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("id",u)("ngModel",o)}}function di(n,t){n&1&&(l(0,"sup",45),p(1,"*"),r())}function ui(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function pi(n,t){if(n&1){let e=D();l(0,"app-file-tree",36)(1,"label",41),S(2,di,2,0,"sup",45),p(3),S(4,ui,2,1,"sh-icon",43),r(),l(5,"input",44),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(3),c=T(4),u=T(5);d("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),_(),d("for",u),_(),E(e.formView.isMandatory&&c?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("id",u)("ngModel",o)}}function mi(n,t){n&1&&(l(0,"sup",46),p(1,"*"),r())}function Ci(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function gi(n,t){n&1&&(l(0,"sh-icon",47),p(1," warning "),r())}function Ti(n,t){n&1&&Y(0)}function Si(n,t){if(n&1&&(l(0,"sh-icon",51),p(1," link "),r()),n&2){s();let e=T(8),i=T(9);Ne("error",e&&i==="error")("warn",e&&i==="warning"),d("shTooltip",e)}}function Ei(n,t){n&1&&(l(0,"sh-icon",50),p(1,"envelope"),r())}function fi(n,t){n&1&&(l(0,"sh-icon",50),p(1,"hard-drives"),r())}function hi(n,t){n&1&&(l(0,"sh-icon",50),p(1,"jar"),r())}function Ni(n,t){n&1&&(l(0,"sh-icon",50),p(1,"textbox"),r())}function Fi(n,t){if(n&1){let e=D();l(0,"sh-form-field")(1,"label",41),S(2,mi,2,0,"sup",46),p(3),S(4,Ci,2,1,"sh-icon",43),S(5,gi,2,0,"sh-icon",47),K(6,Ti,1,0,"ng-container",24),r(),l(7,"input",48),f("keydown",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),_e(8)(9),S(10,Si,2,5,"sh-icon",49)(11,Ei,2,0,"sh-icon",50)(12,fi,2,0,"sh-icon",50)(13,hi,2,0,"sh-icon",50)(14,Ni,2,0,"sh-icon",50),r()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(3),c=T(4),u=T(5);s();let m=H(17);_(),d("for",u),_(),E(e.formView.isMandatory&&c?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),E(c&&e.formView.type==="Path"?5:-1),_(),d("ngTemplateOutlet",m)("ngTemplateOutletContext",Q(16,ne,ce(13,Se,e.fieldGroup,e.formView))),_(),d("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",o);let h=a,$=s().hasLeadingSlash(h??"");_(),j($&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),_(),j(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),_(),E(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 Di(n,t){n&1&&(l(0,"sup",52),p(1,"*"),r())}function Ai(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Ii(n,t){n&1&&Y(0)}function yi(n,t){if(n&1){let e=D();l(0,"span",56),f("click",function(){C(e);let o=s(2).$implicit,a=s(2);return g(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),r()}}function Pi(n,t){n&1&&(l(0,"sh-icon",50),p(1,"password"),r())}function Oi(n,t){if(n&1){let e=D();l(0,"sh-icon",57),f("click",function(){C(e);let o=s(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),r()}}function Mi(n,t){if(n&1){let e=D();l(0,"sh-icon",57),f("click",function(){C(e);let o=s(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),r()}}function xi(n,t){if(n&1){let e=D();l(0,"sh-form-field")(1,"label",41),S(2,Di,2,0,"sup",52),p(3),S(4,Ai,2,1,"sh-icon",43),K(5,Ii,1,0,"ng-container",24),r(),l(6,"input",53),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),S(7,yi,2,0,"span",54)(8,Pi,2,0,"sh-icon",50),S(9,Oi,2,0,"sh-icon",55)(10,Mi,2,0,"sh-icon",55),r()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17);_(),d("for",c),_(),E(e.formView.isMandatory&&a?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(14,ne,ce(11,Se,e.fieldGroup,e.formView))),_(),d("type",e.formView.showPassword?"text":"password")("id",c)("ngModel",o),_(),E(e.oauthField===e.formView.name?7:8),_(2),E(e.formView.showPassword?9:10)}}function wi(n,t){n&1&&(l(0,"sup",59),p(1,"*"),r())}function Ri(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Li(n,t){n&1&&Y(0)}function $i(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;je(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Gi(n,t){if(n&1){let e=D();l(0,"sh-select",58)(1,"label",41),S(2,wi,2,0,"sup",59),p(3),S(4,Ri,2,1,"sh-icon",43),K(5,Li,1,0,"ng-container",24),r(),l(6,"input",44),f("ngModelChange",function(o){C(e);let a=s(2).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),K(7,$i,1,2,"ng-template",null,3,Le)}if(n&2){let e=H(8);s();let i=T(0),o=s().$implicit,a=T(1),c=T(2),u=T(4),m=T(5);s();let h=H(17);d("options",i)("isClearable",!1)("optionTemplate",e),_(),d("for",m),_(),E(o.formView.isMandatory&&u?2:-1),_(),J(" ",a," "),_(),E(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",h)("ngTemplateOutletContext",Q(14,ne,ce(11,Se,o.fieldGroup,o.formView))),_(),d("id",m)("ngModel",c)}}function vi(n,t){if(n&1&&(_e(0),S(1,Gi,9,16)),n&2){let e=s().$implicit,i=j(s(2).mapOptions(e.formView));_(),E(i?1:-1)}}function bi(n,t){n&1&&(l(0,"sup",62),p(1,"*"),r())}function Vi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Ui(n,t){n&1&&Y(0)}function ki(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;je(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Bi(n,t){if(n&1){let e=D();l(0,"sh-select",61)(1,"label",41),S(2,bi,2,0,"sup",62),p(3),S(4,Vi,2,1,"sh-icon",43),K(5,Ui,1,0,"ng-container",24),r(),l(6,"input",44),f("ngModelChange",function(o){C(e);let a=s(2).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),K(7,ki,1,2,"ng-template",null,4,Le)}if(n&2){let e=H(8);s();let i=T(0),o=s().$implicit,a=T(1),c=T(2),u=T(4),m=T(5);s();let h=H(17);d("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),_(),d("for",m),_(),E(o.formView.isMandatory&&u?2:-1),_(),J(" ",a," "),_(),E(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",h)("ngTemplateOutletContext",Q(15,ne,ce(12,Se,o.fieldGroup,o.formView))),_(),d("id",m)("ngModel",c)}}function Ki(n,t){n&1&&A(0,"sh-progress-bar",60)}function zi(n,t){if(n&1&&(_e(0),S(1,Bi,9,17)(2,Ki,1,0,"sh-progress-bar",60)),n&2){let e=s().$implicit,i=T(2),o=j(s(2).mapOptionsWithFreeText(e.formView,i));_(),E(o?1:2)}}function Ji(n,t){n&1&&(l(0,"sup",64),p(1,"*"),r())}function Xi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Wi(n,t){n&1&&Y(0)}function Hi(n,t){if(n&1){let e=D();l(0,"app-size",63),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",41),S(2,Ji,2,0,"sup",64),p(3),S(4,Xi,2,1,"sh-icon",43),K(5,Wi,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17);d("inputType",e.Name)("ngModel",o)("customId",c),_(),d("for",c),_(),E(e.formView.isMandatory&&a?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(12,ne,ce(9,Se,e.fieldGroup,e.formView)))}}function ji(n,t){n&1&&(l(0,"sup",65),p(1,"*"),r())}function qi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Yi(n,t){n&1&&Y(0)}function Qi(n,t){if(n&1){let e=D();l(0,"sh-form-field")(1,"label",41),S(2,ji,2,0,"sup",65),p(3),S(4,qi,2,1,"sh-icon",43),K(5,Yi,1,0,"ng-container",24),r(),l(6,"input",66),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",50),p(8,"numpad"),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17);_(),d("for",c),_(),E(e.formView.isMandatory&&a?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(11,ne,ce(8,Se,e.fieldGroup,e.formView))),_(),d("id",c)("ngModel",o)}}function Zi(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function eo(n,t){n&1&&Y(0)}function to(n,t){if(n&1){let e=D();l(0,"sh-toggle",67),f("click",function(){C(e);let o=s().$implicit,a=T(2),c=s(2);return g(c.updateFieldValue(o.fieldGroup,o.formView.name,c.isTrue(a)?"false":"true"))}),l(1,"label",41),p(2),S(3,Zi,2,1,"sh-icon",43),K(4,eo,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(5);s();let c=H(17),u=s();Ne("active",u.isTrue(o)),_(),d("for",a),_(),J(" ",i," "),_(),E(e.formView.longDescription?3:-1),_(),d("ngTemplateOutlet",c)("ngTemplateOutletContext",Q(10,ne,ce(7,Se,e.fieldGroup,e.formView)))}}function no(n,t){n&1&&(l(0,"sup",69),p(1,"*"),r())}function io(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function oo(n,t){n&1&&Y(0)}function ao(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;je(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function lo(n,t){if(n&1){let e=D();l(0,"sh-select",68)(1,"label",41),S(2,no,2,0,"sup",69),p(3),S(4,io,2,1,"sh-icon",43),K(5,oo,1,0,"ng-container",24),r(),l(6,"input",70),f("ngModelChange",function(o){C(e);let a=s(2).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),K(7,ao,1,2,"ng-template",null,5,Le)}if(n&2){let e=H(8);s();let i=T(0),o=s().$implicit,a=T(1),c=T(2),u=T(4),m=T(5);s();let h=H(17);d("options",i)("selectMultiple",!0)("optionTemplate",e),_(),d("for",m),_(),E(o.formView.isMandatory&&u?2:-1),_(),J(" ",a," "),_(),E(o.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",h)("ngTemplateOutletContext",Q(13,ne,ce(10,Se,o.fieldGroup,o.formView))),_(),d("ngModel",c)}}function ro(n,t){if(n&1&&(_e(0),S(1,lo,9,15)),n&2){let e=s().$implicit,i=j(s(2).mapOptions(e.formView));_(),E(i?1:-1)}}function so(n,t){n&1&&(l(0,"sup",71),p(1,"*"),r())}function _o(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function co(n,t){n&1&&Y(0)}function uo(n,t){if(n&1){let e=D();l(0,"app-timespan",63),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",41),S(2,so,2,0,"sup",71),p(3),S(4,_o,2,1,"sh-icon",43),K(5,co,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17);d("inputType",e.formView.name)("ngModel",o)("customId",c),_(),d("for",c),_(),E(e.formView.isMandatory&&a?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(12,ne,ce(9,Se,e.fieldGroup,e.formView)))}}function po(n,t){n&1&&(l(0,"sup",73),p(1,"*"),r())}function mo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(2).$implicit;d("shTooltip",e.formView.longDescription)}}function Co(n,t){n&1&&Y(0)}function go(n,t){if(n&1){let e=D();l(0,"app-file-drop-textarea",72),f("ngModelChange",function(o){C(e);let a=s().$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label"),S(2,po,2,0,"sup",73),p(3),S(4,mo,2,1,"sh-icon",43),K(5,Co,1,0,"ng-container",24),r()()}if(n&2){let e=s().$implicit,i=T(2),o=T(4),a=T(5);s();let c=H(17);d("ngModel",i)("customId",a)("placeholder",e.formView.longDescription),_(2),E(e.formView.isMandatory&&o?2:-1),_(),J(" ",e.formView.shortDescription??e.formView.name," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",c)("ngTemplateOutletContext",Q(11,ne,ce(8,Se,e.fieldGroup,e.formView)))}}function To(n,t){n&1&&(A(0,"sh-spinner"),l(1,"span"),x(2,10),r()),n&2&&Qt("--spinner-size","16px")("--spinner-thickness","2px")}function So(n,t){n&1&&(l(0,"div",76),x(1,11),r())}function Eo(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;je(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function fo(n,t){if(n&1){let e=D();l(0,"sh-select",77)(1,"label",41)(2,"sup",78),p(3,"*"),r(),l(4,"span"),x(5,12),r()(),l(6,"input",44),f("ngModelChange",function(o){C(e);let a=s(4).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),K(7,Eo,1,2,"ng-template",null,6,Le)}if(n&2){s(4);let e=T(2),i=T(5),o=s(2);d("options",o.restoreBackupIdOptions())("isClearable",!1),_(),d("for",i),_(5),d("id",i)("ngModel",e)}}function ho(n,t){if(n&1&&S(0,To,3,4)(1,So,2,0,"div",76)(2,fo,9,5),n&2){let e=s(5);E(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2)}}function No(n,t){n&1&&(l(0,"sup",79),p(1,"*"),r())}function Fo(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(4).$implicit;d("shTooltip",e.formView.longDescription)}}function Do(n,t){n&1&&Y(0)}function Ao(n,t){if(n&1){let e=D();l(0,"button",81),f("click",function(){C(e),s(4);let o=T(5),a=s(2);return g(a.toggleDisabled(o))}),I(1,13),A(2,"sh-icon"),y(),r()}}function Io(n,t){if(n&1){let e=D();l(0,"sh-form-field")(1,"label",41),S(2,No,2,0,"sup",79),p(3),S(4,Fo,2,1,"sh-icon",43),K(5,Do,1,0,"ng-container",24),r(),l(6,"input",80),f("ngModelChange",function(o){C(e);let a=s(3).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",50),p(8,"textbox"),r()(),S(9,Ao,3,0,"button",40)}if(n&2){let e=s(3).$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17),m=s();_(),d("for",c),_(),E(e.formView.isMandatory&&a?2:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?4:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(15,ne,ce(12,Se,e.fieldGroup,e.formView))),_(),d("type","text")("id",c)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),_(3),E(m.getIsDisabled(c)?9:-1)}}function yo(n,t){if(n&1&&(l(0,"div",74),S(1,ho,3,1)(2,Io,10,17),r()),n&2){let e=s(4);_(),E(e.isRestoreFlow()?1:2)}}function Po(n,t){if(n&1){let e=D();l(0,"div",82),I(1,14),A(2,"div")(3,"div"),y(),r(),l(4,"button",81),f("click",function(){C(e);let o=s(5);return g(o.openConsole())}),I(5,15),A(6,"sh-icon"),y(),r()}}function Oo(n,t){n&1&&(l(0,"div",82),x(1,16),r(),l(2,"button",83),I(3,17),A(4,"sh-icon"),y(),r()),n&2&&(_(2),d("routerLink",Re(1,qn)))}function Mo(n,t){if(n&1&&(l(0,"div",75),S(1,Po,7,0)(2,Oo,5,2),r()),n&2){let e=s(4);_(),E(e.isConnectedToConsole()?1:2)}}function xo(n,t){if(n&1&&S(0,yo,3,1,"div",74)(1,Mo,3,1,"div",75),n&2){let e=s(3);E(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1)}}function wo(n,t){n&1&&(l(0,"sup",85),p(1,"*"),r())}function Ro(n,t){if(n&1&&(l(0,"sh-icon",43),p(1,"question"),r()),n&2){let e=s(3).$implicit;d("shTooltip",e.formView.longDescription)}}function Lo(n,t){n&1&&Y(0)}function $o(n,t){if(n&1){let e=D();l(0,"div",84)(1,"sh-form-field")(2,"label",41),S(3,wo,2,0,"sup",85),p(4),S(5,Ro,2,1,"sh-icon",43),K(6,Lo,1,0,"ng-container",24),r(),l(7,"input",86),f("ngModelChange",function(o){C(e);let a=s(2).$implicit,c=s(2);return g(c.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(8,"sh-icon",50),p(9,"textbox"),r()(),l(10,"button",87),f("click",function(){C(e);let o=s(4);return g(o.authenticateFilen())}),I(11,18),A(12,"sh-icon"),y(),r()()}if(n&2){let e=s(2).$implicit,i=T(1),o=T(2),a=T(4),c=T(5);s();let u=H(17),m=s();_(2),d("for",c),_(),E(e.formView.isMandatory&&a?3:-1),_(),J(" ",i," "),_(),E(e.formView.longDescription?5:-1),_(),d("ngTemplateOutlet",u)("ngTemplateOutletContext",Q(12,ne,ce(9,Se,e.fieldGroup,e.formView))),_(),d("id",c)("ngModel",o),_(3),d("disabled",m.isAuthenticatingFilen())}}function Go(n,t){if(n&1&&S(0,$o,13,14,"div",84),n&2){let e=s(3);E(e.hasFilenApiKey()?-1:0)}}function vo(n,t){if(n&1){let e=D();l(0,"button",81),f("click",function(){C(e);let o=s().$implicit,a=s(2);return g(a.removeAdvancedOption(o.formView.name))}),l(1,"sh-icon"),p(2,"x-circle"),r()()}}function bo(n,t){if(n&1&&(l(0,"div",34),_e(1)(2)(3)(4)(5),S(6,ci,6,12,"app-file-tree",35)(7,pi,6,9,"app-file-tree",36)(8,Fi,15,18,"sh-form-field")(9,xi,11,16,"sh-form-field")(10,vi,2,2)(11,zi,3,2)(12,Hi,6,14,"app-size",37)(13,Qi,9,13,"sh-form-field")(14,to,5,12,"sh-toggle",38)(15,ro,2,2)(16,uo,6,14,"app-timespan",37)(17,go,6,13,"app-file-drop-textarea",39)(18,xo,2,1)(19,Go,1,1),S(20,vo,3,0,"button",40),r()),n&2){let e=t.$implicit;s();let i=T(0),o=s();Ne("single-field",e.fieldGroup!=="advanced"),_(),j(e.formView.shortDescription??e.formView.name),_(),j(o.getFieldGroup(i,e.fieldGroup)[e.formView.name]),_();let a=j(o.getFieldValue(e.fieldGroup,e.formView.name));_(),j((a??"").toString().trim()===""),_(),j("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),_(),E(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),_(14),E(e.fieldGroup==="advanced"?20:-1)}}function Vo(n,t){if(n&1&&(l(0,"sh-icon",88),p(1,"x-circle"),r()),n&2){s();let e=T(0);d("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Uo(n,t){if(n&1&&(l(0,"sh-icon",89),p(1,"warning"),r()),n&2){s();let e=T(0);d("shTooltip",(e==null?null:e.message)??"Invalid value")}}function ko(n,t){if(n&1&&(_e(0),S(1,Vo,2,1,"sh-icon",88)(2,Uo,2,1,"sh-icon",89)),n&2){let e=s().$implicit,i=T(0),o=j(e.formView.validate(i));_(),E((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function Bo(n,t){if(n&1&&(_e(0),S(1,ko,3,2)),n&2){let e=t.$implicit,o=(j(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";_(),E(!o&&e.formView.validate?1:-1)}}function Ko(n,t){if(n&1&&(_e(0),fe(1,Qn,1,9,"ng-container",null,Ee),fe(3,ei,1,9,"ng-container",null,Ee),l(5,"sh-toggle-card",19),se(6,20)(7),x(8,7),ie(),_e(9),S(10,ti,3,0,"button",21)(11,ii,17,2,"div",22),ie(),S(12,oi,1,3,"textarea",23)(13,ri,2,0),r(),K(14,bo,21,9,"ng-template",null,0,Le)(16,Bo,2,2,"ng-template",null,1,Le)),n&2){let e=s(),i=T(1);j(e.destinationForm()),_(),he(i.custom),_(2),he(i.dynamic),_(2),d("disallowToggle",!0),_(4),j(e.nonSelectedAdvancedFormViews()),_(),E(e.showTextArea()?10:11),_(2),E(e.showTextArea()?12:13)}}var Pt=class n{#e=P(De);#t=P(Fe);#n=P(Tt);#i=P(Xe);#s=P(pn);#l=P(mn);#o=P(Oe);injector=P(Ht);targetUrl=qe.required();useBackupState=te(!1);#a=null;destinationType=M(()=>{let t=this.targetUrl();if(!t)return null;let e=Ye(t);return this.#a=e?.customKey??e?.key,this.#a});refreshView=N(!1);destinationForm=N({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=M(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=N(null);showTextArea=N(!1);isLoadingRestoreBackupIdOptions=N(!1);isRestoreFlow=M(()=>!this.useBackupState());restoreBackupIdOptions=xe(un(this.targetUrl).pipe(zt(t=>{if(!t)return{authKey:null,url:null,isRestore:this.isRestoreFlow(),hasKey:this.hasStorageApiKey()};let e=t.indexOf("?"),i=e>=0?t.substring(e+1):"",o=new URLSearchParams(i),a=o.get("duplicati-auth-apiid")??"",c=o.get("duplicati-auth-apikey")??"";return{authKey:`${a}|${c}`,url:t}}),Jt((t,e)=>t.authKey===e.authKey),Wt(({url:t})=>{this.lastRestoreAuthQueryUrl=t}),Xt(({url:t})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()?(this.isLoadingRestoreBackupIdOptions.set(!0),this.#l.getDuplicatiStorageBackups(t).pipe(ve(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Kt([]))),{initialValue:[]});isConnectedToConsole=M(()=>this.#s.state()==="connected");hasStorageApiKey=M(()=>(this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0);isAuthenticatingFilen=N(!1);hasFilenApiKey=M(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=M(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(i=>e.findIndex(o=>o===i.name)===-1)});destinationTypeEffect=ee(()=>{let t=this.targetUrl(),e=Ye(t??""),i=e.key,o=e.customKey??i,a=this.#i.backendModules().find(L=>L.Key===i)??{Key:i,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!i)return;let c=e&&e.oauthField?e.oauthField:null,u=e&&e.customFields?e.customFields:{},m=e&&e.dynamicFields?e.dynamicFields:[],h=e&&e.advancedFields?e.advancedFields:[],$=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],B={destinationType:o,oauthField:c,custom:[],dynamic:[],advanced:[]};u&&Object.entries(u).forEach(([L,F],G)=>{let v=F.order??G,O=F.validate;!O&&F.type==="Bucketname"&&(O=z=>Sn(z)?null:{type:"error",message:$localize`Invalid bucket name.`}),O&&F.type==="Hostname"&&(O=z=>En(z)?null:{type:"error",message:$localize`Invalid hostname.`}),B.custom.push(X({order:900+v,validate:O},F))});for(let L=0;L<a.Options.length;L++){let F=a.Options[L];if(F.Deprecated)continue;let G=m.find(v=>v===F.Name||F.Aliases?.includes(v.name)||v.name===F.Name);if(G){let v=F.Aliases?.indexOf(G.name)??-1,O=F.Aliases&&v>-1?F.Aliases[v]:F.Name,z=G&&typeof G!="string",ue=z?G?.defaultValue??F.DefaultValue:F.DefaultValue,pe=z&&G?.order!==void 0?G.order:L,w={name:O,type:F.Type,shortDescription:F.ShortDescription??void 0,longDescription:F.LongDescription??void 0,options:F.ValidValues,order:900+pe},R=z?X(X({},w),G):w;B.dynamic.push(R)}else{let v=F.Name;if($.find(we=>we===v))continue;let z=h.find(we=>we===v||we.name===v),ue=z&&typeof z!="string",pe=ue&&z?.order!==void 0?z.order:L,w={name:v,type:F.Type,shortDescription:F.ShortDescription??void 0,longDescription:F.LongDescription??void 0,options:F.ValidValues,defaultValue:F.DefaultValue,order:900+pe},R=ue?X(X({},w),z):w;B.advanced.push(R)}}if(B.custom.sort((L,F)=>L.order-F.order),B.dynamic.sort((L,F)=>L.order-F.order),B.advanced.sort((L,F)=>L.order-F.order),this.destinationFormConfig.set(B),!t)return;let q=Et(t);q&&this.destinationForm.set({custom:q.custom,dynamic:q.dynamic,advanced:q.advanced})});destinationFormEffect=ee(()=>{let t=this.#a,e=this.destinationForm(),i=this.refreshView();if(!e||!t)return;let o=gn({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(X({},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,i,o){if(i==="Hostname"||i==="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,i){let o=this.destinationForm();o[t][e]=i,this.destinationForm.set(X({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(X({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let i=t.options;return i?i.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let i=this.mapOptions(t);return i?(e&&e.length>0&&(i.find(a=>a.value===e)||i.push({key:e,value:e})),i):null}#r=N(!1);oauthStartTokenCreation(t,e,i,o){this.#r.set(!0);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),c=this.#n.serverSettings()?.["--oauth-url"];if(c&&c.length>0&&(a=c),this.useBackupState()){let F=this.#e.mapFormsToSettings().find(G=>G.Name==="--oauth-url")?.Value;F&&F.length>0&&(a=F)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let m=`${a}?type=${t}`,h=450,$=600,B=screen.width/2-h/2,q=screen.height/2-$/2,L=window.open(m,"_blank","height="+$+",width="+h+",menubar=0,status=0,titlebar=0,toolbar=0,left="+B+",top="+q);return window.addEventListener("message",F=>{let G=F.data.startsWith("authid:"),v=G?F.data.replace("authid:",""):null;G&&(this.destinationForm.update(O=>(O[e][i]=v,O)),this.#r.set(!1),this.refreshView.set(!this.refreshView()),L?.close())}),!1}settingsAsText=M(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,i])=>{let o=e??"",a="";return typeof i=="boolean"?a=this.isTrue(i)?"True":"False":(typeof i=="number"||i!=null)&&(a=i.toString()),`${o}=${a}`}).join(`
2
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Tn(t);this.destinationForm.update(i=>me(X({},i),{advanced:e}))}getIsDisabled(t){return document.getElementById(t)?.disabled??!0}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled)}openConsole(){this.#s.openConsole()}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(!0),this.#l.getFilenApiKey(t,e).pipe(ve(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:i=>{if(i.length===0){this.#o.open(re,{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"]=i,o.dynamic["two-factor-code"]=null,o)),this.refreshView.set(!this.refreshView())},error:i=>{console.error("Error authenticating Filen",i),this.#o.open(re,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${i.message}`,confirmText:$localize`OK`}})}})}authenticateFilen(){let t=this.targetUrl();if(!t)return;let i=this.destinationForm().advanced["api-key"];if(i&&i.length>0){this.#o.open(re,{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||n)};static \u0275cmp=W({type:n,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$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 c;c=$localize`This field is mandatory`;let u;u=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let m;m=$localize`This field is mandatory`;let h;h=$localize`This field is mandatory`;let $;$=$localize`This field is mandatory`;let B;B=$localize`This field is mandatory`;let q;q=$localize`This field is mandatory`;let L;L=$localize`This field is mandatory`;let F;F=$localize`This field is mandatory`;let G;G=$localize`This field is mandatory`;let v;v=$localize`Loading available backups...`;let O;O=$localize`No backups found from this machine, contact support`;let z;z=$localize`This field is mandatory`;let ue;ue=$localize`Pick the backup to restore from`;let pe;pe=$localize`This field is mandatory`;let w;w=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let R;R=$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:`,R=We(R);let we;we=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Vt;Vt=$localize`Connect to the console to use Duplicati storage.`;let Ut;Ut=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let kt;kt=$localize`This field is mandatory`;let Bt;return Bt=$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,i,v,O,ue,w,R,we,Vt,Ut,Bt,[1,"advanced-options",3,"disallowToggle"],["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"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[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",c],["shTooltip",u,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",m],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",h],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",$],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",B],["shTooltip",q],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",L],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",F],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",G],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",z],["shTooltip",pe],["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",kt],["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,i){if(e&1&&(_e(0)(1),S(2,Ko,18,5)),e&2){let o=j(i.destinationType());_();let a=j(i.destinationFormConfig());_(),E(o&&a?2:-1)}},dependencies:[Be,oe,st,ae,ge,Ce,en,tn,Nt,ht,Fn,yt,Te,Z,le,mt,cn,Me,Ct,Ke,pt,dn],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}"],changeDetection:0})};var Ot=class n{#e=P(gt);#t=P(Oe);#n=P(Fe);testDestination(t,e,i,o,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a):this.testDestinationv1(t,e,i,o,a)}testDestinationv2(t,e,i,o,a){return new et(c=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:u=>{if(u.Success){this.emitSuccessV2(c,t,i,u);return}this.handleGenericError(c,t,i,u.Error??"Unknown error",a)},error:u=>{let m=u?.error?.body??u?.error?.requestBody;if(m?.Data?.FolderExists===!1||m?.StatusCode==="missing-folder"){o?this.handleMissingFolder(c,t,i):this.handleGenericError(c,t,i,$localize`The remote destination folder does not exist.`,a);return}if(m?.Data?.HostCertificate){this.handleMissingCertificate(c,t,i,m.Data?.HostCertificate);return}if(m?.Data?.ReportedHostKey){this.handleIncorrectKey(c,t,i,m.Data.ReportedHostKey,m.Data.AcceptedHostKey??null);return}this.handleGenericError(c,t,i,u?.message??"Unknown error",a)}})})}testDestinationv1(t,e,i,o,a){return new et(c=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:u=>{c.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),c.complete()},error:u=>{this.handleDestinationErrorv1(u.message,t,i,o,a).subscribe(m=>{c.next(m)})}})})}handleMissingFolder(t,e,i){this.#t.open(re,{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:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#t.open(re,{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:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#t.open(re,{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:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#t.open(re,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
3
+ If this is a self-signed certificate, you can choose to trust this certificate.
4
+ The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,i,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),t.complete()}})}handleIncorrectKey(t,e,i,o,a){a?this.#t.open(re,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
5
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
6
+ Do you want to REPLACE your CURRENT host key ${a}
7
+ with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}}):this.#t.open(re,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}})}handleGenericError(t,e,i,o,a){function c(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i,errorMessage:o}),t.complete()}if(a){c();return}this.#t.open(re,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:u=>c()})}handleDestinationErrorv1(t,e,i,o,a){return new et(c=>{if(t==="missing-folder"){o?this.handleMissingFolder(c,e,i):this.handleGenericError(c,e,i,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let u=t.split("incorrect-cert:")[1];this.handleMissingCertificate(c,e,i,u);return}if(t.startsWith("incorrect-host-key:")){let u=t.split('incorrect-host-key:"')[1].split('",')[0],m=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(c,e,i,u,m);return}this.handleGenericError(c,e,i,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=ye({token:n,factory:n.\u0275fac,providedIn:"root"})};function zo(n,t){if(n&1){let e=D();l(0,"sh-alert",0),p(1," Make sure to test the configuration "),l(2,"button",3),f("click",function(){C(e);let o=s(2);return g(o.testDestination())}),p(3,"Test now"),r()()}}function Jo(n,t){n&1&&(l(0,"sh-alert",0),p(1,"Testing connection..."),r())}function Xo(n,t){n&1&&(l(0,"sh-alert",1),p(1,"Connection tested successfully."),r())}function Wo(n,t){if(n&1&&(l(0,"sh-alert",2),p(1),r()),n&2){let e=s(2);_(),J(" ",e.testErrorMessage()," ")}}function Ho(n,t){if(n&1&&S(0,zo,4,0,"sh-alert",0)(1,Jo,2,0,"sh-alert",0)(2,Xo,2,0,"sh-alert",1)(3,Wo,2,1,"sh-alert",2),n&2){let e=s();E(e.testSignal()===""?0:e.testSignal()==="testing"?1:e.testSignal()==="containsBackup"||e.testSignal()==="success"?2:e.testSignal()==="warning"||e.testSignal()==="error"?3:-1)}}var Mt=class n{#e=P(Ot);targetUrl=qe.required();testSignal=qe.required();testErrorMessage=N(null);isExpectedValidTargetUrl=M(()=>{let t=this.targetUrl();return!(!t||!Et(t))});prevTargetUrl=null;targetUrlEffect=ee(()=>{let t=this.targetUrl();t!==this.prevTargetUrl&&(this.prevTargetUrl=t,this.resetTestState())});setTestState(t,e){this.testSignal.set(t),this.testErrorMessage.set(e??null)}resetTestState(){this.testSignal.set(""),this.testErrorMessage.set(null)}testDestination(){let t=this.targetUrl();t&&(this.setTestState("testing"),this.#e.testDestination(t,null,0,!0,!0).subscribe({next:e=>{if(e.action==="success"&&e.containsBackup===!0?this.setTestState("containsBackup"):e.action==="success"&&this.setTestState("success"),this.setTestState("error",e.errorMessage??$localize`An error occurred while testing the destination.`),e.action==="generic-error")return;let i=t.includes("?");e.action==="trust-cert"&&this.targetUrl.set(t+`${i?"&":"?"}accept-specified-ssl-hash=${e.certData}`),e.action==="approve-host-key"&&this.targetUrl.set(t+`${i?"&":"?"}ssh-fingerprint=${e.reportedHostKey}`),e.testAgain&&this.testDestination()}}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange"},decls:1,vars:1,consts:[[1,"simple","primary"],[1,"simple","success"],[1,"simple","warn"],["shButton","",1,"primary","small",3,"click"]],template:function(e,i){e&1&&S(0,Ho,4,1),e&2&&E(i.isExpectedValidTargetUrl()?0:-1)},dependencies:[ut,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};function jo(n,t){if(n&1){let e=D();l(0,"app-destination-list",10),f("setDestination",function(o){C(e);let a=s();return g(a.setDestination(o))}),r()}n&2&&d("showAsSources",!0)}function qo(n,t){if(n&1){let e=D();l(0,"app-destination-list-item",11)(1,"button",8),f("click",function(){C(e);let o=s();return g(o.removeDestination())}),x(2,3),r()(),l(3,"app-test-url",12),k("targetUrlChange",function(o){C(e);let a=s();return b(a.targetUrlModel,o)||(a.targetUrlModel=o),g(o)})("testSignalChange",function(o){C(e);let a=s();return b(a.testSignal,o)||(a.testSignal=o),g(o)}),r(),l(4,"app-single-destination",13),k("targetUrlChange",function(o){C(e);let a=s();return b(a.targetUrlModel,o)||(a.targetUrlModel=o),g(o)}),r()}if(n&2){let e=s();d("targetUrl",e.targetUrlModel()),_(3),U("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),_(),U("targetUrl",e.targetUrlModel)}}var xt=class n{data=te();closed=$e();targetUrlModel=N(null);dataEffect=ee(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel)});testSignal=N("");setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=St(t??"");if(e){if(e.mapper.default){let i=e.mapper.default("");this.setTargetUrl(i,!0);return}this.setTargetUrl(`${t}://`,!0)}}submit(){this.closed.emit(this.targetUrlModel())}removeDestination(){this.setTargetUrl(null,!0)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:5,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let i;i=$localize` Use remote source `;let o;return o=$localize`Change`,[t,e,i,o,[1,"title-30"],["content",""],[3,"showAsSources"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal"],[3,"targetUrlChange","targetUrl"]]},template:function(e,i){if(e&1){let o=D();l(0,"header")(1,"h3",4),x(2,0),r()(),l(3,"section",5),S(4,jo,1,1,"app-destination-list",6),S(5,qo,5,4),r(),l(6,"footer",7)(7,"button",8),f("click",function(){return C(o),g(i.closed.emit(null))}),x(8,1),r(),l(9,"button",9),f("click",function(){return C(o),g(i.submit())}),x(10,2),r()()}if(e&2){let o=!!i.targetUrlModel();_(4),E(o?-1:4),_(),E(o?5:-1),_(4),Ne("loading",i.testSignal()==="testing"),d("disabled",!o||i.testSignal()===""||i.testSignal()==="testing")}},dependencies:[Pt,It,Je,Z,Mt],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}"],changeDetection:0})};var Yo=["formRef"],vt=()=>({standalone:!0});function Qo(n,t){if(n&1){let e=D();l(0,"sh-form-field",43)(1,"input",44),k("ngModelChange",function(o){C(e);let a=s(2);return b(a.editingPath,o)||(a.editingPath=o),g(o)}),r()(),l(2,"button",29),f("click",function(){C(e);let o=s(2);return g(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",29),f("click",function(){C(e);let o=s(2);return g(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(n&2){let e=s(2);_(),U("ngModel",e.editingPath),d("ngModelOptions",Re(2,vt))}}function Zo(n,t){if(n&1){let e=D();l(0,"sh-form-field",43),A(1,"input",45),r(),l(2,"button",29),f("click",function(){C(e);let o=s().$implicit,a=s();return g(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",29),f("click",function(){C(e);let o=s().$implicit,a=s();return g(a.removePath(o))}),l(6,"sh-icon"),p(7,"trash-simple"),r()()}if(n&2){let e=s().$implicit;Yt("readonly",!0),_(),d("ngModel",e)("ngModelOptions",Re(3,vt))}}function ea(n,t){if(n&1&&(l(0,"div",32),S(1,Qo,8,3)(2,Zo,8,4),r()),n&2){let e=t.$implicit,i=s();_(),E(i.oldPath()===e?1:2)}}function ta(n,t){if(n&1){let e=D();l(0,"app-new-filter",47),f("pathChange",function(o){let a=C(e).$index,c=s(2);return g(c.patchPathAt(o,a))})("remove",function(){let o=C(e).$index,a=s(2);return g(a.removePathAt(o))}),r()}if(n&2){let e=t.$implicit,i=s(2);d("path",e)("osType",i.osType()??"")}}function na(n,t){if(n&1&&fe(0,ta,1,2,"app-new-filter",46,Ee),n&2){let e=s();he(e.pathArray())}}function ia(n,t){if(n&1){let e=D();l(0,"div",33)(1,"app-size",48),f("ngModelChange",function(o){C(e);let a=s();return g(a.updateFilesLargerThan(o))}),r()()}if(n&2){let e=s();_(),d("ngModel",e.filesLargerThan())("ngModelOptions",Re(2,vt))}}var Ie=new dt,An=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Ie.group({path:Ie.control(n.path),excludes:Ie.group({hidden:Ie.control(n.excludes.hidden),system:Ie.control(n.excludes.system),temporary:Ie.control(n.excludes.temporary),filesLargerThan:Ie.group({size:Ie.control(null),unit:Ie.control(null)})})}),Gt=class n{#e=P(De);#t=P(Oe);#n=P(Pe);#i=P(ke);formRef=Ue.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new on("");filesLargerThan=M(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=xe(this.sourceDataForm.controls.path.valueChanges);pathArray=M(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=M(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=N(null);editingPath=N(null);addingNewPath=N(!1);openRemoteDestinationDialog(){this.#t.open(xt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1}).closed.subscribe(e=>{if(!e)return;let o=`@${Math.random().toString(36).substring(2,10)}|${e}`;console.log("targetUrl",o),this.addPath(o)})}editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:i}=ft(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:i})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let i=(this.sourceDataForm.controls.path.value??"").split("\0"),o=i.indexOf(t);if(o===-1)return;i.splice(o,1);let a=i.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}addFilter(t="-*"){let i=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i)}patchPathAt(t,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(u=>!u.startsWith("-")&&!u.startsWith("+")).join("\0"),a=this.pathArray().map((u,m)=>m===e?`${t}`:`${u}`).join("\0"),c=[o,a].filter(u=>u&&u!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().filter((c,u)=>u!==t).join("\0"),a=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,i=t?.split("\0")||[];e&&!i.includes(e)&&i.push(e);let o=i.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.isNew()||this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&be(i.formRef,Yo,5),e&2&&Ve()},decls:59,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let i;i=$localize`Hidden files`;let o;o=$localize`System files`;let a;a=$localize`Temporary files`;let c;c=$localize`Source Data`;let u;u=$localize`Folder path`;let m;m=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let $;$=$localize` Paths ${"\uFFFD#20\uFFFD"}:START_TAG_DIV:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_DIV:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path ${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_BUTTON:`;let B;B=$localize`Add a path directly from your machine.`;let q;q=$localize`Filters`;let L;L=$localize`Customize your filters.`;let F;F=$localize`Add filter`;let G;G=$localize`Exclude`;let v;v=$localize`Choose if there’s any files you want to exclude.`;let O;O=$localize` Files with the Hidden attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let z;z=$localize` Files with the System attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#55\uFFFD\uFFFD/#55\uFFFD"}:TAG_INPUT:`;let pe;pe=$localize` Files larger than `;let w;return w=$localize`Edit path`,[["formRef",""],c,u,m,h,$,B,q,L,F,G,v,O,z,ue,pe,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",i,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",a,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",w,3,"ngModelChange","ngModel","ngModelOptions"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,i){if(e&1){let o=D();l(0,"form",16,0),f("submit",function(){return C(o),g(i.next())}),l(2,"div",17)(3,"h3",18),x(4,1),r(),l(5,"app-file-tree",19)(6,"label",20),x(7,2),r(),A(8,"input",21),r(),l(9,"div",22)(10,"button",23),f("click",function(){return C(o),g(i.goBack())}),I(11,3),A(12,"sh-icon"),y(),r(),l(13,"button",24),I(14,4),A(15,"sh-icon"),y(),r()()(),l(16,"div",25)(17,"app-toggle-card",26),se(18,27),I(19,5),A(20,"div",28),l(21,"button",29),f("click",function(){return C(o),g(i.openRemoteDestinationDialog())}),A(22,"sh-icon"),r(),y(),ie(),l(23,"p",30),x(24,6),r(),l(25,"div",31),fe(26,ea,3,1,"div",32,Ee),l(28,"div",33)(29,"sh-form-field"),A(30,"input",34),r(),l(31,"button",35),f("click",function(){return C(o),g(i.addNewPath())}),l(32,"sh-icon"),p(33,"plus"),r()()()()(),l(34,"app-toggle-card",26),se(35,27),x(36,7),ie(),l(37,"p",30),x(38,8),r(),l(39,"button",36),f("click",function(){return C(o),g(i.addFilter())}),x(40,9),r(),S(41,na,2,0),r(),l(42,"app-toggle-card",37),se(43,27),x(44,10),ie(),l(45,"p",30),x(46,11),r(),l(47,"sh-toggle",38),I(48,12),A(49,"input",39),y(),r(),l(50,"sh-toggle",38),I(51,13),A(52,"input",40),y(),r(),l(53,"sh-toggle",38),I(54,14),A(55,"input",41),y(),r(),l(56,"sh-toggle",42),f("click",function(){return C(o),g(i.toggleFilesLargerThan())}),x(57,15),r(),S(58,ia,2,3,"div",33),r()()()}if(e&2){let o;d("formGroup",i.sourceDataForm),_(5),d("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),_(12),d("disallowToggle",!0),_(9),he(i.nonFilterPaths()),_(4),d("formControl",i.newPathCtrl),_(4),d("disallowToggle",!0),_(7),E((o=i.pathSignal())!=null&&o.length?41:-1),_(),d("disallowToggle",!0),_(14),Ne("active",i.filesLargerThan()),_(2),E(i.filesLargerThan()?58:-1)}},dependencies:[ge,rt,oe,ot,ae,lt,Ce,Be,an,ct,_t,ln,Te,le,Z,Ke,At,Nt,Nn,ht],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.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}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var In="1W:1D,4W:1W,12M:1M",De=class n{#e=P(Pe);#t=P(Fe);#n=P(Oe);#i=P(gt);#s=P(Tt);#l=P(Ft);generalForm=yn();sourceDataForm=An();scheduleFields=$t();scheduleType=N("daily");settings=N([]);optionsFields={remoteVolumeSize:N("50MB"),backupRetention:N("all"),backupRetentionTime:N(""),backupRetentionVersions:N(0),backupRetentionCustom:N("")};targetUrlModel=N(null);backupMetadata=N(null);isDraft=N(!1);backupId=N(null);backupName=M(()=>this.generalFormSignal()?.name??"");isSubmitting=N(!1);finishedLoading=N(!1);backupDefaults=N(null);applicationOptions=N(null);isNew=M(()=>this.backupId()==="new");osType=M(()=>this.#t.systemInfo()?.OSType);selectedOptions=N([]);sourceDataFormSignal=xe(this.sourceDataForm.valueChanges);generalFormSignal=xe(this.generalForm.valueChanges);encryptionFieldSignal=xe(this.generalForm.controls.encryption.valueChanges);advancedOptions=M(()=>this.#t.systemInfo()?.Options?.map(this.#d)??[]);#o=N("");#a=N(null);#r=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#a.asReadonly();#_=ee(()=>{let t=this.targetUrlModel(),e=this.#o(),i=this.#r;this.#r=t,!(e==="testing"||i===null||i===t)&&(this.#o.set(""),this.#a.set(null))});setTestState(t,e){this.#o.set(t),this.#a.set(e??null)}#d(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=M(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[Ze,...t]});nonSelectedOptions=M(()=>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);let e=this.#u(),i=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),i==="new"||!i||this.isDraft()?this.#i.postApiV1Backups({requestBody:e}).pipe(ve(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#i.putApiV1BackupById({id:i,requestBody:e}).pipe(ve(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#c(),this.#e.navigate(["/"]);return}this.#n.open(re,{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??"",i=t.Filters?.map(u=>`${u.Include?"":"-"}${u.Expression}`)??[],o=t.Settings?.find(u=>u.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(u=>u.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...i].join("\0"),excludes:{hidden:o.includes("hidden"),system:o.includes("system"),temporary:o.includes("temporary"),filesLargerThan:a===null?void 0:ft(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",i=t.Description??"",o=t.Settings?.find(h=>h.Name==="encryption-module"),a=t.Settings?.find(h=>h.Name==="passphrase")?.Value??"",c=o?.Value&&o.Value.length?o.Value:"",u=t.Settings?.find(h=>h.Name==="compression-module")?.Value??"",m={name:t.Name??"",description:t.Description??""};e&&e!==""&&(m.name=e),i&&i!==""&&(m.description=i),c&&c!==""&&(m.encryption=c),a&&a!==""&&(m.password=a,m.repeatPassword=a),u&&u!==""&&(m.compression=u),this.generalForm.patchValue(m)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#l.fromString(t.Repeat)??null,i=this.#p(t.Time);this.scheduleFields.autoRun.set(!0),i.date&&this.scheduleFields.nextTime.date.set(i.date),this.scheduleFields.nextTime.time.set(i.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=Qe(this.scheduleFields),a=Dt.find(c=>JSON.stringify(c.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#s.serverSettings()??{};Object.keys(m).filter(h=>h.startsWith("--")).forEach(h=>{o.find(B=>B.Name===h)||o.push({Name:h,Value:m[h],Filter:null})})}let a=o.filter(m=>!i.includes(m.Name)),c=o.filter(m=>i.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 u="all";c?.forEach(m=>{if(m.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(m.Value??"50MB"),m.Name==="keep-time"&&(m.Value??"")!=="")return u="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return u="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===In)u="smart";else return u="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(u)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=Qe(this.scheduleFields);return Dn(t)}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,o=this.targetUrlModel(),a=i.path?.split("\0")??[],c=this.mapFormsToSettings(),u=Object.entries(i.excludes??{}).filter(([h,$])=>$&&h!=="filesLargerThan").map(([h])=>h),m=i.excludes?.filesLargerThan;return u.length&&c.push({Name:"--exclude-files-attributes",Value:u.join(",")}),m&&m.size!==null&&m.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${m.size}${m.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:o??null,Sources:a.filter(h=>!(h.startsWith("-")||h.startsWith("+"))),Settings:c,Filters:a.filter(h=>h.startsWith("-")||h.startsWith("+")).map((h,$)=>({Order:$,Include:h.startsWith("+"),Expression:h.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==Ze.Key&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let a=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(a=[]);let c=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];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:In});break}let u=[...t,...i],m=this.settings().filter(h=>!u.includes(h.Name)).map(h=>{let $=h.Value;return typeof h.Value=="number"&&($=h.Value.toString()),typeof h.Value=="boolean"&&($=h.Value?"True":"False"),{Name:h.Name?.startsWith("--")?h.Name:`--${h.Name}`,Value:$}});return[...o,...a,...c,...m]}#p(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.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#r=null),this.targetUrlModel.set(t)}#c(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=$t(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=ye({token:n,factory:n.\u0275fac,providedIn:"root"})};var oa=["formRef"];function aa(n,t){n&1&&(l(0,"sh-alert",17),I(1,5),A(2,"sh-icon",26),y(),r())}function la(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;J(" ",e.DisplayName," ")}}function ra(n,t){if(n&1&&A(0,"sh-progress-bar",40),n&2){let e=s(3);Ne("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),d("value",e.calculatePasswordStrength()*(100/5))}}function sa(n,t){n&1&&(l(0,"span",35),x(1,10),r())}function _a(n,t){n&1&&(I(0,8,1),A(1,"sh-icon"),y())}function ca(n,t){n&1&&(I(0,8,2),A(1,"sh-icon"),y())}function da(n,t){n&1&&(I(0,11,1),A(1,"sh-icon",42),y())}function ua(n,t){n&1&&(I(0,11,2),A(1,"sh-icon"),y())}function pa(n,t){if(n&1){let e=D();l(0,"button",41),f("click",function(){C(e);let o=s(3);return g(o.copyPassword())}),I(1,11),S(2,da,2,0)(3,ua,2,0),y(),r()}if(n&2){let e=s(3);_(2),E(e.copiedPassword()?2:3)}}function ma(n,t){n&1&&(l(0,"sh-alert",39),x(1,12),r())}function Ca(n,t){if(n&1){let e=D();l(0,"div",30)(1,"sh-form-field")(2,"label",31),I(3,7),A(4,"sup"),y(),r(),A(5,"input",32),r(),S(6,ra,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),A(8,"input",34),S(9,sa,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),f("click",function(){C(e);let o=s(2);return g(o.showPassword.set(!o.showPassword()))}),I(12,8),S(13,_a,2,0)(14,ca,2,0),y(),r(),l(15,"button",37),f("click",function(){C(e);let o=s(2);return g(o.generatePassword())}),I(16,9),A(17,"sh-icon"),y(),r(),S(18,pa,4,1,"button",38),r(),S(19,ma,2,0,"sh-alert",39),r()}if(n&2){let e=s(2);_(5),d("type",e.showPassword()?"text":"password"),_(),E(e.generalForm.value.password?6:-1),_(2),d("type",e.showPassword()?"text":"password"),_(),E(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),E(e.showPassword()?13:14),_(5),E(e.showCopyPassword()?18:-1),_(),E(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function ga(n,t){if(n&1&&(l(0,"sh-select",27)(1,"label",28),x(2,6),r(),A(3,"input",29),K(4,la,1,1,"ng-template"),r(),S(5,Ca,20,7,"div",30)),n&2){let e=s();d("options",e.encryptionOptions())("isClearable",!1),_(5),E(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Ta(n,t){if(n&1&&(l(0,"button",24),I(1,13),A(2,"sh-icon"),y(),r()),n&2){let e=s();d("disabled",e.nameAndDescriptionValid()===!1)}}function Sa(n,t){if(n&1&&(l(0,"button",25),I(1,14),A(2,"sh-icon"),y(),r()),n&2){let e=s();d("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ge=new dt,yn=(n={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>Ge.group({name:Ge.control(n.name,[at.required]),description:Ge.control(n.description),encryption:Ge.control(n.encryption,[hn()]),password:Ge.control(n.password,[Rt(t=>t?.value.encryption!=="",[at.required])]),repeatPassword:Ge.control(n.repeatPassword,[Rt(t=>t?.value.encryption!=="",[at.required])]),compression:Ge.control(n.compression)}),Ze={Key:"-",DisplayName:"None"},bt=class n{#e=P(Pe);#t=P(ke);#n=P(fn);#i=P(De);#s=P(Fe);formRef=Ue.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=N(!1);copiedPassword=N(!1);showCopyPassword=N(!1);noneOptionKey=Ze.Key;encryptionEffect=ee(()=>{this.encryptionFieldSignal()===Ze.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=M(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=M(()=>{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.#l(t??""),this.copiedPassword.set(!0)}async#l(t){try{await navigator.clipboard.writeText(t)}catch{try{let i=document.createElement("textarea");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#n.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.isNew()||this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&be(i.formRef,oa,5),e&2&&Ve()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$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 c;c=$localize`Backup description`;let u;u=$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 h;h=$localize`Encryption`;let $;$=$localize`Encryption`;let B;B=$localize`Password`;let q;q=$localize`Repeat password`;let L;L=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let F;F=$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:`,F=We(F);let G;G=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let v;v=$localize`Passwords do not match`;let O;O=$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:`,O=We(O);let z;z=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let pe;return pe=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,c,u,m,$,L,F,G,v,O,z,ue,pe,["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",i,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",h,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",B,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",q,"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,i){if(e&1){let o=D();l(0,"form",15,0),f("submit",function(){return C(o),g(i.next())}),l(2,"h3",16),x(3,1),r(),S(4,aa,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),I(7,2),A(8,"sup"),y(),r(),A(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),x(12,3),r(),A(13,"textarea",21),r(),S(14,ga,6,3),l(15,"div",22)(16,"button",23),f("click",function(){return C(o),g(i.exit())}),I(17,4),A(18,"sh-icon"),y(),r(),S(19,Ta,3,1,"button",24)(20,Sa,3,1,"button",25),r()()}if(e&2){let o;d("formGroup",i.generalForm),_(4),E(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),_(10),E(i.isNew()?14:-1),_(5),E(i.encryptionFieldSignal()===i.noneOptionKey||!i.isNew()?19:20)}},dependencies:[Be,rt,oe,ae,lt,ct,_t,Te,Me,Z,le,pt,ut,Ct],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{yn as a,Ze as b,bt as c,Dt as d,Dn as e,$t as f,Lt as g,Je as h,Xe as i,It as j,Pt as k,Ot as l,An as m,Gt as n,De as o};
@@ -1 +1 @@
1
- import{a as _}from"./chunk-UE5VHUV6.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import{ia as l}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Cb as n,Cc as g,Db as i,Dc as d,Pa as a,Rb as p,W as s,cb as S,jc as c,kc as m}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,E){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,E.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
1
+ import{a as _}from"./chunk-PT5SA5DK.js";import"./chunk-TNJ2RJ2V.js";import"./chunk-DIJYLB6O.js";import"./chunk-P42HQ2IS.js";import"./chunk-KANLHRTR.js";import"./chunk-V4SUZRAG.js";import"./chunk-4SMU6FWN.js";import"./chunk-VRXOIVWD.js";import"./chunk-L4B2T7UE.js";import"./chunk-XURQUV7B.js";import{ia as l}from"./chunk-WC6RBAAY.js";import"./chunk-XUDS7MYD.js";import{Cb as n,Cc as g,Db as i,Dc as d,Pa as a,Rb as p,W as s,cb as S,jc as c,kc as m}from"./chunk-YP4LWQJG.js";import"./chunk-7CGTOI24.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,E){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,E.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
@@ -0,0 +1 @@
1
+ import{a,b,c}from"./chunk-6XFXDO6Y.js";import"./chunk-E24DEHPH.js";import"./chunk-2JMS6ROE.js";import"./chunk-6GTXSMAH.js";import"./chunk-ONYKQCZU.js";import"./chunk-6Q6SSTBK.js";import"./chunk-ONXV5IRS.js";import"./chunk-X52R5Q6W.js";import"./chunk-D45OX6NR.js";import"./chunk-PT5SA5DK.js";import"./chunk-TNJ2RJ2V.js";import"./chunk-DIJYLB6O.js";import"./chunk-P42HQ2IS.js";import"./chunk-KANLHRTR.js";import"./chunk-V4SUZRAG.js";import"./chunk-4SMU6FWN.js";import"./chunk-VRXOIVWD.js";import"./chunk-L4B2T7UE.js";import"./chunk-XURQUV7B.js";import"./chunk-WC6RBAAY.js";import"./chunk-XUDS7MYD.js";import"./chunk-YP4LWQJG.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-KDJCL6HE.js";import"./chunk-WUL6NS6B.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import"./chunk-LP4W35DJ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-KETMZS6P.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-G4VDCGMW.js";import"./chunk-UE5VHUV6.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{B as D,C as N,u as E}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{e as m}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as n,Bb as o,Pa as c,Pb as r,Qb as l,Rb as i,cb as T,xc as d,yb as s,zb as e}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
1
+ import{a as M}from"./chunk-SFDEJ4KT.js";import"./chunk-VIHMVAQG.js";import"./chunk-44IYHRP5.js";import"./chunk-OMCDVUR6.js";import"./chunk-4FWSDHOG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MRTE3AG7.js";import"./chunk-ONXV5IRS.js";import"./chunk-X52R5Q6W.js";import"./chunk-D45OX6NR.js";import"./chunk-FUQM5D63.js";import"./chunk-PT5SA5DK.js";import"./chunk-TNJ2RJ2V.js";import"./chunk-DIJYLB6O.js";import"./chunk-P42HQ2IS.js";import"./chunk-KANLHRTR.js";import{B as D,C as N,u as E}from"./chunk-V4SUZRAG.js";import"./chunk-4SMU6FWN.js";import{e as m}from"./chunk-VRXOIVWD.js";import"./chunk-L4B2T7UE.js";import"./chunk-XURQUV7B.js";import"./chunk-WC6RBAAY.js";import"./chunk-XUDS7MYD.js";import{Ab as n,Bb as o,Pa as c,Pb as r,Qb as l,Rb as i,cb as T,xc as d,yb as s,zb as e}from"./chunk-YP4LWQJG.js";import"./chunk-7CGTOI24.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
@@ -1 +1 @@
1
- import{B as v}from"./chunk-HPNLQHW6.js";import{$ as u,Ab as o,Ib as C,Mc as D,Pa as n,Qc as T,Rc as h,Vb as g,Xb as l,aa as _,cb as x,jc as r,kc as m,sb as s,tb as d,zb as i}from"./chunk-T2WO6CVD.js";import{a as f}from"./chunk-7CGTOI24.js";function y(e,a){if(e&1&&(i(0,"p"),r(1),o()),e&2){let t=l();n(),m(t._data().message)}}function S(e,a){if(e&1){let t=C();i(0,"button",5),g("click",function(){u(t);let p=l();return _(p.close("cancel"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().cancelText)}}function k(e,a){if(e&1){let t=C();i(0,"button",6),g("click",function(){u(t);let p=l();return _(p.close("confirm"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},b=class e{data=h();_data=D(()=>f(f({},w),this.data()));closed=T();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=x({type:e,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(t,c){t&1&&(i(0,"header",0)(1,"h3"),r(2),o()(),i(3,"div",1),s(4,y,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),t&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[v],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{b as a};
1
+ import{B as v}from"./chunk-V4SUZRAG.js";import{$ as u,Ab as o,Ib as C,Mc as D,Pa as n,Qc as T,Rc as h,Vb as g,Xb as l,aa as _,cb as x,jc as r,kc as m,sb as s,tb as d,zb as i}from"./chunk-YP4LWQJG.js";import{a as f}from"./chunk-7CGTOI24.js";function y(e,a){if(e&1&&(i(0,"p"),r(1),o()),e&2){let t=l();n(),m(t._data().message)}}function S(e,a){if(e&1){let t=C();i(0,"button",5),g("click",function(){u(t);let p=l();return _(p.close("cancel"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().cancelText)}}function k(e,a){if(e&1){let t=C();i(0,"button",6),g("click",function(){u(t);let p=l();return _(p.close("confirm"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},b=class e{data=h();_data=D(()=>f(f({},w),this.data()));closed=T();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=x({type:e,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(t,c){t&1&&(i(0,"header",0)(1,"h3"),r(2),o()(),i(3,"div",1),s(4,y,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),t&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[v],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{b as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-MRTE3AG7.js";import"./chunk-WC6RBAAY.js";import"./chunk-XUDS7MYD.js";import"./chunk-YP4LWQJG.js";import"./chunk-7CGTOI24.js";export{a as BytesPipe};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-TELPJYLN.js";import{c as j,e as q}from"./chunk-DAODMGAD.js";import{z as b}from"./chunk-HPNLQHW6.js";import{a as x,c as v}from"./chunk-BGTK25UG.js";import{ka as L}from"./chunk-OTPG7USH.js";import{Cb as N,Cc as W,Db as C,Eb as _,Ec as $,L as O,Mc as p,Pa as M,Pb as A,Qb as w,R as h,Rb as P,Sb as F,Tb as G,W as c,cb as I,f as m,g as y,la as n,na as R}from"./chunk-T2WO6CVD.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=R(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),P(2,0),C()(),N(3,"div",3)(4,"p"),A(5,1),_(6,"strong"),W(7,"number"),w(),C()()),t&2&&(M(7),F($(7,1,s.countdown(),"2.0-0")),G(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var T=class r{dialog=c(b);#e=c(v);#i=n("disconnected");#s=n(null);#t=n(-1);#r=n(0);#l=n(!1);#u=new y;connectionStatus=this.#i.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=c(j).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new y,this.#c()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#c(){this.#i.set("connecting"),this.#e.getApiV1Serverstate({lastEventId:this.#t(),longpoll:this.#t()>=0,duration:this.duration}).pipe(O(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,l=Math.min(5e3*s,3e4);this.#r.set(s),s>3&&this.#i.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(l),setTimeout(()=>{this.#c()},l)}})}#a(e){this.#i.set("connected"),this.#s.set(e),this.#t.set(e.LastEventID??-1),this.#r.set(0)}#n(){this.#l()&&this.#c()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var u=!1,k=class r{#e=c(q);#i=c(D);dialog=c(b);#s=null;#t=n("disconnected");#r=n(null);#l=n(null);#u=n(null);#o=n(null);#c=n(null);#a=void 0;#n=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#t.asReadonly();serverState=this.#r.asReadonly();serverProgress=this.#l.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#n.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#c.asReadonly();#h=null;taskCompleted=new m(e=>{this.#h=e});#d=0;start(){this.#p(),this.shouldConnect.set(!0)}#p(){let e=this.#e.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let l=window.location.hostname,g=x.BASE||"",f=this.#e.xsrfQueryParam(),Q=this.#i.hasWebSocketAuth()?`${t}//${l}${s}${g}/notifications${f?`?${f}`:""}`:`${t}//${l}${s}${g}/notifications?token=${e}${f?`&${f}`:""}`;this.#t.set("connecting"),this.#s=new WebSocket(Q),this.#s.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#t.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e,Action:"auth"}))):this.#S()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let o=JSON.parse(d.data);if(o.Success){u&&console.log("WebSocket authentication successful"),this.#S();return}else if(o?.Type==="legacystatus")u&&console.log("WebSocket authentication successful"),this.#S();else{console.error("WebSocket authentication failed:",o.Message),this.#t.set("disconnected");return}}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#t.set("disconnected");return}try{let o=JSON.parse(d.data),a=o?.Type;if(a==="legacystatus"||a==null)u&&console.log("Received legacy status update:",o),this.#r.set(o);else if(a==="reply"){let i=o;i.Success||console.error("WebSocket reply error:",i.Message)}else if(a==="progress"){let i=o;u&&console.log("Received progress update:",i.Data),this.#l.set(i.Data)}else if(a==="serversettings"){let i=o;u&&console.log("Received server settings update:",i.Data),this.#u.set(i.Data)}else if(a==="taskqueue"){let i=o;u&&console.log("Received task update:",i.Data),this.#o.set(i.Data)}else if(a==="taskcompleted"){let i=o;u&&console.log("Received task completed:",i.Data),this.#h?.next(i.Data)}else if(a==="backuplist"){let i=o;u&&console.log("Received backup list update:",i.Data),this.#c.set(i.Data)}else console.warn("Unknown WebSocket message type:",a)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#s.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#t.set("disconnected");var o=d.code===4401;o&&this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:a=>{console.error("Error refreshing token",a)}}),this.shouldConnect()&&(this.#a||(this.#a=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#a.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#p(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#t.set("disconnected")}}#S(){this.#t.set("connected");let e=this.#n();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#a&&this.#a.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#n(),l=s[e];(!l||JSON.stringify(l)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#n.set(s),this.#t()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#n();t[e]&&(delete t[e],this.#n.set(t),this.#t()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var V=10,J=class r{#e=c(k);#i=c(T);#s=c(v);#t=c(D);#r=n("longpoll");#l=n(!1);#u=p(()=>this.#t.hasTaskCompletedOption()&&this.#r()==="websocket");#o={};#c=null;#a=!1;#n=[];constructor(){this.#e.subscribe("taskcompleted"),this.#e.taskCompleted.subscribe(e=>{if(this.#n.unshift(e),this.#n.length>V&&this.#n.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#r()==="websocket"?this.#e.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#r()==="websocket"?this.#e.serverState():this.#i.serverState());progressState=this.#e.serverProgress;taskQueueState=this.#e.serverTaskQueue;activeTaskQueueState=p(()=>this.#r()==="websocket"?this.#e.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#e.backupListState());setConnectionMethod(e){e==="websocket"?(this.#e.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#e.stop()),this.#r.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#r()}subscribe(e,t=null){this.#e.subscribe(e,t)}unsubscribe(e){this.#e.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#n.find(l=>l.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#h()})}#h(){this.#a||this.#u()||(this.#a=!0,this.#d())}#d(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#n.unshift(s),this.#n.length>V&&this.#n.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#c=window.setTimeout(()=>{this.#d()},1e3)},error:s=>{this.#c=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null),this.#a=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{k as a,J as b};
1
+ import{a as D}from"./chunk-P42HQ2IS.js";import{c as j,e as q}from"./chunk-KANLHRTR.js";import{z as b}from"./chunk-V4SUZRAG.js";import{a as x,c as v}from"./chunk-4SMU6FWN.js";import{ka as L}from"./chunk-WC6RBAAY.js";import{Cb as N,Cc as W,Db as C,Eb as _,Ec as $,L as O,Mc as p,Pa as M,Pb as A,Qb as w,R as h,Rb as P,Sb as F,Tb as G,W as c,cb as I,f as m,g as y,la as n,na as R}from"./chunk-YP4LWQJG.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=R(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),P(2,0),C()(),N(3,"div",3)(4,"p"),A(5,1),_(6,"strong"),W(7,"number"),w(),C()()),t&2&&(M(7),F($(7,1,s.countdown(),"2.0-0")),G(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var T=class r{dialog=c(b);#e=c(v);#i=n("disconnected");#s=n(null);#t=n(-1);#r=n(0);#l=n(!1);#u=new y;connectionStatus=this.#i.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=c(j).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new y,this.#c()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#c(){this.#i.set("connecting"),this.#e.getApiV1Serverstate({lastEventId:this.#t(),longpoll:this.#t()>=0,duration:this.duration}).pipe(O(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,l=Math.min(5e3*s,3e4);this.#r.set(s),s>3&&this.#i.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(l),setTimeout(()=>{this.#c()},l)}})}#a(e){this.#i.set("connected"),this.#s.set(e),this.#t.set(e.LastEventID??-1),this.#r.set(0)}#n(){this.#l()&&this.#c()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var u=!1,k=class r{#e=c(q);#i=c(D);dialog=c(b);#s=null;#t=n("disconnected");#r=n(null);#l=n(null);#u=n(null);#o=n(null);#c=n(null);#a=void 0;#n=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#t.asReadonly();serverState=this.#r.asReadonly();serverProgress=this.#l.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#n.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#c.asReadonly();#h=null;taskCompleted=new m(e=>{this.#h=e});#d=0;start(){this.#p(),this.shouldConnect.set(!0)}#p(){let e=this.#e.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let l=window.location.hostname,g=x.BASE||"",f=this.#e.xsrfQueryParam(),Q=this.#i.hasWebSocketAuth()?`${t}//${l}${s}${g}/notifications${f?`?${f}`:""}`:`${t}//${l}${s}${g}/notifications?token=${e}${f?`&${f}`:""}`;this.#t.set("connecting"),this.#s=new WebSocket(Q),this.#s.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#t.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e,Action:"auth"}))):this.#S()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let o=JSON.parse(d.data);if(o.Success){u&&console.log("WebSocket authentication successful"),this.#S();return}else if(o?.Type==="legacystatus")u&&console.log("WebSocket authentication successful"),this.#S();else{console.error("WebSocket authentication failed:",o.Message),this.#t.set("disconnected");return}}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#t.set("disconnected");return}try{let o=JSON.parse(d.data),a=o?.Type;if(a==="legacystatus"||a==null)u&&console.log("Received legacy status update:",o),this.#r.set(o);else if(a==="reply"){let i=o;i.Success||console.error("WebSocket reply error:",i.Message)}else if(a==="progress"){let i=o;u&&console.log("Received progress update:",i.Data),this.#l.set(i.Data)}else if(a==="serversettings"){let i=o;u&&console.log("Received server settings update:",i.Data),this.#u.set(i.Data)}else if(a==="taskqueue"){let i=o;u&&console.log("Received task update:",i.Data),this.#o.set(i.Data)}else if(a==="taskcompleted"){let i=o;u&&console.log("Received task completed:",i.Data),this.#h?.next(i.Data)}else if(a==="backuplist"){let i=o;u&&console.log("Received backup list update:",i.Data),this.#c.set(i.Data)}else console.warn("Unknown WebSocket message type:",a)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#s.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#t.set("disconnected");var o=d.code===4401;o&&this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:a=>{console.error("Error refreshing token",a)}}),this.shouldConnect()&&(this.#a||(this.#a=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#a.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#p(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#t.set("disconnected")}}#S(){this.#t.set("connected");let e=this.#n();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#a&&this.#a.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#n(),l=s[e];(!l||JSON.stringify(l)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#n.set(s),this.#t()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#n();t[e]&&(delete t[e],this.#n.set(t),this.#t()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var V=10,J=class r{#e=c(k);#i=c(T);#s=c(v);#t=c(D);#r=n("longpoll");#l=n(!1);#u=p(()=>this.#t.hasTaskCompletedOption()&&this.#r()==="websocket");#o={};#c=null;#a=!1;#n=[];constructor(){this.#e.subscribe("taskcompleted"),this.#e.taskCompleted.subscribe(e=>{if(this.#n.unshift(e),this.#n.length>V&&this.#n.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#r()==="websocket"?this.#e.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#r()==="websocket"?this.#e.serverState():this.#i.serverState());progressState=this.#e.serverProgress;taskQueueState=this.#e.serverTaskQueue;activeTaskQueueState=p(()=>this.#r()==="websocket"?this.#e.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#e.backupListState());setConnectionMethod(e){e==="websocket"?(this.#e.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#e.stop()),this.#r.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#r()}subscribe(e,t=null){this.#e.subscribe(e,t)}unsubscribe(e){this.#e.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#n.find(l=>l.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#h()})}#h(){this.#a||this.#u()||(this.#a=!0,this.#d())}#d(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#n.unshift(s),this.#n.length>V&&this.#n.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#c=window.setTimeout(()=>{this.#d()},1e3)},error:s=>{this.#c=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null),this.#a=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{k as a,J as b};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-KETMZS6P.js";import{a as H}from"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import{a as q}from"./chunk-UE5VHUV6.js";import"./chunk-DW332N2S.js";import"./chunk-NNCQNVQC.js";import"./chunk-TELPJYLN.js";import"./chunk-DAODMGAD.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,u as V,w as J}from"./chunk-HPNLQHW6.js";import"./chunk-BGTK25UG.js";import{d as A,e as I}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as m,Ab as l,Bb as T,Bc as $,Ib as f,Mc as O,Pa as a,Pb as S,Qb as P,Rb as p,Rc as v,Ub as D,Vb as h,W as E,Xb as s,aa as F,cb as b,ic as x,jc as d,la as N,na as M,oc as w,pc as L,qc as k,sb as c,tb as _,yb as y,zb as r}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(Q);#n=E(q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
1
+ import{a as Q}from"./chunk-ONXV5IRS.js";import{a as H}from"./chunk-X52R5Q6W.js";import"./chunk-D45OX6NR.js";import{a as q}from"./chunk-PT5SA5DK.js";import"./chunk-TNJ2RJ2V.js";import"./chunk-DIJYLB6O.js";import"./chunk-P42HQ2IS.js";import"./chunk-KANLHRTR.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,u as V,w as J}from"./chunk-V4SUZRAG.js";import"./chunk-4SMU6FWN.js";import{d as A,e as I}from"./chunk-VRXOIVWD.js";import"./chunk-L4B2T7UE.js";import"./chunk-XURQUV7B.js";import"./chunk-WC6RBAAY.js";import"./chunk-XUDS7MYD.js";import{$ as m,Ab as l,Bb as T,Bc as $,Ib as f,Mc as O,Pa as a,Pb as S,Qb as P,Rb as p,Rc as v,Ub as D,Vb as h,W as E,Xb as s,aa as F,cb as b,ic as x,jc as d,la as N,na as M,oc as w,pc as L,qc as k,sb as c,tb as _,yb as y,zb as r}from"./chunk-YP4LWQJG.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(Q);#n=E(q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
@@ -1 +1 @@
1
- import{u as _}from"./chunk-HPNLQHW6.js";import{Ab as n,Pa as r,Rc as C,Uc as u,Vb as m,Yb as f,Zb as a,cb as g,gc as h,jc as s,sb as d,tb as p,zb as o}from"./chunk-T2WO6CVD.js";var v=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],M=["[title]","[description]","[action]","*"];function P(e,c){e&1&&s(0,"Title")}function T(e,c){e&1&&(o(0,"sh-icon"),s(1,"caret-down"),n())}var l=class e{isActive=u(!1);disallowToggle=C(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=g({type:e,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&h("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:M,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(t,i){t&1&&(f(v),o(0,"header")(1,"div",0)(2,"h3",1),m("click",function(){return i.disallowToggle()||i.toggle()}),a(3,0,null,P,1,0),d(5,T,2,0,"sh-icon"),n(),a(6,1),n(),o(7,"div",2),a(8,2),n()(),o(9,"div",3),a(10,3),n()),t&2&&(r(5),p(i.disallowToggle()?-1:5))},dependencies:[_],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})};export{l as a};
1
+ import{u as _}from"./chunk-V4SUZRAG.js";import{Ab as n,Pa as r,Rc as C,Uc as u,Vb as m,Yb as f,Zb as a,cb as g,gc as h,jc as s,sb as d,tb as p,zb as o}from"./chunk-YP4LWQJG.js";var v=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],M=["[title]","[description]","[action]","*"];function P(e,c){e&1&&s(0,"Title")}function T(e,c){e&1&&(o(0,"sh-icon"),s(1,"caret-down"),n())}var l=class e{isActive=u(!1);disallowToggle=C(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=g({type:e,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&h("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:M,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(t,i){t&1&&(f(v),o(0,"header")(1,"div",0)(2,"h3",1),m("click",function(){return i.disallowToggle()||i.toggle()}),a(3,0,null,P,1,0),d(5,T,2,0,"sh-icon"),n(),a(6,1),n(),o(7,"div",2),a(8,2),n()(),o(9,"div",3),a(10,3),n()),t&2&&(r(5),p(i.disallowToggle()?-1:5))},dependencies:[_],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})};export{l as a};