@duplicati/ngclient 0.0.185 → 0.0.186

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 (48) hide show
  1. package/chunk-2BESFS3R.js +1 -0
  2. package/{chunk-HO5WBGKU.js → chunk-2W6XI6OD.js} +1 -1
  3. package/{chunk-DUIZM4ZO.js → chunk-3BVUZQ2W.js} +1 -1
  4. package/{chunk-XUPDFNDB.js → chunk-3JZOPD3P.js} +1 -1
  5. package/chunk-3UO7V7AP.js +1 -0
  6. package/{chunk-BBRK364M.js → chunk-6DL4QE2S.js} +1 -1
  7. package/{chunk-42L3D2F7.js → chunk-7JLJCYEF.js} +1 -1
  8. package/{chunk-5LYRKTAV.js → chunk-7OTMSVOF.js} +1 -1
  9. package/{chunk-V42KLXW4.js → chunk-A24PQP5X.js} +1 -1
  10. package/{chunk-QIUMBQM5.js → chunk-A7L3WODV.js} +1 -1
  11. package/{chunk-JRJXFRW7.js → chunk-BBN4XWKF.js} +1 -1
  12. package/{chunk-EXFIQK72.js → chunk-BVZQOBR2.js} +1 -1
  13. package/{chunk-MNHB4VKJ.js → chunk-C7FYZIR5.js} +1 -1
  14. package/{chunk-WA53HHVH.js → chunk-CHEYOD6Q.js} +1 -1
  15. package/{chunk-RD5JFFHQ.js → chunk-CIHKNRON.js} +1 -1
  16. package/{chunk-QKYDZL4G.js → chunk-CTQZOZYH.js} +1 -1
  17. package/{chunk-JNMQJO3U.js → chunk-DIXZE5G2.js} +1 -1
  18. package/{chunk-H5XAYRQ6.js → chunk-ECH7KK6F.js} +1 -1
  19. package/{chunk-67Q6QMQY.js → chunk-EUZ4VJML.js} +1 -1
  20. package/{chunk-HRCZ5SXI.js → chunk-FQYISTFE.js} +1 -1
  21. package/{chunk-MM36XELZ.js → chunk-FV7RT2H4.js} +1 -1
  22. package/{chunk-QEE2RRQ4.js → chunk-JI7ARQNM.js} +1 -1
  23. package/{chunk-P3AUEHHI.js → chunk-JMCI2QBN.js} +1 -1
  24. package/{chunk-UFTPS2J6.js → chunk-KQZOP4RB.js} +1 -1
  25. package/{chunk-AV5KKRMA.js → chunk-LJWOVRAE.js} +1 -1
  26. package/{chunk-ZTDAMLNP.js → chunk-NEX3Y4KL.js} +1 -1
  27. package/{chunk-UAMORY54.js → chunk-P6MBY2GF.js} +1 -1
  28. package/{chunk-EBSK6KZQ.js → chunk-QZHAUT75.js} +1 -1
  29. package/{chunk-OITOOW5H.js → chunk-RFT6ZTG4.js} +1 -1
  30. package/{chunk-5G4V55RS.js → chunk-RO3J52QB.js} +1 -1
  31. package/{chunk-QT7EG3ZF.js → chunk-RUJVNPDB.js} +1 -1
  32. package/{chunk-LVX3DTQM.js → chunk-S3WJSEPC.js} +1 -1
  33. package/{chunk-67L5H6HO.js → chunk-TJWJCLW2.js} +1 -1
  34. package/{chunk-I3GPRGH5.js → chunk-UFIIFL5F.js} +1 -1
  35. package/{chunk-YYSJESAX.js → chunk-V62OY3LJ.js} +1 -1
  36. package/{chunk-27ICL4CS.js → chunk-VJ4I5EFJ.js} +1 -1
  37. package/{chunk-LJ2P7K2Z.js → chunk-WCWS2RR4.js} +1 -1
  38. package/{chunk-SJTXV6AC.js → chunk-WSJUHVYI.js} +1 -1
  39. package/chunk-WYRWZHVI.js +1 -0
  40. package/{chunk-4YC2YMYH.js → chunk-Z7C6KFII.js} +1 -1
  41. package/{chunk-VGYWG5A3.js → chunk-ZX34QNKC.js} +1 -1
  42. package/{chunk-NF4VR5PI.js → chunk-ZXRAR57U.js} +1 -1
  43. package/index.html +1 -1
  44. package/{main-BV7ROS25.js → main-XAXRNMI2.js} +1 -1
  45. package/package.json +1 -1
  46. package/chunk-A4RSARWN.js +0 -1
  47. package/chunk-B2VS7Z6E.js +0 -1
  48. package/chunk-CGQ2WKCU.js +0 -1
@@ -1 +1 @@
1
- import{a as St}from"./chunk-O4OTZE5N.js";import{b as Oe,c as gt,d as Et}from"./chunk-WIVARGP6.js";import{a as pt,b as Ve,c as Ct}from"./chunk-MHRECQ5Y.js";import{a as dt}from"./chunk-5DJAX2HH.js";import{a as ct}from"./chunk-QIUMBQM5.js";import{b as le}from"./chunk-DW332N2S.js";import{a as Re}from"./chunk-TELPJYLN.js";import{B as ae,F as st,H as Q,L as lt,P as se,V as rt,W as Me,Y as _t,b as Fe,c as j,d as he,e as q,f as Ne,h as et,i as ie,j as fe,k as tt,n as nt,o as it,p as Pe,q as Ae,r as De,s as oe,t as ye,u as Y,w as ot,z as at}from"./chunk-HPNLQHW6.js";import{c as ut}from"./chunk-BGTK25UG.js";import{b as ne,d as z}from"./chunk-A4LPGPDU.js";import{$ as g,Ab as l,Bb as T,E as $e,Fb as b,Gb as v,Ib as $,Mc as L,Pa as r,Pb as S,Qb as m,Qc as ke,R as Ce,Rb as f,Rc as Be,Sc as Te,Ub as be,Vb as h,W as y,Xb as u,aa as E,cb as H,cc as ge,dc as Ee,gc as Se,hb as qe,jc as G,kb as Ye,kc as ve,la as p,lc as Ze,na as te,oc as R,pc as O,qc as w,rb as Qe,sb as A,tb as D,ub as Ge,wb as Ue,xb as xe,xc as me,yb as F,zb as s}from"./chunk-T2WO6CVD.js";import{a as J,b as X}from"./chunk-7CGTOI24.js";var we=class o{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||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};function ce(o){if(Ye(o))return o();if(Array.isArray(o))return o.map(t=>ce(t));if(typeof o=="object"&&o!==null){let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=ce(o[e]));return t}return o}function Nt(o,t){if(o&1){let e=$();s(0,"div",26)(1,"sh-form-field")(2,"label",27),f(3,7),l(),s(4,"input",28,0),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.time,i)||(a.scheduleFields.nextTime.time=i),E(i)}),l(),s(6,"sh-icon",29),G(7,"clock"),l()(),s(8,"sh-datepicker-input",30)(9,"label",31),G(10,"\xA0"),l(),s(11,"input",32,1),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.date,i)||(a.scheduleFields.nextTime.date=i),E(i)}),l(),s(13,"sh-icon",29),G(14,"calendar"),l()()(),s(15,"div",26)(16,"sh-form-field")(17,"label",33),f(18,8),l(),s(19,"input",34),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatValue,i)||(a.scheduleFields.runAgain.repeatValue=i),E(i)}),l()(),s(20,"sh-select",35)(21,"input",36),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatUnit,i)||(a.scheduleFields.runAgain.repeatUnit=i),E(i)}),l()()(),s(22,"sh-toggle-card",37),b(23,38),f(24,9),v(),s(25,"div",39)(26,"sh-toggle",24),S(27,10),s(28,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.mon,i)||(a.scheduleFields.runAgain.allowedDays.mon=i),E(i)}),l(),m(),l(),s(29,"sh-toggle",24),S(30,11),s(31,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.tue,i)||(a.scheduleFields.runAgain.allowedDays.tue=i),E(i)}),l(),m(),l(),s(32,"sh-toggle",24),S(33,12),s(34,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.wed,i)||(a.scheduleFields.runAgain.allowedDays.wed=i),E(i)}),l(),m(),l(),s(35,"sh-toggle",24),S(36,13),s(37,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.thu,i)||(a.scheduleFields.runAgain.allowedDays.thu=i),E(i)}),l(),m(),l(),s(38,"sh-toggle",24),S(39,14),s(40,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.fri,i)||(a.scheduleFields.runAgain.allowedDays.fri=i),E(i)}),l(),m(),l(),s(41,"sh-toggle",24),S(42,15),s(43,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sat,i)||(a.scheduleFields.runAgain.allowedDays.sat=i),E(i)}),l(),m(),l(),s(44,"sh-toggle",24),S(45,16),s(46,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sun,i)||(a.scheduleFields.runAgain.allowedDays.sun=i),E(i)}),l(),m(),l()()()}if(o&2){let e=u(2);r(4),R("ngModel",e.scheduleFields.nextTime.time),r(7),R("ngModel",e.scheduleFields.nextTime.date),r(8),R("ngModel",e.scheduleFields.runAgain.repeatValue),r(),F("options",e.unitOptions)("isClearable",!1),r(),R("ngModel",e.scheduleFields.runAgain.repeatUnit),r(),F("disallowToggle",!0),r(6),R("ngModel",e.scheduleFields.runAgain.allowedDays.mon),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.tue),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.wed),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.thu),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.fri),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sat),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function ft(o,t){if(o&1){let e=$();s(0,"div",23)(1,"sh-toggle",24),S(2,5),s(3,"input",25),w("ngModelChange",function(i){g(e);let a=u();return O(a.scheduleFields.autoRun,i)||(a.scheduleFields.autoRun=i),E(i)}),l(),m(),l(),s(4,"p"),f(5,6),l()(),A(6,Nt,47,14)}if(o&2){let e=u();r(3),R("ngModel",e.scheduleFields.autoRun),r(3),D(e.scheduleFields.autoRun()?6:-1)}}var Pt=[{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`}],Ie=[{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:At().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 mt(o){if(!o.autoRun)return null;let t=[o.runAgain.allowedDays.mon?"Monday":null,o.runAgain.allowedDays.tue?"Tuesday":null,o.runAgain.allowedDays.wed?"Wednesday":null,o.runAgain.allowedDays.thu?"Thursday":null,o.runAgain.allowedDays.fri?"Friday":null,o.runAgain.allowedDays.sat?"Saturday":null,o.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=o.nextTime.time.split(":"),n=new Date(o.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let i=o.runAgain.repeatValue,a=o.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${i}${a}`,AllowedDays:t}}function At(){let o=new Date,t=o.getDay(),e=t===1?7:(8-t)%7;return o.setDate(o.getDate()+e),o.setHours(12,0,0,0),o}var Xe=()=>({autoRun:p(!0),nextTime:{time:p("13:00"),date:p(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:p(1),repeatUnit:p("D"),allowedDays:{mon:p(!0),tue:p(!0),wed:p(!0),thu:p(!0),fri:p(!0),sat:p(!0),sun:p(!0)}}}),Ke=class o{#e=y(Z);#t=y(z);#i=y(ne);unitOptions=Pt;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Ie;updateScheduleType(t){let e=Ie.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$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 C;C=$localize`Next time`;let _;_=$localize`Run again every`;let d;d=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,i,a,c,C,_,d,I,U,B,V,x,K,W,[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,n){e&1&&(s(0,"h3",17),f(1,2),l(),s(2,"sh-select",18)(3,"input",19),h("ngModelChange",function(a){return n.updateScheduleType(a)}),l()(),A(4,ft,7,2),s(5,"div",20)(6,"button",21),h("click",function(){return n.goBack()}),S(7,3),T(8,"sh-icon"),m(),l(),s(9,"button",22),h("click",function(){return n.next()}),S(10,4),T(11,"sh-icon"),m(),l()()),e&2&&(r(2),F("isClearable",!1)("options",n.scheduleOptions),r(),F("ngModel",n.scheduleType()),r(),D(n.scheduleType()==="custom"?4:-1))},dependencies:[oe,j,tt,Fe,q,ie,Q,Me,Y,ae,se,rt,st],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 Dt(o,t){if(o&1){let e=$();s(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l()()}if(o&2){let e=u();F("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),R("ngModel",e.internalPath)}}function yt(o,t){if(o&1&&(b(0,7),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Mt(o,t){if(o&1&&(b(0,8),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function Rt(o,t){if(o&1){let e=$();s(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l(),A(2,yt,2,1,"ng-container",7),A(3,Mt,2,1,"ng-container",8),l()}if(o&2){let e,n,i=u();r(),R("ngModel",i.internalPath),r(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Ot=[{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"}],wt=[{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"}],Le=class o{path=Be.required();osType=Be();pathChange=ke();remove=ke();internalPath=p("");pathType=p("-Expression");currentExpressionOption=L(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=p(Ot);expressionOptions=L(()=>{let e=this.osType()==="Windows"?"\\":"/";return wt.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(J({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(J({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(J({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(J({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(J({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(J({},n),{startsWith:"*.",endsWith:""}):X(J({},n),{startsWith:"",endsWith:""}))});pathEffect=te(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",a=i?"\\":"/";e.startsWith("%")&&e.endsWith(a)||i&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});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||o)};static \u0275cmp=H({type:o,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,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(a){return O(n.pathType,a)||(n.pathType=a),a}),h("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,Dt,2,4,"sh-select",2)(3,Rt,4,3,"sh-form-field",3),s(4,"div",4),h("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),G(6,"x-circle"),l()()),e&2){let i;F("options",n.expressionOptions())("isClearable",!1),r(),R("ngModel",n.pathType),r(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[oe,j,q,ie,se,Q,Y],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var It=["formRef"],ze=()=>({standalone:!0});function Lt(o,t){if(o&1){let e=$();s(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.editingPath,i)||(a.editingPath=i),E(i)}),l()(),s(2,"button",43),h("click",function(){g(e);let i=u(2);return E(i.updatePath())}),s(3,"sh-icon"),G(4,"floppy-disk"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u(2);return E(i.cancelEditPath())}),s(6,"sh-icon"),G(7,"x-bold"),l()()}if(o&2){let e=u(2);r(),R("ngModel",e.editingPath),F("ngModelOptions",me(2,ze))}}function $t(o,t){if(o&1){let e=$();s(0,"sh-form-field",41),T(1,"input",44),l(),s(2,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.editPath(i))}),s(3,"sh-icon"),G(4,"pen"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.removePath(i))}),s(6,"sh-icon"),G(7,"trash-simple"),l()()}if(o&2){let e=u().$implicit;Qe("readonly",!0),r(),F("ngModel",e)("ngModelOptions",me(3,ze))}}function Gt(o,t){if(o&1&&(s(0,"div",30),A(1,Lt,8,3)(2,$t,8,4),l()),o&2){let e=t.$implicit,n=u();r(),D(n.oldPath()===e?1:2)}}function Ut(o,t){if(o&1){let e=$();s(0,"app-new-filter",46),h("pathChange",function(i){let a=g(e).$index,c=u(2);return E(c.patchPathAt(i,a))})("remove",function(){let i=g(e).$index,a=u(2);return E(a.removePathAt(i))}),l()}if(o&2){let e=t.$implicit,n=u(2);F("path",e)("osType",n.osType()??"")}}function xt(o,t){if(o&1&&Ue(0,Ut,1,2,"app-new-filter",45,Ge),o&2){let e=u();xe(e.pathArray())}}function bt(o,t){if(o&1){let e=$();s(0,"div",31)(1,"app-size",47),h("ngModelChange",function(i){g(e);let a=u();return E(a.updateFilesLargerThan(i))}),l()()}if(o&2){let e=u();r(),F("ngModel",e.filesLargerThan())("ngModelOptions",me(2,ze))}}var k=new De,Tt=(o={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>k.group({path:k.control(o.path),excludes:k.group({hidden:k.control(o.excludes.hidden),system:k.control(o.excludes.system),temporary:k.control(o.excludes.temporary),filesLargerThan:k.group({size:k.control(null),unit:k.control(null)})})}),He=class o{#e=y(Z);#t=y(z);#i=y(ne);formRef=Te.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new et("");filesLargerThan=L(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=le(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=L(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=p(null);editingPath=p(null);addingNewPath=p(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=Oe(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let a=n.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(C=>!C.startsWith("-")&&!C.startsWith("+")).join("\0"),a=this.pathArray().map((C,_)=>_===e?`${t}`:`${C}`).join("\0"),c=[i,a].filter(C=>C&&C!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),i=this.pathArray().filter((c,C)=>C!==t).join("\0"),a=[n,i].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,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,It,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let a;a=$localize`Temporary files`;let c;c=$localize`Source Data`;let C;C=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let I;I=$localize`Paths`;let U;U=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let V;V=$localize`Customize your filters.`;let x;x=$localize`Add filter`;let K;K=$localize`Exclude`;let W;W=$localize`Choose if there’s any files you want to exclude.`;let N;N=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let re;re=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],c,C,_,d,I,U,B,V,x,K,W,N,re,_e,ue,[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",""],["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",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",a,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",16,0),h("submit",function(){return g(i),E(n.next())}),s(2,"div",17)(3,"h3",18),f(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),T(8,"input",21),l(),s(9,"div",22)(10,"button",23),h("click",function(){return g(i),E(n.goBack())}),S(11,3),T(12,"sh-icon"),m(),l(),s(13,"button",24),S(14,4),T(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),b(18,27),f(19,5),v(),s(20,"p",28),f(21,6),l(),s(22,"div",29),Ue(23,Gt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),T(27,"input",32),l(),s(28,"button",33),h("click",function(){return g(i),E(n.addNewPath())}),s(29,"sh-icon"),G(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),b(32,27),f(33,7),v(),s(34,"p",28),f(35,8),l(),s(36,"button",34),h("click",function(){return g(i),E(n.addFilter())}),f(37,9),l(),A(38,xt,2,0),l(),s(39,"app-toggle-card",35),b(40,27),f(41,10),v(),s(42,"p",28),f(43,11),l(),s(44,"sh-toggle",36),S(45,12),T(46,"input",37),m(),l(),s(47,"sh-toggle",36),S(48,13),T(49,"input",38),m(),l(),s(50,"sh-toggle",36),S(51,14),T(52,"input",39),m(),l(),s(53,"sh-toggle",40),h("click",function(){return g(i),E(n.toggleFilesLargerThan())}),f(54,15),l(),A(55,bt,2,3,"div",31),l()()()}if(e&2){let i;F("formGroup",n.sourceDataForm),r(5),F("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),F("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),F("formControl",n.newPathCtrl),r(4),F("disallowToggle",!0),r(7),D((i=n.pathSignal())!=null&&i.length?38:-1),r(),F("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),D(n.filesLargerThan()?55:-1)}},dependencies:[oe,fe,j,Fe,q,Ne,ie,ye,nt,Ae,Pe,it,Q,Y,ae,Me,Le,Et,St,gt],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 Ft="1W:1D,4W:1W,12M:1M",Z=class o{#e=y(z);#t=y(Re);#i=y(at);#n=y(ut);#r=y(ct);#a=y(we);generalForm=ht();sourceDataForm=Tt();scheduleFields=Xe();scheduleType=p("daily");settings=p([]);optionsFields={remoteVolumeSize:p("50MB"),backupRetention:p("all"),backupRetentionTime:p(""),backupRetentionVersions:p(0),backupRetentionCustom:p("")};targetUrlModel=p(null);backupMetadata=p(null);isDraft=p(!1);backupId=p(null);backupName=L(()=>this.generalFormSignal()?.name??"");isSubmitting=p(!1);finishedLoading=p(!1);backupDefaults=p(null);applicationOptions=p(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#t.systemInfo()?.OSType);selectedOptions=p([]);sourceDataFormSignal=le(this.sourceDataForm.valueChanges);generalFormSignal=le(this.generalForm.valueChanges);encryptionFieldSignal=le(this.generalForm.controls.encryption.valueChanges);advancedOptions=L(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#o=p("");#s=p(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#p=te(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=L(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=L(()=>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.#d(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(dt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(C=>`${C.Include?"":"-"}${C.Expression}`)??[],i=t.Settings?.find(C=>C.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(C=>C.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:a===null?void 0:Oe(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(d=>d.Name==="encryption-module"),a=t.Settings?.find(d=>d.Name==="passphrase")?.Value??"",c=i?.Value&&i.Value.length?i.Value:"",C=t.Settings?.find(d=>d.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),c&&c!==""&&(_.encryption=c),a&&a!==""&&(_.password=a,_.repeatPassword=a),C&&C!==""&&(_.compression=C),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let i=ce(this.scheduleFields),a=Ie.find(c=>JSON.stringify(c.data)===JSON.stringify(i));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(d=>d.startsWith("--")).forEach(d=>{i.find(U=>U.Name===d)||i.push({Name:d,Value:_[d],Filter:null})})}let a=i.filter(_=>!n.includes(_.Name)),c=i.filter(_=>n.includes(_.Name));this.settings.set(a??[]),a?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var C="all";c?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return C="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return C="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Ft)C="smart";else return C="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(C)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=ce(this.scheduleFields);return mt(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),a=n.path?.split("\0")??[],c=this.mapFormsToSettings(),C=Object.entries(n.excludes??{}).filter(([d,I])=>I&&d!=="filesLargerThan").map(([d])=>d),_=n.excludes?.filesLargerThan;return C.length&&c.push({Name:"--exclude-files-attributes",Value:C.join(",")}),_&&_.size!==null&&_.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${_.size}${_.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:a.filter(d=>!(d.startsWith("-")||d.startsWith("+"))),Settings:c,Filters:a.filter(d=>d.startsWith("-")||d.startsWith("+")).map((d,I)=>({Order:I,Include:d.startsWith("+"),Expression:d.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{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:Ft});break}let C=[...t,...n],_=this.settings().filter(d=>!C.includes(d.Name)).map(d=>{let I=d.Value;return typeof d.Value=="number"&&(I=d.Value.toString()),typeof d.Value=="boolean"&&(I=d.Value?"True":"False"),{Name:d.Name?.startsWith("--")?d.Name:`--${d.Name}`,Value:I}});return[...i,...a,...c,..._]}#c(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.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Xe(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};var vt=["formRef"];function kt(o,t){o&1&&(s(0,"sh-alert",17),S(1,5),T(2,"sh-icon",26),m(),l())}function Bt(o,t){if(o&1&&G(0),o&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function Vt(o,t){if(o&1&&T(0,"sh-progress-bar",40),o&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),F("value",e.calculatePasswordStrength()*(100/5))}}function Kt(o,t){o&1&&(s(0,"span",35),f(1,10),l())}function Wt(o,t){o&1&&(S(0,8,1),T(1,"sh-icon"),m())}function Jt(o,t){o&1&&(S(0,8,2),T(1,"sh-icon"),m())}function Xt(o,t){o&1&&(S(0,11,1),T(1,"sh-icon",42),m())}function Ht(o,t){o&1&&(S(0,11,2),T(1,"sh-icon"),m())}function zt(o,t){if(o&1){let e=$();s(0,"button",41),h("click",function(){g(e);let i=u(3);return E(i.copyPassword())}),S(1,11),A(2,Xt,2,0)(3,Ht,2,0),m(),l()}if(o&2){let e=u(3);r(2),D(e.copiedPassword()?2:3)}}function jt(o,t){o&1&&(s(0,"sh-alert",39),f(1,12),l())}function qt(o,t){if(o&1){let e=$();s(0,"div",30)(1,"sh-form-field")(2,"label",31),S(3,7),T(4,"sup"),m(),l(),T(5,"input",32),l(),A(6,Vt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),T(8,"input",34),A(9,Kt,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),h("click",function(){g(e);let i=u(2);return E(i.showPassword.set(!i.showPassword()))}),S(12,8),A(13,Wt,2,0)(14,Jt,2,0),m(),l(),s(15,"button",37),h("click",function(){g(e);let i=u(2);return E(i.generatePassword())}),S(16,9),T(17,"sh-icon"),m(),l(),A(18,zt,4,1,"button",38),l(),A(19,jt,2,0,"sh-alert",39),l()}if(o&2){let e=u(2);r(5),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.password?6:-1),r(2),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),D(e.showPassword()?13:14),r(5),D(e.showCopyPassword()?18:-1),r(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Yt(o,t){if(o&1&&(s(0,"sh-select",27)(1,"label",28),f(2,6),l(),T(3,"input",29),qe(4,Bt,1,1,"ng-template"),l(),A(5,qt,20,7,"div",30)),o&2){let e=u();F("options",e.encryptionOptions())("isClearable",!1),r(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Qt(o,t){if(o&1&&(s(0,"button",24),S(1,13),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.nameAndDescriptionValid()===!1)}}function Zt(o,t){if(o&1&&(s(0,"button",25),S(1,14),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ee=new De,ht=(o={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ee.group({name:ee.control(o.name,[he.required]),description:ee.control(o.description),encryption:ee.control(o.encryption,[Ct()]),password:ee.control(o.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:ee.control(o.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:ee.control(o.compression)}),pe={Key:"-",DisplayName:"None"},je=class o{#e=y(z);#t=y(ne);#i=y(pt);#n=y(Z);#r=y(Re);formRef=Te.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=p(!1);copiedPassword=p(!1);showCopyPassword=p(!1);noneOptionKey=pe.Key;encryptionEffect=te(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=L(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=L(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#a(t??""),this.copiedPassword.set(!0)}async#a(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,vt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$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 C;C=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let d;d=$localize`Encryption`;let I;I=$localize`Encryption`;let U;U=$localize`Password`;let B;B=$localize`Repeat password`;let V;V=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let x;x=$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:`,x=be(x);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let W;W=$localize`Passwords do not match`;let N;N=$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:`,N=be(N);let re;re=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let _e;_e=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ue;return ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,a,c,C,_,I,V,x,K,W,N,re,_e,ue,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",d,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",U,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",B,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",15,0),h("submit",function(){return g(i),E(n.next())}),s(2,"h3",16),f(3,1),l(),A(4,kt,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),S(7,2),T(8,"sup"),m(),l(),T(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),f(12,3),l(),T(13,"textarea",21),l(),A(14,Yt,6,3),s(15,"div",22)(16,"button",23),h("click",function(){return g(i),E(n.exit())}),S(17,4),T(18,"sh-icon"),m(),l(),A(19,Qt,3,1,"button",24)(20,Zt,3,1,"button",25),l()()}if(e&2){let i;F("formGroup",n.generalForm),r(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),D(n.isNew()?14:-1),r(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[ye,fe,j,q,Ne,Ae,Pe,Q,se,ae,Y,lt,ot,_t],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{ht as a,pe as b,je as c,Ie as d,mt as e,Xe as f,Ke as g,Tt as h,He as i,Z as j};
1
+ import{a as St}from"./chunk-O4OTZE5N.js";import{b as Oe,c as gt,d as Et}from"./chunk-WIVARGP6.js";import{a as pt,b as Ve,c as Ct}from"./chunk-MHRECQ5Y.js";import{a as dt}from"./chunk-5DJAX2HH.js";import{a as ct}from"./chunk-A7L3WODV.js";import{b as le}from"./chunk-DW332N2S.js";import{a as Re}from"./chunk-TELPJYLN.js";import{B as ae,F as st,H as Q,L as lt,P as se,V as rt,W as Me,Y as _t,b as Fe,c as j,d as he,e as q,f as Ne,h as et,i as ie,j as fe,k as tt,n as nt,o as it,p as Pe,q as Ae,r as De,s as oe,t as ye,u as Y,w as ot,z as at}from"./chunk-HPNLQHW6.js";import{c as ut}from"./chunk-BGTK25UG.js";import{b as ne,d as z}from"./chunk-A4LPGPDU.js";import{$ as g,Ab as l,Bb as T,E as $e,Fb as b,Gb as v,Ib as $,Mc as L,Pa as r,Pb as S,Qb as m,Qc as ke,R as Ce,Rb as f,Rc as Be,Sc as Te,Ub as be,Vb as h,W as y,Xb as u,aa as E,cb as H,cc as ge,dc as Ee,gc as Se,hb as qe,jc as G,kb as Ye,kc as ve,la as p,lc as Ze,na as te,oc as R,pc as O,qc as w,rb as Qe,sb as A,tb as D,ub as Ge,wb as Ue,xb as xe,xc as me,yb as F,zb as s}from"./chunk-T2WO6CVD.js";import{a as J,b as X}from"./chunk-7CGTOI24.js";var we=class o{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||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};function ce(o){if(Ye(o))return o();if(Array.isArray(o))return o.map(t=>ce(t));if(typeof o=="object"&&o!==null){let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=ce(o[e]));return t}return o}function Nt(o,t){if(o&1){let e=$();s(0,"div",26)(1,"sh-form-field")(2,"label",27),f(3,7),l(),s(4,"input",28,0),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.time,i)||(a.scheduleFields.nextTime.time=i),E(i)}),l(),s(6,"sh-icon",29),G(7,"clock"),l()(),s(8,"sh-datepicker-input",30)(9,"label",31),G(10,"\xA0"),l(),s(11,"input",32,1),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.nextTime.date,i)||(a.scheduleFields.nextTime.date=i),E(i)}),l(),s(13,"sh-icon",29),G(14,"calendar"),l()()(),s(15,"div",26)(16,"sh-form-field")(17,"label",33),f(18,8),l(),s(19,"input",34),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatValue,i)||(a.scheduleFields.runAgain.repeatValue=i),E(i)}),l()(),s(20,"sh-select",35)(21,"input",36),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.repeatUnit,i)||(a.scheduleFields.runAgain.repeatUnit=i),E(i)}),l()()(),s(22,"sh-toggle-card",37),b(23,38),f(24,9),v(),s(25,"div",39)(26,"sh-toggle",24),S(27,10),s(28,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.mon,i)||(a.scheduleFields.runAgain.allowedDays.mon=i),E(i)}),l(),m(),l(),s(29,"sh-toggle",24),S(30,11),s(31,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.tue,i)||(a.scheduleFields.runAgain.allowedDays.tue=i),E(i)}),l(),m(),l(),s(32,"sh-toggle",24),S(33,12),s(34,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.wed,i)||(a.scheduleFields.runAgain.allowedDays.wed=i),E(i)}),l(),m(),l(),s(35,"sh-toggle",24),S(36,13),s(37,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.thu,i)||(a.scheduleFields.runAgain.allowedDays.thu=i),E(i)}),l(),m(),l(),s(38,"sh-toggle",24),S(39,14),s(40,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.fri,i)||(a.scheduleFields.runAgain.allowedDays.fri=i),E(i)}),l(),m(),l(),s(41,"sh-toggle",24),S(42,15),s(43,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sat,i)||(a.scheduleFields.runAgain.allowedDays.sat=i),E(i)}),l(),m(),l(),s(44,"sh-toggle",24),S(45,16),s(46,"input",25),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.scheduleFields.runAgain.allowedDays.sun,i)||(a.scheduleFields.runAgain.allowedDays.sun=i),E(i)}),l(),m(),l()()()}if(o&2){let e=u(2);r(4),R("ngModel",e.scheduleFields.nextTime.time),r(7),R("ngModel",e.scheduleFields.nextTime.date),r(8),R("ngModel",e.scheduleFields.runAgain.repeatValue),r(),F("options",e.unitOptions)("isClearable",!1),r(),R("ngModel",e.scheduleFields.runAgain.repeatUnit),r(),F("disallowToggle",!0),r(6),R("ngModel",e.scheduleFields.runAgain.allowedDays.mon),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.tue),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.wed),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.thu),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.fri),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sat),r(3),R("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function ft(o,t){if(o&1){let e=$();s(0,"div",23)(1,"sh-toggle",24),S(2,5),s(3,"input",25),w("ngModelChange",function(i){g(e);let a=u();return O(a.scheduleFields.autoRun,i)||(a.scheduleFields.autoRun=i),E(i)}),l(),m(),l(),s(4,"p"),f(5,6),l()(),A(6,Nt,47,14)}if(o&2){let e=u();r(3),R("ngModel",e.scheduleFields.autoRun),r(3),D(e.scheduleFields.autoRun()?6:-1)}}var Pt=[{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`}],Ie=[{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:At().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 mt(o){if(!o.autoRun)return null;let t=[o.runAgain.allowedDays.mon?"Monday":null,o.runAgain.allowedDays.tue?"Tuesday":null,o.runAgain.allowedDays.wed?"Wednesday":null,o.runAgain.allowedDays.thu?"Thursday":null,o.runAgain.allowedDays.fri?"Friday":null,o.runAgain.allowedDays.sat?"Saturday":null,o.runAgain.allowedDays.sun?"Sunday":null].filter(c=>c!==null),e=o.nextTime.time.split(":"),n=new Date(o.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let i=o.runAgain.repeatValue,a=o.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${i}${a}`,AllowedDays:t}}function At(){let o=new Date,t=o.getDay(),e=t===1?7:(8-t)%7;return o.setDate(o.getDate()+e),o.setHours(12,0,0,0),o}var Xe=()=>({autoRun:p(!0),nextTime:{time:p("13:00"),date:p(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:p(1),repeatUnit:p("D"),allowedDays:{mon:p(!0),tue:p(!0),wed:p(!0),thu:p(!0),fri:p(!0),sat:p(!0),sun:p(!0)}}}),Ke=class o{#e=y(Z);#t=y(z);#i=y(ne);unitOptions=Pt;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Ie;updateScheduleType(t){let e=Ie.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$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 C;C=$localize`Next time`;let _;_=$localize`Run again every`;let d;d=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,i,a,c,C,_,d,I,U,B,V,x,K,W,[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,n){e&1&&(s(0,"h3",17),f(1,2),l(),s(2,"sh-select",18)(3,"input",19),h("ngModelChange",function(a){return n.updateScheduleType(a)}),l()(),A(4,ft,7,2),s(5,"div",20)(6,"button",21),h("click",function(){return n.goBack()}),S(7,3),T(8,"sh-icon"),m(),l(),s(9,"button",22),h("click",function(){return n.next()}),S(10,4),T(11,"sh-icon"),m(),l()()),e&2&&(r(2),F("isClearable",!1)("options",n.scheduleOptions),r(),F("ngModel",n.scheduleType()),r(),D(n.scheduleType()==="custom"?4:-1))},dependencies:[oe,j,tt,Fe,q,ie,Q,Me,Y,ae,se,rt,st],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 Dt(o,t){if(o&1){let e=$();s(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l()()}if(o&2){let e=u();F("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),R("ngModel",e.internalPath)}}function yt(o,t){if(o&1&&(b(0,7),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Mt(o,t){if(o&1&&(b(0,8),G(1),v()),o&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function Rt(o,t){if(o&1){let e=$();s(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){g(e);let a=u();return O(a.internalPath,i)||(a.internalPath=i),E(i)}),h("ngModelChange",function(){g(e);let i=u();return E(i.updateFilter())}),l(),A(2,yt,2,1,"ng-container",7),A(3,Mt,2,1,"ng-container",8),l()}if(o&2){let e,n,i=u();r(),R("ngModel",i.internalPath),r(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Ot=[{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"}],wt=[{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"}],Le=class o{path=Be.required();osType=Be();pathChange=ke();remove=ke();internalPath=p("");pathType=p("-Expression");currentExpressionOption=L(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=p(Ot);expressionOptions=L(()=>{let e=this.osType()==="Windows"?"\\":"/";return wt.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(J({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(J({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(J({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(J({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(J({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(J({},n),{startsWith:"*.",endsWith:""}):X(J({},n),{startsWith:"",endsWith:""}))});pathEffect=te(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",a=i?"\\":"/";e.startsWith("%")&&e.endsWith(a)||i&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});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||o)};static \u0275cmp=H({type:o,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,n){if(e&1&&(s(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(a){return O(n.pathType,a)||(n.pathType=a),a}),h("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,Dt,2,4,"sh-select",2)(3,Rt,4,3,"sh-form-field",3),s(4,"div",4),h("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),G(6,"x-circle"),l()()),e&2){let i;F("options",n.expressionOptions())("isClearable",!1),r(),R("ngModel",n.pathType),r(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[oe,j,q,ie,se,Q,Y],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var It=["formRef"],ze=()=>({standalone:!0});function Lt(o,t){if(o&1){let e=$();s(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){g(e);let a=u(2);return O(a.editingPath,i)||(a.editingPath=i),E(i)}),l()(),s(2,"button",43),h("click",function(){g(e);let i=u(2);return E(i.updatePath())}),s(3,"sh-icon"),G(4,"floppy-disk"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u(2);return E(i.cancelEditPath())}),s(6,"sh-icon"),G(7,"x-bold"),l()()}if(o&2){let e=u(2);r(),R("ngModel",e.editingPath),F("ngModelOptions",me(2,ze))}}function $t(o,t){if(o&1){let e=$();s(0,"sh-form-field",41),T(1,"input",44),l(),s(2,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.editPath(i))}),s(3,"sh-icon"),G(4,"pen"),l()(),s(5,"button",43),h("click",function(){g(e);let i=u().$implicit,a=u();return E(a.removePath(i))}),s(6,"sh-icon"),G(7,"trash-simple"),l()()}if(o&2){let e=u().$implicit;Qe("readonly",!0),r(),F("ngModel",e)("ngModelOptions",me(3,ze))}}function Gt(o,t){if(o&1&&(s(0,"div",30),A(1,Lt,8,3)(2,$t,8,4),l()),o&2){let e=t.$implicit,n=u();r(),D(n.oldPath()===e?1:2)}}function Ut(o,t){if(o&1){let e=$();s(0,"app-new-filter",46),h("pathChange",function(i){let a=g(e).$index,c=u(2);return E(c.patchPathAt(i,a))})("remove",function(){let i=g(e).$index,a=u(2);return E(a.removePathAt(i))}),l()}if(o&2){let e=t.$implicit,n=u(2);F("path",e)("osType",n.osType()??"")}}function xt(o,t){if(o&1&&Ue(0,Ut,1,2,"app-new-filter",45,Ge),o&2){let e=u();xe(e.pathArray())}}function bt(o,t){if(o&1){let e=$();s(0,"div",31)(1,"app-size",47),h("ngModelChange",function(i){g(e);let a=u();return E(a.updateFilesLargerThan(i))}),l()()}if(o&2){let e=u();r(),F("ngModel",e.filesLargerThan())("ngModelOptions",me(2,ze))}}var k=new De,Tt=(o={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>k.group({path:k.control(o.path),excludes:k.group({hidden:k.control(o.excludes.hidden),system:k.control(o.excludes.system),temporary:k.control(o.excludes.temporary),filesLargerThan:k.group({size:k.control(null),unit:k.control(null)})})}),He=class o{#e=y(Z);#t=y(z);#i=y(ne);formRef=Te.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new et("");filesLargerThan=L(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=le(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=L(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=p(null);editingPath=p(null);addingNewPath=p(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=Oe(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let a=n.filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(C=>!C.startsWith("-")&&!C.startsWith("+")).join("\0"),a=this.pathArray().map((C,_)=>_===e?`${t}`:`${C}`).join("\0"),c=[i,a].filter(C=>C&&C!=="").join("\0");this.sourceDataForm.controls.path.setValue(c)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),i=this.pathArray().filter((c,C)=>C!==t).join("\0"),a=[n,i].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,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,It,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let a;a=$localize`Temporary files`;let c;c=$localize`Source Data`;let C;C=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let d;d=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let I;I=$localize`Paths`;let U;U=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let V;V=$localize`Customize your filters.`;let x;x=$localize`Add filter`;let K;K=$localize`Exclude`;let W;W=$localize`Choose if there’s any files you want to exclude.`;let N;N=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let re;re=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],c,C,_,d,I,U,B,V,x,K,W,N,re,_e,ue,[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",""],["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",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",a,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",16,0),h("submit",function(){return g(i),E(n.next())}),s(2,"div",17)(3,"h3",18),f(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),T(8,"input",21),l(),s(9,"div",22)(10,"button",23),h("click",function(){return g(i),E(n.goBack())}),S(11,3),T(12,"sh-icon"),m(),l(),s(13,"button",24),S(14,4),T(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),b(18,27),f(19,5),v(),s(20,"p",28),f(21,6),l(),s(22,"div",29),Ue(23,Gt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),T(27,"input",32),l(),s(28,"button",33),h("click",function(){return g(i),E(n.addNewPath())}),s(29,"sh-icon"),G(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),b(32,27),f(33,7),v(),s(34,"p",28),f(35,8),l(),s(36,"button",34),h("click",function(){return g(i),E(n.addFilter())}),f(37,9),l(),A(38,xt,2,0),l(),s(39,"app-toggle-card",35),b(40,27),f(41,10),v(),s(42,"p",28),f(43,11),l(),s(44,"sh-toggle",36),S(45,12),T(46,"input",37),m(),l(),s(47,"sh-toggle",36),S(48,13),T(49,"input",38),m(),l(),s(50,"sh-toggle",36),S(51,14),T(52,"input",39),m(),l(),s(53,"sh-toggle",40),h("click",function(){return g(i),E(n.toggleFilesLargerThan())}),f(54,15),l(),A(55,bt,2,3,"div",31),l()()()}if(e&2){let i;F("formGroup",n.sourceDataForm),r(5),F("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),F("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),F("formControl",n.newPathCtrl),r(4),F("disallowToggle",!0),r(7),D((i=n.pathSignal())!=null&&i.length?38:-1),r(),F("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),D(n.filesLargerThan()?55:-1)}},dependencies:[oe,fe,j,Fe,q,Ne,ie,ye,nt,Ae,Pe,it,Q,Y,ae,Me,Le,Et,St,gt],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 Ft="1W:1D,4W:1W,12M:1M",Z=class o{#e=y(z);#t=y(Re);#i=y(at);#n=y(ut);#r=y(ct);#a=y(we);generalForm=ht();sourceDataForm=Tt();scheduleFields=Xe();scheduleType=p("daily");settings=p([]);optionsFields={remoteVolumeSize:p("50MB"),backupRetention:p("all"),backupRetentionTime:p(""),backupRetentionVersions:p(0),backupRetentionCustom:p("")};targetUrlModel=p(null);backupMetadata=p(null);isDraft=p(!1);backupId=p(null);backupName=L(()=>this.generalFormSignal()?.name??"");isSubmitting=p(!1);finishedLoading=p(!1);backupDefaults=p(null);applicationOptions=p(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#t.systemInfo()?.OSType);selectedOptions=p([]);sourceDataFormSignal=le(this.sourceDataForm.valueChanges);generalFormSignal=le(this.generalForm.valueChanges);encryptionFieldSignal=le(this.generalForm.controls.encryption.valueChanges);advancedOptions=L(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#o=p("");#s=p(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#p=te(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#s.set(null))});setTestState(t,e){this.#o.set(t),this.#s.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=L(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=L(()=>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.#d(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe($e(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(dt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(C=>`${C.Include?"":"-"}${C.Expression}`)??[],i=t.Settings?.find(C=>C.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],a=t.Settings?.find(C=>C.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,c={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:a===null?void 0:Oe(a)}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(d=>d.Name==="encryption-module"),a=t.Settings?.find(d=>d.Name==="passphrase")?.Value??"",c=i?.Value&&i.Value.length?i.Value:"",C=t.Settings?.find(d=>d.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),c&&c!==""&&(_.encryption=c),a&&a!==""&&(_.password=a,_.repeatPassword=a),C&&C!==""&&(_.compression=C),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let i=ce(this.scheduleFields),a=Ie.find(c=>JSON.stringify(c.data)===JSON.stringify(i));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(d=>d.startsWith("--")).forEach(d=>{i.find(U=>U.Name===d)||i.push({Name:d,Value:_[d],Filter:null})})}let a=i.filter(_=>!n.includes(_.Name)),c=i.filter(_=>n.includes(_.Name));this.settings.set(a??[]),a?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var C="all";c?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return C="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return C="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Ft)C="smart";else return C="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(C)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=ce(this.scheduleFields);return mt(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),a=n.path?.split("\0")??[],c=this.mapFormsToSettings(),C=Object.entries(n.excludes??{}).filter(([d,I])=>I&&d!=="filesLargerThan").map(([d])=>d),_=n.excludes?.filesLargerThan;return C.length&&c.push({Name:"--exclude-files-attributes",Value:C.join(",")}),_&&_.size!==null&&_.unit!==null&&c.push({Name:"--skip-files-larger-than",Value:`${_.size}${_.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:a.filter(d=>!(d.startsWith("-")||d.startsWith("+"))),Settings:c,Filters:a.filter(d=>d.startsWith("-")||d.startsWith("+")).map((d,I)=>({Order:I,Include:d.startsWith("+"),Expression:d.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{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:Ft});break}let C=[...t,...n],_=this.settings().filter(d=>!C.includes(d.Name)).map(d=>{let I=d.Value;return typeof d.Value=="number"&&(I=d.Value.toString()),typeof d.Value=="boolean"&&(I=d.Value?"True":"False"),{Name:d.Name?.startsWith("--")?d.Name:`--${d.Name}`,Value:I}});return[...i,...a,...c,..._]}#c(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.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=Xe(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=Ce({token:o,factory:o.\u0275fac,providedIn:"root"})};var vt=["formRef"];function kt(o,t){o&1&&(s(0,"sh-alert",17),S(1,5),T(2,"sh-icon",26),m(),l())}function Bt(o,t){if(o&1&&G(0),o&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function Vt(o,t){if(o&1&&T(0,"sh-progress-bar",40),o&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),F("value",e.calculatePasswordStrength()*(100/5))}}function Kt(o,t){o&1&&(s(0,"span",35),f(1,10),l())}function Wt(o,t){o&1&&(S(0,8,1),T(1,"sh-icon"),m())}function Jt(o,t){o&1&&(S(0,8,2),T(1,"sh-icon"),m())}function Xt(o,t){o&1&&(S(0,11,1),T(1,"sh-icon",42),m())}function Ht(o,t){o&1&&(S(0,11,2),T(1,"sh-icon"),m())}function zt(o,t){if(o&1){let e=$();s(0,"button",41),h("click",function(){g(e);let i=u(3);return E(i.copyPassword())}),S(1,11),A(2,Xt,2,0)(3,Ht,2,0),m(),l()}if(o&2){let e=u(3);r(2),D(e.copiedPassword()?2:3)}}function jt(o,t){o&1&&(s(0,"sh-alert",39),f(1,12),l())}function qt(o,t){if(o&1){let e=$();s(0,"div",30)(1,"sh-form-field")(2,"label",31),S(3,7),T(4,"sup"),m(),l(),T(5,"input",32),l(),A(6,Vt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),T(8,"input",34),A(9,Kt,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),h("click",function(){g(e);let i=u(2);return E(i.showPassword.set(!i.showPassword()))}),S(12,8),A(13,Wt,2,0)(14,Jt,2,0),m(),l(),s(15,"button",37),h("click",function(){g(e);let i=u(2);return E(i.generatePassword())}),S(16,9),T(17,"sh-icon"),m(),l(),A(18,zt,4,1,"button",38),l(),A(19,jt,2,0,"sh-alert",39),l()}if(o&2){let e=u(2);r(5),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.password?6:-1),r(2),F("type",e.showPassword()?"text":"password"),r(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),D(e.showPassword()?13:14),r(5),D(e.showCopyPassword()?18:-1),r(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Yt(o,t){if(o&1&&(s(0,"sh-select",27)(1,"label",28),f(2,6),l(),T(3,"input",29),qe(4,Bt,1,1,"ng-template"),l(),A(5,qt,20,7,"div",30)),o&2){let e=u();F("options",e.encryptionOptions())("isClearable",!1),r(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Qt(o,t){if(o&1&&(s(0,"button",24),S(1,13),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.nameAndDescriptionValid()===!1)}}function Zt(o,t){if(o&1&&(s(0,"button",25),S(1,14),T(2,"sh-icon"),m(),l()),o&2){let e=u();F("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ee=new De,ht=(o={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ee.group({name:ee.control(o.name,[he.required]),description:ee.control(o.description),encryption:ee.control(o.encryption,[Ct()]),password:ee.control(o.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:ee.control(o.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:ee.control(o.compression)}),pe={Key:"-",DisplayName:"None"},je=class o{#e=y(z);#t=y(ne);#i=y(pt);#n=y(Z);#r=y(Re);formRef=Te.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=p(!1);copiedPassword=p(!1);showCopyPassword=p(!1);noneOptionKey=pe.Key;encryptionEffect=te(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=L(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=L(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#a(t??""),this.copiedPassword.set(!0)}async#a(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=H({type:o,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,vt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$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 C;C=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let d;d=$localize`Encryption`;let I;I=$localize`Encryption`;let U;U=$localize`Password`;let B;B=$localize`Repeat password`;let V;V=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let x;x=$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:`,x=be(x);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let W;W=$localize`Passwords do not match`;let N;N=$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:`,N=be(N);let re;re=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let _e;_e=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ue;return ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,a,c,C,_,I,V,x,K,W,N,re,_e,ue,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",d,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",U,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",B,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=$();s(0,"form",15,0),h("submit",function(){return g(i),E(n.next())}),s(2,"h3",16),f(3,1),l(),A(4,kt,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),S(7,2),T(8,"sup"),m(),l(),T(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),f(12,3),l(),T(13,"textarea",21),l(),A(14,Yt,6,3),s(15,"div",22)(16,"button",23),h("click",function(){return g(i),E(n.exit())}),S(17,4),T(18,"sh-icon"),m(),l(),A(19,Qt,3,1,"button",24)(20,Zt,3,1,"button",25),l()()}if(e&2){let i;F("formGroup",n.generalForm),r(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),D(n.isNew()?14:-1),r(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[ye,fe,j,q,Ne,Ae,Pe,Q,se,ae,Y,lt,ot,_t],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{ht as a,pe as b,je as c,Ie as d,mt as e,Xe as f,Ke as g,Tt as h,He as i,Z as j};
@@ -0,0 +1 @@
1
+ import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-VJ4I5EFJ.js")},{path:"encryption",loadComponent:()=>import("./chunk-6DL4QE2S.js")},{path:"select-files",loadComponent:()=>import("./chunk-C7FYZIR5.js")},{path:"options",loadComponent:()=>import("./chunk-RO3J52QB.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-7JLJCYEF.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-LJ2P7K2Z.js";import{j as C}from"./chunk-SJTXV6AC.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-UFTPS2J6.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as G}from"./chunk-HRCZ5SXI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-LVX3DTQM.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-WVF3GRDZ.js";import"./chunk-QIUMBQM5.js";import{b as h}from"./chunk-DW332N2S.js";import"./chunk-B2VS7Z6E.js";import"./chunk-TELPJYLN.js";import"./chunk-4RKO4YFU.js";import{L as M,M as $,R as I}from"./chunk-HPNLQHW6.js";import{c as L}from"./chunk-BGTK25UG.js";import{b as N,c as O,e as B,f as b}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as u,Bb as r,C as f,Pa as n,Pb as c,Qb as _,W as l,Xb as A,cb as D,jc as P,lc as E,na as R,sb as T,tb as g,wc as k,yb as d,zb as s,zc as p}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),P(1),u()),a&2){let t=A();n(),E("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=R(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[k([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),_(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),_(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),_(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),_(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),_(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",p(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
1
+ import{a as v}from"./chunk-WCWS2RR4.js";import{j as C}from"./chunk-WSJUHVYI.js";import"./chunk-O4OTZE5N.js";import"./chunk-WIVARGP6.js";import"./chunk-MHRECQ5Y.js";import"./chunk-KQZOP4RB.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as G}from"./chunk-FQYISTFE.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-S3WJSEPC.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import"./chunk-WVF3GRDZ.js";import"./chunk-A7L3WODV.js";import{b as h}from"./chunk-DW332N2S.js";import"./chunk-2BESFS3R.js";import"./chunk-TELPJYLN.js";import"./chunk-4RKO4YFU.js";import{L as M,M as $,R as I}from"./chunk-HPNLQHW6.js";import{c as L}from"./chunk-BGTK25UG.js";import{b as N,c as O,e as B,f as b}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Ab as u,Bb as r,C as f,Pa as n,Pb as c,Qb as _,W as l,Xb as A,cb as D,jc as P,lc as E,na as R,sb as T,tb as g,wc as k,yb as d,zb as s,zc as p}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),P(1),u()),a&2){let t=A();n(),E("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=R(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=D({type:a,selectors:[["app-backup"]],features:[k([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),_(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),_(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),_(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),_(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),_(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",p(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
@@ -1,4 +1,4 @@
1
- import{a as Gt}from"./chunk-AS6Z56AD.js";import{a as yt,b as Re,c as Ot,d as Ft,e as At,f as wt,h as Mt,i as Lt,j as Pt}from"./chunk-IW4RDAIN.js";import{j as $t}from"./chunk-SJTXV6AC.js";import{c as vt,d as Vt}from"./chunk-WIVARGP6.js";import{a as Dt}from"./chunk-LVX3DTQM.js";import{a as U}from"./chunk-5DJAX2HH.js";import{a as xt}from"./chunk-QIUMBQM5.js";import{a as Et,b as It}from"./chunk-DW332N2S.js";import{a as ue}from"./chunk-TELPJYLN.js";import{B as Ce,C as pt,E as mt,H as Pe,K as Ct,L as ut,O as gt,P as Tt,V as ft,W as St,Y as Nt,a as st,c as se,e as de,i as ce,k as dt,s as pe,t as ct,u as me,z as Le}from"./chunk-HPNLQHW6.js";import{c as ht}from"./chunk-BGTK25UG.js";import{e as _t}from"./chunk-A4LPGPDU.js";import{_ as rt}from"./chunk-OTPG7USH.js";import{$ as f,Ab as d,Ac as Me,Bb as R,D as He,E as $e,Fb as xe,Gb as fe,Gc as oe,Hb as P,Ib as E,K as je,M as qe,Ma as Qe,Mc as $,Pa as r,Pb as H,Qb as j,Qc as ot,R as Ie,Rb as _e,Rc as ae,Sc as at,Ub as Ye,Uc as lt,Vb as h,W as w,Xb as l,Yb as De,Zb as ye,aa as S,cb as Z,cc as Ze,da as We,dc as et,ec as y,f as Ee,fc as tt,gc as Oe,hb as x,jc as m,kc as nt,l as Je,la as k,lc as A,mc as Se,na as Te,oc as Fe,p as Xe,pc as Ae,qc as we,rc as X,sb as u,sc as M,tb as g,tc as p,ub as te,uc as Ge,wb as ne,wc as it,xb as ie,xc as be,yb as c,yc as v,zb as s,zc as B}from"./chunk-T2WO6CVD.js";import{a as z,b as he}from"./chunk-7CGTOI24.js";var bt=class n{#e=w(ht);#t=w(Le);#n=w(ue);testDestination(t,e,o,i,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i,a):this.testDestinationv1(t,e,o,i,a)}testDestinationv2(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:C=>{if(C.Success){this.emitSuccessV2(_,t,o,C);return}this.handleGenericError(_,t,o,C.Error??"Unknown error",a)},error:C=>{let N=C?.error?.body??C?.error?.requestBody;if(N?.Data?.FolderExists===!1||N?.StatusCode==="missing-folder"){i?this.handleMissingFolder(_,t,o):this.handleGenericError(_,t,o,$localize`The remote destination folder does not exist.`,a);return}if(N?.Data?.HostCertificate){this.handleMissingCertificate(_,t,o,N.Data?.HostCertificate);return}if(N?.Data?.ReportedHostKey){this.handleIncorrectKey(_,t,o,N.Data.ReportedHostKey,N.Data.AcceptedHostKey??null);return}this.handleGenericError(_,t,o,C?.message??"Unknown error",a)}})})}testDestinationv1(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:C=>{_.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:o}),_.complete()},error:C=>{this.handleDestinationErrorv1(C.message,t,o,i,a).subscribe(N=>{_.next(N)})}})})}handleMissingFolder(t,e,o){this.#t.open(U,{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:i=>{if(!i){this.reportNoAction(t,e,o,$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,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(U,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(U,{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:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(U,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as Gt}from"./chunk-AS6Z56AD.js";import{a as yt,b as Re,c as Ot,d as Ft,e as At,f as wt,h as Mt,i as Lt,j as Pt}from"./chunk-IW4RDAIN.js";import{j as $t}from"./chunk-WSJUHVYI.js";import{c as vt,d as Vt}from"./chunk-WIVARGP6.js";import{a as Dt}from"./chunk-S3WJSEPC.js";import{a as U}from"./chunk-5DJAX2HH.js";import{a as xt}from"./chunk-A7L3WODV.js";import{a as Et,b as It}from"./chunk-DW332N2S.js";import{a as ue}from"./chunk-TELPJYLN.js";import{B as Ce,C as pt,E as mt,H as Pe,K as Ct,L as ut,O as gt,P as Tt,V as ft,W as St,Y as Nt,a as st,c as se,e as de,i as ce,k as dt,s as pe,t as ct,u as me,z as Le}from"./chunk-HPNLQHW6.js";import{c as ht}from"./chunk-BGTK25UG.js";import{e as _t}from"./chunk-A4LPGPDU.js";import{_ as rt}from"./chunk-OTPG7USH.js";import{$ as f,Ab as d,Ac as Me,Bb as R,D as He,E as $e,Fb as xe,Gb as fe,Gc as oe,Hb as P,Ib as E,K as je,M as qe,Ma as Qe,Mc as $,Pa as r,Pb as H,Qb as j,Qc as ot,R as Ie,Rb as _e,Rc as ae,Sc as at,Ub as Ye,Uc as lt,Vb as h,W as w,Xb as l,Yb as De,Zb as ye,aa as S,cb as Z,cc as Ze,da as We,dc as et,ec as y,f as Ee,fc as tt,gc as Oe,hb as x,jc as m,kc as nt,l as Je,la as k,lc as A,mc as Se,na as Te,oc as Fe,p as Xe,pc as Ae,qc as we,rc as X,sb as u,sc as M,tb as g,tc as p,ub as te,uc as Ge,wb as ne,wc as it,xb as ie,xc as be,yb as c,yc as v,zb as s,zc as B}from"./chunk-T2WO6CVD.js";import{a as z,b as he}from"./chunk-7CGTOI24.js";var bt=class n{#e=w(ht);#t=w(Le);#n=w(ue);testDestination(t,e,o,i,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i,a):this.testDestinationv1(t,e,o,i,a)}testDestinationv2(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:C=>{if(C.Success){this.emitSuccessV2(_,t,o,C);return}this.handleGenericError(_,t,o,C.Error??"Unknown error",a)},error:C=>{let N=C?.error?.body??C?.error?.requestBody;if(N?.Data?.FolderExists===!1||N?.StatusCode==="missing-folder"){i?this.handleMissingFolder(_,t,o):this.handleGenericError(_,t,o,$localize`The remote destination folder does not exist.`,a);return}if(N?.Data?.HostCertificate){this.handleMissingCertificate(_,t,o,N.Data?.HostCertificate);return}if(N?.Data?.ReportedHostKey){this.handleIncorrectKey(_,t,o,N.Data.ReportedHostKey,N.Data.AcceptedHostKey??null);return}this.handleGenericError(_,t,o,C?.message??"Unknown error",a)}})})}testDestinationv1(t,e,o,i,a){return new Ee(_=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:C=>{_.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:o}),_.complete()},error:C=>{this.handleDestinationErrorv1(C.message,t,o,i,a).subscribe(N=>{_.next(N)})}})})}handleMissingFolder(t,e,o){this.#t.open(U,{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:i=>{if(!i){this.reportNoAction(t,e,o,$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,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(U,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(U,{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:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(U,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#t.open(U,{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,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -1 +1 @@
1
- import{b as ee,k as _n}from"./chunk-IW4RDAIN.js";import{a as an}from"./chunk-LJ2P7K2Z.js";import{a as on}from"./chunk-UFTPS2J6.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as tn}from"./chunk-HRCZ5SXI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-LVX3DTQM.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import{a as nn}from"./chunk-WVF3GRDZ.js";import"./chunk-QIUMBQM5.js";import"./chunk-DW332N2S.js";import"./chunk-B2VS7Z6E.js";import"./chunk-TELPJYLN.js";import"./chunk-4RKO4YFU.js";import{A as Ue,B as Z,C as Ke,E as je,G as We,K as qe,L as Qe,S as Ye,T as Ze,u as Y}from"./chunk-HPNLQHW6.js";import{c as en}from"./chunk-BGTK25UG.js";import{e as Q}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as I,Ab as t,Bb as T,Cc as M,Dc as G,E as K,Ec as A,Fb as O,Gb as m,Gc as q,Hb as f,Ib as H,Ma as j,Pa as a,Pb as c,Qb as s,Rb as C,Sb as h,Tb as L,Ub as W,Vb as $,W as v,Xb as r,aa as P,cb as be,ec as V,gc as R,hb as N,ib as ve,jc as u,la as X,lc as S,na as Be,oc as we,pb as Xe,pc as ze,qb as Je,qc as Ve,sb as g,tb as p,ub as J,wb as w,xb as z,xc as U,yb as E,yc as D,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var rn=()=>[Q,import("./chunk-6GC4UPHS.js").then(e=>e.NgTemplateOutlet),Z,Y,je,Ze,Ye,import("./chunk-2PAQOFN3.js").then(e=>e.DurationFormatPipe),import("./chunk-2XXH473G.js").then(e=>e.BytesPipe),import("./chunk-YDDSLDHZ.js").then(e=>e.RelativeTimePipe)],cn=()=>["/add-backup"],sn=()=>["/restore"],ln=e=>({$implicit:e}),un=()=>["/backup/new"],Fn=e=>["/backup",e],Cn=e=>["/restore",e],Tn=e=>["/backup",e,"export"],En=e=>["/backup",e,"delete"],dn=e=>["/backup",e,"database"],gn=e=>["/backup",e,"commandline"],pn=e=>["/backup",e,"log"];function Sn(e,i){e&1&&C(0,11,1)}function On(e,i){e&1&&C(0,11,2)}function mn(e,i){if(e&1&&C(0,11,3),e&2){let n=r(2);h(n.timeType()),L(0)}}function Nn(e,i){if(e&1){let n=H();o(0,"button",54),$("click",function(){let F=I(n).$implicit,d=r(3);return P(d.sortByColumn.set(F.value))}),C(1,15),t()}if(e&2){let n=i.$implicit,_=r(3);R("active",_.orderBy()===n.value),a(),h(n.label),L(1)}}function Mn(e,i){if(e&1&&(o(0,"sh-menu",55)(1,"button",56),c(2,14),T(3,"strong")(4,"sh-icon"),s(),t(),O(5,57),w(6,Nn,2,3,"button",58,J),m(),t()),e&2){let n=r(2);a(4),h(n.orderBy()),L(2),a(2),z(n.sortOrderOptions())}}function In(e,i){if(e&1){let n=H();o(0,"div",52)(1,"sh-button-group",53)(2,"button",54),$("click",function(){I(n);let F=r();return P(F.viewMode.set("list"))}),c(3,9),T(4,"sh-icon"),s(),t(),o(5,"button",54),$("click",function(){I(n);let F=r();return P(F.viewMode.set("details"))}),c(6,10),T(7,"sh-icon"),s(),t()(),o(8,"sh-menu",55)(9,"button",56),c(10,11),o(11,"strong"),g(12,Sn,1,0)(13,On,1,0)(14,mn,1,1),t(),T(15,"sh-icon"),s(),t(),O(16,57),o(17,"button",54),$("click",function(){I(n);let F=r();return P(F.setTimeType("relative"))}),C(18,12),t(),o(19,"button",54),$("click",function(){I(n);let F=r();return P(F.setTimeType("actual"))}),C(20,13),t(),m(),t(),g(21,Mn,8,1,"sh-menu",55),t()}if(e&2){let n=r();a(2),R("active",n.viewMode()==="list"),a(3),R("active",n.viewMode()==="details"),a(7),p(n.timeType()=="relative"?12:n.timeType()=="actual"?13:14),a(9),p(n.viewMode()==="list"?21:-1)}}function Pn(e,i){if(e&1&&(o(0,"p")(1,"span"),C(2,21),t(),u(3),M(4,"relativeTime"),t()),e&2){let n=r().$implicit,_=r(4);a(3),S(" ",A(4,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function fn(e,i){if(e&1&&(u(0),M(1,"durationFormat")),e&2){let n=r().$implicit,_=r(4);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Dn(e,i){e&1&&(O(0),u(1,"-"),m())}function $n(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Rn(e,i){e&1&&(O(0),u(1,"-"),m())}function An(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function hn(e,i){e&1&&(O(0),u(1,"-"),m())}function Ln(e,i){e&1&&(o(0,"sh-chip",67),C(1,22),t())}function Hn(e,i){e&1&&f(0)}function Gn(e,i){if(e&1&&(o(0,"div",63)(1,"div",48)(2,"h3"),u(3),o(4,"sh-chip"),T(5,"img",64),u(6),t()(),o(7,"p")(8,"span"),C(9,16),t(),u(10),M(11,"relativeTime"),t(),g(12,Pn,5,4,"p"),o(13,"p")(14,"span"),C(15,17),t(),g(16,fn,2,4)(17,Dn,2,0,"ng-container"),t(),o(18,"p")(19,"span"),C(20,18),t(),g(21,$n,2,3)(22,Rn,2,0,"ng-container"),t(),o(23,"p")(24,"span"),C(25,19),t(),g(26,An,2,3)(27,hn,2,0,"ng-container"),t()(),o(28,"div",65)(29,"sh-chip",66),C(30,20),t(),g(31,Ln,2,0,"sh-chip",67),t(),o(32,"div",52),N(33,Hn,1,0,"ng-container",68),t()()),e&2){let n=i.$implicit,_=r(4),F=V(33);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),j),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(4),S(" ",A(11,13,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?12:-1),a(4),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?16:17),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?21:22),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?26:27);let d=_.getBackupVersionCount(n);a(4),h(d)(d),L(30),a(),p(n.Backup.ExternalID?31:-1),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(16,ln,n))}}function xn(e,i){if(e&1&&w(0,Gn,34,18,"div",63,J),e&2){let n=r(3);z(n.backups())}}function kn(e,i){e&1&&(o(0,"div",62),c(1,23),o(2,"button",69),T(3,"sh-icon"),t(),s(),t()),e&2&&(a(2),E("routerLink",U(1,un)))}function yn(e,i){if(e&1&&(o(0,"div",61),g(1,xn,2,0)(2,kn,4,2,"div",62),t()),e&2){let n=r(2);R("fallback",n.backups().length===0),a(),p(n.backups().length?1:2)}}function Bn(e,i){e&1&&(c(0,24,1),f(1),s())}function bn(e,i){e&1&&(c(0,25,1),f(1),s())}function vn(e,i){e&1&&(c(0,26,1),f(1),s())}function Xn(e,i){e&1&&(c(0,27,1),f(1),s())}function Jn(e,i){e&1&&(c(0,28,1),f(1),s())}function wn(e,i){e&1&&(c(0,29,1),f(1),s())}function zn(e,i){e&1&&(c(0,30,1),f(1),s())}function Vn(e,i){if(e&1&&(u(0),M(1,"relativeTime")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," ")}}function Un(e,i){e&1&&(O(0),u(1,"-"),m())}function Kn(e,i){if(e&1&&(u(0),M(1,"relativeTime")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function jn(e,i){e&1&&(O(0),u(1,"-"),m())}function Wn(e,i){if(e&1&&(u(0),M(1,"durationFormat")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function qn(e,i){e&1&&(O(0),u(1,"-"),m())}function Qn(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Yn(e,i){e&1&&(O(0),u(1,"-"),m())}function Zn(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function et(e,i){e&1&&(O(0),u(1,"-"),m())}function nt(e,i){e&1&&f(0)}function tt(e,i){if(e&1&&(o(0,"tr")(1,"td"),u(2),t(),o(3,"td")(4,"sh-chip",80),T(5,"img",64),u(6),t()(),o(7,"td"),g(8,Vn,2,4)(9,Un,2,0,"ng-container"),t(),o(10,"td"),g(11,Kn,2,4)(12,jn,2,0,"ng-container"),t(),o(13,"td"),g(14,Wn,2,4)(15,qn,2,0,"ng-container"),t(),o(16,"td"),g(17,Qn,2,3)(18,Yn,2,0,"ng-container"),t(),o(19,"td"),g(20,Zn,2,3)(21,et,2,0,"ng-container"),t(),o(22,"td")(23,"span"),C(24,33),t()(),o(25,"td"),N(26,nt,1,0,"ng-container",68),t()()),e&2){let n=i.$implicit,_=r(3),F=V(33);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),j),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDate?8:9),a(3),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?11:12),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?14:15),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?17:18),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21);let d=_.getBackupVersionCount(n);a(4),h(d)(d),L(24),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(12,ln,n))}}function it(e,i){if(e&1){let n=H();o(0,"sh-table",70),Ve("sortByColumnChange",function(F){I(n);let d=r(2);return ze(d.sortByColumn,F)||(d.sortByColumn=F),P(F)}),o(1,"tr",71)(2,"th",72),c(3,24),N(4,Bn,2,0,"ng-container",73),s(),t(),o(5,"th",74),c(6,25),N(7,bn,2,0,"ng-container",73),s(),t(),o(8,"th",75),c(9,26),N(10,vn,2,0,"ng-container",73),s(),t(),o(11,"th",76),c(12,27),N(13,Xn,2,0,"ng-container",73),s(),t(),o(14,"th",77),c(15,28),N(16,Jn,2,0,"ng-container",73),s(),t(),o(17,"th",78),c(18,29),N(19,wn,2,0,"ng-container",73),s(),t(),o(20,"th",79),c(21,30),N(22,zn,2,0,"ng-container",73),s(),t(),o(23,"th"),C(24,31),t(),o(25,"th"),C(26,32),t()(),w(27,tt,27,14,"tr",null,J),t()}if(e&2){let n=r(2),_=V(35);E("data",n.backups())("loading",n.backupsLoading()),we("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),z(n.backups())}}function ot(e,i){if(e&1&&g(0,yn,3,3,"div",59)(1,it,29,10,"sh-table",60),e&2){let n=r();p(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function _t(e,i){e&1&&(o(0,"div",81),T(1,"sh-progress-bar",82),o(2,"div",48)(3,"h3"),C(4,34),t()()())}function at(e,i){e&1&&C(0,35,1)}function lt(e,i){e&1&&(o(0,"sh-icon"),u(1,"check"),t())}function rt(e,i){e&1&&(o(0,"sh-icon"),u(1,"dots-three-vertical"),t())}function ct(e,i){if(e&1){let n=H();o(0,"button",83),$("click",function(){let F=I(n).$implicit,d=r();return P(d.startBackup(F.Backup.ID))}),c(1,35),T(2,"sh-icon"),g(3,at,1,0),s(),t(),o(4,"button",84)(5,"sh-icon"),u(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",49),g(9,lt,2,0,"sh-icon")(10,rt,2,0,"sh-icon"),t(),O(11,57),o(12,"h3",85),u(13,"Operations"),t(),o(14,"button",86),c(15,36),T(16,"sh-icon"),s(),t(),o(17,"button",86),c(18,37),T(19,"sh-icon"),s(),t(),o(20,"button",86),c(21,38),T(22,"sh-icon"),s(),t(),T(23,"sh-divider"),o(24,"h3",85),C(25,39),t(),o(26,"button",86),c(27,40),T(28,"sh-icon"),s(),t(),o(29,"button",54),$("click",function(){let F=I(n).$implicit,d=r();return P(d.verifyFiles(F.Backup.ID))}),c(30,41),T(31,"sh-icon"),s(),t(),o(32,"button",54),$("click",function(){let F=I(n).$implicit,d=r();return P(d.compressBackup(F.Backup.ID))}),c(33,42),T(34,"sh-icon"),s(),t(),o(35,"button",86),c(36,43),T(37,"sh-icon"),s(),t(),T(38,"sh-divider"),o(39,"h3",85),C(40,44),t(),o(41,"button",86),c(42,45),T(43,"sh-icon"),s(),t(),m(),t()}if(e&2){let n=i.$implicit,_=r();R("loader",_.startingBackup()===n.Backup.ID),a(3),p(_.viewMode()==="list"?3:-1),a(),E("routerLink",D(15,Fn,n.Backup.ID)),a(4),R("loader",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),p(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",D(17,Cn,n.Backup.ID)),a(3),E("routerLink",D(19,Tn,n.Backup.ID)),a(3),E("routerLink",D(21,En,n.Backup.ID)),a(6),E("routerLink",D(23,dn,n.Backup.ID)),a(9),E("routerLink",D(25,gn,n.Backup.ID)),a(6),E("routerLink",D(27,pn,n.Backup.ID))}}function st(e,i){e&1&&(o(0,"sh-icon",87),u(1,"funnel-simple"),t(),o(2,"sh-icon",88),u(3,"sort-ascending"),t(),o(4,"sh-icon",89),u(5,"sort-descending"),t())}var ut={file:{Display:$localize`Local`,Icon:null}},ne=class e{#n=v(en);#t=v(on);#e=v(tn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=nn("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=Be(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){return i?ee(i).icon??"database":""}getBackendType(i){if(!i)return"";let n=ee(i);if(!n)return"";let _=ut[n.key];if(_?.Display)return _.Display;if(n.key==="s3"){let F="http://null?"+i.split("?")[1],x=new URL(F).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[k,y]of Object.entries(_n))if(x.endsWith(k))return y}return n.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(K(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(K(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["app-home"]],decls:36,vars:6,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Keep your data safe at your chosen destination.`;let _;_=$localize` Create ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restores`;let d;d=$localize`Recover your files from any backup set.`;let x;x=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let k;k=$localize`My backups`;let y;y=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let te;te=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ie;ie=$localize` Time: ${"\uFFFD#11\uFFFD"}:START_TAG_STRONG:${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Relative ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE_IF: Actual ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:3\uFFFD"}:START_BLOCK_ELSE: ${"\uFFFD0:3\uFFFD"}:INTERPOLATION: ${"\uFFFD/*14:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize`Relative time`;let _e;_e=$localize`Actual time`;let ae;ae=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let le;le=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let re;re=$localize`Last successful backup:`;let ce;ce=$localize`Duration:`;let se;se=$localize`Source:`;let ue;ue=$localize`Destination:`;let B;B=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,B=W(B,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Fe;Fe=$localize` ${B}:ICU@@6502601490918455200: `;let Ce;Ce=$localize`Next scheduled run:`;let Te;Te=$localize`Externally managed`;let Ee;Ee=$localize` No backups found ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON: Click to create one now ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let de;de=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Oe;Oe=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let me;me=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ne;Ne=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Me;Me=$localize`Version`;let Ie;Ie=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Pe;Pe=$localize` ${b}:ICU@@3521773141017690117: `;let fe;fe=$localize`Loading backups...`;let De;De=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let $e;$e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let Re;Re=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let Ae;Ae=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let he;he=$localize`Advanced`;let Le;Le=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let He;He=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ge;Ge=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let xe;xe=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let ke;ke=$localize`Reporting`;let ye;return ye=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,n,_,F,d,x,k,y,te,ie,oe,_e,ae,le,re,ce,se,ue,Fe,Ce,Te,Ee,de,ge,pe,Se,Oe,me,Ne,Me,Ie,Pe,fe,De,$e,Re,Ae,he,Le,He,Ge,xe,ke,ye,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small","type-b"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups",3,"fallback"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backups"],[1,"no-backups"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","success"],[1,"simple","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","",1,"primary","raised",3,"routerLink"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["thead",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"small"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){n&1&&(T(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",46),T(4,"img",47),o(5,"div",48)(6,"h3"),C(7,2),t(),o(8,"p"),C(9,3),t()(),o(10,"button",49),c(11,4),T(12,"sh-icon"),s(),t()(),o(13,"sh-card",46),T(14,"img",50),o(15,"div",48)(16,"h3"),C(17,5),t(),o(18,"p"),C(19,6),t()(),o(20,"button",49),c(21,7),T(22,"sh-icon"),s(),t()()(),o(23,"div",51)(24,"h2"),O(25),C(26,8),m(),g(27,In,22,6,"div",52),t(),ve(28,ot,2,1)(29,_t,5,0),Xe(30,28,rn,null,29),t()(),N(32,ct,44,29,"ng-template",null,0,q)(34,st,6,0,"ng-template",null,1,q)),n&2&&(a(3),E("routerLink",U(4,cn)),a(10),E("routerLink",U(5,sn)),a(14),p(_.backups().length>0?27:-1),a(3),Je(!_.backupsLoading()))},dependencies:[Q,an,Ke,Z,Y,We,qe,Qe,Ue],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}sh-menu[_ngcontent-%COMP%]{color:red}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backups.fallback[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:4rem;border:1px solid var(--base-4);background:var(--base-2);border-radius:var(--shape-2);width:calc(100% - 4rem);margin:0 auto}.no-backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{ne as default};
1
+ import{b as ee,k as _n}from"./chunk-IW4RDAIN.js";import{a as an}from"./chunk-WCWS2RR4.js";import{a as on}from"./chunk-KQZOP4RB.js";import"./chunk-FOQJA6X2.js";import"./chunk-VHOAXFIJ.js";import{a as tn}from"./chunk-FQYISTFE.js";import"./chunk-6Q6SSTBK.js";import"./chunk-FK7JFD5B.js";import"./chunk-S3WJSEPC.js";import"./chunk-ME77WZZI.js";import"./chunk-5DJAX2HH.js";import{a as nn}from"./chunk-WVF3GRDZ.js";import"./chunk-A7L3WODV.js";import"./chunk-DW332N2S.js";import"./chunk-2BESFS3R.js";import"./chunk-TELPJYLN.js";import"./chunk-4RKO4YFU.js";import{A as Ue,B as Z,C as Ke,E as je,G as We,K as qe,L as Qe,S as Ye,T as Ze,u as Y}from"./chunk-HPNLQHW6.js";import{c as en}from"./chunk-BGTK25UG.js";import{e as Q}from"./chunk-A4LPGPDU.js";import"./chunk-PKPBSTZA.js";import"./chunk-QPTSKQZ2.js";import"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{$ as I,Ab as t,Bb as T,Cc as M,Dc as G,E as K,Ec as A,Fb as O,Gb as m,Gc as q,Hb as f,Ib as H,Ma as j,Pa as a,Pb as c,Qb as s,Rb as C,Sb as h,Tb as L,Ub as W,Vb as $,W as v,Xb as r,aa as P,cb as be,ec as V,gc as R,hb as N,ib as ve,jc as u,la as X,lc as S,na as Be,oc as we,pb as Xe,pc as ze,qb as Je,qc as Ve,sb as g,tb as p,ub as J,wb as w,xb as z,xc as U,yb as E,yc as D,zb as o}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var rn=()=>[Q,import("./chunk-6GC4UPHS.js").then(e=>e.NgTemplateOutlet),Z,Y,je,Ze,Ye,import("./chunk-2PAQOFN3.js").then(e=>e.DurationFormatPipe),import("./chunk-2XXH473G.js").then(e=>e.BytesPipe),import("./chunk-YDDSLDHZ.js").then(e=>e.RelativeTimePipe)],cn=()=>["/add-backup"],sn=()=>["/restore"],ln=e=>({$implicit:e}),un=()=>["/backup/new"],Fn=e=>["/backup",e],Cn=e=>["/restore",e],Tn=e=>["/backup",e,"export"],En=e=>["/backup",e,"delete"],dn=e=>["/backup",e,"database"],gn=e=>["/backup",e,"commandline"],pn=e=>["/backup",e,"log"];function Sn(e,i){e&1&&C(0,11,1)}function On(e,i){e&1&&C(0,11,2)}function mn(e,i){if(e&1&&C(0,11,3),e&2){let n=r(2);h(n.timeType()),L(0)}}function Nn(e,i){if(e&1){let n=H();o(0,"button",54),$("click",function(){let F=I(n).$implicit,d=r(3);return P(d.sortByColumn.set(F.value))}),C(1,15),t()}if(e&2){let n=i.$implicit,_=r(3);R("active",_.orderBy()===n.value),a(),h(n.label),L(1)}}function Mn(e,i){if(e&1&&(o(0,"sh-menu",55)(1,"button",56),c(2,14),T(3,"strong")(4,"sh-icon"),s(),t(),O(5,57),w(6,Nn,2,3,"button",58,J),m(),t()),e&2){let n=r(2);a(4),h(n.orderBy()),L(2),a(2),z(n.sortOrderOptions())}}function In(e,i){if(e&1){let n=H();o(0,"div",52)(1,"sh-button-group",53)(2,"button",54),$("click",function(){I(n);let F=r();return P(F.viewMode.set("list"))}),c(3,9),T(4,"sh-icon"),s(),t(),o(5,"button",54),$("click",function(){I(n);let F=r();return P(F.viewMode.set("details"))}),c(6,10),T(7,"sh-icon"),s(),t()(),o(8,"sh-menu",55)(9,"button",56),c(10,11),o(11,"strong"),g(12,Sn,1,0)(13,On,1,0)(14,mn,1,1),t(),T(15,"sh-icon"),s(),t(),O(16,57),o(17,"button",54),$("click",function(){I(n);let F=r();return P(F.setTimeType("relative"))}),C(18,12),t(),o(19,"button",54),$("click",function(){I(n);let F=r();return P(F.setTimeType("actual"))}),C(20,13),t(),m(),t(),g(21,Mn,8,1,"sh-menu",55),t()}if(e&2){let n=r();a(2),R("active",n.viewMode()==="list"),a(3),R("active",n.viewMode()==="details"),a(7),p(n.timeType()=="relative"?12:n.timeType()=="actual"?13:14),a(9),p(n.viewMode()==="list"?21:-1)}}function Pn(e,i){if(e&1&&(o(0,"p")(1,"span"),C(2,21),t(),u(3),M(4,"relativeTime"),t()),e&2){let n=r().$implicit,_=r(4);a(3),S(" ",A(4,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function fn(e,i){if(e&1&&(u(0),M(1,"durationFormat")),e&2){let n=r().$implicit,_=r(4);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function Dn(e,i){e&1&&(O(0),u(1,"-"),m())}function $n(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Rn(e,i){e&1&&(O(0),u(1,"-"),m())}function An(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function hn(e,i){e&1&&(O(0),u(1,"-"),m())}function Ln(e,i){e&1&&(o(0,"sh-chip",67),C(1,22),t())}function Hn(e,i){e&1&&f(0)}function Gn(e,i){if(e&1&&(o(0,"div",63)(1,"div",48)(2,"h3"),u(3),o(4,"sh-chip"),T(5,"img",64),u(6),t()(),o(7,"p")(8,"span"),C(9,16),t(),u(10),M(11,"relativeTime"),t(),g(12,Pn,5,4,"p"),o(13,"p")(14,"span"),C(15,17),t(),g(16,fn,2,4)(17,Dn,2,0,"ng-container"),t(),o(18,"p")(19,"span"),C(20,18),t(),g(21,$n,2,3)(22,Rn,2,0,"ng-container"),t(),o(23,"p")(24,"span"),C(25,19),t(),g(26,An,2,3)(27,hn,2,0,"ng-container"),t()(),o(28,"div",65)(29,"sh-chip",66),C(30,20),t(),g(31,Ln,2,0,"sh-chip",67),t(),o(32,"div",52),N(33,Hn,1,0,"ng-container",68),t()()),e&2){let n=i.$implicit,_=r(4),F=V(33);a(3),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(2),E("src",_.getBackendIcon(n.Backup.TargetURL),j),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(4),S(" ",A(11,13,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupFinished,_.timeType()==="actual")," "),a(2),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?12:-1),a(4),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?16:17),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?21:22),a(5),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?26:27);let d=_.getBackupVersionCount(n);a(4),h(d)(d),L(30),a(),p(n.Backup.ExternalID?31:-1),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(16,ln,n))}}function xn(e,i){if(e&1&&w(0,Gn,34,18,"div",63,J),e&2){let n=r(3);z(n.backups())}}function kn(e,i){e&1&&(o(0,"div",62),c(1,23),o(2,"button",69),T(3,"sh-icon"),t(),s(),t()),e&2&&(a(2),E("routerLink",U(1,un)))}function yn(e,i){if(e&1&&(o(0,"div",61),g(1,xn,2,0)(2,kn,4,2,"div",62),t()),e&2){let n=r(2);R("fallback",n.backups().length===0),a(),p(n.backups().length?1:2)}}function Bn(e,i){e&1&&(c(0,24,1),f(1),s())}function bn(e,i){e&1&&(c(0,25,1),f(1),s())}function vn(e,i){e&1&&(c(0,26,1),f(1),s())}function Xn(e,i){e&1&&(c(0,27,1),f(1),s())}function Jn(e,i){e&1&&(c(0,28,1),f(1),s())}function wn(e,i){e&1&&(c(0,29,1),f(1),s())}function zn(e,i){e&1&&(c(0,30,1),f(1),s())}function Vn(e,i){if(e&1&&(u(0),M(1,"relativeTime")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,_.timeType()==="actual")," ")}}function Un(e,i){e&1&&(O(0),u(1,"-"),m())}function Kn(e,i){if(e&1&&(u(0),M(1,"relativeTime")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Schedule.Time,_.timeType()==="actual")," ")}}function jn(e,i){e&1&&(O(0),u(1,"-"),m())}function Wn(e,i){if(e&1&&(u(0),M(1,"durationFormat")),e&2){let n=r().$implicit,_=r(3);S(" ",A(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration,_.timeType()==="actual")," ")}}function qn(e,i){e&1&&(O(0),u(1,"-"),m())}function Qn(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.SourceFilesSize)," ")}}function Yn(e,i){e&1&&(O(0),u(1,"-"),m())}function Zn(e,i){if(e&1&&(u(0),M(1,"bytes")),e&2){let n=r().$implicit;S(" ",G(1,1,n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFilesSize)," ")}}function et(e,i){e&1&&(O(0),u(1,"-"),m())}function nt(e,i){e&1&&f(0)}function tt(e,i){if(e&1&&(o(0,"tr")(1,"td"),u(2),t(),o(3,"td")(4,"sh-chip",80),T(5,"img",64),u(6),t()(),o(7,"td"),g(8,Vn,2,4)(9,Un,2,0,"ng-container"),t(),o(10,"td"),g(11,Kn,2,4)(12,jn,2,0,"ng-container"),t(),o(13,"td"),g(14,Wn,2,4)(15,qn,2,0,"ng-container"),t(),o(16,"td"),g(17,Qn,2,3)(18,Yn,2,0,"ng-container"),t(),o(19,"td"),g(20,Zn,2,3)(21,et,2,0,"ng-container"),t(),o(22,"td")(23,"span"),C(24,33),t()(),o(25,"td"),N(26,nt,1,0,"ng-container",68),t()()),e&2){let n=i.$implicit,_=r(3),F=V(33);a(2),S(" ",n.Backup.Name??_.MISSING_BACKUP_NAME," "),a(3),E("src",_.getBackendIcon(n.Backup.TargetURL),j),a(),S(" ",_.getBackendType(n.Backup.TargetURL)," "),a(2),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDate?8:9),a(3),p(!(n==null||n.Schedule==null)&&n.Schedule.Time?11:12),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?14:15),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?17:18),a(3),p(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?20:21);let d=_.getBackupVersionCount(n);a(4),h(d)(d),L(24),a(2),E("ngTemplateOutlet",F)("ngTemplateOutletContext",D(12,ln,n))}}function it(e,i){if(e&1){let n=H();o(0,"sh-table",70),Ve("sortByColumnChange",function(F){I(n);let d=r(2);return ze(d.sortByColumn,F)||(d.sortByColumn=F),P(F)}),o(1,"tr",71)(2,"th",72),c(3,24),N(4,Bn,2,0,"ng-container",73),s(),t(),o(5,"th",74),c(6,25),N(7,bn,2,0,"ng-container",73),s(),t(),o(8,"th",75),c(9,26),N(10,vn,2,0,"ng-container",73),s(),t(),o(11,"th",76),c(12,27),N(13,Xn,2,0,"ng-container",73),s(),t(),o(14,"th",77),c(15,28),N(16,Jn,2,0,"ng-container",73),s(),t(),o(17,"th",78),c(18,29),N(19,wn,2,0,"ng-container",73),s(),t(),o(20,"th",79),c(21,30),N(22,zn,2,0,"ng-container",73),s(),t(),o(23,"th"),C(24,31),t(),o(25,"th"),C(26,32),t()(),w(27,tt,27,14,"tr",null,J),t()}if(e&2){let n=r(2),_=V(35);E("data",n.backups())("loading",n.backupsLoading()),we("sortByColumn",n.sortByColumn),a(4),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(3),E("ngTemplateOutlet",_),a(5),z(n.backups())}}function ot(e,i){if(e&1&&g(0,yn,3,3,"div",59)(1,it,29,10,"sh-table",60),e&2){let n=r();p(n.viewMode()==="list"?0:n.viewMode()==="details"?1:-1)}}function _t(e,i){e&1&&(o(0,"div",81),T(1,"sh-progress-bar",82),o(2,"div",48)(3,"h3"),C(4,34),t()()())}function at(e,i){e&1&&C(0,35,1)}function lt(e,i){e&1&&(o(0,"sh-icon"),u(1,"check"),t())}function rt(e,i){e&1&&(o(0,"sh-icon"),u(1,"dots-three-vertical"),t())}function ct(e,i){if(e&1){let n=H();o(0,"button",83),$("click",function(){let F=I(n).$implicit,d=r();return P(d.startBackup(F.Backup.ID))}),c(1,35),T(2,"sh-icon"),g(3,at,1,0),s(),t(),o(4,"button",84)(5,"sh-icon"),u(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",49),g(9,lt,2,0,"sh-icon")(10,rt,2,0,"sh-icon"),t(),O(11,57),o(12,"h3",85),u(13,"Operations"),t(),o(14,"button",86),c(15,36),T(16,"sh-icon"),s(),t(),o(17,"button",86),c(18,37),T(19,"sh-icon"),s(),t(),o(20,"button",86),c(21,38),T(22,"sh-icon"),s(),t(),T(23,"sh-divider"),o(24,"h3",85),C(25,39),t(),o(26,"button",86),c(27,40),T(28,"sh-icon"),s(),t(),o(29,"button",54),$("click",function(){let F=I(n).$implicit,d=r();return P(d.verifyFiles(F.Backup.ID))}),c(30,41),T(31,"sh-icon"),s(),t(),o(32,"button",54),$("click",function(){let F=I(n).$implicit,d=r();return P(d.compressBackup(F.Backup.ID))}),c(33,42),T(34,"sh-icon"),s(),t(),o(35,"button",86),c(36,43),T(37,"sh-icon"),s(),t(),T(38,"sh-divider"),o(39,"h3",85),C(40,44),t(),o(41,"button",86),c(42,45),T(43,"sh-icon"),s(),t(),m(),t()}if(e&2){let n=i.$implicit,_=r();R("loader",_.startingBackup()===n.Backup.ID),a(3),p(_.viewMode()==="list"?3:-1),a(),E("routerLink",D(15,Fn,n.Backup.ID)),a(4),R("loader",_.loadingId()===n.Backup.ID)("success",_.successId()===n.Backup.ID),a(),p(_.successId()===n.Backup.ID?9:10),a(5),E("routerLink",D(17,Cn,n.Backup.ID)),a(3),E("routerLink",D(19,Tn,n.Backup.ID)),a(3),E("routerLink",D(21,En,n.Backup.ID)),a(6),E("routerLink",D(23,dn,n.Backup.ID)),a(9),E("routerLink",D(25,gn,n.Backup.ID)),a(6),E("routerLink",D(27,pn,n.Backup.ID))}}function st(e,i){e&1&&(o(0,"sh-icon",87),u(1,"funnel-simple"),t(),o(2,"sh-icon",88),u(3,"sort-ascending"),t(),o(4,"sh-icon",89),u(5,"sort-descending"),t())}var ut={file:{Display:$localize`Local`,Icon:null}},ne=class e{#n=v(en);#t=v(on);#e=v(tn);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=nn("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=Be(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){return i?ee(i).icon??"database":""}getBackendType(i){if(!i)return"";let n=ee(i);if(!n)return"";let _=ut[n.key];if(_?.Display)return _.Display;if(n.key==="s3"){let F="http://null?"+i.split("?")[1],x=new URL(F).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[k,y]of Object.entries(_n))if(x.endsWith(k))return y}return n.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(K(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(K(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["app-home"]],decls:36,vars:6,consts:()=>{let i;i=$localize`Backups`;let n;n=$localize`Keep your data safe at your chosen destination.`;let _;_=$localize` Create ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let F;F=$localize`Restores`;let d;d=$localize`Recover your files from any backup set.`;let x;x=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let k;k=$localize`My backups`;let y;y=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let te;te=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ie;ie=$localize` Time: ${"\uFFFD#11\uFFFD"}:START_TAG_STRONG:${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Relative ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE_IF: Actual ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:3\uFFFD"}:START_BLOCK_ELSE: ${"\uFFFD0:3\uFFFD"}:INTERPOLATION: ${"\uFFFD/*14:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize`Relative time`;let _e;_e=$localize`Actual time`;let ae;ae=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let le;le=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let re;re=$localize`Last successful backup:`;let ce;ce=$localize`Duration:`;let se;se=$localize`Source:`;let ue;ue=$localize`Destination:`;let B;B=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,B=W(B,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Fe;Fe=$localize` ${B}:ICU@@6502601490918455200: `;let Ce;Ce=$localize`Next scheduled run:`;let Te;Te=$localize`Externally managed`;let Ee;Ee=$localize` No backups found ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON: Click to create one now ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let de;de=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Oe;Oe=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let me;me=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ne;Ne=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Me;Me=$localize`Version`;let Ie;Ie=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Pe;Pe=$localize` ${b}:ICU@@3521773141017690117: `;let fe;fe=$localize`Loading backups...`;let De;De=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let $e;$e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let Re;Re=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let Ae;Ae=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let he;he=$localize`Advanced`;let Le;Le=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let He;He=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ge;Ge=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let xe;xe=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let ke;ke=$localize`Reporting`;let ye;return ye=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,n,_,F,d,x,k,y,te,ie,oe,_e,ae,le,re,ce,se,ue,Fe,Ce,Te,Ee,de,ge,pe,Se,Oe,me,Ne,Me,Ie,Pe,fe,De,$e,Re,Ae,he,Le,He,Ge,xe,ke,ye,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small","type-b"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups",3,"fallback"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backups"],[1,"no-backups"],[1,"backup"],["alt","",1,"provider-icon",3,"src"],[1,"tags"],[1,"simple","success"],[1,"simple","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","",1,"primary","raised",3,"routerLink"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["thead",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"small"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(n,_){n&1&&(T(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",46),T(4,"img",47),o(5,"div",48)(6,"h3"),C(7,2),t(),o(8,"p"),C(9,3),t()(),o(10,"button",49),c(11,4),T(12,"sh-icon"),s(),t()(),o(13,"sh-card",46),T(14,"img",50),o(15,"div",48)(16,"h3"),C(17,5),t(),o(18,"p"),C(19,6),t()(),o(20,"button",49),c(21,7),T(22,"sh-icon"),s(),t()()(),o(23,"div",51)(24,"h2"),O(25),C(26,8),m(),g(27,In,22,6,"div",52),t(),ve(28,ot,2,1)(29,_t,5,0),Xe(30,28,rn,null,29),t()(),N(32,ct,44,29,"ng-template",null,0,q)(34,st,6,0,"ng-template",null,1,q)),n&2&&(a(3),E("routerLink",U(4,cn)),a(10),E("routerLink",U(5,sn)),a(14),p(_.backups().length>0?27:-1),a(3),Je(!_.backupsLoading()))},dependencies:[Q,an,Ke,Z,Y,We,qe,Qe,Ue],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}sh-menu[_ngcontent-%COMP%]{color:red}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backups.fallback[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:4rem;border:1px solid var(--base-4);background:var(--base-2);border-radius:var(--shape-2);width:calc(100% - 4rem);margin:0 auto}.no-backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.backup[_ngcontent-%COMP%] .tags[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:.5rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{ne as default};
package/index.html CHANGED
@@ -124,5 +124,5 @@
124
124
  <body>
125
125
  <app-root></app-root>
126
126
  <div class="loading">Connecting ...</div>
127
- <link rel="modulepreload" href="chunk-VEWX3KXN.js"><link rel="modulepreload" href="chunk-EXFIQK72.js"><link rel="modulepreload" href="chunk-KRXQDBGB.js"><link rel="modulepreload" href="chunk-UFTPS2J6.js"><link rel="modulepreload" href="chunk-FOQJA6X2.js"><link rel="modulepreload" href="chunk-VHOAXFIJ.js"><link rel="modulepreload" href="chunk-HRCZ5SXI.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-FK7JFD5B.js"><link rel="modulepreload" href="chunk-5DJAX2HH.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-BV7ROS25.js" type="module"></script></body>
127
+ <link rel="modulepreload" href="chunk-VEWX3KXN.js"><link rel="modulepreload" href="chunk-BVZQOBR2.js"><link rel="modulepreload" href="chunk-KRXQDBGB.js"><link rel="modulepreload" href="chunk-KQZOP4RB.js"><link rel="modulepreload" href="chunk-FOQJA6X2.js"><link rel="modulepreload" href="chunk-VHOAXFIJ.js"><link rel="modulepreload" href="chunk-FQYISTFE.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-FK7JFD5B.js"><link rel="modulepreload" href="chunk-5DJAX2HH.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-XAXRNMI2.js" type="module"></script></body>
128
128
  </html>
@@ -1 +1 @@
1
- import{b as Ie,c as ke}from"./chunk-VEWX3KXN.js";import{a as we}from"./chunk-EXFIQK72.js";import{a as Me}from"./chunk-KRXQDBGB.js";import{a as I}from"./chunk-UFTPS2J6.js";import{a as Ee}from"./chunk-FOQJA6X2.js";import{b as Te}from"./chunk-VHOAXFIJ.js";import"./chunk-HRCZ5SXI.js";import{a as H}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-WVF3GRDZ.js";import"./chunk-B2VS7Z6E.js";import{a as P}from"./chunk-TELPJYLN.js";import{a as h,b as ye,c as S,d as Re,e as M}from"./chunk-4RKO4YFU.js";import{v as be,x as Ce}from"./chunk-HPNLQHW6.js";import{a as ge,d as ve}from"./chunk-BGTK25UG.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-A4LPGPDU.js";import{a as ne}from"./chunk-PKPBSTZA.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-QPTSKQZ2.js";import{fa as te,ka as oe}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Bb as Y,E,I as J,Ic as Z,Jc as ee,K as w,M as K,R as v,U as _,W as s,cb as Q,da as q,ea as z,f as F,g as W,l as $,la as d,m as G,na as X,p as R,y as L,z as B}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#a=s(S);ngOnInit(){ye(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),E(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(M);return e.token()?!0:e.checkProxyAuthed().pipe(w(t=>t?$(!0):e.refreshToken().pipe(R(()=>!0))))},je=()=>{let e=s(S),t=s(I),o=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(P).preload(!0),o.get(P).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?L(a).pipe(R(()=>n)):e.configLoaded?.pipe(w(()=>L(a)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-ZTDAMLNP.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-43HR5ZDT.js")},{path:"logout",loadComponent:()=>import("./chunk-IQ3RNWGH.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-ZXVCNNR6.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-YYSJESAX.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-OITOOW5H.js"),children:[{path:"",loadComponent:()=>import("./chunk-NF4VR5PI.js")},Ne,{path:"add-backup",loadComponent:()=>import("./chunk-HO5WBGKU.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-DUIZM4ZO.js")},{path:"backup/import",loadComponent:()=>import("./chunk-H5XAYRQ6.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-4YC2YMYH.js"),loadChildren:()=>import("./chunk-A4RSARWN.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-4YC2YMYH.js"),loadChildren:()=>import("./chunk-A4RSARWN.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QEE2RRQ4.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-P3AUEHHI.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-MM36XELZ.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-JNMQJO3U.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-67Q6QMQY.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-UAMORY54.js")},{path:"from-config",loadComponent:()=>import("./chunk-FQZFKTPW.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-5LYRKTAV.js"),loadChildren:()=>import("./chunk-CGQ2WKCU.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-5LYRKTAV.js"),loadChildren:()=>import("./chunk-CGQ2WKCU.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-5LYRKTAV.js"),loadChildren:()=>import("./chunk-CGQ2WKCU.js")},{path:"settings",loadComponent:()=>import("./chunk-QKYDZL4G.js")},{path:"about",loadComponent:()=>import("./chunk-67L5H6HO.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-WA53HHVH.js")},{path:"changelog",loadComponent:()=>import("./chunk-T7WSF7RL.js")},{path:"libraries",loadComponent:()=>import("./chunk-B2Y54P3R.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFR3XMV4.js")},{path:"server-settings",loadComponent:()=>import("./chunk-V42KLXW4.js")},{path:"logs",loadChildren:()=>import("./chunk-MRAKGZE6.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-7XS6T6TX.js")}]}]}]}]}]}];var V=null,xe=(e,t)=>{let o=s(M),n=s(me),a=s(h),p=s(f),i=a.getItem("locale"),u=s(Ce),c=Ie(i),r=ge.BASE||"",m=e.url===`${r}/api/v1/auth/login`,y=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,C=e.url===`${r}/api/v1/remoteoperation/test`,T=e.url===`${r}/api/v1/filesystem/validate`,Ve=e.url.startsWith(`${r}/api/v2/`),x=o.token(),U=e,j=e.headers.has("custom-proxy-check")||x===Re;if(x&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${x}`);i&&i!=="en-US"&&(l=l.set("X-Ui-Language",c)),U=e.clone({headers:l})}return t(U).pipe(R(l=>{if(l.type===4&&l.status===200&&Ve){let g=l.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return l}),B(l=>{let g=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;return!j&&(b&&l.status===404||C||T||u.error(g),y&&l.status===401&&(o.logout(),n.navigate(["/logout"])),!m&&!y&&l.status===401)?(V??=o.refreshToken().pipe(J()),V.pipe(w(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),E(()=>V=null))):G(()=>({error:l,message:g}))}))};var N=class e{#e=s(z);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${H()}`,Ge=1,O=class e{#e=1e3;#a=s(f);#d=s(N);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=X(()=>{let t=this.#p(),o=this.#u(),n=this.#c();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#c.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let c={token:t,publicKey:"",clientVersion:$e,protocolVersion:Ge},r=this.createResponse(i,"authportal",c);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let c=this.#l.pop();c&&this.#r[c.messageId]&&this.activateCommand(c)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let c=this.#r[i.messageId];if(c){if(i.errorMessage)this.#i(i.errorMessage),c.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),c.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(c.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Le,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((c,r)=>{let m=H(),b={from:Le,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},C={resolve:c,reject:r,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),T.reject("Timeout"))},u)};this.#r[m]=C,this.#n()?this.activateCommand(b):this.#l.push(b)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Pe(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Be(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let c=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new F(r=>{c.then(m=>{let y=new re;p!=null&&Object.keys(p).forEach(C=>{y.set(C,p[C])});let b=new se({body:m.body,status:m.statusCode,statusText:"OK",headers:y});r.next(b),r.complete()}).catch(m=>{r.error(new ie({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var He=(e,t)=>{let o={relayconfigState:s(S),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new W;return o.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(o,e,t).subscribe(a)}),a}return Pe(o,e,t)};var De={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Ee,Me]};ne(k,De);
1
+ import{b as Ie,c as ke}from"./chunk-VEWX3KXN.js";import{a as we}from"./chunk-BVZQOBR2.js";import{a as Me}from"./chunk-KRXQDBGB.js";import{a as I}from"./chunk-KQZOP4RB.js";import{a as Ee}from"./chunk-FOQJA6X2.js";import{b as Te}from"./chunk-VHOAXFIJ.js";import"./chunk-FQYISTFE.js";import{a as H}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-WVF3GRDZ.js";import"./chunk-2BESFS3R.js";import{a as P}from"./chunk-TELPJYLN.js";import{a as h,b as ye,c as S,d as Re,e as M}from"./chunk-4RKO4YFU.js";import{v as be,x as Ce}from"./chunk-HPNLQHW6.js";import{a as ge,d as ve}from"./chunk-BGTK25UG.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-A4LPGPDU.js";import{a as ne}from"./chunk-PKPBSTZA.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-QPTSKQZ2.js";import{fa as te,ka as oe}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Bb as Y,E,I as J,Ic as Z,Jc as ee,K as w,M as K,R as v,U as _,W as s,cb as Q,da as q,ea as z,f as F,g as W,l as $,la as d,m as G,na as X,p as R,y as L,z as B}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#a=s(S);ngOnInit(){ye(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),E(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(M);return e.token()?!0:e.checkProxyAuthed().pipe(w(t=>t?$(!0):e.refreshToken().pipe(R(()=>!0))))},je=()=>{let e=s(S),t=s(I),o=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(P).preload(!0),o.get(P).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?L(a).pipe(R(()=>n)):e.configLoaded?.pipe(w(()=>L(a)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-NEX3Y4KL.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-43HR5ZDT.js")},{path:"logout",loadComponent:()=>import("./chunk-IQ3RNWGH.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-ZXVCNNR6.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-V62OY3LJ.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-RFT6ZTG4.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZXRAR57U.js")},Ne,{path:"add-backup",loadComponent:()=>import("./chunk-2W6XI6OD.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-3BVUZQ2W.js")},{path:"backup/import",loadComponent:()=>import("./chunk-ECH7KK6F.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-Z7C6KFII.js"),loadChildren:()=>import("./chunk-3UO7V7AP.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-Z7C6KFII.js"),loadChildren:()=>import("./chunk-3UO7V7AP.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-JI7ARQNM.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-JMCI2QBN.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-FV7RT2H4.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-DIXZE5G2.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-EUZ4VJML.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-P6MBY2GF.js")},{path:"from-config",loadComponent:()=>import("./chunk-FQZFKTPW.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-7OTMSVOF.js"),loadChildren:()=>import("./chunk-WYRWZHVI.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-7OTMSVOF.js"),loadChildren:()=>import("./chunk-WYRWZHVI.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-7OTMSVOF.js"),loadChildren:()=>import("./chunk-WYRWZHVI.js")},{path:"settings",loadComponent:()=>import("./chunk-CTQZOZYH.js")},{path:"about",loadComponent:()=>import("./chunk-TJWJCLW2.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-CHEYOD6Q.js")},{path:"changelog",loadComponent:()=>import("./chunk-T7WSF7RL.js")},{path:"libraries",loadComponent:()=>import("./chunk-B2Y54P3R.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFR3XMV4.js")},{path:"server-settings",loadComponent:()=>import("./chunk-A24PQP5X.js")},{path:"logs",loadChildren:()=>import("./chunk-MRAKGZE6.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-7XS6T6TX.js")}]}]}]}]}]}];var V=null,xe=(e,t)=>{let o=s(M),n=s(me),a=s(h),p=s(f),i=a.getItem("locale"),u=s(Ce),c=Ie(i),r=ge.BASE||"",m=e.url===`${r}/api/v1/auth/login`,y=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,C=e.url===`${r}/api/v1/remoteoperation/test`,T=e.url===`${r}/api/v1/filesystem/validate`,Ve=e.url.startsWith(`${r}/api/v2/`),x=o.token(),U=e,j=e.headers.has("custom-proxy-check")||x===Re;if(x&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${x}`);i&&i!=="en-US"&&(l=l.set("X-Ui-Language",c)),U=e.clone({headers:l})}return t(U).pipe(R(l=>{if(l.type===4&&l.status===200&&Ve){let g=l.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return l}),B(l=>{let g=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;return!j&&(b&&l.status===404||C||T||u.error(g),y&&l.status===401&&(o.logout(),n.navigate(["/logout"])),!m&&!y&&l.status===401)?(V??=o.refreshToken().pipe(J()),V.pipe(w(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),E(()=>V=null))):G(()=>({error:l,message:g}))}))};var N=class e{#e=s(z);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${H()}`,Ge=1,O=class e{#e=1e3;#a=s(f);#d=s(N);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=X(()=>{let t=this.#p(),o=this.#u(),n=this.#c();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#c.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let c={token:t,publicKey:"",clientVersion:$e,protocolVersion:Ge},r=this.createResponse(i,"authportal",c);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let c=this.#l.pop();c&&this.#r[c.messageId]&&this.activateCommand(c)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let c=this.#r[i.messageId];if(c){if(i.errorMessage)this.#i(i.errorMessage),c.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),c.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(c.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Le,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((c,r)=>{let m=H(),b={from:Le,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},C={resolve:c,reject:r,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),T.reject("Timeout"))},u)};this.#r[m]=C,this.#n()?this.activateCommand(b):this.#l.push(b)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=v({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Pe(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Be(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let c=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new F(r=>{c.then(m=>{let y=new re;p!=null&&Object.keys(p).forEach(C=>{y.set(C,p[C])});let b=new se({body:m.body,status:m.statusCode,statusText:"OK",headers:y});r.next(b),r.complete()}).catch(m=>{r.error(new ie({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var He=(e,t)=>{let o={relayconfigState:s(S),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new W;return o.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(o,e,t).subscribe(a)}),a}return Pe(o,e,t)};var De={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Ee,Me]};ne(k,De);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.185",
2
+ "version": "0.0.186",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-A4RSARWN.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-RD5JFFHQ.js")},{path:"destination",loadComponent:()=>import("./chunk-QT7EG3ZF.js")},{path:"source-data",loadComponent:()=>import("./chunk-EBSK6KZQ.js")},{path:"schedule",loadComponent:()=>import("./chunk-XUPDFNDB.js")},{path:"options",loadComponent:()=>import("./chunk-AV5KKRMA.js")}];export{o as default};
package/chunk-B2VS7Z6E.js DELETED
@@ -1 +0,0 @@
1
- import{a as v}from"./chunk-TELPJYLN.js";import{c as j,e as x}from"./chunk-4RKO4YFU.js";import{z as m}from"./chunk-HPNLQHW6.js";import{a as $,c as b}from"./chunk-BGTK25UG.js";import{ka as L}from"./chunk-OTPG7USH.js";import{Cb as N,Cc as G,Db as y,Eb as I,Ec as W,L as E,Mc as p,Pa as R,Pb as _,Qb as A,R as h,Rb as w,Sb as P,Tb as F,W as c,cb as M,f,g as k,la as n,na as O}from"./chunk-T2WO6CVD.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=O(()=>{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=M({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"),w(2,0),y()(),N(3,"div",3)(4,"p"),_(5,1),I(6,"strong"),G(7,"number"),A(),y()()),t&2&&(R(7),P(W(7,1,s.countdown(),"2.0-0")),F(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var D=class r{dialog=c(m);#e=c(b);#i=n("disconnected");#s=n(null);#t=n(-1);#r=n(0);#l=n(!1);#u=new k;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 k,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(E(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,a=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(a),setTimeout(()=>{this.#c()},a)}})}#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,T=class r{#e=c(x);#i=c(v);dialog=c(m);#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 f(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 a=window.location.hostname,g=$.BASE||"",J=this.#i.hasWebSocketAuth()?`${t}//${a}${s}${g}/notifications`:`${t}//${a}${s}${g}/notifications?token=${e}`;this.#t.set("connecting"),this.#s=new WebSocket(J),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}))):this.#S()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let o=JSON.parse(d.data);o.Success?(u&&console.log("WebSocket authentication successful"),this.#S()):(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),l=o?.Type;if(l==="legacystatus"||l==null)u&&console.log("Received legacy status update:",o),this.#r.set(o);else if(l==="reply"){let i=o;i.Success||console.error("WebSocket reply error:",i.Message)}else if(l==="progress"){let i=o;u&&console.log("Received progress update:",i.Data),this.#l.set(i.Data)}else if(l==="serversettings"){let i=o;u&&console.log("Received server settings update:",i.Data),this.#u.set(i.Data)}else if(l==="taskqueue"){let i=o;u&&console.log("Received task update:",i.Data),this.#o.set(i.Data)}else if(l==="taskcompleted"){let i=o;u&&console.log("Received task completed:",i.Data),this.#h?.next(i.Data)}else if(l==="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:",l)}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:l=>{console.error("Error refreshing token",l)}}),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(),a=s[e];(!a||JSON.stringify(a)!==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 q=10,V=class r{#e=c(T);#i=c(D);#s=c(b);#t=c(v);#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>q&&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 f(t=>{let s=this.#n.find(a=>a.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>q&&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{T as a,V as b};