@duplicati/ngclient 0.0.159 → 0.0.160
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.
- package/{chunk-BQJICFF5.js → chunk-2J4H7C6W.js} +1 -1
- package/{chunk-2ZGJS4OW.js → chunk-4OBQWIWP.js} +1 -1
- package/{chunk-QNM5CG4Z.js → chunk-4XH2XMUL.js} +1 -1
- package/{chunk-KT7U3QIP.js → chunk-5EOS64VG.js} +1 -1
- package/{chunk-MGTRQOF6.js → chunk-66TRUOH6.js} +1 -1
- package/{chunk-VXRNST6C.js → chunk-7RM3VKDO.js} +1 -1
- package/{chunk-U2Y2D6MA.js → chunk-DQGMVICD.js} +1 -1
- package/{chunk-KAAYNQ7L.js → chunk-DUHMJQLC.js} +1 -1
- package/{chunk-2WGW24ZH.js → chunk-EKL66TNH.js} +1 -1
- package/{chunk-D6KZSKI7.js → chunk-ERFIISF6.js} +1 -1
- package/{chunk-XUIDYG2O.js → chunk-EWLAEWGN.js} +1 -1
- package/{chunk-PQSZLHZR.js → chunk-GNKFIYOX.js} +1 -1
- package/chunk-GZ4YKLCY.js +1 -0
- package/{chunk-4IIDZXFC.js → chunk-IXN3WMCO.js} +1 -1
- package/{chunk-XX3WLO55.js → chunk-JTSI7UN4.js} +1 -1
- package/chunk-K6V2N3GS.js +1 -0
- package/{chunk-K3ILN56U.js → chunk-KATY4JFV.js} +1 -1
- package/chunk-LVTEOKA4.js +1 -0
- package/{chunk-PUNIQ3JW.js → chunk-MBRRLME5.js} +1 -1
- package/{chunk-OKDVOGSM.js → chunk-OQ3CIW34.js} +1 -1
- package/{chunk-GDQZEB3A.js → chunk-OXKNUQ4S.js} +1 -1
- package/{chunk-FNJU5CD3.js → chunk-RFQCUMV5.js} +1 -1
- package/{chunk-DW7A6PHZ.js → chunk-RZVBW5HI.js} +1 -1
- package/{chunk-RZKDEJUP.js → chunk-SDXU6VMB.js} +1 -1
- package/{chunk-7JHF4R5J.js → chunk-TDJOG66Y.js} +1 -1
- package/{chunk-ZDME3W57.js → chunk-TIGMPMCF.js} +1 -1
- package/{chunk-2S6ABLBU.js → chunk-TX6PGD4I.js} +1 -1
- package/{chunk-A2LUC3NC.js → chunk-TYUEMPMP.js} +1 -1
- package/{chunk-CHYEYO6L.js → chunk-TZAOQANG.js} +1 -1
- package/{chunk-A5LNLNWR.js → chunk-USYSNGYO.js} +1 -1
- package/{chunk-LSKF2B33.js → chunk-UTOT5S6Z.js} +1 -1
- package/{chunk-DTOILX4E.js → chunk-UZVZ7QY6.js} +1 -1
- package/chunk-V4JPJPZI.js +3 -0
- package/{chunk-EBANXXYI.js → chunk-V7LUGECS.js} +1 -1
- package/chunk-WXTYJ7CH.js +1 -0
- package/{chunk-GYDI67IZ.js → chunk-YHUSOICR.js} +1 -1
- package/{chunk-W2CMPDWL.js → chunk-YX7ZJ2VA.js} +1 -1
- package/index.html +1 -1
- package/{main-AK26L46R.js → main-OUD7GLNU.js} +1 -1
- package/package.json +1 -1
- package/chunk-33J6ZQYE.js +0 -1
- package/chunk-3OCWLJKG.js +0 -3
- package/chunk-72HORZFV.js +0 -1
- package/chunk-RUXUFB7C.js +0 -1
- package/chunk-RWPF5SQT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ut,c as ct,d as dt}from"./chunk-A5LNLNWR.js";import{a as ye}from"./chunk-3NFAL4U4.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-72HORZFV.js";import{a as Oe}from"./chunk-XLDVUBTQ.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-QF4DQYEP.js";import{h as st}from"./chunk-2QJVTZ56.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as N,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{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||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),N(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),N(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),N(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{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`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;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||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,P,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","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),N(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),N(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;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 St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{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"}],ft=[{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"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(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||a)};static \u0275cmp=J({type:a,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),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(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 o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}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(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}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(o=>o&&o!=="").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||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,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 o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let f;return f=$localize`Edit path`,[["formRef",""],r,p,h,S,w,P,$,K,v,W,R,Z,_e,ue,ce,[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",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",f,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=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),N(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),N(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),N(19,5),k(),s(20,"p",28),N(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),N(33,7),k(),s(34,"p",28),N(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),N(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),N(41,10),k(),s(42,"p",28),N(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),N(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],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}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{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)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,$])=>$).map(([P,$])=>P):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,$])=>$&&P!=="filesLargerThan").map(([P])=>P),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(P=>!P.startsWith("-")),Settings:h,Filters:p.filter(P=>P.startsWith("-")).map((P,$)=>({Order:$,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}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 o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#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)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),N(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),N(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),N(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{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.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#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||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,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 o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let P;P=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$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:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$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:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["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",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"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=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),N(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),N(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],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{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
|
|
1
|
+
import{a as ut,c as ct,d as dt}from"./chunk-USYSNGYO.js";import{a as ye}from"./chunk-3NFAL4U4.js";import{a as rt,b as Ve,c as _t}from"./chunk-4VY6SMSL.js";import{b as re}from"./chunk-Z27IQRKV.js";import{a as lt}from"./chunk-LVTEOKA4.js";import{a as Oe}from"./chunk-XLDVUBTQ.js";import{b as ie,d as H}from"./chunk-ABYM5HWA.js";import{B as se,G as Y,K as ot,O as le,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as ae,t as Re,u as q,w as nt,z as it}from"./chunk-QF4DQYEP.js";import{h as st}from"./chunk-2QJVTZ56.js";import{$b as u,Ab as $e,Bb as xe,Bc as Se,Cb as T,Db as s,Eb as l,Fb as g,H as we,Jb as B,Kb as k,Mb as x,Qc as G,Rc as ne,Sa as _,Tb as E,Ub as m,V as Ce,Vb as N,Vc as Be,Wc as ke,Xc as Fe,Yb as Ue,Zb as F,_ as O,cb as J,ea as c,fa as d,gc as ge,hb as je,hc as Ee,ic as be,kc as me,nc as U,oc as ve,pa as C,pc as Ye,sc as y,tc as L,ub as qe,uc as I,xb as A,yb as D,zb as Ge}from"./chunk-QONLYWYC.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class a{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||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};function Et(a,t){if(a&1){let e=x();s(0,"div",24)(1,"sh-form-field")(2,"label",25),N(3,7),l(),s(4,"input",26,0),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),F("focus",function(){c(e);let i=be(5);return d(i.showPicker())}),l(),s(6,"sh-icon",27),U(7,"clock"),l()(),s(8,"sh-form-field"),g(9,"label",28),s(10,"input",29,1),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),F("focus",function(){c(e);let i=be(11);return d(i.showPicker())}),l(),s(12,"sh-icon",27),U(13,"calendar"),l()()(),s(14,"div",24)(15,"sh-form-field")(16,"label",30),N(17,8),l(),s(18,"input",31),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),l()(),s(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),l()()(),s(21,"app-toggle-card",34),B(22,35),N(23,9),k(),s(24,"div",36)(25,"sh-toggle",19),E(26,10),s(27,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),l(),m(),l(),s(28,"sh-toggle",19),E(29,11),s(30,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),l(),m(),l(),s(31,"sh-toggle",19),E(32,12),s(33,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),l(),m(),l(),s(34,"sh-toggle",19),E(35,13),s(36,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),l(),m(),l(),s(37,"sh-toggle",19),E(38,14),s(39,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),l(),m(),l(),s(40,"sh-toggle",19),E(41,15),s(42,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),l(),m(),l(),s(43,"sh-toggle",19),E(44,16),s(45,"input",20),I("ngModelChange",function(i){c(e);let o=u();return L(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),l(),m(),l()()()}if(a&2){let e=u();_(4),y("ngModel",e.scheduleFields.nextTime().time),_(6),y("ngModel",e.scheduleFields.nextTime().date),_(8),y("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),y("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),y("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),y("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{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`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class a{#e=O(Q);#t=O(H);#i=O(ie);unitOptions=mt;scheduleFields=this.#e.scheduleFields;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||a)};static \u0275cmp=J({type:a,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let p;p=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,p,h,S,w,P,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","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),N(1,2),l(),s(2,"div",18)(3,"sh-toggle",19),E(4,3),s(5,"input",20),I("ngModelChange",function(o){return L(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),m(),l(),s(6,"p"),N(7,4),l()(),A(8,Et,46,14),s(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),E(11,5),g(12,"sh-icon"),m(),l(),s(13,"button",23),F("click",function(){return n.next()}),E(14,6),g(15,"sh-icon"),m(),l()()),e&2&&(_(5),y("ngModel",n.scheduleFields.autoRun),_(3),D(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,z,Ze,Te,j,oe,Y,Me,q,se,le,ye],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;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 St(a,t){if(a&1){let e=x();s(0,"sh-select",2)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l()()}if(a&2){let e=u();T("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),_(),y("ngModel",e.internalPath)}}function Ft(a,t){if(a&1&&(B(0,7),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Tt(a,t){if(a&1&&(B(0,8),U(1),k()),a&2){let e,n=u(2);_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ht(a,t){if(a&1){let e=x();s(0,"sh-form-field",3)(1,"input",6),I("ngModelChange",function(i){c(e);let o=u();return L(o.internalPath,i)||(o.internalPath=i),d(i)}),F("ngModelChange",function(){c(e);let i=u();return d(i.updateFilter())}),l(),A(2,Ft,2,1,"ng-container",7),A(3,Tt,2,1,"ng-container",8),l()}if(a&2){let e,n,i=u();_(),y("ngModel",i.internalPath),_(),D(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),_(),D(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Nt=[{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"}],ft=[{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"}],Ie=class a{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=C("");pathType=C("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=C(Nt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return ft.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(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||a)};static \u0275cmp=J({type:a,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),I("ngModelChange",function(o){return L(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),l()(),A(2,St,2,4,"sh-select",2)(3,ht,4,3,"sh-form-field",3),s(4,"div",4),F("click",function(){return n.removeFilter()}),s(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;T("options",n.expressionOptions())("isClearable",!1),_(),y("ngModel",n.pathType),_(),D(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[ae,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Pt=["formRef"],He=()=>({standalone:!0});function At(a,t){if(a&1){let e=x();s(0,"sh-form-field",41)(1,"input",42),I("ngModelChange",function(i){c(e);let o=u(2);return L(o.editingPath,i)||(o.editingPath=i),d(i)}),l()(),s(2,"button",43),F("click",function(){c(e);let i=u(2);return d(i.updatePath())}),s(3,"sh-icon"),U(4,"floppy-disk"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u(2);return d(i.cancelEditPath())}),s(6,"sh-icon"),U(7,"x-bold"),l()()}if(a&2){let e=u(2);_(),y("ngModel",e.editingPath),T("ngModelOptions",Se(2,He))}}function Dt(a,t){if(a&1){let e=x();s(0,"sh-form-field",41),g(1,"input",44),l(),s(2,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),s(3,"sh-icon"),U(4,"pen"),l()(),s(5,"button",43),F("click",function(){c(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),s(6,"sh-icon"),U(7,"trash-simple"),l()()}if(a&2){let e=u().$implicit;qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Se(3,He))}}function Rt(a,t){if(a&1&&(s(0,"div",30),A(1,At,8,3)(2,Dt,8,4),l()),a&2){let e=t.$implicit,n=u();_(),D(n.oldPath()===e?1:2)}}function Mt(a,t){if(a&1){let e=x();s(0,"app-new-filter",46),F("pathChange",function(i){let o=c(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return d(o.removePathAt(i))}),l()}if(a&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Ot(a,t){if(a&1&&$e(0,Mt,1,2,"app-new-filter",45,Ge),a&2){let e=u();xe(e.pathArray())}}function yt(a,t){if(a&1){let e=x();s(0,"div",31)(1,"app-size",47),F("ngModelChange",function(i){c(e);let o=u();return d(o.updateFilesLargerThan(i))}),l()()}if(a&2){let e=u();_(),T("ngModel",e.filesLargerThan())("ngModelOptions",Se(2,He))}}var V=new De,pt=(a={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(a.path),excludes:V.group({hidden:V.control(a.excludes.hidden),system:V.control(a.excludes.system),temporary:V.control(a.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class a{#e=O(Q);#t=O(H);#i=O(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=C(null);editingPath=C(null);addingNewPath=C(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ct(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 o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}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(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),o=this.pathArray().map((p,h)=>h===e?`${t}`:`${p}`).join("\0"),r=[i,o].filter(p=>p&&p!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}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(o=>o&&o!=="").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||a)};static \u0275cmp=J({type:a,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Pt,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 o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let p;p=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let w;w=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let R;R=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let f;return f=$localize`Edit path`,[["formRef",""],r,p,h,S,w,P,$,K,v,W,R,Z,_e,ue,ce,[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",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",f,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=x();s(0,"form",16,0),F("submit",function(){return c(i),d(n.next())}),s(2,"div",17)(3,"h3",18),N(4,1),l(),s(5,"app-file-tree",19)(6,"label",20),N(7,2),l(),g(8,"input",21),l(),s(9,"div",22)(10,"button",23),F("click",function(){return c(i),d(n.goBack())}),E(11,3),g(12,"sh-icon"),m(),l(),s(13,"button",24),E(14,4),g(15,"sh-icon"),m(),l()()(),s(16,"div",25)(17,"app-toggle-card",26),B(18,27),N(19,5),k(),s(20,"p",28),N(21,6),l(),s(22,"div",29),$e(23,Rt,3,1,"div",30,Ge),s(25,"div",31)(26,"sh-form-field"),g(27,"input",32),l(),s(28,"button",33),F("click",function(){return c(i),d(n.addNewPath())}),s(29,"sh-icon"),U(30,"plus"),l()()()()(),s(31,"app-toggle-card",26),B(32,27),N(33,7),k(),s(34,"p",28),N(35,8),l(),s(36,"button",34),F("click",function(){return c(i),d(n.addFilter())}),N(37,9),l(),A(38,Ot,2,0),l(),s(39,"app-toggle-card",35),B(40,27),N(41,10),k(),s(42,"p",28),N(43,11),l(),s(44,"sh-toggle",36),E(45,12),g(46,"input",37),m(),l(),s(47,"sh-toggle",36),E(48,13),g(49,"input",38),m(),l(),s(50,"sh-toggle",36),E(51,14),g(52,"input",39),m(),l(),s(53,"sh-toggle",40),F("click",function(){return c(i),d(n.toggleFilesLargerThan())}),N(54,15),l(),A(55,yt,2,3,"div",31),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),xe(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),D((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),me("active",n.filesLargerThan()),_(2),D(n.filesLargerThan()?55:-1)}},dependencies:[ae,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,se,Me,Ie,ut,ye,dt],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}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Ct="1W:1D,4W:1W,12M:1M",Q=class a{#e=O(H);#t=O(Oe);#i=O(it);#n=O(st);#a=O(Le);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:C(ee.autoRun),nextTime:C(ee.nextTime),runAgain:C(ee.runAgain)};settings=C([]);optionsFields={remoteVolumeSize:C("50MB"),backupRetention:C("all"),backupRetentionTime:C(""),backupRetentionVersions:C(0),backupRetentionCustom:C("")};targetUrlModel=C(null);backupMetadata=C(null);isDraft=C(!1);backupId=C(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=C(!1);finishedLoading=C(!1);backupDefaults=C(null);applicationOptions=C(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=C([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=C("");#s=C(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#s.asReadonly();#d=ne(()=>{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)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(lt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(p=>`${p.Include?"":"-"}${p.Expression}`)??[],i=t.Settings?.find(p=>p.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(p=>p.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",p=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),p&&p!==""&&(h.compression=p),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#a.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===Ct)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#a.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,$])=>$).map(([P,$])=>P):[],p=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,$])=>$&&P!=="filesLargerThan").map(([P])=>P),w=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),w&&w.size!==null&&w.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:p.filter(P=>!P.startsWith("-")),Settings:h,Filters:p.filter(P=>P.startsWith("-")).map((P,$)=>({Order:$,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}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 o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Ct});break}let p=[...t,...n],h=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let w=S.Value;return typeof S.Value=="number"&&(w=S.Value.toString()),typeof S.Value=="boolean"&&(w=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:w}});return[...i,...o,...r,...h]}#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)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var Lt=["formRef"];function It(a,t){a&1&&(s(0,"sh-alert",17),E(1,5),g(2,"sh-icon",26),m(),l())}function wt(a,t){if(a&1&&U(0),a&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function Gt(a,t){if(a&1&&g(0,"sh-progress-bar",40),a&2){let e=u(3);me("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(a,t){a&1&&(s(0,"span",35),N(1,10),l())}function xt(a,t){a&1&&(E(0,8,1),g(1,"sh-icon"),m())}function Ut(a,t){a&1&&(E(0,8,2),g(1,"sh-icon"),m())}function bt(a,t){a&1&&(E(0,11,1),g(1,"sh-icon",42),m())}function vt(a,t){a&1&&(E(0,11,2),g(1,"sh-icon"),m())}function Bt(a,t){if(a&1){let e=x();s(0,"button",41),F("click",function(){c(e);let i=u(3);return d(i.copyPassword())}),E(1,11),A(2,bt,2,0)(3,vt,2,0),m(),l()}if(a&2){let e=u(3);_(2),D(e.copiedPassword()?2:3)}}function kt(a,t){a&1&&(s(0,"sh-alert",39),N(1,12),l())}function Vt(a,t){if(a&1){let e=x();s(0,"div",30)(1,"sh-form-field")(2,"label",31),E(3,7),g(4,"sup"),m(),l(),g(5,"input",32),l(),A(6,Gt,1,9,"sh-progress-bar",33),s(7,"sh-form-field"),g(8,"input",34),A(9,$t,2,0,"span",35),l(),s(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),E(12,8),A(13,xt,2,0)(14,Ut,2,0),m(),l(),s(15,"button",37),F("click",function(){c(e);let i=u(2);return d(i.generatePassword())}),E(16,9),g(17,"sh-icon"),m(),l(),A(18,Bt,4,1,"button",38),l(),A(19,kt,2,0,"sh-alert",39),l()}if(a&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),D(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),D(e.showPassword()?13:14),_(5),D(e.showCopyPassword()?18:-1),_(),D(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Kt(a,t){if(a&1&&(s(0,"sh-select",27)(1,"label",28),N(2,6),l(),g(3,"input",29),je(4,wt,1,1,"ng-template"),l(),A(5,Vt,20,7,"div",30)),a&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),D(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Wt(a,t){if(a&1&&(s(0,"button",24),E(1,13),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Xt(a,t){if(a&1&&(s(0,"button",25),E(1,14),g(2,"sh-icon"),m(),l()),a&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,gt=(a={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(a.name,[he.required]),description:te.control(a.description),encryption:te.control(a.encryption,[_t()]),password:te.control(a.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(a.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(a.compression)}),pe={Key:"-",DisplayName:"None"},ze=class a{#e=O(H);#t=O(ie);#i=O(rt);#n=O(Q);#a=O(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=C(!1);copiedPassword=C(!1);showCopyPassword=C(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{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.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#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||a)};static \u0275cmp=J({type:a,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Lt,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 o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let w;w=$localize`Encryption`;let P;P=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$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:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let R;R=$localize`Passwords do not match`;let Z;Z=$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:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,p,h,w,K,v,W,R,Z,_e,ue,ce,["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",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"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=x();s(0,"form",15,0),F("submit",function(){return c(i),d(n.next())}),s(2,"h3",16),N(3,1),l(),A(4,It,3,0,"sh-alert",17),s(5,"sh-form-field")(6,"label",18),E(7,2),g(8,"sup"),m(),l(),g(9,"input",19),l(),s(10,"sh-form-field")(11,"label",20),N(12,3),l(),g(13,"textarea",21),l(),A(14,Kt,6,3),s(15,"div",22)(16,"button",23),F("click",function(){return c(i),d(n.exit())}),E(17,4),g(18,"sh-icon"),m(),l(),A(19,Wt,3,1,"button",24)(20,Xt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),D(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),D(n.isNew()?14:-1),_(5),D(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,se,q,ot,nt,at],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{gt as a,pe as b,ze as c,ee as d,Ke as e,pt as f,Je as g,Q as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ot}from"./chunk-ZBVBVQO7.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-C6F6FP4R.js";import{h as it}from"./chunk-
|
|
1
|
+
import{a as ot}from"./chunk-ZBVBVQO7.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-C6F6FP4R.js";import{h as it}from"./chunk-2J4H7C6W.js";import{a as tt,d as nt}from"./chunk-USYSNGYO.js";import{a as Qe}from"./chunk-6YGURBW6.js";import{a as R}from"./chunk-LVTEOKA4.js";import{a as z}from"./chunk-XLDVUBTQ.js";import{B as Ce,G as Ke,J as Ue,K as Je,O as Xe,U as He,V as je,X as qe,a as Re,c as de,e as ce,i as pe,k as ke,s as me,t as Be,u as ue,z as ze}from"./chunk-QF4DQYEP.js";import{h as We}from"./chunk-2QJVTZ56.js";import{ea as Ge}from"./chunk-5ZSBXGHQ.js";import{$b as s,Ab as X,Ac as Le,Bb as H,Bc as Pe,Cb as m,Cc as se,Db as _,Eb as d,Ec as _e,Fb as ie,Jb as oe,Jc as q,Kb as j,Lb as ae,Mb as E,Qc as P,Rc as W,Sa as l,Tb as Ne,Ub as xe,V as te,Vb as De,Wc as Q,Xc as $e,Zb as x,Zc as be,_ as V,ac as we,bc as Oe,cb as ne,ea as S,f as ee,fa as h,gc as Ae,hb as G,hc as Me,ic as B,ja as ye,kc as re,nc as p,pa as b,pc as A,qc as le,sc as Ve,tc as Fe,uc as ve,vc as L,wc as O,xb as g,xc as c,yb as f,zb as J}from"./chunk-QONLYWYC.js";import{a as M,b as Y}from"./chunk-EUDKD2JW.js";var at=class n{#t=V(We);#e=V(ze);#n=V(z);testDestination(t,e,i,o,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a):this.testDestinationv1(t,e,i,o,a)}testDestinationv2(t,e,i,o,a){return new ee(r=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:u=>{if(u.Success){this.emitSuccessV2(r,t,i,u);return}this.handleGenericError(r,t,i,u.Error??"Unknown error",a)},error:u=>{let T=u?.error?.body;if(T?.Data?.FolderExists===!1||T?.StatusCode==="missing-folder"){o?this.handleMissingFolder(r,t,i):this.handleGenericError(r,t,i,$localize`The remote destination folder does not exist.`,a);return}if(T?.Data?.HostCertificate){this.handleMissingCertificate(r,t,i,T.Data?.HostCertificate);return}if(T?.Data?.ReportedHostKey){this.handleIncorrectKey(r,t,i,T.Data.ReportedHostKey,T.Data.AcceptedHostKey??null);return}this.handleGenericError(r,t,i,u?.message??"Unknown error",a)}})})}testDestinationv1(t,e,i,o,a){return new ee(r=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:u=>{r.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),r.complete()},error:u=>{this.handleDestinationErrorv1(u.message,t,i,o,a).subscribe(T=>{r.next(T)})}})})}handleMissingFolder(t,e,i){this.#e.open(R,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#e.open(R,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#e.open(R,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#e.open(R,{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: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,i,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),t.complete()}})}handleIncorrectKey(t,e,i,o,a){a?this.#e.open(R,{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{a as b}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-7RM3VKDO.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-YHUSOICR.js";import"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-LVTEOKA4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{b as M,e as O}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B,u as R}from"./chunk-QF4DQYEP.js";import{h as A}from"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Ab as T,Bb as g,Db as F,Eb as a,Fb as _,Qc as L,Sa as i,Tb as c,Ub as d,Vb as l,Yb as p,Zb as I,_ as C,cb as f,nc as E,pa as r,pc as N,xb as s,yb as u,zb as S}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";function $(e,t){e&1&&l(0,2,1)}function P(e,t){e&1&&l(0,2,2)}function k(e,t){e&1&&l(0,2,3)}function v(e,t){e&1&&l(0,2,4)}function U(e,t){if(e&1&&(E(0),_(1,"br")),e&2){let n=t.$implicit;N(" ",n," ")}}var D=class e{#t=C(A);#e=C(M);#n=h(this.#e.params);runId=L(()=>this.#n()?.runId);offset=r(0);status=r("starting");messageLog=r([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=f({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=p(o),[t,n,o,[1,"back"],["type","button","shButton","","routerLink","../",1,"small"],["type","button","shButton","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(_(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"sh-icon"),d(),a()(),F(6,"h3"),c(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),d(),a(),F(9,"div",6),c(10,2),s(11,$,1,0),s(12,P,1,0),s(13,k,1,0),s(14,v,1,0),d(),a(),F(15,"code"),T(16,U,2,1,null,null,S),a()()),n&2&&(i(11),u(o.status()==="starting"?11:-1),i(),u(o.status()==="started"?12:-1),i(),u(o.status()==="finished"?13:-1),i(),u(o.status()==="aborted"?14:-1),i(2),g(o.messageLog()))},dependencies:[b,R,B,O],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-YHUSOICR.js";import{h as m}from"./chunk-2QJVTZ56.js";import{B as d,F as o,H as p,R as h,Rc as l,V as N,_ as r,n as c,pa as s,x as f}from"./chunk-QONLYWYC.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
1
|
+
import{a as A}from"./chunk-7RM3VKDO.js";import"./chunk-YHUSOICR.js";import"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-LVTEOKA4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{c as u,e as N,f as c}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{T as S}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Db as e,Eb as t,Fb as T,Vb as n,cb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Pe}from"./chunk-GYDI67IZ.js";import{a as Ne}from"./chunk-4NBLWONL.js";import{a as Oe}from"./chunk-CCKT2GLS.js";import{a as Ee}from"./chunk-XLDVUBTQ.js";import{b as oe}from"./chunk-GCCJSS4C.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-QF4DQYEP.js";import{h as P}from"./chunk-2QJVTZ56.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
|
|
1
|
+
import{a as Pe}from"./chunk-YHUSOICR.js";import{a as Ne}from"./chunk-4NBLWONL.js";import{a as Oe}from"./chunk-CCKT2GLS.js";import{a as Ee}from"./chunk-XLDVUBTQ.js";import{b as oe}from"./chunk-GCCJSS4C.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-QF4DQYEP.js";import{h as P}from"./chunk-2QJVTZ56.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Lt,b as Rt,c as Bt}from"./chunk-2ZGJS4OW.js";import"./chunk-ZBVBVQO7.js";import{a as Pt}from"./chunk-C6F6FP4R.js";import{h as yt}from"./chunk-BQJICFF5.js";import"./chunk-A5LNLNWR.js";import"./chunk-3NFAL4U4.js";import"./chunk-4VY6SMSL.js";import"./chunk-6YGURBW6.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
|
|
1
|
+
import{a as Lt,b as Rt,c as Bt}from"./chunk-4OBQWIWP.js";import"./chunk-ZBVBVQO7.js";import{a as Pt}from"./chunk-C6F6FP4R.js";import{h as yt}from"./chunk-2J4H7C6W.js";import"./chunk-USYSNGYO.js";import"./chunk-3NFAL4U4.js";import"./chunk-4VY6SMSL.js";import"./chunk-6YGURBW6.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-LVTEOKA4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
|