@duplicati/ngclient 0.0.229 → 0.0.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/{chunk-B9zNFJSv.js → chunk-3RXp81pP.js} +1 -1
  2. package/{chunk-D_JCqKo8.js → chunk-B0RBkC1E.js} +1 -1
  3. package/{chunk-BAZ5npJw.js → chunk-B2TXzbpy.js} +1 -1
  4. package/{chunk-BjkwnDTL.js → chunk-B728v9oc.js} +1 -1
  5. package/{chunk-w_Hs_Uxi.js → chunk-BB1pOOUx.js} +1 -1
  6. package/{chunk-dScOwyAU.js → chunk-BD9-OWSe.js} +1 -1
  7. package/{chunk-CwB_t7g-.js → chunk-BIL3nR4_.js} +1 -1
  8. package/{chunk-DDVdXEVe.js → chunk-BIOMsSHI.js} +1 -1
  9. package/{chunk-cLFxUFjv.js → chunk-BOOAIFTC.js} +1 -1
  10. package/{chunk-DiZeSQXj.js → chunk-BYJA6sbi.js} +1 -1
  11. package/{chunk-B12Syddi.js → chunk-BaGYaLxZ.js} +1 -1
  12. package/{chunk-CByrJpDb.js → chunk-Bceym75m.js} +1 -1
  13. package/{chunk-BtzP4vdU.js → chunk-BfZh4DNq.js} +1 -1
  14. package/{chunk-D4UZC_u0.js → chunk-BjAIXsAS.js} +1 -1
  15. package/{chunk-C1t4wbdG.js → chunk-BlSN71kd.js} +1 -1
  16. package/{chunk-D2XTQURr.js → chunk-Bq7wRTmy.js} +1 -1
  17. package/chunk-ByhuT4BS.js +14 -0
  18. package/{chunk-GVxWY6X-.js → chunk-BzIY4AaX.js} +1 -1
  19. package/{chunk-SycscfJp.js → chunk-C-NgIZiF.js} +1 -1
  20. package/{chunk-Cs0rlpWi.js → chunk-C1kucB1O.js} +1 -1
  21. package/{chunk-DaIpTiYw.js → chunk-C4kBXz3C.js} +1 -1
  22. package/{chunk-BcpsSgKo.js → chunk-C6QX7znk.js} +1 -1
  23. package/{chunk-D28lTX0k.js → chunk-C7pjkqKB.js} +1 -1
  24. package/{chunk-C11i_gv7.js → chunk-CBgNjPex.js} +1 -1
  25. package/{chunk-BDXLL1lt.js → chunk-CEyp0Xmg.js} +1 -1
  26. package/chunk-CFne6FXR.js +1 -0
  27. package/{chunk-DVgkAgur.js → chunk-CGn_EA_5.js} +1 -1
  28. package/{chunk-C_JveZJH.js → chunk-CJ0GoaW1.js} +1 -1
  29. package/{chunk-DQwpGI_E.js → chunk-CJ1mxauG.js} +1 -1
  30. package/chunk-CMJCX33P.js +1 -0
  31. package/{chunk-DQW8lSiz.js → chunk-CRAg6SRo.js} +1 -1
  32. package/{chunk-CBdr-6_u.js → chunk-CT9ziigM.js} +1 -1
  33. package/{chunk-bgWe6t7y.js → chunk-CWAvlP_u.js} +1 -1
  34. package/{chunk-ObToq7vh.js → chunk-CYQJGwsB.js} +1 -1
  35. package/{chunk-DVlpMN2Q.js → chunk-Ca-HIRNP.js} +1 -1
  36. package/{chunk-MvQwR7nW.js → chunk-Ca1C9pJ0.js} +1 -1
  37. package/chunk-CegwkGVu.js +3 -0
  38. package/chunk-Cgbi9MZq.js +2 -0
  39. package/{chunk-BYHopERA.js → chunk-CgcnOoRq.js} +1 -1
  40. package/chunk-Ck9c9Juw.js +1 -0
  41. package/{chunk-DC8QqmzV.js → chunk-CnRCpl-v.js} +1 -1
  42. package/{chunk-BoCnrrB4.js → chunk-CrgyDps4.js} +1 -1
  43. package/{chunk-Bc4gFy5W.js → chunk-D2g44FyO.js} +2 -2
  44. package/{chunk-JA7rUsYF.js → chunk-D2g5mSLr.js} +1 -1
  45. package/{chunk-BZqhgAZ-.js → chunk-D5lj-fQk.js} +1 -1
  46. package/{chunk-0sb5_LpD.js → chunk-D6aNT_wo.js} +1 -1
  47. package/{chunk-M21GJPzH.js → chunk-DDBflo2l.js} +3 -3
  48. package/{chunk-DV2SIgNN.js → chunk-DD_QfWih.js} +1 -1
  49. package/{chunk-CA-ER0DL.js → chunk-DFEb6rgg.js} +1 -1
  50. package/{chunk-D1wHRltX.js → chunk-DN6f5jXR.js} +1 -1
  51. package/{chunk-DJbAxHpK.js → chunk-DPNAj9Vc.js} +1 -1
  52. package/{chunk-DMJycFPC.js → chunk-DWkdK0Ib.js} +1 -1
  53. package/{chunk-Byb051F6.js → chunk-DaGzYsVs.js} +1 -1
  54. package/{chunk-BFH9sFEg.js → chunk-Df7q8ewK.js} +1 -1
  55. package/{chunk-Bf1diO1u.js → chunk-Dgns65Zu.js} +1 -1
  56. package/{chunk-B6vxBiK4.js → chunk-Dh6x3lXP.js} +1 -1
  57. package/{chunk-Drc5kcUX.js → chunk-DipTNkHN.js} +1 -1
  58. package/{chunk-2OH1SKyQ.js → chunk-Dj3xknEh.js} +1 -1
  59. package/{chunk-SKxVK_pD.js → chunk-DkdGEw1e.js} +1 -1
  60. package/{chunk-CfoJuTJX.js → chunk-DmKJmG9z.js} +1 -1
  61. package/{chunk-BZYVgHEz.js → chunk-DtA6Mvdt.js} +1 -1
  62. package/chunk-DtdFhFa9.js +1 -0
  63. package/{chunk-C9EdrQe6.js → chunk-DuIUmwWN.js} +1 -1
  64. package/{chunk-DDo7wKQT.js → chunk-DwKPz2Gn.js} +1 -1
  65. package/chunk-DwMhABnQ.js +2 -0
  66. package/{chunk-B-fklW6A.js → chunk-Fw6nFDZK.js} +2 -2
  67. package/{chunk-B3yuN2OH.js → chunk-HWQc1Hoa.js} +1 -1
  68. package/{chunk-CdKfNiwm.js → chunk-I0R6Ty-p.js} +1 -1
  69. package/{chunk-BIeNnIyg.js → chunk-LL0IHZns.js} +1 -1
  70. package/{chunk-C2bnZ62D.js → chunk-OFYkgZA1.js} +1 -1
  71. package/{chunk-COgNe44h.js → chunk-OLi7f6y7.js} +1 -1
  72. package/{chunk-CMmgPgiU.js → chunk-PVmXLw9b.js} +1 -1
  73. package/{chunk-CRU3lYvk.js → chunk-RQ_MoiOh.js} +1 -1
  74. package/chunk-Zo-grJt3.js +1 -0
  75. package/{chunk-DP9SoPGV.js → chunk-dmyIQdVx.js} +1 -1
  76. package/{chunk-wyer8fjS.js → chunk-glhLCQrb.js} +1 -1
  77. package/{chunk-B2fqvpov.js → chunk-khm9J_G0.js} +1 -1
  78. package/{chunk-D48AStVy.js → chunk-wyNyzSXi.js} +1 -1
  79. package/{chunk-D_A6A07f.js → chunk-yF6CJHRg.js} +1 -1
  80. package/index.html +1 -1
  81. package/locale/dayjs/ko.js +45 -0
  82. package/locale/dayjs/tr.js +39 -0
  83. package/locale/messages.de.json +168 -12
  84. package/locale/messages.de_CH.json +162 -6
  85. package/locale/messages.de_DE.json +162 -6
  86. package/locale/messages.en.json +1 -0
  87. package/locale/messages.fr.json +175 -8
  88. package/locale/messages.fr_CA.json +175 -8
  89. package/locale/messages.fr_FR.json +175 -8
  90. package/locale/messages.it.json +79 -5
  91. package/locale/messages.it_IT.json +79 -5
  92. package/locale/messages.ja.json +198 -15
  93. package/locale/messages.ja_JP.json +198 -15
  94. package/locale/messages.json +1 -0
  95. package/locale/messages.ko.json +776 -0
  96. package/locale/messages.nl_BE.json +174 -7
  97. package/locale/messages.nl_NL.json +174 -7
  98. package/locale/messages.tr.json +943 -0
  99. package/main-KFKZO6SJ.js +16 -0
  100. package/package.json +1 -1
  101. package/chunk-A5DpxPOI.js +0 -1
  102. package/chunk-BJ6LKfIL.js +0 -2
  103. package/chunk-CI78bAye.js +0 -2
  104. package/chunk-CQ8rm_d9.js +0 -3
  105. package/chunk-CUxq_s_t.js +0 -14
  106. package/chunk-CXEImxhE.js +0 -1
  107. package/chunk-CgYrHQGO.js +0 -1
  108. package/chunk-D0u1cyeL.js +0 -1
  109. package/chunk-RKTSBnYB.js +0 -1
  110. package/main-PXGZLKMN.js +0 -16
@@ -1 +1 @@
1
- import {m,C as C$1,F}from'./chunk-DaIpTiYw.js';import {J}from'./chunk-B2fqvpov.js';import {x}from'./chunk-0sb5_LpD.js';import {T,a6 as be$1,ab as C,aw as W,e as ee,ax as De,a5 as g,U as Ue$1,N as Nt,G as Ga,at as h,ay as $u,az as t,aA as y,aj as l,C as Bu,d as dw,_ as _t,f as N,v,u as ue,Q as Qi,q as PC,O as Og,j as mg,P as Pg,H as Hl,F as Fg,s as sm,p as DD,o as oT,D as DE,z as gg,a3 as QC,I as Qg,aB as rm,w as im,y as TD,i as iT,t as tC,l as HC,k as gT,S as Sd,n as nC,x as xd,E as nm,X as XT,au as Lg,av as eC}from'./main-PXGZLKMN.js';import {L}from'./chunk-D28lTX0k.js';import {d}from'./chunk-DQW8lSiz.js';import {F as Fe}from'./chunk-C9EdrQe6.js';import {j as jn,m as me,G as Gn,T as Tn,Z as Ze,y as yt,R as Rn,P as Pn,g as gn,h as hn}from'./chunk-Drc5kcUX.js';import {a as at}from'./chunk-B-fklW6A.js';var Xe=()=>["/"];function be(t,o){t&1&&(Qi(0,"sh-toggle",25),Og(1,5),mg(2,"input",28),DD(),Pg(),Hl()),t&2&&(DE(2),TD());}function Ge(t,o){t&1&&(Qi(0,"span",31),XT(1,9),Hl());}function Be(t,o){if(t&1&&(Qi(0,"span",31),XT(1,10),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.password.errors?.minlength.requiredLength),eC(1);}}function ve(t,o){if(t&1&&mg(0,"sh-progress-bar",38),t&2){let e=nC(2);Qg("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),gg("value",e.calculatePasswordStrength()*(100/5));}}function ke(t,o){t&1&&(Qi(0,"span",31),XT(1,11),Hl());}function Ue(t,o){t&1&&(Qi(0,"span",31),XT(1,12),Hl());}function Ke(t,o){if(t&1&&(Qi(0,"span",31),XT(1,13),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.repeatPassword.errors?.minlength.requiredLength),eC(1);}}function Je(t,o){t&1&&(Og(0,7,1),mg(1,"sh-icon"),Pg());}function He(t,o){t&1&&(Og(0,7,2),mg(1,"sh-icon"),Pg());}function ze(t,o){t&1&&(Og(0,14,1),mg(1,"sh-icon",40),Pg());}function Ve(t,o){t&1&&(Og(0,14,2),mg(1,"sh-icon"),Pg());}function qe(t,o){if(t&1){let e=gT();Qi(0,"button",39),Fg("click",function(){Sd(e);let a=nC(2);return xd(a.copyPassword())}),Og(1,14),oT(2,ze,2,0)(3,Ve,2,0),Pg(),Hl();}if(t&2){let e=nC(2);DE(2),iT(e.copiedPassword()?2:3);}}function je(t,o){t&1&&(Qi(0,"sh-alert",37),XT(1,15),Hl());}function We(t,o){if(t&1){let e=gT();Qi(0,"div",26)(1,"sh-form-field")(2,"label",29),Og(3,6),mg(4,"sup"),Pg(),Hl(),mg(5,"input",30),DD(),oT(6,Ge,2,0,"span",31)(7,Be,2,1,"span",31),Hl(),oT(8,ve,1,9,"sh-progress-bar",32),Qi(9,"sh-form-field"),mg(10,"input",33),DD(),oT(11,ke,2,0,"span",31)(12,Ue,2,0,"span",31)(13,Ke,2,1,"span",31),Hl(),Qi(14,"div",34)(15,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.showPassword.set(!a.showPassword()))}),Og(16,7),oT(17,Je,2,0)(18,He,2,0),Pg(),Hl(),Qi(19,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.generatePassword())}),Og(20,8),mg(21,"sh-icon"),Pg(),Hl(),oT(22,qe,4,1,"button",36),Hl(),oT(23,je,2,0,"sh-alert",37),Hl();}if(t&2){let e=nC();DE(5),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.controls.password.errors?.required?6:e.exportForm.controls.password.errors?.minlength?7:-1),DE(2),iT(e.exportForm.value.password?8:-1),DE(2),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors?.required?12:e.exportForm.controls.repeatPassword.errors?.minlength?13:-1),DE(6),iT(e.showPassword()?17:18),DE(5),iT(e.showCopyPassword()?22:-1),DE(),iT(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1);}}function Qe(t,o){if(t&1&&(Qi(0,"div",27)(1,"code"),PC(2),Hl()()),t&2){let e=nC();DE(2),nm(e.exportedCmd());}}var I=new jn,K=class t$1{#o=T(m);#n=T(be$1);#t=T(C);#e=T(W);#i=T(ee);#r=T(De);#s=T(g);isExporting=Ue$1(false);exportType=Ue$1("file");exportedCmd=Ue$1(null);exportForm=I.group({exportPasswords:I.control(true),encryption:I.control(false,[me.required,F()]),password:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])]),repeatPassword:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])])});exportFormSignal=L(this.exportForm.valueChanges);encryptionFieldSignal=Nt(()=>(this.exportFormSignal()?.encryption??false)&&this.exportType()==="file");activeBackup=Nt(()=>this.#s.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=Ue$1(false);copiedPassword=Ue$1(false);showCopyPassword=Ue$1(false);calculatePasswordStrength=Nt(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=Ga(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity();});disablePasswordForCommandLine=Ga(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(false);});submit(){if(this.exportType()==="file"&&this.exportFormSignal()?.exportPasswords===true&&!this.exportFormSignal()?.encryption){this.#n.open(h,{data:{title:$localize`Export without encryption?`,message:$localize`Are you sure you want to export your backup without encryption?`,confirmText:$localize`Yes, write plain-text passwords`,cancelText:$localize`Cancel`},closed:o=>{o&&this.submitApproved();}});return}this.submitApproved();}submitApproved(){this.isExporting.set(true),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe($u(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([h,E])=>E!=null).map(([h,E])=>`${encodeURIComponent(h)}=${encodeURIComponent(E)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,a=t.BASE||"";return this.#r.get(`${a}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new y(l({},t.HEADERS??{}))})}),Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",a=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${a}`),this.#i.navigate(["/"]);},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null);},error:o=>{}});}downloadFile(o,e){let n=window.URL.createObjectURL(o),a=document.createElement("a");a.href=n,a.download=e,a.click(),window.URL.revokeObjectURL(n);}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#a(o??""),this.copiedPassword.set(true);}async#a(o){try{await navigator.clipboard.writeText(o);}catch{try{let n=document.createElement("textarea");n.value=o,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(false);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(true);}static \u0275fac=function(e){return new(e||t$1)};static \u0275cmp=dw({type:t$1,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let h;h=$localize`Password`;let E;E=$localize`Repeat password`;let J;J=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*17: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/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18: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/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=tC(w);let H;H=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let z;z=$localize`Passwords are required`;let V;V=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let q;q=$localize`Passwords do not match`;let j;j=$localize`Passwords are required`;let W;W=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let D;D=$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:`,D=tC(D);let Q;return Q=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,a,T,O,J,w,H,z,V,q,j,W,D,Q,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",E,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){e&1&&(Qi(0,"header")(1,"h3"),PC(2," Export backup configuration "),Qi(3,"div",16)(4,"button",17),Og(5,0),mg(6,"sh-icon"),Pg(),Hl(),Qi(7,"button",18),Fg("click",function(){return n.submit()}),Og(8,1),mg(9,"sh-icon"),Pg(),Hl()()(),Qi(10,"p"),PC(11),Hl()(),Qi(12,"form",19)(13,"sh-button-group",20),sm("valueChange",function(T){return HC(n.exportType,T)||(n.exportType=T),T}),Qi(14,"button",21),Og(15,2),mg(16,"sh-icon"),Pg(),Hl(),Qi(17,"button",22),Og(18,3),mg(19,"sh-icon"),Pg(),Hl()(),Qi(20,"sh-toggle",23),Og(21,4),mg(22,"input",24),DD(),Pg(),Hl(),oT(23,be,3,0,"sh-toggle",25),oT(24,We,24,8,"div",26),oT(25,Qe,3,1,"div",27),Hl()),e&2&&(DE(4),gg("routerLink",QC(12,Xe)),DE(3),Qg("loading",n.isExporting()),gg("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),DE(4),rm("#",n.activeBackup()?.Backup?.ID,": ",n.activeBackup()?.Backup?.Name),DE(),gg("formGroup",n.exportForm),DE(),im("value",n.exportType),DE(9),TD(),DE(),iT(n.exportType()==="file"?23:-1),DE(),iT(n.encryptionFieldSignal()?24:-1),DE(),iT(n.exportedCmd()?25:-1));},dependencies:[Gn,Tn,Ze,yt,Rn,Pn,gn,hn,_t,x,J,N,Fe,v,ue,d,at],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"]})};export{K as default};
1
+ import {m,C as C$1,F}from'./chunk-C4kBXz3C.js';import {J}from'./chunk-khm9J_G0.js';import {x}from'./chunk-D6aNT_wo.js';import {T,a6 as be$1,ab as C,aw as W,e as ee,ax as De,a5 as g,U as Ue$1,N as Nt,G as Ga,at as h,ay as $u,az as t,aA as y,aj as l,C as Bu,d as dw,_ as _t,f as N,v,u as ue,Q as Qi,q as PC,O as Og,j as mg,P as Pg,H as Hl,F as Fg,s as sm,p as DD,o as oT,D as DE,z as gg,a3 as QC,I as Qg,aB as rm,w as im,y as TD,i as iT,t as tC,l as HC,k as gT,S as Sd,n as nC,x as xd,E as nm,X as XT,au as Lg,av as eC}from'./main-KFKZO6SJ.js';import {d}from'./chunk-CRAg6SRo.js';import {F as Fe}from'./chunk-DuIUmwWN.js';import {j as jn,m as me,G as Gn,T as Tn,Z as Ze,y as yt,R as Rn,P as Pn,g as gn,h as hn}from'./chunk-DipTNkHN.js';import {a as at}from'./chunk-Fw6nFDZK.js';import {L}from'./chunk-C7pjkqKB.js';var Xe=()=>["/"];function be(t,o){t&1&&(Qi(0,"sh-toggle",25),Og(1,5),mg(2,"input",28),DD(),Pg(),Hl()),t&2&&(DE(2),TD());}function Ge(t,o){t&1&&(Qi(0,"span",31),XT(1,9),Hl());}function Be(t,o){if(t&1&&(Qi(0,"span",31),XT(1,10),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.password.errors?.minlength.requiredLength),eC(1);}}function ve(t,o){if(t&1&&mg(0,"sh-progress-bar",38),t&2){let e=nC(2);Qg("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),gg("value",e.calculatePasswordStrength()*(100/5));}}function ke(t,o){t&1&&(Qi(0,"span",31),XT(1,11),Hl());}function Ue(t,o){t&1&&(Qi(0,"span",31),XT(1,12),Hl());}function Ke(t,o){if(t&1&&(Qi(0,"span",31),XT(1,13),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.repeatPassword.errors?.minlength.requiredLength),eC(1);}}function Je(t,o){t&1&&(Og(0,7,1),mg(1,"sh-icon"),Pg());}function He(t,o){t&1&&(Og(0,7,2),mg(1,"sh-icon"),Pg());}function ze(t,o){t&1&&(Og(0,14,1),mg(1,"sh-icon",40),Pg());}function Ve(t,o){t&1&&(Og(0,14,2),mg(1,"sh-icon"),Pg());}function qe(t,o){if(t&1){let e=gT();Qi(0,"button",39),Fg("click",function(){Sd(e);let a=nC(2);return xd(a.copyPassword())}),Og(1,14),oT(2,ze,2,0)(3,Ve,2,0),Pg(),Hl();}if(t&2){let e=nC(2);DE(2),iT(e.copiedPassword()?2:3);}}function je(t,o){t&1&&(Qi(0,"sh-alert",37),XT(1,15),Hl());}function We(t,o){if(t&1){let e=gT();Qi(0,"div",26)(1,"sh-form-field")(2,"label",29),Og(3,6),mg(4,"sup"),Pg(),Hl(),mg(5,"input",30),DD(),oT(6,Ge,2,0,"span",31)(7,Be,2,1,"span",31),Hl(),oT(8,ve,1,9,"sh-progress-bar",32),Qi(9,"sh-form-field"),mg(10,"input",33),DD(),oT(11,ke,2,0,"span",31)(12,Ue,2,0,"span",31)(13,Ke,2,1,"span",31),Hl(),Qi(14,"div",34)(15,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.showPassword.set(!a.showPassword()))}),Og(16,7),oT(17,Je,2,0)(18,He,2,0),Pg(),Hl(),Qi(19,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.generatePassword())}),Og(20,8),mg(21,"sh-icon"),Pg(),Hl(),oT(22,qe,4,1,"button",36),Hl(),oT(23,je,2,0,"sh-alert",37),Hl();}if(t&2){let e=nC();DE(5),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.controls.password.errors?.required?6:e.exportForm.controls.password.errors?.minlength?7:-1),DE(2),iT(e.exportForm.value.password?8:-1),DE(2),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors?.required?12:e.exportForm.controls.repeatPassword.errors?.minlength?13:-1),DE(6),iT(e.showPassword()?17:18),DE(5),iT(e.showCopyPassword()?22:-1),DE(),iT(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1);}}function Qe(t,o){if(t&1&&(Qi(0,"div",27)(1,"code"),PC(2),Hl()()),t&2){let e=nC();DE(2),nm(e.exportedCmd());}}var I=new jn,K=class t$1{#o=T(m);#n=T(be$1);#t=T(C);#e=T(W);#i=T(ee);#r=T(De);#s=T(g);isExporting=Ue$1(false);exportType=Ue$1("file");exportedCmd=Ue$1(null);exportForm=I.group({exportPasswords:I.control(true),encryption:I.control(false,[me.required,F()]),password:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])]),repeatPassword:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])])});exportFormSignal=L(this.exportForm.valueChanges);encryptionFieldSignal=Nt(()=>(this.exportFormSignal()?.encryption??false)&&this.exportType()==="file");activeBackup=Nt(()=>this.#s.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=Ue$1(false);copiedPassword=Ue$1(false);showCopyPassword=Ue$1(false);calculatePasswordStrength=Nt(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=Ga(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity();});disablePasswordForCommandLine=Ga(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(false);});submit(){if(this.exportType()==="file"&&this.exportFormSignal()?.exportPasswords===true&&!this.exportFormSignal()?.encryption){this.#n.open(h,{data:{title:$localize`Export without encryption?`,message:$localize`Are you sure you want to export your backup without encryption?`,confirmText:$localize`Yes, write plain-text passwords`,cancelText:$localize`Cancel`},closed:o=>{o&&this.submitApproved();}});return}this.submitApproved();}submitApproved(){this.isExporting.set(true),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe($u(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([h,E])=>E!=null).map(([h,E])=>`${encodeURIComponent(h)}=${encodeURIComponent(E)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,a=t.BASE||"";return this.#r.get(`${a}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new y(l({},t.HEADERS??{}))})}),Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",a=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${a}`),this.#i.navigate(["/"]);},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null);},error:o=>{}});}downloadFile(o,e){let n=window.URL.createObjectURL(o),a=document.createElement("a");a.href=n,a.download=e,a.click(),window.URL.revokeObjectURL(n);}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#a(o??""),this.copiedPassword.set(true);}async#a(o){try{await navigator.clipboard.writeText(o);}catch{try{let n=document.createElement("textarea");n.value=o,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(false);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(true);}static \u0275fac=function(e){return new(e||t$1)};static \u0275cmp=dw({type:t$1,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let h;h=$localize`Password`;let E;E=$localize`Repeat password`;let J;J=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*17: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/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18: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/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=tC(w);let H;H=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let z;z=$localize`Passwords are required`;let V;V=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let q;q=$localize`Passwords do not match`;let j;j=$localize`Passwords are required`;let W;W=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let D;D=$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:`,D=tC(D);let Q;return Q=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,a,T,O,J,w,H,z,V,q,j,W,D,Q,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",E,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){e&1&&(Qi(0,"header")(1,"h3"),PC(2," Export backup configuration "),Qi(3,"div",16)(4,"button",17),Og(5,0),mg(6,"sh-icon"),Pg(),Hl(),Qi(7,"button",18),Fg("click",function(){return n.submit()}),Og(8,1),mg(9,"sh-icon"),Pg(),Hl()()(),Qi(10,"p"),PC(11),Hl()(),Qi(12,"form",19)(13,"sh-button-group",20),sm("valueChange",function(T){return HC(n.exportType,T)||(n.exportType=T),T}),Qi(14,"button",21),Og(15,2),mg(16,"sh-icon"),Pg(),Hl(),Qi(17,"button",22),Og(18,3),mg(19,"sh-icon"),Pg(),Hl()(),Qi(20,"sh-toggle",23),Og(21,4),mg(22,"input",24),DD(),Pg(),Hl(),oT(23,be,3,0,"sh-toggle",25),oT(24,We,24,8,"div",26),oT(25,Qe,3,1,"div",27),Hl()),e&2&&(DE(4),gg("routerLink",QC(12,Xe)),DE(3),Qg("loading",n.isExporting()),gg("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),DE(4),rm("#",n.activeBackup()?.Backup?.ID,": ",n.activeBackup()?.Backup?.Name),DE(),gg("formGroup",n.exportForm),DE(),im("value",n.exportType),DE(9),TD(),DE(),iT(n.exportType()==="file"?23:-1),DE(),iT(n.encryptionFieldSignal()?24:-1),DE(),iT(n.exportedCmd()?25:-1));},dependencies:[Gn,Tn,Ze,yt,Rn,Pn,gn,hn,_t,x,J,N,Fe,v,ue,d,at],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"]})};export{K as default};
@@ -1,2 +1,2 @@
1
- import {O}from'./chunk-SycscfJp.js';import {br as x,T,a6 as be,ab as C$1,m,a as T$1,bg as Q,U as Ue,N as Nt,G as Ga,at as h,aZ as ee}from'./main-PXGZLKMN.js';var S=new x("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});var C=class l{#c=T(S);#g=T(be);#t=T(C$1);#o=T(m);#l=T(T$1);#n=T(Q);#u=T(O);constructor(){this.#l.subscribe("remotecontrol");}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=false;state=Ue("unknown");claimUrl=Ue(null);registerUrl=Ue("");customRegisterUrl=Ue("");statusMessage=Nt(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=Ga(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"");});remoteEffect=Ga(()=>{let e=this.#l.remoteControlState();e&&this.#e(e);});pendingRefreshEffect=Ga(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=false,this.refreshRemoteControlStatus());});#a=Nt(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)});}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},i);}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=true;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}}beginRemoteRegistration(e=false){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)});}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}deleteRemoteControl(){let e=this;this.#g.open(h,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)});}});}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),y=this.#o.systemInfo(),r="https://app.duplicati.com",c=y?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let v=new URLSearchParams(i);r+=`?${v.toString()}`;}this.#c.open(r,"_blank");}static \u0275fac=function(i){return new(i||l)};static \u0275prov=ee({token:l,factory:l.\u0275fac,providedIn:"root"})};
1
+ import {O}from'./chunk-C-NgIZiF.js';import {br as x,T,a6 as be,ab as C$1,m,a as T$1,bg as Q,U as Ue,N as Nt,G as Ga,at as h,aZ as ee}from'./main-KFKZO6SJ.js';var S=new x("WindowToken",{providedIn:"root",factory:()=>typeof window<"u"?window:{}});var C=class l{#c=T(S);#g=T(be);#t=T(C$1);#o=T(m);#l=T(T$1);#n=T(Q);#u=T(O);constructor(){this.#l.subscribe("remotecontrol");}repeatRegisterTimer=null;#s=null;#r=0;#h=5;#m=2e3;pendingRefresh=false;state=Ue("unknown");claimUrl=Ue(null);registerUrl=Ue("");customRegisterUrl=Ue("");statusMessage=Nt(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=Ga(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"");});remoteEffect=Ga(()=>{let e=this.#l.remoteControlState();e&&this.#e(e);});pendingRefreshEffect=Ga(()=>{this.#n.isConnectionMethodSet()&&this.pendingRefresh&&(this.pendingRefresh=false,this.refreshRemoteControlStatus());});#a=Nt(()=>{let e=this.#n.getConnectionMethod()==="websocket",i=this.#o.hasWsRemoteControl();return e&&i});#f(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");}#e(e){if(this.#r=0,this.#f(e),this.#a())return;let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#e(t)});}#i(e){if(this.#s!==null&&(clearTimeout(this.#s),this.#s=null),this.#r>=this.#h){this.state.set("registeringfaulted"),this.#r=0;return}let i=this.#m*Math.pow(2,this.#r);this.#r++,this.#s=setTimeout(()=>{this.#s=null,this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#e(t),error:t=>this.#i(t)});},i);}refreshRemoteControlStatus(){if(!this.#a()){if(!this.#n.isConnectionMethodSet()){this.pendingRefresh=true;return}this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}}beginRemoteRegistration(e=false){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#e(i),error:i=>this.#i(i)});}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#e(e),error:e=>this.#i(e)});}deleteRemoteControl(){let e=this;this.#g.open(h,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#e(t),error:t=>e.#i(t)});}});}openConsole(e="/app/machines",i){let t=this.#u.serverSettings(),y=this.#o.systemInfo(),r="https://app.duplicati.com",c=y?.RemoteControlDashboardUrl??"";if(c.length>0&&(r=c),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let v=new URLSearchParams(i);r+=`?${v.toString()}`;}this.#c.open(r,"_blank");}static \u0275fac=function(i){return new(i||l)};static \u0275prov=ee({token:l,factory:l.\u0275fac,providedIn:"root"})};
2
2
  export{C,S};
@@ -0,0 +1,3 @@
1
+ import {j as jn,m as me}from'./chunk-DipTNkHN.js';import {aj as l$1,T as T$1,ab as C$1,N as Nt,aG as pt,aZ as ee,U as Ue,ai as m$1,C as Bu}from'./main-KFKZO6SJ.js';var y=class{constructor(t){this.loader=t;}loader;_data=Ue(void 0);_isLoading=false;_loaded=false;load(){return !this._loaded&&!this._isLoading&&(this._isLoading=true,this.loader().pipe(Bu(()=>this._isLoading=false)).subscribe(t=>{this._data.set(t),this._loaded=true;})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=false;}};var d=class e{#e=T$1(C$1);#o=new y(()=>this.getS3Config("Providers"));#n=new y(()=>this.getS3Config("Regions"));#r=new y(()=>this.getS3Config("RegionHosts"));#s=new y(()=>this.getS3Config("StorageClasses"));#i=Nt(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#a=new y(()=>this.getStorjConfig("Satellites"));#l=new y(()=>this.getStorjConfig("AuthenticationMethods"));#c=new y(()=>this.getOpenstackConfig("Providers"));#u=new y(()=>this.getOpenstackConfig("Versions"));#p=new y(()=>this.getGcsConfig("Locations"));#m=new y(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#i}getS3ProvidersFiltered(t){return Nt(()=>this.getS3AllProviders()().filter(t))}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#s.load()}getStorjSatellites(){return this.#a.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#u.load()}getGcsLocations(){return this.#p.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(pt(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(pt(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(pt(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(pt(o=>this.#t(o)))}#t(t){return (t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}getDuplicatiStorageBackups(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"duplicati-list-backups",requestBody:{action:"ListBackups",url:t}}).pipe(pt(o=>this.#t(o)),pt(o=>o.find(r=>r.key==="folders")?.value),pt(o=>JSON.parse(o)))}getFilenApiKey(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"filen-get-api-key",requestBody:{"filen-operation":"GetApiKey","backup-id":o??"",url:t}}).pipe(pt(r=>this.#t(r)),pt(r=>r.find(n=>n.key==="api-key")?.value))}getOffice365Counts(t,o,r){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":r??"","source-prefix":o,operation:"CountItems",url:t}}).pipe(pt(n=>this.#t(n)),pt(n=>n.find(i=>i.key==="counts")?.value),pt(n=>JSON.parse(n)))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=ee({token:e,factory:e.\u0275fac,providedIn:"root"})};var s=new jn,u={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},U={description:$localize`Unknown destination type`,icon:"assets/dest-icons/file-system.png",isDefaultEntry:true,customFields:{path:{type:"String",name:"path",doubleSlash:u,shortDescription:$localize`Path`,formElement:e=>s.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return l$1({destinationType:e,custom:{path:n.split("?")[0]}},l(e,t))}}},F={key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,icon:"assets/dest-icons/s3compat.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3AllProviders(),isMandatory:true,formElement:e=>s.control(e??"")},{name:"auth-username",isMandatory:true},{name:"auth-password",isMandatory:true},{name:"use-ssl"}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>Ue([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}]),validate:e=>({type:"warning",message:$localize`Invalid client selected`})}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},P=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,icon:"assets/dest-icons/file-system.png",searchTerms:"local disk harddrive localdisk filesystem unc server share drive",sortOrder:110,customFields:{path:{type:"FolderTree",name:"path",doubleSlash:u,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>s.control(e??""),isMandatory:true}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),p=n.slice(1).startsWith(":\\")||n.slice(1).startsWith(":/")||n.startsWith("\\\\")?n:"/"+n;return l$1({destinationType:e,custom:{path:p.split("?")[0]}},l(e,t))}}},{key:"duplicati",displayName:$localize`Duplicati Storage`,description:$localize`Store backups with Duplicati Storage.`,icon:"assets/dest-icons/duplicati.png",searchTerms:"duplicati internal built-in",sortOrder:100,dynamicFields:[{name:"duplicati-backup-id",type:"DuplicatiBackupId",isMandatory:true,shortDescription:$localize`Unique Backup ID`,longDescription:$localize`A unique identifier for the backup job. It is recommended to not change this value.`}],mapper:{to:e=>c(e,null,null,null),from:(e,t,o)=>l$1({destinationType:e},l(e,t)),default:e=>e&&e.length>0?`duplicati://?duplicati-backup-id=${encodeURIComponent(e)}`:"duplicati://"}},{key:"ssh",displayName:$localize`SFTP (SSH)`,description:$localize`Store backups with SFTP (SSH).`,icon:"assets/dest-icons/ssh.png",searchTerms:"sftp scp secure shell",sortOrder:80,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>s.control(e??"",[me.required,me.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,longDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,longDescription:$localize`Password`}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,icon:"assets/dest-icons/s3compat.png",searchTerms:"spaces cloud digitalocean cloudian minio linode bunnycdn oracle cloudflare alibaba huawei tencent baidu jd ucloud qiniu aliyun tcloud tencent ",sortOrder:90,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3AllProviders(),isMandatory:true,formElement:e=>s.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:true},{name:"auth-password",isMandatory:true}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>Ue([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"s3",customKey:"s3-aws",displayName:$localize`Amazon S3`,description:$localize`Store backups in Amazon S3.`,icon:"assets/dest-icons/aws.png",searchTerms:"amazon aws",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3ProvidersFiltered(t=>t.value.endsWith(".amazonaws.com")),isMandatory:true,formElement:e=>s.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:true},{name:"auth-password",isMandatory:true}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>Ue([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return e.dynamic["s3-server-name"]?.endsWith(".amazonaws.com")&&(e.destinationType="s3"),c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))},default:e=>"s3-aws://?use-ssl=true",intercept:e=>e.searchParams.get("s3-server-name")?.endsWith(".amazonaws.com")??false}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,icon:"assets/dest-icons/google-cloud.png",oauthField:"authid",searchTerms:"gcp googlecloud",sortOrder:70,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true,longDescription:$localize`An OAuth token with access to the Google Cloud Storage. Not required if service account JSON is provided.`}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getGcsStorageClasses()},{name:"gcs-service-account-file",type:"FileTree",accepts:".json,",shortDescription:$localize`Service account JSON file`,longDescription:$localize`Pick the path to a file with service account JSON.`},{name:"gcs-service-account-json",type:"FreeText",shortDescription:$localize`Service account JSON`,longDescription:$localize`Paste the service account JSON here.`}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,icon:"assets/dest-icons/google-drive.png",oauthField:"authid",searchTerms:"gdrive",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,icon:"assets/dest-icons/pcloud.png",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>Ue([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:true}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return l$1({destinationType:e,custom:{server:r,path:n}},l(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,icon:"assets/dest-icons/azure.png",searchTerms:"microsoft ms",sortOrder:60,customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,icon:"assets/dest-icons/one-drive.png",oauthField:"authid",searchTerms:"micorsoft ms",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business (deprecated)`,description:$localize`Store backups in OneDrive Business. Deprecated, use Sharepoint instead.`,icon:"assets/dest-icons/one-drive.png",searchTerms:"microsoft ms",sortOrder:-1,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:true}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint (deprecated)`,description:$localize`Store backups in Microsoft SharePoint using legacy API.`,icon:"assets/dest-icons/sharepoint.png",searchTerms:"microsoft ms",sortOrder:-1,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"String",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:true}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"assets/dest-icons/sharepoint.png",oauthField:"authid",searchTerms:"microsoft ms",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:true},{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,icon:"assets/dest-icons/dropbox.png",oauthField:"authid",searchTerms:"dbx",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,icon:"assets/dest-icons/box-com.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,icon:"assets/dest-icons/jottacloud.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,icon:"assets/dest-icons/backblaze.png",searchTerms:"backblaze",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true,validate:e=>{function t(o){if(!o)return false;let r=o.length;return !(r<6||r>63||!/^[a-zA-Z0-9.-]+$/.test(o)||!/^[a-zA-Z0-9]/.test(o)||!/[a-zA-Z0-9]$/.test(o)||/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||/(\.\.)|(\.-)|(-\.)/.test(o)||o.toLowerCase().startsWith("b2-"))}return t(e)?null:{type:"error",message:$localize`Invalid bucket name.`}}},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:true}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,icon:"assets/dest-icons/idrive-e2.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"String",name:"path",doubleSlash:u,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:true}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{bucket:r,path:n}},l(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,icon:"assets/dest-icons/mega-nz.png",sortOrder:-1,customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:true}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,icon:"assets/dest-icons/office-365.png",oauthField:"authid",searchTerms:"ms",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>s.control(e??"",[me.email]),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,icon:"assets/dest-icons/rackspace.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:true}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,icon:"assets/dest-icons/rclone.png",searchTerms:"rcl",dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return C(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced??{}),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=l(e,t),{bucket:i,path:p}=m(t);return {destinationType:e,dynamic:l$1({"rclone-remote-repository":i,"rclone-remote-path":p},n),advanced:l$1({},r)}}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,icon:"assets/dest-icons/open-stack.png",searchTerms:"swift",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>s.control(e??""),isMandatory:true}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(d).getOpenstackProviders(),isMandatory:true},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(d).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{bucket:r,path:n}=m(t);return l$1({destinationType:e,custom:{path:n,bucket:r}},l(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,icon:"assets/dest-icons/webdav.png",searchTerms:"web dav",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:true}],advancedFields:[{type:"FileTree",name:"debug-propfind-file",accepts:".txt,.log"}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",searchTerms:"alt file transfer protocol ftps",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:true}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",searchTerms:"file transfer protocol ftps",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:true}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,icon:"assets/dest-icons/sia-cloud.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return C(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,icon:"assets/dest-icons/tencent-cloud.png",customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:true,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:true},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:true},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:true}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=m$1(l$1({},e),{advanced:m$1(l$1({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=l(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],l$1({destinationType:e,custom:{path:h(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,icon:"assets/dest-icons/tahoelafs.png",searchTerms:"least authority file system",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>s.control(e??"")},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:i}=m(t);return l$1({destinationType:e,custom:{server:r,port:n,path:i}},l(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,icon:"assets/dest-icons/smb.png",searchTerms:"cifs samba",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>s.control(e??""),isMandatory:true},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>s.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:true},{name:"auth-password",isMandatory:true},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,N(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),i=n.split("/")[0],p=n.split("/").slice(1).join("/");return l$1({destinationType:e,custom:{server:r,share:i,path:p}},l(e,t))}}},{key:"cifs",displayName:$localize`CIFS (deprecated)`,description:$localize`Same as SMB backend, but with a different name. Use SMB instead.`,icon:"assets/dest-icons/smb.png",sortOrder:-1,mapper:U.mapper},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,icon:"assets/dest-icons/filen.png",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:true},{name:"auth-password",isMandatory:true},{name:"two-factor-code",type:"Filen2FACode"}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,icon:"assets/dest-icons/file-jump.png",sortOrder:-1,customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>s.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>s.control(e??""),isMandatory:true}],mapper:{to:e=>{let{path:t}=e.custom;return c(e,null,null,t)},from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:true},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:true},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:u},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getStorjSatellites(),isMandatory:true}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return `storj://storj.io/config${$([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=l(e,t);return delete r.advanced["storj-auth-method"],l$1({destinationType:e},r)},intercept:e=>e.protocol!=="storj:"?false:!!(e.searchParams.get("storj-shared-access")||e.searchParams.get("storj-auth-method")==="Acccess grant"),default:()=>"storj://?storj-shared-access=&storj-auth-method=Acccess+grant"}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(d).getStorjSatellites(),isMandatory:true},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:true},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:true},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:true},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:u}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return `storj://storj.io/config${$([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=l("storjApiKey",t);return delete r.advanced["storj-auth-method"],l$1({destinationType:e},r)},intercept:e=>e.protocol!=="storj:"?false:!!(e.searchParams.get("storj-api-key")||e.searchParams.get("storj-secret")||e.searchParams.get("storj-auth-method")==="API key"),default:()=>"storj://?storj-api-key=&storj-secret=&storj-auth-method=API+key"}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,icon:"assets/dest-icons/aliyun.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>s.control(e??""),isMandatory:true},path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:true},{name:"oss-access-key-id",isMandatory:true},{name:"oss-access-key-secret",isMandatory:true}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=m$1(l$1({},e),{advanced:m$1(l$1({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=l(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],l$1({destinationType:e,custom:{path:h(t),bucket:n}},r)}}},{key:"office365",displayName:$localize`Microsoft 365`,description:$localize`Create backups of Microsoft 365 data.`,searchTerms:"office o365 office365 m365 ms365",icon:"assets/dest-icons/office365.png",isNonFree:true,dynamicFields:[{name:"auth-username",shortDescription:$localize`Client ID`,longDescription:$localize`Application (client) ID from your Azure AD app registration.`,isMandatory:true},{name:"auth-password",shortDescription:$localize`Client Secret`,longDescription:$localize`Client Secret from your Azure AD app registration.`,isMandatory:true},{name:"office365-tenant-id",shortDescription:$localize`Tenant ID`,isMandatory:true}],advancedFields:[{name:"office365-certificate-path",type:"FileTree"}],mapper:{to:e=>`office365://${$([...Object.entries(e.advanced),...Object.entries(e.dynamic)])}`,from:(e,t,o)=>{let{advanced:r,dynamic:n}=l(e,t);return {destinationType:e,advanced:l$1({},r),dynamic:l$1({},n)}}}},{key:"googleworkspace",displayName:$localize`Google Workspace`,description:$localize`Create backups of Google Workspace data.`,icon:"assets/dest-icons/googleworkspace.png",isNonFree:true,dynamicFields:[{name:"google-admin-email",type:"Email",shortDescription:$localize`Admin Email`,longDescription:$localize`Email address of the Google Workspace admin user.`,isMandatory:true},{name:"google-service-account-json",type:"FreeText",shortDescription:$localize`Service account JSON`,longDescription:$localize`Paste the service account JSON here.`,isMandatory:true}],advancedFields:[{name:"google-service-account-file",type:"FileTree",accepts:".json,",shortDescription:$localize`Service account JSON file`,longDescription:$localize`Pick the path to a file with service account JSON.`}],mapper:{to:e=>`googleworkspace://${$([...Object.entries(e.advanced),...Object.entries(e.dynamic)])}`,from:(e,t,o)=>{let{advanced:r,dynamic:n}=l(e,t);return {destinationType:e,advanced:l$1({},r),dynamic:l$1({},n)}}}},{key:"drimecloud",displayName:$localize`Drime Cloud`,description:$localize`Store backups in Drime Cloud.`,icon:"assets/dest-icons/drime.png",customFields:{path:{type:"Path",name:"path",doubleSlash:u,shortDescription:$localize`Path in Drime Cloud`,longDescription:$localize`Path in Drime Cloud`,formElement:e=>s.control(e??"")}},dynamicFields:[{name:"api-token",isMandatory:true}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>l$1({destinationType:e,custom:{path:h(t)}},l(e,t))}},g("rabata","Rabata.io",null,"assets/dest-icons/rabata.png",[".rabata.io"]),g("wasabi","Wasabi Hot Storage",null,"assets/dest-icons/wasabi.png",[".wasabisys.com"]),g("impossiblecloud","Impossible Cloud",null,"assets/dest-icons/impossiblecloud.png",[".impossibleapi.net"]),g("scaleway","Scaleway",null,"assets/dest-icons/scaleway.png",[".scw.cloud"]),g("hosteurope","Hosteurope",null,"assets/dest-icons/hosteurope.png",[".hosteurope.de"]),g("dunkel","Dunkel",null,"assets/dest-icons/dunkel.png",[".dunkel.de"]),g("dreamhost","DreamHost",null,"assets/dest-icons/dreamhost.png",[".dreamhost.com"]),g("dincloud","dinCloud",null,"assets/dest-icons/dincloud.png",[".dincloud.com"]),g("polisystems","Poli Systems",null,"assets/dest-icons/polisystems.png",[".polisystems.ch"]),g("ibmcos","IBM COS",null,"assets/dest-icons/ibmcos.png",[".softlayer.net"]),g("storadera","Storadera",null,"assets/dest-icons/storadera.png",[".storadera.com"]),g("infomaniak","Infomaniak",null,"assets/dest-icons/infomaniak.png",[".infomaniak.com",".infomaniak.cloud"]),g("sakuracloud","\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9",null,"assets/dest-icons/sakuracloud.png",[".sakurastorage.jp"]),g("seagatelyve","Seagate Lyve",null,"assets/dest-icons/seagatelyve.png",[".lyvecloud.seagate.com"]),g("internxt","Internxt",null,"assets/dest-icons/internxt.png",[".internxt.com"]),g("selectel","Selectel",null,"assets/dest-icons/selectel.png",[".storage.selcloud.ru",".srvstorage.uz",".srvstorage.kz"])],j={".amazonaws.com":"Amazon S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3",".rabata.io":"Rabata S3",".internxt.com":"Internxt S3",".storage.selcloud.ru":"Selectel S3",".srvstorage.uz":"Selectel S3",".srvstorage.kz":"Selectel S3"};var W=new jn,v=class{host;hostname;exactHostname;pathname;port;protocol;search;username;password;searchParams;originalUrl;constructor(t){let o=new URL(t);this.originalUrl=t,this.host=o.host,this.hostname=o.hostname,this.exactHostname=this.extractExactHostname(t),this.pathname=o.pathname,this.port=o.port,this.protocol=o.protocol,this.search=o.search,this.username=o.username,this.password=o.password,this.searchParams=o.searchParams;}extractExactHostname(t){let o=t.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/(?:[^@\/?#]*@)?(\[[a-fA-F0-9:.]+\]|[^:\/?#]+)/);return o?o[1]:""}};function c(e,t,o,r){return C(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function C(e,t,o,r,n){let i=$(n),p=encodeURIComponent(_(t)),S=p==""?"":p+K(o),k=r??"",w=k.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,b=N(S,H(k));return `${w}${b}${i}`}function R(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function N(...e){if(e.length===0)return "";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function H(e){return e.split("/").map(encodeURIComponent).join("/")}function h(e){if(e==null||e==="")return "";if(typeof e=="string")try{e=new v(e);}catch{return ""}return decodeURIComponent(e.exactHostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function _(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function K(e){return e==null||e===""?"":":"+e.toString()}function Fe(e){return e?e.startsWith("diskimage:")?"assets/dest-icons/external-harddrive.png":V(e).icon:""}function Pe(e){if(!e)return "";if(e.startsWith("diskimage:"))return $localize`Local disk`;let t=V(e);return t?t.displayName:"Unknown"}function V(e){try{let o=new v(e),r=P.find(n=>n.mapper.intercept?.(o));if(r)return r}catch{}let t=e.split("://")[0];return G(t)}var q={file:{Display:$localize`Local`,Icon:null}};function Oe(e){if(!e)return "";let t=V(e);if(!t)return "";let o=q[t.key];if(o?.Display)return o.Display;if(t.key==="s3"){let r="http://null?"+e.split("?")[1],i=new URL(r).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[p,S]of Object.entries(j))if(i.endsWith(p))return S}return t.displayName}function G(e){return P.find(o=>o.key===e||o.customKey===e)??P.find(o=>`${o.key}s`===e)??null??l$1({key:e,displayName:e},U)}function Me(e){return P.filter(t=>t.key===e||t.customKey===e)}function m(e){return {bucket:decodeURIComponent(e.exactHostname),server:decodeURIComponent(e.exactHostname||e.hostname),port:e.port,path:R(decodeURIComponent(e.pathname))}}function l(e,t){let o={},r={},n=G(e);return t.searchParams.forEach((i,p)=>{n?.dynamicFields?.some(k=>k===p||k?.name===p)?r[p]=decodeURIComponent(i):o[p]=decodeURIComponent(i);}),{advanced:o,dynamic:r}}function $(e,t=false){let o=e.map(([n,i])=>`${n}=${i?encodeURIComponent(i.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function Ce(e){let t=e.destinationType??"";return G(t)?.mapper.to(e)??""}function Ve(e){let t=e.split("://")[0],o=e.split("://")[1],r=t==="file"?"http://dummy":o==""||o.startsWith("?")?`${t}://`+o:"http://"+o;if(!o)return null;let n=V(e),i="";if(`${n.key}s`===t&&(i+=r.indexOf("?")===-1?"?":"&",i+="use-ssl=true",e=n.key+e.substring(t.length)),t==="file"&&o.indexOf("?")!==-1&&(i+=i.indexOf("?")===-1?"?":"&",i+=o.split("?")[1]??""),t==="file"&&o.startsWith("%")&&!o.startsWith("%5C"))return G(t).mapper.from(t,new v("http://localhost"+i),e);try{let p=new v(r+i);if(p.host==="undefined")return null;let S=o.split("?")[0].split("/")[0],k=p.host!=""&&!isNaN(Number(p.host.replaceAll(".",""))),A=S.split("."),w=A.length===4&&A.every(b=>b.length&&b.length<=3&&!isNaN(Number(b))&&parseInt(b)<=255);return k&&!w?null:n.mapper.from(n.key,p,e)}catch(p){return console.error("Error while parsing target path",e,r+i,p),null}}function T(e){return typeof e!="string"||!e.trim()?[]:e.split(`
2
+ `).map(t=>t.trim()).filter(t=>t).map(t=>{let[o,...r]=t.split("="),n=r.join("=").trim();return o.trim()?[o.trim(),n]:null}).filter(t=>t!==null)}function Ge(e){return T(e).map(([t,o])=>({Name:t,Value:o}))}function Ae(e){return Object.fromEntries(T(e))}function we(e){if(!e)return false;let t=e.length;return !(t<3||t>63||!/^[a-z0-9.-]+$/.test(e)||!/^[a-z0-9]/.test(e)||!/[a-z0-9]$/.test(e)||/^\d{1,3}(\.\d{1,3}){3}$/.test(e)||/(\.\.)|(\.-)|(-\.)/.test(e))}function Ee(e){if(!e||e.length>253)return false;let t=e.split(".");for(let o of t)if(!o||o.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(o))return false;return true}function g(e,t,o,r,n){return m$1(l$1({},F),{customKey:`s3-${e}`,icon:r??F.icon,displayName:$localize`${t} (S3)`,description:$localize`Store backups in ${t} storage.`,dynamicFields:[...(F.dynamicFields??[]).filter(i=>i?.name!=="s3-server-name"),{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the ${t} endpoint`,type:"NonValidatedSelectableString",loadOptions:i=>i.get(d).getS3ProvidersFiltered(p=>n.some(S=>p.value.endsWith(S))),isMandatory:true,formElement:i=>W.control(i??"")}],mapper:m$1(l$1({},F.mapper),{to:i=>{let{bucket:p,path:S}=i.custom;return n.some(k=>i.dynamic["s3-server-name"]?.endsWith(k))&&(i.destinationType="s3"),c(i,p,null,S)},default:i=>`s3-${e}://?use-ssl=true`,intercept:i=>n.some(p=>i.searchParams.get("s3-server-name")?.endsWith(p))??false})})}
3
+ export{Ae as A,Ce as C,Ee as E,Fe as F,G,Me as M,Oe as O,Pe as P,V,Ge as a,Ve as b,d,h,we as w};
@@ -0,0 +1,2 @@
1
+ import {e as ee}from'./chunk-B0RBkC1E.js';import'./chunk-BB1pOOUx.js';import'./chunk-DN6f5jXR.js';import'./chunk-3RXp81pP.js';import {r as rt,n as nn,s as st,Y as Yt,e as en}from'./chunk-ByhuT4BS.js';import'./chunk-C4kBXz3C.js';import'./chunk-Dh6x3lXP.js';import'./chunk-DD_QfWih.js';import'./chunk-khm9J_G0.js';import'./chunk-wyNyzSXi.js';import {h,G,V}from'./chunk-CegwkGVu.js';import'./chunk-CT9ziigM.js';import'./chunk-D5lj-fQk.js';import'./chunk-D6aNT_wo.js';import {c}from'./chunk-OLi7f6y7.js';import'./chunk-B2TXzbpy.js';import {T,a5 as g,a6 as be$1,B as y1,U as Ue$1,N as Nt,G as Ga,at as h$1,d as dw,v,f as N,j as mg,Q as Qi,o as oT,H as Hl,D as DE,i as iT,t as tC,$ as $g,K as lC,X as XT,n as nC,k as gT,F as Fg,S as Sd,x as xd,q as PC,O as Og,P as Pg,au as Lg,av as eC,I as Qg,z as gg,a1 as cT,ap as sT,a2 as lT,s as sm,l as HC,p as DD,w as im,y as TD,E as nm}from'./main-KFKZO6SJ.js';import {f}from'./chunk-DPNAj9Vc.js';import {d}from'./chunk-CRAg6SRo.js';import {F as Fe$1}from'./chunk-DuIUmwWN.js';import {B as Bn,Z as Ze,R as Rn,J as Jt}from'./chunk-DipTNkHN.js';import'./chunk-Fw6nFDZK.js';import'./chunk-Ca1C9pJ0.js';import'./chunk-C-NgIZiF.js';import'./chunk-PVmXLw9b.js';import'./chunk-C7pjkqKB.js';function Ee(n,t){n&1&&(Qi(0,"div",13),mg(1,"sh-progress-bar",14),Qi(2,"div",15)(3,"h3"),XT(4,2),Hl()()());}function Fe(n,t){n&1&&(Qi(0,"sh-divider"),XT(1,5),Hl());}function Ie(n,t){if(n&1&&(Qi(0,"p",20),PC(1),Hl()),n&2){let e=nC().$implicit;DE(),nm(e.Description);}}function Ne(n,t){if(n&1&&(Qi(0,"p",20),PC(1),Hl()),n&2){let e=nC().$implicit,o=nC(3);DE(),nm(o.getSimplePath(e.BaseUrl));}}function ye(n,t){if(n&1){let e=gT();Qi(0,"button",25),Fg("click",function(i){Sd(e);let r=nC().$implicit,f=nC(3);return xd(f.updateBackupsSync(r,i))}),PC(1," Update backups "),Hl();}if(n&2){let e=nC(4);gg("disabled",e.isSaving());}}function he(n,t){if(n&1){let e=gT();Qi(0,"app-destination-list-item",18),Fg("click",function(){let i=Sd(e).$implicit,r=nC(3);return xd(r.selectDestination(i))}),Qi(1,"h3",19),PC(2),Hl(),oT(3,Ie,2,1,"p",20)(4,Ne,2,1,"p",20),Qi(5,"div",21),oT(6,ye,2,1,"button",22),Qi(7,"button",23),Fg("click",function(i){let r=Sd(e).$implicit,f=nC(3);return xd(f.deleteDestination(r.ID,i))}),Qi(8,"sh-icon"),PC(9,"trash"),Hl()(),Qi(10,"button",24),Og(11,6),mg(12,"sh-icon"),Pg(),Hl()()();}if(n&2){let e=t.$implicit,o=nC(3);gg("targetUrl",e.BaseUrl),DE(2),nm(e.Name||e.BaseUrl),DE(),iT(e.Description?3:4),DE(3),iT(o.isOutOfSync(e)?6:-1);}}function Oe(n,t){if(n&1){let e=gT();Qi(0,"sh-card",16),Fg("click",function(){Sd(e);let i=nC(2);return xd(i.selectDestination("new"))})("keydown.enter",function(i){return i.target.click()})("keydown.space",function(i){return i.target.click()}),Qi(1,"sh-icon"),PC(2,"plus-circle"),Hl(),Qi(3,"div",15)(4,"h3"),XT(5,3),Hl(),Qi(6,"p"),XT(7,4),Hl()()(),oT(8,Fe,2,0,"sh-divider"),cT(9,he,13,4,"app-destination-list-item",17,sT);}if(n&2){let e=nC(2);DE(8),iT(e.destinations().length>0?8:-1),DE(),lT(e.destinations());}}function xe(n,t){if(n&1&&(Qi(0,"h2"),XT(1,1),Hl(),oT(2,Ee,5,0,"div",13)(3,Oe,11,1)),n&2){let e=nC();DE(2),iT(e.isLoading()?2:3);}}function Be(n,t){n&1&&XT(0,10,1);}function Pe(n,t){n&1&&XT(0,10,2);}function Ae(n,t){n&1&&XT(0,10,3);}function Me(n,t){if(n&1){let e=gT();Qi(0,"button",37),Fg("click",function(){Sd(e);let i=nC(2);return xd(i.testDestination())}),Og(1,10),oT(2,Be,1,0)(3,Pe,1,0)(4,Ae,1,0),Pg(),Hl();}if(n&2){let e=nC(2);gg("disabled",e.testSignal()=="testing"),DE(2),iT(e.testSignal()=="testing"?2:e.testResponse()?.action==="success"?3:4);}}function be(n,t){if(n&1){let e=gT();Qi(0,"div",32)(1,"sh-form-field")(2,"label"),XT(3,11),Hl(),Qi(4,"input",38),sm("ngModelChange",function(i){Sd(e);let r=nC(2);return HC(r.editName,i)||(r.editName=i),xd(i)}),Hl(),DD(),Hl()();}if(n&2){let e=nC(2);DE(4),im("ngModel",e.editName),TD();}}function $e(n,t){if(n&1){let e=gT();Qi(0,"app-test-url",39,0),sm("targetUrlChange",function(i){Sd(e);let r=nC(2);return HC(r.editBaseUrl,i)||(r.editBaseUrl=i),xd(i)})("testSignalChange",function(i){Sd(e);let r=nC(2);return HC(r.testSignal,i)||(r.testSignal=i),xd(i)}),Hl();}if(n&2){let e=nC(2);im("targetUrl",e.editBaseUrl)("testSignal",e.testSignal),gg("connectionStringId",e.selectedDestinationId())("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",true)("askToCreate",true)("testExpectation","any")("readOnlyTest",false)("moduleType","Backend");}}function ke(n,t){if(n&1){let e=gT();Qi(0,"app-destination-list-item",40)(1,"button",41),Fg("click",function(){Sd(e);let i=nC(2);return xd(i.removeDestination())}),XT(2,12),Hl()(),Qi(3,"app-single-destination",42),sm("targetUrlChange",function(i){Sd(e);let r=nC(2);return HC(r.editBaseUrl,i)||(r.editBaseUrl=i),xd(i)}),Hl();}if(n&2){let e=nC(2);gg("targetUrl",e.editBaseUrl()),DE(3),im("targetUrl",e.editBaseUrl);}}function Re(n,t){if(n&1){let e=gT();Qi(0,"app-destination-list",43),Fg("setDestination",function(i){Sd(e);let r=nC(2);return xd(r.setDestination(i))}),Hl();}}function Le(n,t){n&1&&XT(0,9,1);}function we(n,t){n&1&&XT(0,9,2);}function Ue(n,t){n&1&&XT(0,9,3);}function ve(n,t){n&1&&XT(0,9,4);}function Ge(n,t){if(n&1){let e=gT();Qi(0,"header",26)(1,"button",23),Fg("click",function(){Sd(e);let i=nC();return xd(i.cancelEdit())}),Qi(2,"sh-icon"),PC(3,"arrow-left"),Hl()()(),Qi(4,"div",27)(5,"sh-card",28)(6,"header",29)(7,"h3"),XT(8,7),Hl(),Qi(9,"div",30),oT(10,Me,5,2,"button",31),Hl()(),oT(11,be,5,1,"div",32),oT(12,$e,2,10,"app-test-url",33),oT(13,ke,4,2)(14,Re,1,0,"app-destination-list"),Hl(),Qi(15,"div",34)(16,"button",35),Fg("click",function(){Sd(e);let i=nC();return xd(i.cancelEdit())}),XT(17,8),Hl(),Qi(18,"button",36),Fg("click",function(){Sd(e);let i=nC();return xd(i.testResponse()?.action==="success"||i.testResponse()?.action==="missing-folder"||!i.isUrlChanged()?i.save():i.testDestination())}),Og(19,9),oT(20,Le,1,0)(21,we,1,0)(22,Ue,1,0)(23,ve,1,0),Pg(),Hl()()();}if(n&2){let e=nC();DE(8),Lg(e.selectedDestination()==="new"?"New Destination":"Edit Destination"),eC(8),DE(2),iT(e.editBaseUrl()?10:-1),DE(),iT(e.selectedDestination()!=="new"?11:-1),DE(),iT(e.editBaseUrl()?12:-1),DE(),iT(e.editBaseUrl()?13:14),DE(5),Qg("primary",e.testResponse()?.action==="success"||!e.isUrlChanged())("warn",e.isUrlChanged()&&e.testSignal()===null||e.testSignal()==="testing"||e.testResponse()?.action==="missing-folder")("error",e.testResponse()&&e.testResponse()?.action!=="success"&&e.testResponse()?.action!=="missing-folder"),gg("disabled",!e.editBaseUrl()||e.isSaving()||e.testSignal()==="testing"),DE(2),iT(e.isSaving()?20:e.testSignal()==="testing"?21:e.testResponse()?.action==="success"||e.testResponse()?.action==="missing-folder"||!e.isUrlChanged()?22:23);}}var R=class n{#e=T(rt);#t=T(g);#n=T(be$1);getSimplePath=h;backups=this.#t.backups;constructor(){this.#t.getBackups();}isSaving=this.#e.isSaving;destinations=this.#e.destinations;isLoading=this.#e.resourceDestinations.isLoading;testUrl=y1(nn);selectedDestination=Ue$1(null);selectedDestinationId=Nt(()=>this.selectedDestination()!=="new"?this.selectedDestination().ID:null);editName=Ue$1(null);editDescription=Ue$1(null);editBaseUrl=Ue$1(null);initialBaseUrl=Ue$1(null);isUrlChanged=Nt(()=>{let t=this.editBaseUrl(),e=this.initialBaseUrl();return this.selectedDestination()==="new"?true:t!==e});testSignal=Ue$1(null);testResponse=Nt(()=>{let t=this.testSignal();return t&&typeof t!="string"?t:null});getOutOfSyncBackupIds(t){if(!t.Backups)return [];let e=new Map(this.backups().map(o=>[o.Backup?.ID,o.Backup]));return t.Backups.filter(o=>{let i=e.get(o.ID);return i&&i.TargetURL!==t.BaseUrl}).map(o=>o.ID).filter(o=>!!o)}isOutOfSync(t){return this.getOutOfSyncBackupIds(t).length>0}#i=Ga(()=>{this.editBaseUrl(),this.testSignal.set(null);});selectDestination(t){this.selectedDestination.set(t),this.testSignal.set(null),t==="new"?(this.editName.set(null),this.editDescription.set(null),this.editBaseUrl.set(null),this.initialBaseUrl.set(null)):(this.editName.set(t.Name),this.editDescription.set(t.Description),this.editBaseUrl.set(t.BaseUrl),this.initialBaseUrl.set(t.BaseUrl),this.#e.getById(t.ID).subscribe(e=>{e.Data&&(this.editName.set(e.Data.Name),this.editDescription.set(e.Data.Description),this.editBaseUrl.set(e.Data.BaseUrl??null),this.initialBaseUrl.set(e.Data.BaseUrl??null));}));}cancelEdit(){this.selectedDestination.set(null);}setDestination(t){let e=G(t??"");if(e){if(e.mapper.default){let o=e.mapper.default("");this.editBaseUrl.set(o);return}this.editBaseUrl.set(`${t}://`);}}removeDestination(){this.editBaseUrl.set(null);}async testDestination(){(await this.testUrl()?.testDestination(false))?.action==="missing-folder"&&this.promptCreateFolder();}promptCreateFolder(){this.#n.open(h$1,{data:{title:$localize`Folder missing`,message:$localize`The specified folder does not exist. Would you like to create it now?`,confirmText:$localize`Create Folder`,cancelText:$localize`Dismiss`},closed:t=>{t&&this.testUrl()?.createFolder();}});}save(){let t=this.selectedDestination();t&&this.performSave(t);}performSave(t){let e=this.editName(),o=this.editDescription(),i=this.editBaseUrl();if(t==="new"){let I=V(i??"")?.displayName??"Destination",y=this.destinations().filter(F=>F.Name?.startsWith(I)).length;e=`${I} #${y+1}`,o=null;}let r={Name:e,Description:o,BaseUrl:i};this.#e.save(t,r).subscribe(()=>{this.selectedDestination.set(null),this.#e.reload(),this.#t.getBackups(true);});}updateBackupsSync(t,e){e.stopPropagation();let o=this.getOutOfSyncBackupIds(t);this.#n.open(h$1,{data:{title:$localize`Update backups`,message:$localize`Are you sure you want to update ${o.length} backup(s) to use the current connection string?`,confirmText:$localize`Update`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#e.updateBackups(t.ID,o).subscribe(()=>{this.#e.reload(),this.#t.getBackups(true);});}});}deleteDestination(t,e){e.stopPropagation(),this.#n.open(h$1,{data:{title:$localize`Delete destination`,message:$localize`Are you sure you want to delete this destination?`,confirmText:$localize`Delete`,confirmVariant:"error",cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.delete(t).subscribe(()=>{this.#e.reload();});}});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=dw({type:n,selectors:[["app-destinations"]],viewQuery:function(e,o){e&1&&$g(o.testUrl,nn,5),e&2&&lC();},decls:4,vars:1,consts:()=>{let t;t=$localize`Destinations`;let e;e=$localize`Loading destinations...`;let o;o=$localize`Add new destination`;let i;i=$localize`Configure a new storage location.`;let r;r=$localize`Or manage your saved destinations`;let f;f=$localize` Manage ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let I;I=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let y;y=$localize`Cancel`;let F;F=$localize`${"\uFFFD*20:1\uFFFD"}:START_BLOCK_IF: Saving... ${"\uFFFD/*20:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*21:2\uFFFD"}:START_BLOCK_ELSE_IF: Testing... ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*22:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Save Destination ${"[\uFFFD/*21:2\uFFFD|\uFFFD/*22:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*23:4\uFFFD"}:START_BLOCK_ELSE: Test & Save ${"\uFFFD/*23:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,F=tC(F);let L;L=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE_IF: Retry test ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*4:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*4:3\uFFFD"}:CLOSE_BLOCK_ELSE:`;let w;w=$localize`Name`;let U;U=$localize`Name`;let v;return v=$localize`Change`,[["testUrl",""],t,e,o,i,r,f,I,y,F,L,U,v,[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],["tabindex","0",1,"type-a","actionable","add-new",3,"click","keydown.enter","keydown.space"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"manage-actions"],["shButton","","type","button",1,"small","raised","primary",3,"disabled"],["shButton","","iconOnly","","type","button",1,"ghost",3,"click"],["shButton","","type","button",1,"manage-btn"],["shButton","","type","button",1,"small","raised","primary",3,"click","disabled"],[1,"edit-header"],[1,"edit-form"],[1,"config-section","type-c"],[1,"dest-config-header"],[1,"actions"],["shButton","","type","button",1,"small","ghost",3,"disabled"],[1,"form-row"],[3,"targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[1,"form-footer"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised",3,"click","disabled"],["shButton","","type","button",1,"small","ghost",3,"click","disabled"],["placeholder",w,3,"ngModelChange","ngModel"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","connectionStringId","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[1,"selected-backend",3,"targetUrl"],["shButton","","type","button",1,"ghost",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"setDestination"]]},template:function(e,o){e&1&&(mg(0,"app-status-bar"),Qi(1,"section"),oT(2,xe,4,1)(3,Ge,24,13),Hl()),e&2&&(DE(2),iT(o.selectedDestination()===null?2:3));},dependencies:[st,Yt,en,ee,d,v,N,f,Fe$1,c,nn,Bn,Ze,Rn,Jt],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:1rem}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}h3[_ngcontent-%COMP%]{font:var(--paragraph-10)}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-info[_ngcontent-%COMP%]{flex:1}.custom-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--body-10);color:var(--base-7);margin:.25rem 0 0}.manage-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}@media(max-width:600px){.manage-actions[_ngcontent-%COMP%] .manage-btn[_ngcontent-%COMP%]{display:none}}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8)}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.edit-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.edit-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:1.5rem}@media(max-width:600px){.edit-form[_ngcontent-%COMP%] .form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem}.edit-form[_ngcontent-%COMP%] .config-section[_ngcontent-%COMP%] .dest-config-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.edit-form[_ngcontent-%COMP%] .form-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:1rem;margin-top:1rem;padding-top:1.5rem;border-top:1px solid var(--base-3)}.selected-backend[_ngcontent-%COMP%]{margin-bottom:.5rem}.loading-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center;padding:4rem}.loading-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}"]})};
2
+ export{R as default};
@@ -1,2 +1,2 @@
1
- import {v as v$1}from'./chunk-BcpsSgKo.js';import {c}from'./chunk-D48AStVy.js';import {ShipTable as ot}from'./chunk-CA-ER0DL.js';import {T,b as g1,G as Ga,U as Ue,d as dw,f as N,v as v$2,aJ as ci,o as oT,i as iT,I as Qg,Q as Qi,X as XT,H as Hl,j as mg,a1 as cT,n as nC,ag as zg,z as gg,D as DE,a2 as lT,k as gT,F as Fg,S as Sd,x as xd,q as PC,aM as tb,E as nm,aN as ob,aa as Gl,ap as sT}from'./main-PXGZLKMN.js';import'./chunk-BAZ5npJw.js';import'./chunk-DQW8lSiz.js';var B=(t,n)=>n.ID;function J(t,n){t&1&&(Qi(0,"div",4),XT(1,0),Hl());}function U(t,n){if(t&1&&(Qi(0,"li"),PC(1),Hl()),t&2){let e=n.$implicit;DE(),nm(e);}}function X(t,n){if(t&1&&(Qi(0,"strong"),PC(1,"# Exception"),Hl(),Qi(2,"ol",15),cT(3,U,2,1,"li",null,sT),Hl()),t&2){let e=nC(3).$implicit,a=nC(2);DE(3),lT(a.breakIntoLines(e.Exception));}}function j(t,n){if(t&1&&(Qi(0,"li"),PC(1),Hl()),t&2){let e=n.$implicit;DE(),nm(e);}}function z(t,n){if(t&1&&(Qi(0,"strong"),PC(1,"# Message"),Hl(),Qi(2,"ol",15),cT(3,j,2,1,"li",null,sT),Hl()),t&2){let e=nC(3).$implicit,a=nC(2);DE(3),lT(a.breakIntoLines(e.Message));}}function W(t,n){if(t&1&&(Qi(0,"code"),oT(1,X,5,0),oT(2,z,5,0),Hl()),t&2){let e=nC(2).$implicit;DE(),iT(e.Exception?1:-1),DE(),iT(e.Message?2:-1);}}function H(t,n){if(t&1&&(Qi(0,"tr")(1,"td",12)(2,"sh-list",13)(3,"div",14),PC(4),Hl(),Qi(5,"div",14),PC(6),Hl(),Qi(7,"div",14),PC(8),Hl(),Qi(9,"div",14),PC(10),Hl(),Qi(11,"div",14),PC(12),Hl()(),oT(13,W,3,2,"code"),Hl()()),t&2){let e=nC().$implicit;DE(4),Gl("ID: ",e.ID),DE(2),Gl("Type: ",e.Type),DE(2),Gl("Tag: ",e.Tag),DE(2),Gl("TaskID: ",e.TaskID),DE(2),Gl("MessageID: ",e.MessageID),DE(),iT(e.Exception||e.Message?13:-1);}}function q(t,n){if(t&1){let e=gT();Qi(0,"tr",10),Fg("click",function(){let u=Sd(e).$implicit,g=nC(2);return xd(g.toggleRow(u.ID))}),Qi(1,"td"),PC(2),tb(3,"date"),Hl(),Qi(4,"td"),PC(5),Hl(),Qi(6,"td",8)(7,"button",11)(8,"sh-icon"),PC(9,"caret-down"),Hl()()()(),oT(10,H,14,6,"tr");}if(t&2){let e=n.$implicit,a=nC(2);DE(2),nm(ob(3,5,e.When,"medium")),DE(3),nm(a.subStringMessage(e.Message)),DE(2),Qg("rotated-icon",e.ID===a.openRowId()),DE(3),iT(e.ID===a.openRowId()?10:-1);}}function K(t,n){if(t&1&&(Qi(0,"sh-table",6)(1,"tr",7)(2,"th"),XT(3,1),Hl(),Qi(4,"th"),XT(5,2),Hl(),mg(6,"th",8),Hl(),cT(7,q,11,8,null,null,B),Qi(9,"div",9),XT(10,3),Hl()()),t&2){let e=nC();zg("grid-template-columns","auto 1fr auto"),Qg("type-b",true),gg("data",e.logs())("loading",e.logsLoading()),DE(7),lT(e.logs());}}var v=class t{#e=T(v$1);whenFilter=g1();backupIdFilter=g1();polling=g1();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=Ga(()=>{let n=this.polling()??false;this.#e.isPolling.set(n);});openRowId=Ue(null);whenEffect=Ga(()=>{let n=this.whenFilter()??null;this.#e.setWhenFilter(n),this.#e.logLevel.set(n?"Verbose":"Disabled");});backupIdEffect=Ga(()=>{let n=this.backupIdFilter()??null;this.#e.setBackupIdFilter(n),this.#e.logLevel.set(n?"Verbose":"Disabled");});toggleRow(n){n!=null&&this.openRowId.set(n===this.openRowId()?null:n);}breakIntoLines(n){return n?n.split(`
1
+ import {v as v$1}from'./chunk-C6QX7znk.js';import {ShipTable as ot}from'./chunk-DFEb6rgg.js';import {c}from'./chunk-wyNyzSXi.js';import {T,b as g1,G as Ga,U as Ue,d as dw,f as N,v as v$2,aJ as ci,o as oT,i as iT,I as Qg,Q as Qi,X as XT,H as Hl,j as mg,a1 as cT,n as nC,ag as zg,z as gg,D as DE,a2 as lT,k as gT,F as Fg,S as Sd,x as xd,q as PC,aM as tb,E as nm,aN as ob,aa as Gl,ap as sT}from'./main-KFKZO6SJ.js';import'./chunk-B2TXzbpy.js';import'./chunk-CRAg6SRo.js';var B=(t,n)=>n.ID;function J(t,n){t&1&&(Qi(0,"div",4),XT(1,0),Hl());}function U(t,n){if(t&1&&(Qi(0,"li"),PC(1),Hl()),t&2){let e=n.$implicit;DE(),nm(e);}}function X(t,n){if(t&1&&(Qi(0,"strong"),PC(1,"# Exception"),Hl(),Qi(2,"ol",15),cT(3,U,2,1,"li",null,sT),Hl()),t&2){let e=nC(3).$implicit,a=nC(2);DE(3),lT(a.breakIntoLines(e.Exception));}}function j(t,n){if(t&1&&(Qi(0,"li"),PC(1),Hl()),t&2){let e=n.$implicit;DE(),nm(e);}}function z(t,n){if(t&1&&(Qi(0,"strong"),PC(1,"# Message"),Hl(),Qi(2,"ol",15),cT(3,j,2,1,"li",null,sT),Hl()),t&2){let e=nC(3).$implicit,a=nC(2);DE(3),lT(a.breakIntoLines(e.Message));}}function W(t,n){if(t&1&&(Qi(0,"code"),oT(1,X,5,0),oT(2,z,5,0),Hl()),t&2){let e=nC(2).$implicit;DE(),iT(e.Exception?1:-1),DE(),iT(e.Message?2:-1);}}function H(t,n){if(t&1&&(Qi(0,"tr")(1,"td",12)(2,"sh-list",13)(3,"div",14),PC(4),Hl(),Qi(5,"div",14),PC(6),Hl(),Qi(7,"div",14),PC(8),Hl(),Qi(9,"div",14),PC(10),Hl(),Qi(11,"div",14),PC(12),Hl()(),oT(13,W,3,2,"code"),Hl()()),t&2){let e=nC().$implicit;DE(4),Gl("ID: ",e.ID),DE(2),Gl("Type: ",e.Type),DE(2),Gl("Tag: ",e.Tag),DE(2),Gl("TaskID: ",e.TaskID),DE(2),Gl("MessageID: ",e.MessageID),DE(),iT(e.Exception||e.Message?13:-1);}}function q(t,n){if(t&1){let e=gT();Qi(0,"tr",10),Fg("click",function(){let u=Sd(e).$implicit,g=nC(2);return xd(g.toggleRow(u.ID))}),Qi(1,"td"),PC(2),tb(3,"date"),Hl(),Qi(4,"td"),PC(5),Hl(),Qi(6,"td",8)(7,"button",11)(8,"sh-icon"),PC(9,"caret-down"),Hl()()()(),oT(10,H,14,6,"tr");}if(t&2){let e=n.$implicit,a=nC(2);DE(2),nm(ob(3,5,e.When,"medium")),DE(3),nm(a.subStringMessage(e.Message)),DE(2),Qg("rotated-icon",e.ID===a.openRowId()),DE(3),iT(e.ID===a.openRowId()?10:-1);}}function K(t,n){if(t&1&&(Qi(0,"sh-table",6)(1,"tr",7)(2,"th"),XT(3,1),Hl(),Qi(4,"th"),XT(5,2),Hl(),mg(6,"th",8),Hl(),cT(7,q,11,8,null,null,B),Qi(9,"div",9),XT(10,3),Hl()()),t&2){let e=nC();zg("grid-template-columns","auto 1fr auto"),Qg("type-b",true),gg("data",e.logs())("loading",e.logsLoading()),DE(7),lT(e.logs());}}var v=class t{#e=T(v$1);whenFilter=g1();backupIdFilter=g1();polling=g1();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=Ga(()=>{let n=this.polling()??false;this.#e.isPolling.set(n);});openRowId=Ue(null);whenEffect=Ga(()=>{let n=this.whenFilter()??null;this.#e.setWhenFilter(n),this.#e.logLevel.set(n?"Verbose":"Disabled");});backupIdEffect=Ga(()=>{let n=this.backupIdFilter()??null;this.#e.setBackupIdFilter(n),this.#e.logLevel.set(n?"Verbose":"Disabled");});toggleRow(n){n!=null&&this.openRowId.set(n===this.openRowId()?null:n);}breakIntoLines(n){return n?n.split(`
2
2
  `):[]}subStringMessage(n){return n?n.substring(0,80)+"...":""}ngOnDestroy(){this.#e.destroy();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=dw({type:t,selectors:[["app-logs-live"]],hostVars:2,hostBindings:function(e,a){e&2&&Qg("is-disabled",a.logLevel()==="Disabled");},inputs:{whenFilter:[1,"whenFilter"],backupIdFilter:[1,"backupIdFilter"],polling:[1,"polling"]},decls:2,vars:1,consts:()=>{let n;n=$localize`Live logs are disabled`;let e;e=$localize`When`;let a;a=$localize`Message`;let u;return u=$localize`No data available`,[n,e,a,u,[1,"live-view-disabled"],[3,"type-b","data","loading","grid-template-columns"],[3,"data","loading"],["thead",""],[1,"sticky-end"],["table-no-rows",""],[3,"click"],["shButton","","type","button",1,"outlined","small"],[1,"expanded-cell"],[1,"primary"],["item",""],[1,"line-numbers-ol"]]},template:function(e,a){e&1&&oT(0,J,2,0,"div",4)(1,K,11,6,"sh-table",5),e&2&&iT(a.logLevel()==="Disabled"?0:1);},dependencies:[ot,N,c,v$2,ci],styles:["[_nghost-%COMP%]{display:block}.is-disabled[_nghost-%COMP%]{padding:0 2rem}.live-view-disabled[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:18.75rem;width:100%;background-color:var(--base-2);border:1px solid var(--base-3);border-radius:var(--shape-2);font:var(--paragraph-20)}.expanded-cell[_ngcontent-%COMP%]{height:auto;grid-column:1/-1;white-space:pre-wrap;display:flex;flex-direction:column;background:var(--base-2)}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1.5rem;border-radius:var(--shape-2);overflow:auto;white-space:pre;max-width:100%;width:100%}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0}code[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:inline-block;margin-bottom:.25rem}code[_ngcontent-%COMP%] ol.line-numbers-ol[_ngcontent-%COMP%] + strong[_ngcontent-%COMP%]{margin-top:1.25rem}"]})};export{v as default};
@@ -0,0 +1 @@
1
+ var o=[{path:"",loadComponent:()=>import('./chunk-Bceym75m.js'),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import('./chunk-CnRCpl-v.js')},{path:"live",loadComponent:()=>import('./chunk-CgcnOoRq.js')}]}],t=o;export{t as default};
@@ -1,2 +1,2 @@
1
- import {ShipTable as ot}from'./chunk-CA-ER0DL.js';import'./chunk-BAZ5npJw.js';import'./chunk-DQW8lSiz.js';import {T,ab as C,U as Ue,G as Ga,C as Bu,ai as m,aj as l,d as dw,f as N,v,aJ as ci,Q as Qi,X as XT,H as Hl,j as mg,a1 as cT,F as Fg,O as Og,o as oT,P as Pg,ag as zg,z as gg,D as DE,a2 as lT,i as iT,k as gT,S as Sd,n as nC,x as xd,q as PC,aM as tb,E as nm,aN as ob,I as Qg,ap as sT}from'./main-PXGZLKMN.js';function X(o,e){if(o&1&&(Qi(0,"li"),PC(1),Hl()),o&2){let t=e.$implicit;DE(),nm(t);}}function j(o,e){if(o&1&&(Qi(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),cT(4,X,2,1,"li",null,sT),Hl()()()()),o&2){let t=nC().$implicit,n=nC();DE(),zg("grid-column","1 / -1")("height","auto"),DE(3),lT(n.breakIntoLines(t.Exception));}}function K(o,e){if(o&1){let t=gT();Qi(0,"tr",9),Fg("click",function(){let _=Sd(t).$index,m=nC();return xd(m.toggleRow(_))}),Qi(1,"td"),PC(2),tb(3,"date"),Hl(),Qi(4,"td",10),PC(5),Hl(),Qi(6,"td"),PC(7),Hl(),Qi(8,"td")(9,"button",11)(10,"sh-icon"),PC(11,"caret-down"),Hl()()()(),oT(12,j,6,4,"tr");}if(o&2){let t=e.$implicit,n=e.$index,_=nC();DE(2),nm(t.Timestamp?ob(3,6,t.Timestamp*1e3,"medium"):"-"),DE(3),nm(t.BackupID>=0?t.BackupID:"-"),DE(2),nm(t.Message),DE(2),Qg("rotated-icon",n===_.openRowIndex()),DE(3),iT(n===_.openRowIndex()?12:-1);}}function V(o,e){o&1&&XT(0,4,1);}function q(o,e){o&1&&XT(0,4,2);}var H=["BackupID","Timestamp","Message","actions"],M=class o{#e=T(C);displayedColumns=Ue(H);openRowIndex=Ue(null);noMoreItems=Ue(false);logsIsLoading=Ue(false);logs=Ue([]);pagination=Ue({offsetTime:void 0,pagesize:10});paginationEffect=Ga(()=>{this.pagination();this.getLogs();});ngOnInit(){this.getLogs();}getLogs(){this.logsIsLoading.set(true);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(Bu(()=>this.logsIsLoading.set(false))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(true),this.logs.update(n=>[...n,...t]);}});}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e);}breakIntoLines(e){return e?e.split(`
1
+ import {ShipTable as ot}from'./chunk-DFEb6rgg.js';import'./chunk-B2TXzbpy.js';import'./chunk-CRAg6SRo.js';import {T,ab as C,U as Ue,G as Ga,C as Bu,ai as m,aj as l,d as dw,f as N,v,aJ as ci,Q as Qi,X as XT,H as Hl,j as mg,a1 as cT,F as Fg,O as Og,o as oT,P as Pg,ag as zg,z as gg,D as DE,a2 as lT,i as iT,k as gT,S as Sd,n as nC,x as xd,q as PC,aM as tb,E as nm,aN as ob,I as Qg,ap as sT}from'./main-KFKZO6SJ.js';function X(o,e){if(o&1&&(Qi(0,"li"),PC(1),Hl()),o&2){let t=e.$implicit;DE(),nm(t);}}function j(o,e){if(o&1&&(Qi(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),cT(4,X,2,1,"li",null,sT),Hl()()()()),o&2){let t=nC().$implicit,n=nC();DE(),zg("grid-column","1 / -1")("height","auto"),DE(3),lT(n.breakIntoLines(t.Exception));}}function K(o,e){if(o&1){let t=gT();Qi(0,"tr",9),Fg("click",function(){let _=Sd(t).$index,m=nC();return xd(m.toggleRow(_))}),Qi(1,"td"),PC(2),tb(3,"date"),Hl(),Qi(4,"td",10),PC(5),Hl(),Qi(6,"td"),PC(7),Hl(),Qi(8,"td")(9,"button",11)(10,"sh-icon"),PC(11,"caret-down"),Hl()()()(),oT(12,j,6,4,"tr");}if(o&2){let t=e.$implicit,n=e.$index,_=nC();DE(2),nm(t.Timestamp?ob(3,6,t.Timestamp*1e3,"medium"):"-"),DE(3),nm(t.BackupID>=0?t.BackupID:"-"),DE(2),nm(t.Message),DE(2),Qg("rotated-icon",n===_.openRowIndex()),DE(3),iT(n===_.openRowIndex()?12:-1);}}function V(o,e){o&1&&XT(0,4,1);}function q(o,e){o&1&&XT(0,4,2);}var H=["BackupID","Timestamp","Message","actions"],M=class o{#e=T(C);displayedColumns=Ue(H);openRowIndex=Ue(null);noMoreItems=Ue(false);logsIsLoading=Ue(false);logs=Ue([]);pagination=Ue({offsetTime:void 0,pagesize:10});paginationEffect=Ga(()=>{this.pagination();this.getLogs();});ngOnInit(){this.getLogs();}getLogs(){this.logsIsLoading.set(true);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(Bu(()=>this.logsIsLoading.set(false))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(true),this.logs.update(n=>[...n,...t]);}});}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e);}breakIntoLines(e){return e?e.split(`
2
2
  `):[]}loadMore(){let e=this.logs().at(-1)?.Timestamp;this.pagination.update(t=>m(l({},t),{offsetTime:e}));}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=dw({type:o,selectors:[["app-logs-stored"]],decls:18,vars:6,consts:()=>{let e;e=$localize`Timestamp`;let t;t=$localize`Backup ID`;let n;n=$localize`Message`;let _;_=$localize`No data available`;let m;return m=$localize`${"\uFFFD*16:1\uFFFD"}:START_BLOCK_IF: No more items ${"\uFFFD/*16:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*17:2\uFFFD"}:START_BLOCK_ELSE: Load more ${"\uFFFD/*17:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,[e,t,n,_,m,[1,"type-b",3,"data","loading"],["thead",""],["table-no-rows",""],["shButton","",1,"primary","raised",3,"click","disabled"],[3,"click"],[1,"id"],["shButton","","type","button",1,"outlined","small"],[2,"white-space","pre-wrap"],[1,"line-numbers-ol"]]},template:function(t,n){if(t&1&&(Qi(0,"sh-table",5)(1,"tr",6)(2,"th"),XT(3,0),Hl(),Qi(4,"th"),XT(5,1),Hl(),Qi(6,"th"),XT(7,2),Hl(),mg(8,"th"),Hl(),cT(9,K,13,9,null,null,sT),Qi(11,"div",7),XT(12,3),Hl()(),Qi(13,"footer")(14,"button",8),Fg("click",function(){return n.loadMore()}),Og(15,4),oT(16,V,1,0)(17,q,1,0),Pg(),Hl()()),t&2){let _=n.logs();zg("grid-template-columns","1fr 1fr 1fr auto"),gg("data",_)("loading",n.logsIsLoading()),DE(9),lT(_),DE(5),gg("disabled",n.logsIsLoading()||n.noMoreItems()),DE(2),iT(n.noMoreItems()?16:17);}},dependencies:[ot,N,v,ci],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) 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}footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 0 0}"]})};export{M as default};
@@ -1 +1 @@
1
- import {d as dw,Z as lr,j as mg}from'./main-PXGZLKMN.js';var t=class o{static \u0275fac=function(e){return new(e||o)};static \u0275cmp=dw({type:o,selectors:[["app-welcome"]],decls:1,vars:0,template:function(e,m){e&1&&mg(0,"router-outlet");},dependencies:[lr],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:100vh}"]})};export{t as default};
1
+ import {d as dw,Z as lr,j as mg}from'./main-KFKZO6SJ.js';var t=class o{static \u0275fac=function(e){return new(e||o)};static \u0275cmp=dw({type:o,selectors:[["app-welcome"]],decls:1,vars:0,template:function(e,m){e&1&&mg(0,"router-outlet");},dependencies:[lr],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:100vh}"]})};export{t as default};
@@ -1,3 +1,3 @@
1
- import {w as we,H as Ht}from'./chunk-CUxq_s_t.js';import'./chunk-DaIpTiYw.js';import {OptionsListComponent as Oe}from'./chunk-Bf1diO1u.js';import'./chunk-B6vxBiK4.js';import'./chunk-DV2SIgNN.js';import'./chunk-B2fqvpov.js';import'./chunk-D48AStVy.js';import {e as ee$1}from'./chunk-D_JCqKo8.js';import'./chunk-w_Hs_Uxi.js';import'./chunk-D1wHRltX.js';import'./chunk-CQ8rm_d9.js';import {N as Nt$2}from'./chunk-CBdr-6_u.js';import'./chunk-BZqhgAZ-.js';import'./chunk-0sb5_LpD.js';import'./chunk-B9zNFJSv.js';import {c as c$1}from'./chunk-COgNe44h.js';import'./chunk-BAZ5npJw.js';import {T,ab as C,e as ee,aw as W,aW as G,aX as y,m,N as Nt$1,U as Ue,G as Ga,d as dw,_ as _t,v,f as N,j as mg,Q as Qi,O as Og,P as Pg,H as Hl,o as oT,D as DE,i as iT,aD as zC,aY as x,aZ as ee$2,k as gT,p as DD,X as XT,s as sm,S as Sd,n as nC,l as HC,x as xd,F as Fg,z as gg,a3 as QC,y as TD,w as im,I as Qg,au as Lg,av as eC}from'./main-PXGZLKMN.js';import'./chunk-DJbAxHpK.js';import'./chunk-MvQwR7nW.js';import'./chunk-SycscfJp.js';import {L}from'./chunk-D28lTX0k.js';import {d}from'./chunk-DQW8lSiz.js';import'./chunk-CMmgPgiU.js';import {F as Fe}from'./chunk-C9EdrQe6.js';import {j as jn,B as Bn,T as Tn,Z as Ze,R as Rn,P as Pn,G as Gn,g as gn,h as hn}from'./chunk-Drc5kcUX.js';import {a as at}from'./chunk-B-fklW6A.js';var I=class m{#t=new Map;saveState(e){let t=x();return this.#t.set(t,e),t}getState(e){return this.#t.get(e)}static \u0275fac=function(t){return new(t||m)};static \u0275prov=ee$2({token:m,factory:m.\u0275fac,providedIn:"root"})};var Tt=()=>["backup"];function ft(m,e){m&1&&mg(0,"sh-progress-bar",10);}function Nt(m,e){if(m&1){let t=gT();Qi(0,"form",11)(1,"sh-select",12)(2,"label",13),Og(3,1),mg(4,"sh-icon",14),Pg(),Hl(),mg(5,"input",15),DD(),Hl(),Qi(6,"sh-form-field")(7,"label",16),Og(8,2),mg(9,"sh-icon",17),Pg(),Hl(),mg(10,"textarea",18),DD(),Hl(),Qi(11,"sh-form-field")(12,"label",19),Og(13,3),mg(14,"sh-icon",20),Pg(),Hl(),mg(15,"textarea",21),DD(),Hl()(),Qi(16,"sh-divider"),XT(17,4),Hl(),Qi(18,"form",11)(19,"sh-form-field")(20,"label",22),Og(21,5),mg(22,"sh-icon",23),Pg(),Hl(),mg(23,"input",24),DD(),Hl(),Qi(24,"sh-form-field")(25,"label",25),Og(26,6),mg(27,"sh-icon",26),Pg(),Hl(),mg(28,"input",27),DD(),Hl(),Qi(29,"app-filters",28),sm("filtersChange",function(i){Sd(t);let s=nC();return HC(s.filters,i)||(s.filters=i),xd(i)}),Fg("filtersChange",function(i){Sd(t);let s=nC();return xd(s.updateFilters(i))}),Hl()(),Qi(30,"app-options-list",29),sm("optionsChange",function(i){Sd(t);let s=nC();return HC(s.settings,i)||(s.settings=i),xd(i)}),Hl(),Qi(31,"div",30)(32,"button",31),Fg("click",function(){Sd(t);let i=nC();return xd(i.submit())}),Og(33,7),mg(34,"sh-icon"),Pg(),Hl()();}if(m&2){let t=nC();gg("formGroup",t.baseCmdForm),DE(),gg("options",t.commandOptions()??QC(11,Tt))("inlineSearch",true),DE(4),TD(),DE(5),TD(),DE(5),TD(),DE(3),gg("formGroup",t.standardFields),DE(5),TD(),DE(5),TD(),DE(),im("filters",t.filters),gg("osType",t.osType()??""),DE(),im("options",t.settings),gg("hasFreeTextSettings",true),DE(2),Qg("loading",t.isSubmitting()),DE(2),Lg(t.baseCmdForm.value.command),eC(33);}}var c=new jn,$=class m$1{#t=T(we);#n=T(C);#o=T(ee);#e=T(W);#a=T(G);#s=T(y);#i=T(I);#r=T(m);osType=Nt$1(()=>this.#r.systemInfo()?.OSType);#l=L(this.#e.params);commandOptions=L(this.#a.getApiV1Commandline());isSubmitting=Ue(false);optionsFields=this.#t.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#t.finishedLoading;backupId=this.#t.backupId;filters=Ue([]);settings=this.#t.settings;updateFilters(e){this.standardFields.controls.filters.clear(),e.forEach(t=>this.standardFields.controls.filters.push(c.control(t))),this.filters.set(e);}#m=Ga(()=>{let e=this.#l()?.id;this.#t.backupId.set(e),this.getBackup(e);});getBackup(e){this.#n.getApiV1BackupById({id:e}).subscribe({next:t=>{this.#t.mapScheduleToForm(t.Schedule??null),t.Backup&&(this.#t.mapGeneralToForm(t.Backup),this.mapStandardFieldsToForm(t.Backup),this.mapBaseCmdToForm(t.Backup),this.#t.mapOptionsToForms(t.Backup,true)),this.applyStateFromUrl(),this.#t.finishedLoading.set(true);}});}mapStandardFieldsToForm(e){if(this.standardFields.patchValue({dbpath:e.DBPath,"backup-id":e.ID,"backup-name":e.Name}),this.standardFields.controls.filters.clear(),e.Filters&&e.Filters.length){let t=e.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);t.forEach(n=>{this.standardFields.controls.filters.push(c.control(n));}),this.filters.set(t);}else this.filters.set([]);}submit(){this.#s.resumeDialogCheck(()=>this.#c());}#c(){this.isSubmitting.set(true);let e=this.updateUrl(),t=this.baseCmdForm.value,n=t.targetUrl??"",i=(t.arguments??"").split(`
1
+ import {OptionsListComponent as Oe}from'./chunk-Dgns65Zu.js';import {e as ee$1}from'./chunk-B0RBkC1E.js';import'./chunk-BB1pOOUx.js';import'./chunk-DN6f5jXR.js';import'./chunk-3RXp81pP.js';import {k as ke,j as jt}from'./chunk-ByhuT4BS.js';import'./chunk-C4kBXz3C.js';import'./chunk-Dh6x3lXP.js';import'./chunk-DD_QfWih.js';import'./chunk-khm9J_G0.js';import'./chunk-wyNyzSXi.js';import'./chunk-CegwkGVu.js';import {N as Nt$2}from'./chunk-CT9ziigM.js';import'./chunk-D5lj-fQk.js';import'./chunk-D6aNT_wo.js';import {c as c$1}from'./chunk-OLi7f6y7.js';import'./chunk-B2TXzbpy.js';import {T,ab as C,e as ee,aw as W,aW as G,aX as y,m,N as Nt$1,U as Ue,G as Ga,d as dw,_ as _t,v,f as N,j as mg,Q as Qi,O as Og,P as Pg,H as Hl,o as oT,D as DE,i as iT,aD as zC,aY as x,aZ as ee$2,k as gT,p as DD,X as XT,s as sm,S as Sd,n as nC,l as HC,x as xd,F as Fg,z as gg,a3 as QC,y as TD,w as im,I as Qg,au as Lg,av as eC}from'./main-KFKZO6SJ.js';import'./chunk-DPNAj9Vc.js';import {d}from'./chunk-CRAg6SRo.js';import {F as Fe}from'./chunk-DuIUmwWN.js';import {j as jn,B as Bn,T as Tn,Z as Ze,R as Rn,P as Pn,G as Gn,g as gn,h as hn}from'./chunk-DipTNkHN.js';import {a as at}from'./chunk-Fw6nFDZK.js';import'./chunk-Ca1C9pJ0.js';import'./chunk-C-NgIZiF.js';import {L}from'./chunk-C7pjkqKB.js';import'./chunk-PVmXLw9b.js';var I=class m{#t=new Map;saveState(e){let t=x();return this.#t.set(t,e),t}getState(e){return this.#t.get(e)}static \u0275fac=function(t){return new(t||m)};static \u0275prov=ee$2({token:m,factory:m.\u0275fac,providedIn:"root"})};var Tt=()=>["backup"];function ft(m,e){m&1&&mg(0,"sh-progress-bar",10);}function Nt(m,e){if(m&1){let t=gT();Qi(0,"form",11)(1,"sh-select",12)(2,"label",13),Og(3,1),mg(4,"sh-icon",14),Pg(),Hl(),mg(5,"input",15),DD(),Hl(),Qi(6,"sh-form-field")(7,"label",16),Og(8,2),mg(9,"sh-icon",17),Pg(),Hl(),mg(10,"textarea",18),DD(),Hl(),Qi(11,"sh-form-field")(12,"label",19),Og(13,3),mg(14,"sh-icon",20),Pg(),Hl(),mg(15,"textarea",21),DD(),Hl()(),Qi(16,"sh-divider"),XT(17,4),Hl(),Qi(18,"form",11)(19,"sh-form-field")(20,"label",22),Og(21,5),mg(22,"sh-icon",23),Pg(),Hl(),mg(23,"input",24),DD(),Hl(),Qi(24,"sh-form-field")(25,"label",25),Og(26,6),mg(27,"sh-icon",26),Pg(),Hl(),mg(28,"input",27),DD(),Hl(),Qi(29,"app-filters",28),sm("filtersChange",function(i){Sd(t);let s=nC();return HC(s.filters,i)||(s.filters=i),xd(i)}),Fg("filtersChange",function(i){Sd(t);let s=nC();return xd(s.updateFilters(i))}),Hl()(),Qi(30,"app-options-list",29),sm("optionsChange",function(i){Sd(t);let s=nC();return HC(s.settings,i)||(s.settings=i),xd(i)}),Hl(),Qi(31,"div",30)(32,"button",31),Fg("click",function(){Sd(t);let i=nC();return xd(i.submit())}),Og(33,7),mg(34,"sh-icon"),Pg(),Hl()();}if(m&2){let t=nC();gg("formGroup",t.baseCmdForm),DE(),gg("options",t.commandOptions()??QC(11,Tt))("inlineSearch",true),DE(4),TD(),DE(5),TD(),DE(5),TD(),DE(3),gg("formGroup",t.standardFields),DE(5),TD(),DE(5),TD(),DE(),im("filters",t.filters),gg("osType",t.osType()??""),DE(),im("options",t.settings),gg("hasFreeTextSettings",true),DE(2),Qg("loading",t.isSubmitting()),DE(2),Lg(t.baseCmdForm.value.command),eC(33);}}var c=new jn,$=class m$1{#t=T(ke);#n=T(C);#o=T(ee);#e=T(W);#a=T(G);#s=T(y);#i=T(I);#r=T(m);osType=Nt$1(()=>this.#r.systemInfo()?.OSType);#l=L(this.#e.params);commandOptions=L(this.#a.getApiV1Commandline());isSubmitting=Ue(false);optionsFields=this.#t.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#t.finishedLoading;backupId=this.#t.backupId;filters=Ue([]);settings=this.#t.settings;updateFilters(e){this.standardFields.controls.filters.clear(),e.forEach(t=>this.standardFields.controls.filters.push(c.control(t))),this.filters.set(e);}#m=Ga(()=>{let e=this.#l()?.id;this.#t.backupId.set(e),this.getBackup(e);});getBackup(e){this.#n.getApiV1BackupById({id:e}).subscribe({next:t=>{this.#t.mapScheduleToForm(t.Schedule??null),t.Backup&&(this.#t.mapGeneralToForm(t.Backup),this.mapStandardFieldsToForm(t.Backup),this.mapBaseCmdToForm(t.Backup),this.#t.mapOptionsToForms(t.Backup,true)),this.applyStateFromUrl(),this.#t.finishedLoading.set(true);}});}mapStandardFieldsToForm(e){if(this.standardFields.patchValue({dbpath:e.DBPath,"backup-id":e.ID,"backup-name":e.Name}),this.standardFields.controls.filters.clear(),e.Filters&&e.Filters.length){let t=e.Filters.map(n=>`${n.Include?"":"-"}${n.Expression}`);t.forEach(n=>{this.standardFields.controls.filters.push(c.control(n));}),this.filters.set(t);}else this.filters.set([]);}submit(){this.#s.resumeDialogCheck(()=>this.#c());}#c(){this.isSubmitting.set(true);let e=this.updateUrl(),t=this.baseCmdForm.value,n=t.targetUrl??"",i=(t.arguments??"").split(`
2
2
  `)??[],s=[n,...i].filter(o=>o.length>0),g=this.standardFields.value,N=g.filters??[],E=[t.command,...s,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...N.filter(o=>o).map(o=>o.startsWith("-")?`--exclude=${o?.slice(1)}`:`--include=${o}`),...this.#t.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(o=>`${o.Name.startsWith("--")?"":"--"}${o.Name}=${o.Value}`),"--disable-module=console-password-input"];this.#n.postApiV1Commandline({requestBody:E}).subscribe({next:o=>{o.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",o.ID],{queryParams:{state:e}});},error:()=>{this.isSubmitting.set(false);}});}mapBaseCmdToForm(e){let t=e.TargetURL??null;t&&this.baseCmdForm.patchValue({targetUrl:t??"",arguments:e.Sources?.join(`
3
- `)??""});}updateUrl(){let e=this.baseCmdForm.value,t=this.standardFields.value,n=t.filters??[],i=this.settings(),s=this.#i.saveState({command:e.command,targetUrl:e.targetUrl,arguments:e.arguments,backupId:t["backup-id"],backupName:t["backup-name"],dbpath:t.dbpath,filters:n,options:i});return this.#o.navigate([],{relativeTo:this.#e,queryParams:{state:s},replaceUrl:true}),s}applyStateFromUrl(){let t=this.#e.snapshot.queryParams.state;if(!t)return;let n=this.#i.getState(t);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(i=>{this.standardFields.controls.filters.push(c.control(i));}),this.filters.set(n.filters)),n.options&&n.options.length>0&&this.settings.set(n.options));}static \u0275fac=function(t){return new(t||m$1)};static \u0275cmp=dw({type:m$1,selectors:[["app-commandline"]],features:[zC([we])],decls:8,vars:1,consts:()=>{let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let t;t=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let s;s=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let N;N=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let E;return E=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[e,t,n,i,s,g,N,E,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"filtersChange","filters","osType"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"]]},template:function(t,n){t&1&&(mg(0,"app-status-bar"),Qi(1,"section")(2,"div",8)(3,"button",9),Og(4,0),mg(5,"sh-icon"),Pg(),Hl()(),oT(6,ft,1,0,"sh-progress-bar",10)(7,Nt,35,12),Hl()),t&2&&(DE(6),iT(n.finishedLoading()?7:6));},dependencies:[Bn,Tn,Ze,Rn,Pn,ee$1,Oe,Ht,Gn,gn,hn,_t,Fe,v,c$1,Nt$2,d,N,at],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"]})};export{$ as default};
3
+ `)??""});}updateUrl(){let e=this.baseCmdForm.value,t=this.standardFields.value,n=t.filters??[],i=this.settings(),s=this.#i.saveState({command:e.command,targetUrl:e.targetUrl,arguments:e.arguments,backupId:t["backup-id"],backupName:t["backup-name"],dbpath:t.dbpath,filters:n,options:i});return this.#o.navigate([],{relativeTo:this.#e,queryParams:{state:s},replaceUrl:true}),s}applyStateFromUrl(){let t=this.#e.snapshot.queryParams.state;if(!t)return;let n=this.#i.getState(t);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(i=>{this.standardFields.controls.filters.push(c.control(i));}),this.filters.set(n.filters)),n.options&&n.options.length>0&&this.settings.set(n.options));}static \u0275fac=function(t){return new(t||m$1)};static \u0275cmp=dw({type:m$1,selectors:[["app-commandline"]],features:[zC([ke])],decls:8,vars:1,consts:()=>{let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let t;t=$localize` Command ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let s;s=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let N;N=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let E;return E=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[e,t,n,i,s,g,N,E,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"filtersChange","filters","osType"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"]]},template:function(t,n){t&1&&(mg(0,"app-status-bar"),Qi(1,"section")(2,"div",8)(3,"button",9),Og(4,0),mg(5,"sh-icon"),Pg(),Hl()(),oT(6,ft,1,0,"sh-progress-bar",10)(7,Nt,35,12),Hl()),t&2&&(DE(6),iT(n.finishedLoading()?7:6));},dependencies:[Bn,Tn,Ze,Rn,Pn,ee$1,Oe,jt,Gn,gn,hn,_t,Fe,v,c$1,Nt$2,d,N,at],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"]})};export{$ as default};
@@ -1 +1 @@
1
- import {OptionsListComponent as Oe}from'./chunk-Bf1diO1u.js';import {I}from'./chunk-DV2SIgNN.js';import {L}from'./chunk-D28lTX0k.js';import {T,ab as C,e as ee$1,aw as W,U as Ue,N as Nt,C as Bu,d as dw,f as N,v,Q as Qi,F as Fg,o as oT,aP as Ul,X as XT,aQ as Wl,s as sm,H as Hl,O as Og,j as mg,P as Pg,z as gg,D as DE,i as iT,w as im,a6 as be,at as h,aZ as ee$2,l as HC,p as DD,y as TD}from'./main-PXGZLKMN.js';import {F as Fe}from'./chunk-C9EdrQe6.js';import {j as jn,G as Gn,T as Tn,Z as Ze,R as Rn,P as Pn,g as gn,h as hn}from'./chunk-Drc5kcUX.js';import'./chunk-B6vxBiK4.js';import'./chunk-B2fqvpov.js';import'./chunk-D48AStVy.js';import'./chunk-CQ8rm_d9.js';import'./chunk-CBdr-6_u.js';import'./chunk-BZqhgAZ-.js';import'./chunk-0sb5_LpD.js';import'./chunk-COgNe44h.js';import'./chunk-BAZ5npJw.js';import'./chunk-DQW8lSiz.js';import'./chunk-CMmgPgiU.js';import'./chunk-B-fklW6A.js';var d=class r{#t=T(be);destinationTargetUrl=Ue(null);destinationTestSignal=Ue(null);encryptionForm=Z();temporaryBackupId=Ue(null);updateTargetUrl(e){this.destinationTargetUrl.set(e);}showErrorDialog(e){this.#t.open(h,{data:{title:$localize`Error occured`,message:e,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{}});}static \u0275fac=function(n){return new(n||r)};static \u0275prov=ee$2({token:r,factory:r.\u0275fac,providedIn:"root"})};function ne(r,e){r&1&&(Qi(0,"p"),XT(1,3),Hl());}function oe(r,e){r&1&&(Qi(0,"sh-form-field")(1,"label",11),XT(2,4),Hl(),mg(3,"input",12),DD(),Hl()),r&2&&(DE(3),TD());}var ee=new jn,Z=()=>ee.group({passphrase:ee.control("")}),f=class r{#t=T(C);#e=T(d);#n=T(ee$1);#o=T(W);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=Ue(false);settings=Ue([]);hasEncryptedBackup=Nt(()=>{let e=this.#e.destinationTestSignal();return e==="testing"||typeof e=="string"?true:e?.containsEncryptedBackupFiles??true});passphraseSignal=L(this.encryptionForm.controls.passphrase.valueChanges);showEncryptionField=Ue(false);isValidConfig=Nt(()=>{if(!this.#e.destinationTargetUrl())return false;let n=this.#e.destinationTestSignal();return !(typeof n!="string"&&(n?.containsEncryptedBackupFiles??false)&&!this.passphraseSignal())});next(){let e=this.#e.destinationTargetUrl();if(!e)throw new Error("No target URL");this.creatingTemporaryBackup.set(true);let n=this.encryptionForm.value?.passphrase??null,t=[];n?t.push({Name:"--passphrase",Value:n}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(i=>{let o=i.Name?.trim();o&&o!=="--"&&(o.startsWith("--")||(o=`--${o}`),t.push({Name:o,Value:i.Value??""}));}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:e,Settings:t}},temporary:true}).pipe(Bu(()=>this.creatingTemporaryBackup.set(false))).subscribe({next:i=>{let o=i.ID;this.#e.temporaryBackupId.set(o),this.#n.navigate(["../select-config"],{relativeTo:this.#o});},error:i=>{console.error(i);}});}back(){this.#n.navigate(["../destination"],{relativeTo:this.#o});}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=dw({type:r,selectors:[["app-import-destination-encryption"]],decls:14,vars:6,consts:()=>{let e;e=$localize`Advanced options`;let n;n=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let t;t=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let i;i=$localize`The backup does not contain encrypted files.`;let o;o=$localize`Enter backup passphrase if defined.`;let P;return P=$localize`Password`,[e,n,t,i,P,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["for","password"],["type","password","id","password","autocomplete","disabled","placeholder",o,"formControlName","passphrase"]]},template:function(n,t){n&1&&(Qi(0,"form",5),Fg("submit",function(){return t.next()}),oT(1,ne,2,0,"p"),oT(2,oe,4,0,"sh-form-field"),Qi(3,"sh-toggle-card"),Ul(4,6),XT(5,0),Wl(),Qi(6,"app-options-list",7),sm("optionsChange",function(o){return HC(t.settings,o)||(t.settings=o),o}),Hl()(),Qi(7,"div",8)(8,"button",9),Fg("click",function(){return t.back()}),Og(9,1),mg(10,"sh-icon"),Pg(),Hl(),Qi(11,"button",10),Og(12,2),mg(13,"sh-icon"),Pg(),Hl()()()),n&2&&(gg("formGroup",t.encryptionForm),DE(),iT(t.hasEncryptedBackup()?-1:1),DE(),iT(t.hasEncryptedBackup()||t.showEncryptionField()?2:-1),DE(4),im("options",t.settings),gg("hasFreeTextSettings",true),DE(5),gg("disabled",!t.isValidConfig()));},dependencies:[Gn,Tn,Ze,Rn,Pn,gn,hn,Fe,N,v,I,Oe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"]})};var chunkGEQXBNCM=/*#__PURE__*/Object.freeze({__proto__:null,createEncryptionForm:Z,default:f});export{chunkGEQXBNCM as c,d};
1
+ import {OptionsListComponent as Oe}from'./chunk-Dgns65Zu.js';import {I}from'./chunk-DD_QfWih.js';import {F as Fe}from'./chunk-DuIUmwWN.js';import {j as jn,G as Gn,T as Tn,Z as Ze,R as Rn,P as Pn,g as gn,h as hn}from'./chunk-DipTNkHN.js';import {L}from'./chunk-C7pjkqKB.js';import {T,ab as C,e as ee$1,aw as W,U as Ue,N as Nt,C as Bu,d as dw,f as N,v,Q as Qi,F as Fg,o as oT,aP as Ul,X as XT,aQ as Wl,s as sm,H as Hl,O as Og,j as mg,P as Pg,z as gg,D as DE,i as iT,w as im,a6 as be,at as h,aZ as ee$2,l as HC,p as DD,y as TD}from'./main-KFKZO6SJ.js';import'./chunk-Dh6x3lXP.js';import'./chunk-khm9J_G0.js';import'./chunk-wyNyzSXi.js';import'./chunk-CegwkGVu.js';import'./chunk-CT9ziigM.js';import'./chunk-D5lj-fQk.js';import'./chunk-D6aNT_wo.js';import'./chunk-OLi7f6y7.js';import'./chunk-B2TXzbpy.js';import'./chunk-CRAg6SRo.js';import'./chunk-Fw6nFDZK.js';import'./chunk-PVmXLw9b.js';var d=class r{#t=T(be);destinationTargetUrl=Ue(null);destinationTestSignal=Ue(null);encryptionForm=Z();temporaryBackupId=Ue(null);updateTargetUrl(e){this.destinationTargetUrl.set(e);}showErrorDialog(e){this.#t.open(h,{data:{title:$localize`Error occured`,message:e,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{}});}static \u0275fac=function(n){return new(n||r)};static \u0275prov=ee$2({token:r,factory:r.\u0275fac,providedIn:"root"})};function ne(r,e){r&1&&(Qi(0,"p"),XT(1,3),Hl());}function oe(r,e){r&1&&(Qi(0,"sh-form-field")(1,"label",11),XT(2,4),Hl(),mg(3,"input",12),DD(),Hl()),r&2&&(DE(3),TD());}var ee=new jn,Z=()=>ee.group({passphrase:ee.control("")}),f=class r{#t=T(C);#e=T(d);#n=T(ee$1);#o=T(W);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=Ue(false);settings=Ue([]);hasEncryptedBackup=Nt(()=>{let e=this.#e.destinationTestSignal();return e==="testing"||typeof e=="string"?true:e?.containsEncryptedBackupFiles??true});passphraseSignal=L(this.encryptionForm.controls.passphrase.valueChanges);showEncryptionField=Ue(false);isValidConfig=Nt(()=>{if(!this.#e.destinationTargetUrl())return false;let n=this.#e.destinationTestSignal();return !(typeof n!="string"&&(n?.containsEncryptedBackupFiles??false)&&!this.passphraseSignal())});next(){let e=this.#e.destinationTargetUrl();if(!e)throw new Error("No target URL");this.creatingTemporaryBackup.set(true);let n=this.encryptionForm.value?.passphrase??null,t=[];n?t.push({Name:"--passphrase",Value:n}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(i=>{let o=i.Name?.trim();o&&o!=="--"&&(o.startsWith("--")||(o=`--${o}`),t.push({Name:o,Value:i.Value??""}));}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:e,Settings:t}},temporary:true}).pipe(Bu(()=>this.creatingTemporaryBackup.set(false))).subscribe({next:i=>{let o=i.ID;this.#e.temporaryBackupId.set(o),this.#n.navigate(["../select-config"],{relativeTo:this.#o});},error:i=>{console.error(i);}});}back(){this.#n.navigate(["../destination"],{relativeTo:this.#o});}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=dw({type:r,selectors:[["app-import-destination-encryption"]],decls:14,vars:6,consts:()=>{let e;e=$localize`Advanced options`;let n;n=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let t;t=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let i;i=$localize`The backup does not contain encrypted files.`;let o;o=$localize`Enter backup passphrase if defined.`;let P;return P=$localize`Password`,[e,n,t,i,P,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["for","password"],["type","password","id","password","autocomplete","disabled","placeholder",o,"formControlName","passphrase"]]},template:function(n,t){n&1&&(Qi(0,"form",5),Fg("submit",function(){return t.next()}),oT(1,ne,2,0,"p"),oT(2,oe,4,0,"sh-form-field"),Qi(3,"sh-toggle-card"),Ul(4,6),XT(5,0),Wl(),Qi(6,"app-options-list",7),sm("optionsChange",function(o){return HC(t.settings,o)||(t.settings=o),o}),Hl()(),Qi(7,"div",8)(8,"button",9),Fg("click",function(){return t.back()}),Og(9,1),mg(10,"sh-icon"),Pg(),Hl(),Qi(11,"button",10),Og(12,2),mg(13,"sh-icon"),Pg(),Hl()()()),n&2&&(gg("formGroup",t.encryptionForm),DE(),iT(t.hasEncryptedBackup()?-1:1),DE(),iT(t.hasEncryptedBackup()||t.showEncryptionField()?2:-1),DE(4),im("options",t.settings),gg("hasFreeTextSettings",true),DE(5),gg("disabled",!t.isValidConfig()));},dependencies:[Gn,Tn,Ze,Rn,Pn,gn,hn,Fe,N,v,I,Oe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"]})};var chunkSON5C7BG=/*#__PURE__*/Object.freeze({__proto__:null,createEncryptionForm:Z,default:f});export{chunkSON5C7BG as c,d};
@@ -1,2 +1,2 @@
1
- import {o as oe$1,F as Fe}from'./chunk-C9EdrQe6.js';import {T,ad as br,bB as yD,bu as N,N as Nt,b as g1,af as m1,ac as h1,U as Ue,B as y1,G as Ga,b$ as oe,c0 as ae,bv as le,d as dw,f as N$1,k as gT,L as oC,Q as Qi,s as sm,S as Sd,l as HC,x as xd,F as Fg,Y as iC,o as oT,H as Hl,j as mg,w as im,z as gg,a3 as QC,D as DE,I as Qg,aC as hg,i as iT,$ as $g,K as lC,q as PC}from'./main-PXGZLKMN.js';var X=["inputRef"],Z=["optionsRef"],ee=["*",[["","menu",""]]],te=["*","[menu]"],ie=()=>({closeOnButton:false,closeOnEsc:true});function ne(a,J){a&1&&(Qi(0,"sh-icon",5),PC(1,"caret-down"),Hl());}function se(a,J){a&1&&(Qi(0,"sh-icon",6),PC(1,"caret-right"),Hl());}var m=[],ve=(()=>{class a{constructor(){this.#i=T(br),this.#t=T(yD),this.#e=T(N),this.parentMenu=T(a,{optional:true,skipSelf:true}),this.isSubmenu=Nt(()=>this.parentMenu!==null),this.asMultiLayer=g1(false),this.openIndicator=g1(false),this.disabled=g1(false),this.customOptionElementSelectors=g1(["button"]),this.keepClickedOptionActive=g1(false),this.closeOnClick=g1(true),this.isOpen=m1(false),this.closed=h1(),this.searchable=g1(false),this.activeOptionIndex=Ue(-1),this.inputRef=y1("inputRef"),this.optionsRef=y1("optionsRef"),this.openMenusEffect=Ga(t=>{this.isOpen()&&m.push(this),t(()=>{let i=m.indexOf(this);i>-1&&m.splice(i,1);});}),this.options=oe(this.optionsRef,this.customOptionElementSelectors),this.optionsEl=Nt(()=>{let t=this.optionsRef()?.nativeElement;return t?this.options.signal().filter(i=>i.disabled?false:i.closest(".options")===t):[]}),this.inputValue=ae(this.inputRef),this.optionsId=le(),this.activeOptionId=Ue(void 0),this.abortController=null,this.optionsEffect=Ga(t=>{if(this.abortController!==null&&(this.abortController.abort(),this.abortController=null),!this.isOpen())return;if(this.searchable()&&this.#e.pause(),t(()=>{this.searchable()&&this.#e.resume();}),this.abortController=new AbortController,!this.searchable())this.#i.documentElement.addEventListener("keydown",this.keyDownEventListener,{signal:this.abortController.signal});else {let n=this.inputRef()?.nativeElement;n&&n.addEventListener("keydown",this.keyDownEventListener,{signal:this.abortController.signal});}let e=this.inputRef()?.nativeElement;e&&(queueMicrotask(()=>e.focus()),this.closeOnClick()||this.optionsRef()?.nativeElement?.addEventListener("click",s=>{let o=s.target,r=this.activeElements();if(!r.length){let c=this.optionsEl();this.activeElements.set(c),r=c;}let p=r.findIndex(c=>c===o);p>-1&&(this.activeOptionIndex.set(p),e.focus());}));}),this.keyDownEventListener=t=>{if(m.at(-1)!==this)return;let i=this.activeOptionIndex(),e=this.searchable();if(this.#e.matches(t,"menu.next"))t.preventDefault(),this.activeOptionIndex.set(this.nextActiveIndex(i));else if(this.#e.matches(t,"menu.prev"))t.preventDefault(),this.activeOptionIndex.set(this.prevActiveIndex(i));else if(this.#e.matches(t,"menu.open-submenu")){if(!e&&i>-1){let n=this.activeElements()[i];if(n.parentElement?.hasAttribute("trigger")){t.preventDefault();let o=new CustomEvent("ship-menu-open",{bubbles:true,cancelable:true,detail:{keyboard:true}});n.dispatchEvent(o);}}}else if(this.#e.matches(t,"menu.close-submenu"))!e&&this.isSubmenu()&&(t.preventDefault(),this.close("closed"));else if(this.#e.matches(t,"menu.select")){let n=t.key==="Enter",s=t.key===" "||t.key==="Spacebar";if((n||s&&!e)&&(t.preventDefault(),i>-1)){let o=this.activeElements()[i];if(o.parentElement?.hasAttribute("trigger")){let p=new CustomEvent("ship-menu-open",{bubbles:true,cancelable:true,detail:{keyboard:true}});o.dispatchEvent(p);}else o.click(),o.querySelector("sh-checkbox")||queueMicrotask(()=>this.close("active"));}}else if(t.key==="Tab"){let n=this.activeElements();if(!n.length){let s=this.optionsEl();this.activeElements.set(s),n=s;}t.shiftKey?i<=0?(t.preventDefault(),this.close("closed")):(t.preventDefault(),this.activeOptionIndex.set(this.prevActiveIndex(i))):i>=n.length-1?(t.preventDefault(),this.close("closed")):(t.preventDefault(),this.activeOptionIndex.set(this.nextActiveIndex(i)));}},this._lastElementList=[],this.activeElements=Ue([]),this.lastInputValue="",this.inputValueEffect=Ga(()=>{if(!this.searchable()){this.activeElements.set(this.optionsEl());return}let i=(this.inputValue()??"").toLowerCase();if(this.#n(),!i||i===""){let n=this.optionsEl();this.activeElements.set(n),this._lastElementList=n;for(let s=0;s<n.length;s++)this.#t.removeStyle(n[s],"order"),n[s].id||(n[s].id=`${this.optionsId}-option-${s}`),n[s].setAttribute("role","option");return}if(!i||i==="")return;let e=this._lastElementList.length&&i.length>this.lastInputValue.length?this._lastElementList:this.optionsEl();this.lastInputValue=i;for(let n=0;n<e.length;n++){let s=e[n],o=s.textContent?.toLowerCase()||"",r=this.#s(o,i);s.value=r;}e=e.filter(n=>n.value>0).sort((n,s)=>s.value-n.value);for(let n=0;n<e.length;n++)this.#t.setStyle(e[n],"order",n);this.activeElements.set(e),this._lastElementList=e;for(let n=0;n<e.length;n++)e[n].id||(e[n].id=`${this.optionsId}-option-${n}`),e[n].setAttribute("role","option");}),this.activeOptionIndexEffect=Ga(()=>{let t=this.activeElements(),i=this.activeOptionIndex();for(let e=0;e<t.length;e++)t[e].classList.remove("active"),t[e].removeAttribute("aria-selected");if(i>-1){let e=t[i];e.scrollIntoView({block:"center"}),e.classList.add("active"),e.setAttribute("aria-selected","true"),this.activeOptionId.set(e.id);}else this.activeOptionId.set(void 0);});}#i;#t;#e;toggleIsOpen(t){t.preventDefault(),t.stopPropagation(),!this.disabled()&&(this.isOpen()?this.close("fromPopover"):this.open());}open(){this.disabled()||(this.isOpen.set(true),this.searchable()&&setTimeout(()=>this.inputRef()?.nativeElement.focus()));}onShipMenuOpen(t){t.preventDefault(),t.stopPropagation(),this.open(),t.detail?.keyboard&&setTimeout(()=>{this.activeOptionIndex.set(0);},50);}#s(t,i){if(!i)return 0;let e=0,n=-1,s=0,o=true;for(let r=0;r<i.length;r++){let p=i[r];if(t.length>n+1&&t[n+1]===p)e+=r===0?100:150,n++,s++;else {let c=t.indexOf(p,n+1);if(r>0&&(o=false),c===-1)return 0;e+=100,n=c,s++;}}return o&&i.length===s&&(e+=1e3),e+=s*20,e}nextActiveIndex(t){let i=this.activeElements();if(!i.length){let n=this.optionsEl();this.activeElements.set(n),i=n;}if(t===-1||t===i.length-1)return 0;let e=t+1;return i[e].disabled?this.nextActiveIndex(e):e}prevActiveIndex(t){let i=this.activeElements();if(!i.length){let n=this.optionsEl();this.activeElements.set(n),i=n;}if(t===0||t===-1)return i.length-1;let e=t-1;return i[e].disabled?this.prevActiveIndex(e):e}close(t="closed",i){this.inputValue.set("");let e=this.inputRef()?.nativeElement;if(e&&(e.value=""),this.closeOnClick()&&((!this.keepClickedOptionActive()||t==="closed")&&this.#n(),this.isOpen.set(false),this.closed.emit(t==="active"),this.isSubmenu())){let n=this.parentMenu?.inputRef()?.nativeElement;n&&queueMicrotask(()=>n.focus());}}#n(){this.activeOptionIndex.set(-1);let t=this.optionsEl();for(let i=0;i<t.length;i++)t[i].classList.remove("active"),t[i].removeAttribute("aria-selected");}ngOnDestroy(){this.abortController&&(this.abortController.abort(),this.abortController=null);let t=m.indexOf(this);t>-1&&m.splice(t,1);}static{this.\u0275fac=function(i){return new(i||a)};}static{this.\u0275cmp=dw({type:a,selectors:[["sh-menu"]],viewQuery:function(i,e){i&1&&$g(e.inputRef,X,5)(e.optionsRef,Z,5),i&2&&lC(2);},hostVars:6,hostBindings:function(i,e){i&1&&Fg("ship-menu-open",function(s){return e.onShipMenuOpen(s)}),i&2&&Qg("disabled",e.disabled())("has-search",e.searchable())("multi-layer",e.asMultiLayer());},inputs:{asMultiLayer:[1,"asMultiLayer"],openIndicator:[1,"openIndicator"],disabled:[1,"disabled"],customOptionElementSelectors:[1,"customOptionElementSelectors"],keepClickedOptionActive:[1,"keepClickedOptionActive"],closeOnClick:[1,"closeOnClick"],isOpen:[1,"isOpen"],searchable:[1,"searchable"]},outputs:{isOpen:"isOpenChange",closed:"closed"},ngContentSelectors:te,decls:13,vars:21,consts:[["formFieldWrapper",""],["inputRef",""],["optionsRef",""],[3,"isOpenChange","closed","isOpen","disableOpenByClick","asMultiLayer","options"],["trigger","","role","combobox","aria-haspopup","listbox",3,"click"],[1,"open-indicator"],[1,"submenu-indicator"],[1,"form-field-wrap"],[1,"small","stretch"],["type","text","placeholder","Search","role","combobox","aria-autocomplete","list"],["role","listbox",1,"options",3,"click","id"]],template:function(i,e){if(i&1){let n=gT();oC(ee),Qi(0,"sh-popover",3,0),sm("isOpenChange",function(o){return Sd(n),HC(e.isOpen,o)||(e.isOpen=o),xd(o)}),Fg("closed",function(){return e.close("fromPopover")}),Qi(2,"div",4),Fg("click",function(o){return e.toggleIsOpen(o)}),iC(3),oT(4,ne,2,0,"sh-icon",5),oT(5,se,2,0,"sh-icon",6),Hl(),Qi(6,"div",7)(7,"sh-form-field",8),mg(8,"input",9,1),Hl()(),Qi(10,"div",10,2),Fg("click",function(){return e.close("active")}),iC(12,1),Hl()();}i&2&&(im("isOpen",e.isOpen),gg("disableOpenByClick",true)("asMultiLayer",e.asMultiLayer())("options",QC(20,ie)),DE(2),Qg("is-open",e.isOpen()),hg("aria-expanded",e.isOpen())("aria-controls",e.optionsId)("aria-activedescendant",e.activeOptionId()),DE(2),iT(e.openIndicator()?4:-1),DE(),iT(e.isSubmenu()?5:-1),DE(2),Qg("hidden",e.searchable()===false),DE(),hg("aria-expanded",e.isOpen())("aria-controls",e.optionsId)("aria-activedescendant",e.activeOptionId()),DE(2),Qg("searching",e.searchable()&&e.inputValue()!==""),gg("id",e.optionsId),hg("aria-activedescendant",e.activeOptionId()));},dependencies:[oe$1,Fe,N$1],styles:[`sh-menu{--menu-mh: 20rem;display:inline-flex;position:relative}sh-menu.disabled{opacity:.5;pointer-events:none}sh-menu.stretch{width:100%}sh-menu.stretch [trigger]>*{width:100%}sh-menu.has-search sh-popover .options [title]{position:sticky;border-bottom:var(--border-10)}sh-menu.has-search .form-field-wrap{margin:.5rem .5rem 0}sh-menu.has-search .options{margin:.25rem 0 0}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-90deg)}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator){display:flex}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator) .open-indicator{right:1rem}sh-menu.multi-layer [trigger] button:first-child{margin-top:0}sh-menu [trigger]:has(sh-icon.open-indicator){position:relative}sh-menu [trigger]:has(sh-icon.open-indicator)>:first-child{padding-right:2rem}sh-menu [trigger]:has(sh-icon.open-indicator) .open-indicator{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-180deg)}sh-menu [trigger]:has(sh-icon.submenu-indicator){position:relative}sh-menu [trigger]:has(sh-icon.submenu-indicator)>:first-child{padding-right:2rem!important}sh-menu [trigger]:has(sh-icon.submenu-indicator) .submenu-indicator{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.submenu-indicator).is-open .submenu-indicator{transform:translateY(-50%) rotate(90deg)}sh-menu sh-popover{flex:1 0}sh-menu sh-popover .popover{padding:0}sh-menu sh-popover .popover-content{overflow:hidden}sh-menu sh-popover .form-field-wrap sh-form-field{z-index:10;background-color:var(--base-1)}sh-menu sh-popover .form-field-wrap sh-form-field.hidden{opacity:0;height:0;width:0;min-width:0;min-height:0;margin:0}sh-menu sh-popover .options{z-index:2;position:relative;display:flex;flex-direction:column;gap:.25rem;padding:0;margin:0;max-height:var(--menu-mh);overflow:auto}sh-menu sh-popover .options sh-menu:first-child,sh-menu sh-popover .options button:first-child{margin-top:.5rem}sh-menu sh-popover .options.searching button[disabled]{display:none}sh-menu sh-popover .options.searching button[value="0"]{display:none}sh-menu sh-popover .options.searching>*:not(button){display:none}sh-menu sh-popover .options:after{content:"";display:block;width:100%;min-height:.25rem;order:9999999}sh-menu sh-popover .options [title]{font:var(--paragraph-30);color:var(--base-8);padding:.5rem .75rem;margin:0;-webkit-user-select:none;user-select:none;position:relative;top:0;z-index:10;background-color:var(--base-1)}sh-menu sh-popover .options button{display:flex;justify-content:flex-start;align-items:center;text-align:left;height:auto;margin:0 .5rem;padding:.25rem .5rem;gap:0 .5rem;width:calc(100% - 1rem);border-radius:var(--shape-2);appearance:none;background-color:transparent;border:0;cursor:pointer;color:var(--base-12);transition:transform 125ms linear;transform:scale(1)}sh-menu sh-popover .options button:before{content:"";min-height:1.5rem;display:inline-block;width:0;margin-right:-.5rem}sh-menu sh-popover .options button:active{transform:scale(.98)}sh-menu sh-popover .options button[disabled]{opacity:.3;cursor:initial}sh-menu sh-popover .options button[disabled]:hover{background-color:transparent}sh-menu sh-popover .options button [suffix]{order:999;color:var(--base-8);font:var(--paragraph-30);justify-self:flex-end;display:inline-flex;flex:1 0;justify-content:flex-end}sh-menu sh-popover .options button sh-icon{font-size:1rem}sh-menu sh-popover .options button.active,sh-menu sh-popover .options button:hover{background-color:var(--base-2);color:var(--base-12)}sh-menu sh-popover .options button.focused{background-color:var(--primary-2);color:var(--base-12)}sh-menu sh-popover .options button.focused:hover{background-color:var(--primary-3)}
1
+ import {o as oe$1,F as Fe}from'./chunk-DuIUmwWN.js';import {T,ad as br,bB as yD,bu as N,N as Nt,b as g1,af as m1,ac as h1,U as Ue,B as y1,G as Ga,b$ as oe,c0 as ae,bv as le,d as dw,f as N$1,k as gT,L as oC,Q as Qi,s as sm,S as Sd,l as HC,x as xd,F as Fg,Y as iC,o as oT,H as Hl,j as mg,w as im,z as gg,a3 as QC,D as DE,I as Qg,aC as hg,i as iT,$ as $g,K as lC,q as PC}from'./main-KFKZO6SJ.js';var X=["inputRef"],Z=["optionsRef"],ee=["*",[["","menu",""]]],te=["*","[menu]"],ie=()=>({closeOnButton:false,closeOnEsc:true});function ne(a,J){a&1&&(Qi(0,"sh-icon",5),PC(1,"caret-down"),Hl());}function se(a,J){a&1&&(Qi(0,"sh-icon",6),PC(1,"caret-right"),Hl());}var m=[],ve=(()=>{class a{constructor(){this.#i=T(br),this.#t=T(yD),this.#e=T(N),this.parentMenu=T(a,{optional:true,skipSelf:true}),this.isSubmenu=Nt(()=>this.parentMenu!==null),this.asMultiLayer=g1(false),this.openIndicator=g1(false),this.disabled=g1(false),this.customOptionElementSelectors=g1(["button"]),this.keepClickedOptionActive=g1(false),this.closeOnClick=g1(true),this.isOpen=m1(false),this.closed=h1(),this.searchable=g1(false),this.activeOptionIndex=Ue(-1),this.inputRef=y1("inputRef"),this.optionsRef=y1("optionsRef"),this.openMenusEffect=Ga(t=>{this.isOpen()&&m.push(this),t(()=>{let i=m.indexOf(this);i>-1&&m.splice(i,1);});}),this.options=oe(this.optionsRef,this.customOptionElementSelectors),this.optionsEl=Nt(()=>{let t=this.optionsRef()?.nativeElement;return t?this.options.signal().filter(i=>i.disabled?false:i.closest(".options")===t):[]}),this.inputValue=ae(this.inputRef),this.optionsId=le(),this.activeOptionId=Ue(void 0),this.abortController=null,this.optionsEffect=Ga(t=>{if(this.abortController!==null&&(this.abortController.abort(),this.abortController=null),!this.isOpen())return;if(this.searchable()&&this.#e.pause(),t(()=>{this.searchable()&&this.#e.resume();}),this.abortController=new AbortController,!this.searchable())this.#i.documentElement.addEventListener("keydown",this.keyDownEventListener,{signal:this.abortController.signal});else {let n=this.inputRef()?.nativeElement;n&&n.addEventListener("keydown",this.keyDownEventListener,{signal:this.abortController.signal});}let e=this.inputRef()?.nativeElement;e&&(queueMicrotask(()=>e.focus()),this.closeOnClick()||this.optionsRef()?.nativeElement?.addEventListener("click",s=>{let o=s.target,r=this.activeElements();if(!r.length){let c=this.optionsEl();this.activeElements.set(c),r=c;}let p=r.findIndex(c=>c===o);p>-1&&(this.activeOptionIndex.set(p),e.focus());}));}),this.keyDownEventListener=t=>{if(m.at(-1)!==this)return;let i=this.activeOptionIndex(),e=this.searchable();if(this.#e.matches(t,"menu.next"))t.preventDefault(),this.activeOptionIndex.set(this.nextActiveIndex(i));else if(this.#e.matches(t,"menu.prev"))t.preventDefault(),this.activeOptionIndex.set(this.prevActiveIndex(i));else if(this.#e.matches(t,"menu.open-submenu")){if(!e&&i>-1){let n=this.activeElements()[i];if(n.parentElement?.hasAttribute("trigger")){t.preventDefault();let o=new CustomEvent("ship-menu-open",{bubbles:true,cancelable:true,detail:{keyboard:true}});n.dispatchEvent(o);}}}else if(this.#e.matches(t,"menu.close-submenu"))!e&&this.isSubmenu()&&(t.preventDefault(),this.close("closed"));else if(this.#e.matches(t,"menu.select")){let n=t.key==="Enter",s=t.key===" "||t.key==="Spacebar";if((n||s&&!e)&&(t.preventDefault(),i>-1)){let o=this.activeElements()[i];if(o.parentElement?.hasAttribute("trigger")){let p=new CustomEvent("ship-menu-open",{bubbles:true,cancelable:true,detail:{keyboard:true}});o.dispatchEvent(p);}else o.click(),o.querySelector("sh-checkbox")||queueMicrotask(()=>this.close("active"));}}else if(t.key==="Tab"){let n=this.activeElements();if(!n.length){let s=this.optionsEl();this.activeElements.set(s),n=s;}t.shiftKey?i<=0?(t.preventDefault(),this.close("closed")):(t.preventDefault(),this.activeOptionIndex.set(this.prevActiveIndex(i))):i>=n.length-1?(t.preventDefault(),this.close("closed")):(t.preventDefault(),this.activeOptionIndex.set(this.nextActiveIndex(i)));}},this._lastElementList=[],this.activeElements=Ue([]),this.lastInputValue="",this.inputValueEffect=Ga(()=>{if(!this.searchable()){this.activeElements.set(this.optionsEl());return}let i=(this.inputValue()??"").toLowerCase();if(this.#n(),!i||i===""){let n=this.optionsEl();this.activeElements.set(n),this._lastElementList=n;for(let s=0;s<n.length;s++)this.#t.removeStyle(n[s],"order"),n[s].id||(n[s].id=`${this.optionsId}-option-${s}`),n[s].setAttribute("role","option");return}if(!i||i==="")return;let e=this._lastElementList.length&&i.length>this.lastInputValue.length?this._lastElementList:this.optionsEl();this.lastInputValue=i;for(let n=0;n<e.length;n++){let s=e[n],o=s.textContent?.toLowerCase()||"",r=this.#s(o,i);s.value=r;}e=e.filter(n=>n.value>0).sort((n,s)=>s.value-n.value);for(let n=0;n<e.length;n++)this.#t.setStyle(e[n],"order",n);this.activeElements.set(e),this._lastElementList=e;for(let n=0;n<e.length;n++)e[n].id||(e[n].id=`${this.optionsId}-option-${n}`),e[n].setAttribute("role","option");}),this.activeOptionIndexEffect=Ga(()=>{let t=this.activeElements(),i=this.activeOptionIndex();for(let e=0;e<t.length;e++)t[e].classList.remove("active"),t[e].removeAttribute("aria-selected");if(i>-1){let e=t[i];e.scrollIntoView({block:"center"}),e.classList.add("active"),e.setAttribute("aria-selected","true"),this.activeOptionId.set(e.id);}else this.activeOptionId.set(void 0);});}#i;#t;#e;toggleIsOpen(t){t.preventDefault(),t.stopPropagation(),!this.disabled()&&(this.isOpen()?this.close("fromPopover"):this.open());}open(){this.disabled()||(this.isOpen.set(true),this.searchable()&&setTimeout(()=>this.inputRef()?.nativeElement.focus()));}onShipMenuOpen(t){t.preventDefault(),t.stopPropagation(),this.open(),t.detail?.keyboard&&setTimeout(()=>{this.activeOptionIndex.set(0);},50);}#s(t,i){if(!i)return 0;let e=0,n=-1,s=0,o=true;for(let r=0;r<i.length;r++){let p=i[r];if(t.length>n+1&&t[n+1]===p)e+=r===0?100:150,n++,s++;else {let c=t.indexOf(p,n+1);if(r>0&&(o=false),c===-1)return 0;e+=100,n=c,s++;}}return o&&i.length===s&&(e+=1e3),e+=s*20,e}nextActiveIndex(t){let i=this.activeElements();if(!i.length){let n=this.optionsEl();this.activeElements.set(n),i=n;}if(t===-1||t===i.length-1)return 0;let e=t+1;return i[e].disabled?this.nextActiveIndex(e):e}prevActiveIndex(t){let i=this.activeElements();if(!i.length){let n=this.optionsEl();this.activeElements.set(n),i=n;}if(t===0||t===-1)return i.length-1;let e=t-1;return i[e].disabled?this.prevActiveIndex(e):e}close(t="closed",i){this.inputValue.set("");let e=this.inputRef()?.nativeElement;if(e&&(e.value=""),this.closeOnClick()&&((!this.keepClickedOptionActive()||t==="closed")&&this.#n(),this.isOpen.set(false),this.closed.emit(t==="active"),this.isSubmenu())){let n=this.parentMenu?.inputRef()?.nativeElement;n&&queueMicrotask(()=>n.focus());}}#n(){this.activeOptionIndex.set(-1);let t=this.optionsEl();for(let i=0;i<t.length;i++)t[i].classList.remove("active"),t[i].removeAttribute("aria-selected");}ngOnDestroy(){this.abortController&&(this.abortController.abort(),this.abortController=null);let t=m.indexOf(this);t>-1&&m.splice(t,1);}static{this.\u0275fac=function(i){return new(i||a)};}static{this.\u0275cmp=dw({type:a,selectors:[["sh-menu"]],viewQuery:function(i,e){i&1&&$g(e.inputRef,X,5)(e.optionsRef,Z,5),i&2&&lC(2);},hostVars:6,hostBindings:function(i,e){i&1&&Fg("ship-menu-open",function(s){return e.onShipMenuOpen(s)}),i&2&&Qg("disabled",e.disabled())("has-search",e.searchable())("multi-layer",e.asMultiLayer());},inputs:{asMultiLayer:[1,"asMultiLayer"],openIndicator:[1,"openIndicator"],disabled:[1,"disabled"],customOptionElementSelectors:[1,"customOptionElementSelectors"],keepClickedOptionActive:[1,"keepClickedOptionActive"],closeOnClick:[1,"closeOnClick"],isOpen:[1,"isOpen"],searchable:[1,"searchable"]},outputs:{isOpen:"isOpenChange",closed:"closed"},ngContentSelectors:te,decls:13,vars:21,consts:[["formFieldWrapper",""],["inputRef",""],["optionsRef",""],[3,"isOpenChange","closed","isOpen","disableOpenByClick","asMultiLayer","options"],["trigger","","role","combobox","aria-haspopup","listbox",3,"click"],[1,"open-indicator"],[1,"submenu-indicator"],[1,"form-field-wrap"],[1,"small","stretch"],["type","text","placeholder","Search","role","combobox","aria-autocomplete","list"],["role","listbox",1,"options",3,"click","id"]],template:function(i,e){if(i&1){let n=gT();oC(ee),Qi(0,"sh-popover",3,0),sm("isOpenChange",function(o){return Sd(n),HC(e.isOpen,o)||(e.isOpen=o),xd(o)}),Fg("closed",function(){return e.close("fromPopover")}),Qi(2,"div",4),Fg("click",function(o){return e.toggleIsOpen(o)}),iC(3),oT(4,ne,2,0,"sh-icon",5),oT(5,se,2,0,"sh-icon",6),Hl(),Qi(6,"div",7)(7,"sh-form-field",8),mg(8,"input",9,1),Hl()(),Qi(10,"div",10,2),Fg("click",function(){return e.close("active")}),iC(12,1),Hl()();}i&2&&(im("isOpen",e.isOpen),gg("disableOpenByClick",true)("asMultiLayer",e.asMultiLayer())("options",QC(20,ie)),DE(2),Qg("is-open",e.isOpen()),hg("aria-expanded",e.isOpen())("aria-controls",e.optionsId)("aria-activedescendant",e.activeOptionId()),DE(2),iT(e.openIndicator()?4:-1),DE(),iT(e.isSubmenu()?5:-1),DE(2),Qg("hidden",e.searchable()===false),DE(),hg("aria-expanded",e.isOpen())("aria-controls",e.optionsId)("aria-activedescendant",e.activeOptionId()),DE(2),Qg("searching",e.searchable()&&e.inputValue()!==""),gg("id",e.optionsId),hg("aria-activedescendant",e.activeOptionId()));},dependencies:[oe$1,Fe,N$1],styles:[`sh-menu{--menu-mh: 20rem;display:inline-flex;position:relative}sh-menu.disabled{opacity:.5;pointer-events:none}sh-menu.stretch{width:100%}sh-menu.stretch [trigger]>*{width:100%}sh-menu.has-search sh-popover .options [title]{position:sticky;border-bottom:var(--border-10)}sh-menu.has-search .form-field-wrap{margin:.5rem .5rem 0}sh-menu.has-search .options{margin:.25rem 0 0}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-90deg)}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator){display:flex}sh-menu.multi-layer [trigger]:has(sh-icon.open-indicator) .open-indicator{right:1rem}sh-menu.multi-layer [trigger] button:first-child{margin-top:0}sh-menu [trigger]:has(sh-icon.open-indicator){position:relative}sh-menu [trigger]:has(sh-icon.open-indicator)>:first-child{padding-right:2rem}sh-menu [trigger]:has(sh-icon.open-indicator) .open-indicator{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.open-indicator).is-open .open-indicator{transform:translateY(-50%) rotate(-180deg)}sh-menu [trigger]:has(sh-icon.submenu-indicator){position:relative}sh-menu [trigger]:has(sh-icon.submenu-indicator)>:first-child{padding-right:2rem!important}sh-menu [trigger]:has(sh-icon.submenu-indicator) .submenu-indicator{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--base-8);font-size:1rem;font-weight:inherit;pointer-events:none;transition:transform 75ms ease-in-out}sh-menu [trigger]:has(sh-icon.submenu-indicator).is-open .submenu-indicator{transform:translateY(-50%) rotate(90deg)}sh-menu sh-popover{flex:1 0}sh-menu sh-popover .popover{padding:0}sh-menu sh-popover .popover-content{overflow:hidden}sh-menu sh-popover .form-field-wrap sh-form-field{z-index:10;background-color:var(--base-1)}sh-menu sh-popover .form-field-wrap sh-form-field.hidden{opacity:0;height:0;width:0;min-width:0;min-height:0;margin:0}sh-menu sh-popover .options{z-index:2;position:relative;display:flex;flex-direction:column;gap:.25rem;padding:0;margin:0;max-height:var(--menu-mh);overflow:auto}sh-menu sh-popover .options sh-menu:first-child,sh-menu sh-popover .options button:first-child{margin-top:.5rem}sh-menu sh-popover .options.searching button[disabled]{display:none}sh-menu sh-popover .options.searching button[value="0"]{display:none}sh-menu sh-popover .options.searching>*:not(button){display:none}sh-menu sh-popover .options:after{content:"";display:block;width:100%;min-height:.25rem;order:9999999}sh-menu sh-popover .options [title]{font:var(--paragraph-30);color:var(--base-8);padding:.5rem .75rem;margin:0;-webkit-user-select:none;user-select:none;position:relative;top:0;z-index:10;background-color:var(--base-1)}sh-menu sh-popover .options button{display:flex;justify-content:flex-start;align-items:center;text-align:left;height:auto;margin:0 .5rem;padding:.25rem .5rem;gap:0 .5rem;width:calc(100% - 1rem);border-radius:var(--shape-2);appearance:none;background-color:transparent;border:0;cursor:pointer;color:var(--base-12);transition:transform 125ms linear;transform:scale(1)}sh-menu sh-popover .options button:before{content:"";min-height:1.5rem;display:inline-block;width:0;margin-right:-.5rem}sh-menu sh-popover .options button:active{transform:scale(.98)}sh-menu sh-popover .options button[disabled]{opacity:.3;cursor:initial}sh-menu sh-popover .options button[disabled]:hover{background-color:transparent}sh-menu sh-popover .options button [suffix]{order:999;color:var(--base-8);font:var(--paragraph-30);justify-self:flex-end;display:inline-flex;flex:1 0;justify-content:flex-end}sh-menu sh-popover .options button sh-icon{font-size:1rem}sh-menu sh-popover .options button.active,sh-menu sh-popover .options button:hover{background-color:var(--base-2);color:var(--base-12)}sh-menu sh-popover .options button.focused{background-color:var(--primary-2);color:var(--base-12)}sh-menu sh-popover .options button.focused:hover{background-color:var(--primary-3)}
2
2
  `],encapsulation:2});}}return a})();export{ve as v};
@@ -1,2 +1,2 @@
1
- import {b7 as ue,b as g1,b8 as ce,d as dw,b9 as rg,L as oC,Y as iC,h as bC,ag as zg}from'./main-PXGZLKMN.js';var p=["*"],x=(()=>{class o extends ue{constructor(){super("button","active",{hostRole:"group"}),this.id="--"+Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,12),this.color=g1(null),this.variant=g1(null),this.size=g1(null),this.hostClasses=ce("buttonGroup",{color:this.color,variant:this.variant,size:this.size});}static{this.\u0275fac=function(t){return new(t||o)};}static{this.\u0275cmp=dw({type:o,selectors:[["sh-button-group"]],hostVars:4,hostBindings:function(t,n){t&2&&(bC(n.hostClasses()),zg("--btng-id",n.id));},inputs:{color:[1,"color"],variant:[1,"variant"],size:[1,"size"]},features:[rg],ngContentSelectors:p,decls:1,vars:0,template:function(t,n){t&1&&(oC(),iC(0));},styles:[`sh-button-group{--btng-bg: var(--base-3);--btng-item-bg: var(--base-1);--btng-c: var(--base-12);--btng-ic: var(--base-12);--btng-bc: var(--base-4);--btng-h: 2.5rem;--btng-p: 0 .75rem;--btng-s: var(--shape-2);--btng-s-a: var(--shape-2);--btng-f: var(--paragraph-30);display:inline-flex;height:var(--btng-h);max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;position:relative}sh-button-group::-webkit-scrollbar{display:none}sh-button-group{background-color:var(--btng-bg);background-image:linear-gradient(90deg,var(--btng-bg) 30%,rgba(255,255,255,0)),linear-gradient(-90deg,var(--btng-bg) 30%,rgba(255,255,255,0)),radial-gradient(farthest-side at 0% 50%,rgb(from var(--base-12) r g b/8%),rgb(from var(--base-12) r g b/0%)),radial-gradient(farthest-side at 100% 50%,rgb(from var(--base-12) r g b/8%),rgb(from var(--base-12) r g b/0%));background-repeat:no-repeat;background-position:left center,right center,left center,right center;background-size:1.5rem 100%,1.5rem 100%,.5rem 100%,.5rem 100%;background-attachment:local,local,scroll,scroll;padding:.1875rem;gap:.25rem;border:0;border-radius:var(--btng-s)}sh-button-group.small{--btng-h: 2rem;--btng-p: 0 .5rem}sh-button-group button{border:0;flex:1 0;appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;position:relative;padding:var(--btng-p);min-width:auto;cursor:pointer;outline:none;line-height:inherit;-webkit-user-select:none;user-select:none;overflow:visible;vertical-align:middle;white-space:nowrap;background:transparent;color:var(--btng-c);font:var(--btng-f);border-radius:calc(var(--btng-s) / 3 * 2);transition:color 80ms linear,transform 125ms linear;transform:scale(1)}sh-button-group button:focus-visible{outline:2px solid var(--primary-8);outline-offset:-2px}sh-button-group button:active{transform:scale(.96)}sh-button-group button:hover{--btng-bg: var(--base-2)}sh-button-group button:hover,sh-button-group button.active{--btng-bg: var(--base-1);box-shadow:var(--box-shadow-10)}@supports not (anchor-name: --anchor){sh-button-group button{--btng-item-bg: var(--base-3);background:var(--btng-item-bg)}sh-button-group button:hover,sh-button-group button.active{--btng-c: var(--base-12);--btng-ic: var(--base-12);--btng-bg: var(--base-1);--btng-item-bg: var(--base-1)}}@supports (anchor-name: --anchor){sh-button-group button{z-index:1}sh-button-group button.active{position:relative;anchor-name:var(--btng-id)}}sh-button-group button[disabled]{opacity:.5;pointer-events:none;cursor:not-allowed}@supports (anchor-name: --anchor){sh-button-group:after{content:"";background:var(--btng-item-bg);pointer-events:none;position:absolute;z-index:0;top:anchor(top);bottom:anchor(bottom);left:anchor(left);right:anchor(right);position-anchor:var(--btng-id);transition:left .175s ease-out,right .175s ease-out;border-radius:calc(var(--btng-s) / 3 * 2)}}
1
+ import {b7 as ue,b as g1,b8 as ce,d as dw,b9 as rg,L as oC,Y as iC,h as bC,ag as zg}from'./main-KFKZO6SJ.js';var p=["*"],x=(()=>{class o extends ue{constructor(){super("button","active",{hostRole:"group"}),this.id="--"+Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,12),this.color=g1(null),this.variant=g1(null),this.size=g1(null),this.hostClasses=ce("buttonGroup",{color:this.color,variant:this.variant,size:this.size});}static{this.\u0275fac=function(t){return new(t||o)};}static{this.\u0275cmp=dw({type:o,selectors:[["sh-button-group"]],hostVars:4,hostBindings:function(t,n){t&2&&(bC(n.hostClasses()),zg("--btng-id",n.id));},inputs:{color:[1,"color"],variant:[1,"variant"],size:[1,"size"]},features:[rg],ngContentSelectors:p,decls:1,vars:0,template:function(t,n){t&1&&(oC(),iC(0));},styles:[`sh-button-group{--btng-bg: var(--base-3);--btng-item-bg: var(--base-1);--btng-c: var(--base-12);--btng-ic: var(--base-12);--btng-bc: var(--base-4);--btng-h: 2.5rem;--btng-p: 0 .75rem;--btng-s: var(--shape-2);--btng-s-a: var(--shape-2);--btng-f: var(--paragraph-30);display:inline-flex;height:var(--btng-h);max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;position:relative}sh-button-group::-webkit-scrollbar{display:none}sh-button-group{background-color:var(--btng-bg);background-image:linear-gradient(90deg,var(--btng-bg) 30%,rgba(255,255,255,0)),linear-gradient(-90deg,var(--btng-bg) 30%,rgba(255,255,255,0)),radial-gradient(farthest-side at 0% 50%,rgb(from var(--base-12) r g b/8%),rgb(from var(--base-12) r g b/0%)),radial-gradient(farthest-side at 100% 50%,rgb(from var(--base-12) r g b/8%),rgb(from var(--base-12) r g b/0%));background-repeat:no-repeat;background-position:left center,right center,left center,right center;background-size:1.5rem 100%,1.5rem 100%,.5rem 100%,.5rem 100%;background-attachment:local,local,scroll,scroll;padding:.1875rem;gap:.25rem;border:0;border-radius:var(--btng-s)}sh-button-group.small{--btng-h: 2rem;--btng-p: 0 .5rem}sh-button-group button{border:0;flex:1 0;appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;position:relative;padding:var(--btng-p);min-width:auto;cursor:pointer;outline:none;line-height:inherit;-webkit-user-select:none;user-select:none;overflow:visible;vertical-align:middle;white-space:nowrap;background:transparent;color:var(--btng-c);font:var(--btng-f);border-radius:calc(var(--btng-s) / 3 * 2);transition:color 80ms linear,transform 125ms linear;transform:scale(1)}sh-button-group button:focus-visible{outline:2px solid var(--primary-8);outline-offset:-2px}sh-button-group button:active{transform:scale(.96)}sh-button-group button:hover{--btng-bg: var(--base-2)}sh-button-group button:hover,sh-button-group button.active{--btng-bg: var(--base-1);box-shadow:var(--box-shadow-10)}@supports not (anchor-name: --anchor){sh-button-group button{--btng-item-bg: var(--base-3);background:var(--btng-item-bg)}sh-button-group button:hover,sh-button-group button.active{--btng-c: var(--base-12);--btng-ic: var(--base-12);--btng-bg: var(--base-1);--btng-item-bg: var(--base-1)}}@supports (anchor-name: --anchor){sh-button-group button{z-index:1}sh-button-group button.active{position:relative;anchor-name:var(--btng-id)}}sh-button-group button[disabled]{opacity:.5;pointer-events:none;cursor:not-allowed}@supports (anchor-name: --anchor){sh-button-group:after{content:"";background:var(--btng-item-bg);pointer-events:none;position:absolute;z-index:0;top:anchor(top);bottom:anchor(bottom);left:anchor(left);right:anchor(right);position-anchor:var(--btng-id);transition:left .175s ease-out,right .175s ease-out;border-radius:calc(var(--btng-s) / 3 * 2)}}
2
2
  `],encapsulation:2});}}return o})();export{x};