@duplicati/ngclient 0.0.208 → 0.0.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dest-icons/digitalocean.png +0 -0
- package/assets/dest-icons/hetzner.png +0 -0
- package/{chunk-7B4AIHYK.js → chunk-23BFPX3M.js} +1 -1
- package/{chunk-RC3UQLPB.js → chunk-2FD4SR65.js} +1 -1
- package/chunk-3ULPLOSF.js +1 -0
- package/chunk-562BU33Q.js +1 -0
- package/{chunk-Q5WLMQD4.js → chunk-76USHURS.js} +1 -1
- package/{chunk-5ECY4LSP.js → chunk-AQWULDGL.js} +1 -1
- package/{chunk-GLR4FXRG.js → chunk-BDC5JQVQ.js} +1 -1
- package/{chunk-4QE3MT56.js → chunk-CKVJ36E5.js} +1 -1
- package/{chunk-BSYMQ4VF.js → chunk-DJAQY2GM.js} +1 -1
- package/{chunk-KQZNQ7RD.js → chunk-DJJ3VITJ.js} +1 -1
- package/chunk-DKA7IP53.js +1 -0
- package/{chunk-7YLK4QIL.js → chunk-DMMZWQEZ.js} +1 -1
- package/{chunk-AZJ2P3YU.js → chunk-DWFQAX4H.js} +1 -1
- package/{chunk-47PB4WN3.js → chunk-EVMEYZB7.js} +1 -1
- package/chunk-F3TYSZ53.js +1 -0
- package/{chunk-NCN2TOJR.js → chunk-FG4GOBKA.js} +1 -1
- package/{chunk-3SSB4QCJ.js → chunk-FKYRYVJD.js} +1 -1
- package/{chunk-CNUQWXBC.js → chunk-FZQEPDIF.js} +1 -1
- package/{chunk-JW6W3ER7.js → chunk-GVXQIOKE.js} +1 -1
- package/{chunk-3WOW2XM3.js → chunk-I2BAH6NC.js} +1 -1
- package/chunk-I6Y22V2Q.js +1 -0
- package/{chunk-RCZGOO7K.js → chunk-I7U3XXJD.js} +1 -1
- package/{chunk-64IX6ISO.js → chunk-IGEX5B3E.js} +1 -1
- package/{chunk-LQKADAHT.js → chunk-INI4AJEU.js} +1 -1
- package/{chunk-HA7XREWO.js → chunk-IUJGDYFS.js} +1 -1
- package/{chunk-JKIZ6U22.js → chunk-JFUWTLM7.js} +1 -1
- package/{chunk-WZV32HLQ.js → chunk-JIJGVYNW.js} +1 -1
- package/{chunk-J33RTTTX.js → chunk-KNB7LCAL.js} +1 -1
- package/{chunk-ODHFI4PA.js → chunk-KXBEW3N2.js} +1 -1
- package/{chunk-2V75WWT2.js → chunk-LP2DMTA7.js} +1 -1
- package/{chunk-7ZA3Q6TS.js → chunk-LSIAE7ZL.js} +1 -1
- package/{chunk-UUQWSINE.js → chunk-LTVI3WYF.js} +1 -1
- package/{chunk-AZFGZQQK.js → chunk-M3JOG5RD.js} +1 -1
- package/{chunk-2T442RZU.js → chunk-M7QNSQM2.js} +1 -1
- package/chunk-MYHC4Y56.js +1 -0
- package/{chunk-BT44N2RL.js → chunk-NBPZDFGF.js} +1 -1
- package/{chunk-LSF3JCSI.js → chunk-NXF5BMPG.js} +1 -1
- package/{chunk-OISQ63OG.js → chunk-NYX7YT7G.js} +1 -1
- package/{chunk-IXUAJIIQ.js → chunk-PAPOSE5G.js} +1 -1
- package/chunk-PRBKV7LX.js +1 -0
- package/{chunk-P5MXBPC4.js → chunk-PUBEHQ4W.js} +1 -1
- package/{chunk-MAKVVEKB.js → chunk-S2F2BNOG.js} +1 -1
- package/{chunk-5VSRHMHD.js → chunk-T3YMO3FB.js} +1 -1
- package/{chunk-FSFXGPH3.js → chunk-TDEVA3XM.js} +1 -1
- package/{chunk-CPI5ZQUF.js → chunk-UQLHXE6V.js} +1 -1
- package/{chunk-5KQZMHFN.js → chunk-V43VAZTT.js} +1 -1
- package/{chunk-AYCSIHGS.js → chunk-VOJGEOOO.js} +1 -1
- package/chunk-VUABEJRL.js +1 -0
- package/{chunk-I2HYK2BL.js → chunk-XHUQYWAM.js} +1 -1
- package/{chunk-B6CAREL6.js → chunk-YE7IXREK.js} +1 -1
- package/{chunk-B35WNLRM.js → chunk-YF6ULZXZ.js} +1 -1
- package/chunk-ZOOFKMMI.js +1 -0
- package/chunk-ZVTMKBV5.js +1 -0
- package/index.html +1 -1
- package/main-IO5OKXBW.js +1 -0
- package/package.json +1 -1
- package/chunk-4FDBDI3J.js +0 -1
- package/chunk-4KNVWFT2.js +0 -1
- package/chunk-54PAHILA.js +0 -1
- package/chunk-COKAO446.js +0 -1
- package/chunk-GG5S6RWM.js +0 -1
- package/chunk-K32ZRHDV.js +0 -1
- package/chunk-LO5YNFFR.js +0 -1
- package/chunk-O7MDPYFW.js +0 -1
- package/chunk-R63C22I3.js +0 -1
- package/chunk-XQTUBHIK.js +0 -1
- package/main-BYMMXHVT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as yt,b as $t,c as Ut,l as Lt,p as Rt,q as vt}from"./chunk-FSFXGPH3.js";import"./chunk-ITA7DTN3.js";import"./chunk-Q72Y55NB.js";import{b as Mt,c as Ft,d as wt}from"./chunk-LSF3JCSI.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HA7XREWO.js";import"./chunk-X64LSE6Y.js";import"./chunk-RFB5A3B7.js";import"./chunk-3SSB4QCJ.js";import"./chunk-AYOFR344.js";import"./chunk-UUQWSINE.js";import"./chunk-BEXYTIOL.js";import"./chunk-LO5YNFFR.js";import{B as It,C as ht,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-YCLTQEU6.js";import"./chunk-2LSZ2I43.js";import{b as lt,d as _t}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Ab as E,Bb as a,Cb as s,Db as I,Hb as L,Ib as R,Kb as N,Pc as w,Ra as _,Rb as f,Sb as O,Tb as S,Xb as C,Xc as st,Z as P,Zb as r,ca as c,da as d,eb as nt,ec as it,fc as ot,ga as et,ic as v,lc as g,mc as D,oa as h,qa as U,qc as b,rc as G,sc as k,tc as at,ub as T,uc as B,vb as p,vc as x,wb as A,yb as M,zb as F,zc as rt}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";var bt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,e){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),s(),a(4,"button",33),C("click",function(){c(t);let i=r(3);return d(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),s()()(),a(8,"app-destination-list",34),C("setDestination",function(i){c(t);let l=r(3);return d(l.setDestination(i))}),s()()}}function Bt(o,e){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),C("click",function(){c(t);let i=r(2).$index,l=r(2);return d(l.toggleSave(i))}),a(2,"span",44),S(3,8),s()()()}if(o&2){let t=r(2).$implicit;_(),v("active",t.save),E("color","primary")("variant","raised")}}function Vt(o,e){if(o&1){let t=N();a(0,"sh-toggle-card",31),L(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.changeDestination(i))}),g(4,"Change"),s(),a(5,"sh-menu",37),C("click",function(i){return i.stopPropagation()}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),s()(),L(9,39),a(10,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.openTargetUrlDialog(i))}),f(11,5),I(12,"sh-icon"),O(),s(),a(13,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.copyTargetUrl(i))}),f(14,6),I(15,"sh-icon"),O(),s(),a(16,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.removeDestination(i))}),f(17,7),I(18,"sh-icon"),O(),s(),R(),s()(),R(),T(19,Bt,4,4,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTargetUrl(l,i))})("testSignalChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTestState(l,i))}),s(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTargetUrl(l,i))}),s()()}if(o&2){let t=r(),n=t.$implicit,i=t.$index,l=r(2);E("disableToggle",!0)("isActive",!0),_(2),E("targetUrl",n.url)("connectionStringId",n.connectionStringId),_(17),p(n.connectionStringId?-1:19),_(),E("targetUrl",n.url)("testSignal",l.testStates()[i]||null)("backupId",l.backupId())("connectionStringId",n.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",l.isNew()?"destinationEmpty":"any")("moduleType","Backend"),_(2),E("targetUrl",n.url)("useBackupState",!0)}}function Kt(o,e){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=e.$index,n=r(2);p(n.showCustomList()&&n.currentEditingIndex()===t?0:1)}}function Jt(o,e){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){r();let t=x(0);F(t)}}function Xt(o,e){o&1&&(a(0,"div",45),I(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),s()()())}function zt(o,e){o&1&&(a(0,"sh-divider"),S(1,12),s())}function Ht(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;_(),D(t.Description)}}function jt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(4);_(),D(n.getSimplePath(t.BaseUrl))}}function Wt(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,l=r(4);return d(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Ht,2,1,"p",52)(4,jt,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),_(2),D(t.Name||t.BaseUrl),_(),p(t.Description?3:4)}}function Qt(o,e){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){c(t);let i=r(3);return d(i.toggleCustomList())}),a(1,"sh-icon"),g(2,"plus-circle"),s(),a(3,"div",47)(4,"h3"),S(5,10),s(),a(6,"p"),S(7,11),s()()(),T(8,zt,2,0,"sh-divider"),M(9,Wt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(3);_(8),p(t.destinations().length>0?8:-1),_(),F(t.destinations())}}function qt(o,e){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=r(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,e){o&1&&(a(0,"sh-divider"),S(1,15),s())}function Zt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;_(),D(t.Description)}}function te(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(3);_(),D(n.getSimplePath(t.BaseUrl))}}function ee(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,l=r(3);return d(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),_(2),D(t.Name||t.BaseUrl),_(),p(t.Description?3:4)}}function ne(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=r(2);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s(),g(4," Back "),s()(),a(5,"sh-card",48),C("click",function(){c(t);let i=r(2);return d(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),s(),a(8,"div",47)(9,"h3"),S(10,13),s(),a(11,"p"),S(12,14),s()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(2);_(13),p(t.destinations().length>0?13:-1),_(),F(t.destinations())}}function ie(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=r(3);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s()(),a(4,"h3"),S(5,16),s()()}}function oe(o,e){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){c(t);let l=r(2);return d(l.setDestination(i))}),s()}if(o&2){let t=r(2),n=x(0);p(t.destinations().length>0||n.length>0?0:-1)}}function ae(o,e){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=r(),n=x(1);p(!t.showCustomList()&&!n&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,e){if(o&1){let t=N();a(0,"div",25)(1,"button",55),C("click",function(){c(t);let i=r();return d(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),s(),g(4," Add another destination "),s()()}}function se(o,e){o&1&&(a(0,"h2"),S(1,19),s())}function le(o,e){o&1&&(a(0,"h2"),S(1,20),s())}function _e(o,e){if(o&1){let t=N();a(0,"sh-dialog",56),k("isOpenChange",function(i){c(t);let l=r();return G(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),d(i)}),a(1,"header",57)(2,"div",58),T(3,se,2,0,"h2")(4,le,2,0,"h2"),a(5,"sh-alert",59),S(6,17),s()()(),a(7,"div",60)(8,"sh-form-field")(9,"textarea",61),k("ngModelChange",function(i){c(t);let l=r();return G(l.targetUrlCtrl,i)||(l.targetUrlCtrl=i),d(i)}),s()()(),a(10,"footer",62)(11,"button",27),C("click",function(){c(t);let i=r();return d(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),s(),a(13,"button",63),C("click",function(){c(t);let i=r();return d(i.closeTargetUrlDialog(!0))}),f(14,18),I(15,"sh-icon"),O(),s()()()}if(o&2){let t=r(),n=x(1);b("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),_(3),p(n?4:3),_(6),b("ngModel",t.targetUrlCtrl)}}var y=new pt,Ae=(o={destinations:[]})=>y.group({destinations:y.array(o.destinations)}),Me=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>y.group({destinationType:y.control(o),custom:e,dynamic:t,advanced:n}),V=class o{#n=P(_t);#i=P(lt);#t=P(Rt);#e=P(yt);injector=P(et);testUrlComponents=st("testUrl");testStates=h([]);targetUrls=this.#t.targetUrls;targetUrlModel=w(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=h(null);targetUrlInitial=h(null);currentEditingIndex=h(null);targetUrlDialogOpen=h(!1);showCustomList=h(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=w(()=>{let e=this.targetUrlModel();return e?Ft(e)??null:null});isLoadingDestinationEffect=U(()=>{let e=this.isLoadingDestinations(),t=this.destinations(),n=this.targetUrls();!e&&t.length==0&&n.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=w(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});getConnectionString(e){let t=this.#e.destinations().find(n=>n.ID===e);return console.log("connection",t),t}getSimplePath(e){return e?Mt(e):""}copyTargetUrl(e=0){let t=this.targetUrls()[e]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(e=0){let t=this.targetUrls()[e]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();if(!e||t===n||!t)return;let i=this.currentEditingIndex();if(i!==null){let l=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,l,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(e){let t=wt(e??"");if(!t)return;let n=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${e}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),n,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=U(()=>{let e=this.targetUrls();this.testStates.update(t=>{if(t.length===e.length)return t;let n=[...t];if(n.length<e.length)for(let i=n.length;i<e.length;i++)n.push(null);else n.length=e.length;return n})});selectSavedDestination(e){e.BaseUrl&&e.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(e.BaseUrl,!0,e.ID,null):(this.#t.addTargetUrl(e.BaseUrl,e.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=h(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(e){this.currentEditingIndex.set(e),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(e){this.#t.removeTargetUrl(e)}updateTargetUrl(e,t){if(!t)return;let n=this.targetUrls()[e]?.connectionStringId??null,i=this.targetUrls()[e]?.urlKey??null;this.#t.updateTargetUrl(e,t,n,i),this.updateTestState(e,null)}updateTestState(e,t){this.testStates.update(n=>{let i=[...n];return i[e]=t,i})}toggleSave(e){this.#t.toggleSaveConnectionString(e)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),n=this.testStates();for(let i=0;i<t.length;i++){let l=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await l.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=nt({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&it(n.testUrlComponents,bt,5),t&2&&ot()},decls:19,vars:9,consts:()=>{let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let l;l=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let $;$=$localize`Save as connection string`;let K;K=$localize`Loading destinations...`;let J;J=$localize`Configure a new destination`;let X;X=$localize`Configure a one-off or new storage location.`;let z;z=$localize`Or select a saved destination`;let H;H=$localize`Configure a new destination`;let j;j=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let Q;Q=$localize`Select storage type`;let q;q=$localize`Be careful, this will overwrite everything you have in your destination.`;let Y;Y=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Z;Z=$localize`Set target URL`;let tt;return tt=$localize`Edit target URL`,[["formRef",""],["testUrl",""],e,t,n,i,l,m,$,K,J,X,z,H,j,W,Q,q,Y,Z,tt,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"click","color","variant"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"secondary",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1&&(at(0)(1),a(2,"form",21,0),C("submit",function(){return n.next()}),a(4,"div",22),I(5,"input",23)(6,"input",24),s(),a(7,"header"),T(8,Jt,2,0),s(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return n.goBack()}),f(13,2),I(14,"sh-icon"),O(),s(),a(15,"button",28),f(16,3),I(17,"sh-icon"),O(),s()()(),T(18,_e,16,5,"sh-dialog",29)),t&2){let i=B(n.targetUrls());_();let l=B(i.length>0);_(7),p(n.currentEditingIndex()!==null||!n.showCustomList()&&!n.isAddingNew()?8:-1),_(),p((!l||n.showCustomList()||n.isAddingNew())&&n.currentEditingIndex()===null?9:-1),_(),p(l&&!n.showCustomList()&&!n.isAddingNew()?10:-1),_(5),v("loading",n.isNew()&&n.testStates().length>0&&n.testStates()[0]==="testing"),E("disabled",!l),_(3),p(n.targetUrlDialogOpen()?18:-1)}},dependencies:[vt,Ut,$t,Lt,mt,Tt,ct,dt,Ct,ut,gt,It,Ot,Dt,St,Et,Nt,ht,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.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}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,V as default};
|
|
1
|
+
import{a as yt,b as $t,c as Ut,l as Lt,p as Rt,q as vt}from"./chunk-TDEVA3XM.js";import"./chunk-ITA7DTN3.js";import"./chunk-Q72Y55NB.js";import{b as Mt,c as Ft,d as wt}from"./chunk-NXF5BMPG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-IUJGDYFS.js";import"./chunk-X64LSE6Y.js";import"./chunk-RFB5A3B7.js";import"./chunk-FKYRYVJD.js";import"./chunk-AYOFR344.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import{B as It,C as ht,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-YCLTQEU6.js";import"./chunk-2LSZ2I43.js";import{b as lt,d as _t}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Ab as E,Bb as a,Cb as s,Db as I,Hb as L,Ib as R,Kb as N,Pc as w,Ra as _,Rb as f,Sb as O,Tb as S,Xb as C,Xc as st,Z as P,Zb as r,ca as c,da as d,eb as nt,ec as it,fc as ot,ga as et,ic as v,lc as g,mc as D,oa as h,qa as U,qc as b,rc as G,sc as k,tc as at,ub as T,uc as B,vb as p,vc as x,wb as A,yb as M,zb as F,zc as rt}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";var bt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,e){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),s(),a(4,"button",33),C("click",function(){c(t);let i=r(3);return d(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),s()()(),a(8,"app-destination-list",34),C("setDestination",function(i){c(t);let l=r(3);return d(l.setDestination(i))}),s()()}}function Bt(o,e){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),C("click",function(){c(t);let i=r(2).$index,l=r(2);return d(l.toggleSave(i))}),a(2,"span",44),S(3,8),s()()()}if(o&2){let t=r(2).$implicit;_(),v("active",t.save),E("color","primary")("variant","raised")}}function Vt(o,e){if(o&1){let t=N();a(0,"sh-toggle-card",31),L(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.changeDestination(i))}),g(4,"Change"),s(),a(5,"sh-menu",37),C("click",function(i){return i.stopPropagation()}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),s()(),L(9,39),a(10,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.openTargetUrlDialog(i))}),f(11,5),I(12,"sh-icon"),O(),s(),a(13,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.copyTargetUrl(i))}),f(14,6),I(15,"sh-icon"),O(),s(),a(16,"button",33),C("click",function(){c(t);let i=r().$index,l=r(2);return d(l.removeDestination(i))}),f(17,7),I(18,"sh-icon"),O(),s(),R(),s()(),R(),T(19,Bt,4,4,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTargetUrl(l,i))})("testSignalChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTestState(l,i))}),s(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){c(t);let l=r().$index,m=r(2);return d(m.updateTargetUrl(l,i))}),s()()}if(o&2){let t=r(),n=t.$implicit,i=t.$index,l=r(2);E("disableToggle",!0)("isActive",!0),_(2),E("targetUrl",n.url)("connectionStringId",n.connectionStringId),_(17),p(n.connectionStringId?-1:19),_(),E("targetUrl",n.url)("testSignal",l.testStates()[i]||null)("backupId",l.backupId())("connectionStringId",n.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",l.isNew()?"destinationEmpty":"any")("moduleType","Backend"),_(2),E("targetUrl",n.url)("useBackupState",!0)}}function Kt(o,e){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=e.$index,n=r(2);p(n.showCustomList()&&n.currentEditingIndex()===t?0:1)}}function Jt(o,e){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){r();let t=x(0);F(t)}}function Xt(o,e){o&1&&(a(0,"div",45),I(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),s()()())}function zt(o,e){o&1&&(a(0,"sh-divider"),S(1,12),s())}function Ht(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;_(),D(t.Description)}}function jt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(4);_(),D(n.getSimplePath(t.BaseUrl))}}function Wt(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,l=r(4);return d(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Ht,2,1,"p",52)(4,jt,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),_(2),D(t.Name||t.BaseUrl),_(),p(t.Description?3:4)}}function Qt(o,e){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){c(t);let i=r(3);return d(i.toggleCustomList())}),a(1,"sh-icon"),g(2,"plus-circle"),s(),a(3,"div",47)(4,"h3"),S(5,10),s(),a(6,"p"),S(7,11),s()()(),T(8,zt,2,0,"sh-divider"),M(9,Wt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(3);_(8),p(t.destinations().length>0?8:-1),_(),F(t.destinations())}}function qt(o,e){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=r(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,e){o&1&&(a(0,"sh-divider"),S(1,15),s())}function Zt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;_(),D(t.Description)}}function te(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(3);_(),D(n.getSimplePath(t.BaseUrl))}}function ee(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=c(t).$implicit,l=r(3);return d(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),_(2),D(t.Name||t.BaseUrl),_(),p(t.Description?3:4)}}function ne(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=r(2);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s(),g(4," Back "),s()(),a(5,"sh-card",48),C("click",function(){c(t);let i=r(2);return d(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),s(),a(8,"div",47)(9,"h3"),S(10,13),s(),a(11,"p"),S(12,14),s()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(2);_(13),p(t.destinations().length>0?13:-1),_(),F(t.destinations())}}function ie(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){c(t);let i=r(3);return d(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s()(),a(4,"h3"),S(5,16),s()()}}function oe(o,e){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){c(t);let l=r(2);return d(l.setDestination(i))}),s()}if(o&2){let t=r(2),n=x(0);p(t.destinations().length>0||n.length>0?0:-1)}}function ae(o,e){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=r(),n=x(1);p(!t.showCustomList()&&!n&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,e){if(o&1){let t=N();a(0,"div",25)(1,"button",55),C("click",function(){c(t);let i=r();return d(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),s(),g(4," Add another destination "),s()()}}function se(o,e){o&1&&(a(0,"h2"),S(1,19),s())}function le(o,e){o&1&&(a(0,"h2"),S(1,20),s())}function _e(o,e){if(o&1){let t=N();a(0,"sh-dialog",56),k("isOpenChange",function(i){c(t);let l=r();return G(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),d(i)}),a(1,"header",57)(2,"div",58),T(3,se,2,0,"h2")(4,le,2,0,"h2"),a(5,"sh-alert",59),S(6,17),s()()(),a(7,"div",60)(8,"sh-form-field")(9,"textarea",61),k("ngModelChange",function(i){c(t);let l=r();return G(l.targetUrlCtrl,i)||(l.targetUrlCtrl=i),d(i)}),s()()(),a(10,"footer",62)(11,"button",27),C("click",function(){c(t);let i=r();return d(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),s(),a(13,"button",63),C("click",function(){c(t);let i=r();return d(i.closeTargetUrlDialog(!0))}),f(14,18),I(15,"sh-icon"),O(),s()()()}if(o&2){let t=r(),n=x(1);b("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),_(3),p(n?4:3),_(6),b("ngModel",t.targetUrlCtrl)}}var y=new pt,Ae=(o={destinations:[]})=>y.group({destinations:y.array(o.destinations)}),Me=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>y.group({destinationType:y.control(o),custom:e,dynamic:t,advanced:n}),V=class o{#n=P(_t);#i=P(lt);#t=P(Rt);#e=P(yt);injector=P(et);testUrlComponents=st("testUrl");testStates=h([]);targetUrls=this.#t.targetUrls;targetUrlModel=w(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=h(null);targetUrlInitial=h(null);currentEditingIndex=h(null);targetUrlDialogOpen=h(!1);showCustomList=h(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=w(()=>{let e=this.targetUrlModel();return e?Ft(e)??null:null});isLoadingDestinationEffect=U(()=>{let e=this.isLoadingDestinations(),t=this.destinations(),n=this.targetUrls();!e&&t.length==0&&n.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=w(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});getConnectionString(e){let t=this.#e.destinations().find(n=>n.ID===e);return console.log("connection",t),t}getSimplePath(e){return e?Mt(e):""}copyTargetUrl(e=0){let t=this.targetUrls()[e]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(e=0){let t=this.targetUrls()[e]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();if(!e||t===n||!t)return;let i=this.currentEditingIndex();if(i!==null){let l=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,l,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(e){let t=wt(e??"");if(!t)return;let n=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${e}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),n,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=U(()=>{let e=this.targetUrls();this.testStates.update(t=>{if(t.length===e.length)return t;let n=[...t];if(n.length<e.length)for(let i=n.length;i<e.length;i++)n.push(null);else n.length=e.length;return n})});selectSavedDestination(e){e.BaseUrl&&e.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(e.BaseUrl,!0,e.ID,null):(this.#t.addTargetUrl(e.BaseUrl,e.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=h(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(e){this.currentEditingIndex.set(e),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(e){this.#t.removeTargetUrl(e)}updateTargetUrl(e,t){if(!t)return;let n=this.targetUrls()[e]?.connectionStringId??null,i=this.targetUrls()[e]?.urlKey??null;this.#t.updateTargetUrl(e,t,n,i),this.updateTestState(e,null)}updateTestState(e,t){this.testStates.update(n=>{let i=[...n];return i[e]=t,i})}toggleSave(e){this.#t.toggleSaveConnectionString(e)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),n=this.testStates();for(let i=0;i<t.length;i++){let l=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await l.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=nt({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&it(n.testUrlComponents,bt,5),t&2&&ot()},decls:19,vars:9,consts:()=>{let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let l;l=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let $;$=$localize`Save as connection string`;let K;K=$localize`Loading destinations...`;let J;J=$localize`Configure a new destination`;let X;X=$localize`Configure a one-off or new storage location.`;let z;z=$localize`Or select a saved destination`;let H;H=$localize`Configure a new destination`;let j;j=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let Q;Q=$localize`Select storage type`;let q;q=$localize`Be careful, this will overwrite everything you have in your destination.`;let Y;Y=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Z;Z=$localize`Set target URL`;let tt;return tt=$localize`Edit target URL`,[["formRef",""],["testUrl",""],e,t,n,i,l,m,$,K,J,X,z,H,j,W,Q,q,Y,Z,tt,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"click","color","variant"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"secondary",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1&&(at(0)(1),a(2,"form",21,0),C("submit",function(){return n.next()}),a(4,"div",22),I(5,"input",23)(6,"input",24),s(),a(7,"header"),T(8,Jt,2,0),s(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return n.goBack()}),f(13,2),I(14,"sh-icon"),O(),s(),a(15,"button",28),f(16,3),I(17,"sh-icon"),O(),s()()(),T(18,_e,16,5,"sh-dialog",29)),t&2){let i=B(n.targetUrls());_();let l=B(i.length>0);_(7),p(n.currentEditingIndex()!==null||!n.showCustomList()&&!n.isAddingNew()?8:-1),_(),p((!l||n.showCustomList()||n.isAddingNew())&&n.currentEditingIndex()===null?9:-1),_(),p(l&&!n.showCustomList()&&!n.isAddingNew()?10:-1),_(5),v("loading",n.isNew()&&n.testStates().length>0&&n.testStates()[0]==="testing"),E("disabled",!l),_(3),p(n.targetUrlDialogOpen()?18:-1)}},dependencies:[vt,Ut,$t,Lt,mt,Tt,ct,dt,Ct,ut,gt,It,Ot,Dt,St,Et,Nt,ht,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.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}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./chunk-
|
|
1
|
+
import{a as $}from"./chunk-GVXQIOKE.js";import"./chunk-W4HWOC3K.js";import"./chunk-JFUWTLM7.js";import"./chunk-CKVJ36E5.js";import"./chunk-XHUQYWAM.js";import"./chunk-YF6ULZXZ.js";import"./chunk-SLS3DCJP.js";import"./chunk-SUY5AQLW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-I4XRVBRQ.js";import"./chunk-IUJGDYFS.js";import"./chunk-X64LSE6Y.js";import"./chunk-RFB5A3B7.js";import"./chunk-DWFQAX4H.js";import"./chunk-FKYRYVJD.js";import{b as f}from"./chunk-AYOFR344.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import{B as b,v as h}from"./chunk-YCLTQEU6.js";import{d as P}from"./chunk-2LSZ2I43.js";import{b as B,e as A}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Ab as E,Ac as R,Bb as a,Cb as F,Db as _,Pc as D,Ra as i,Rb as c,Sb as d,Tb as r,Wb as N,Xb as L,Z as C,eb as S,lc as M,nc as O,oa as l,ub as s,vb as u,wb as T,yb as p,zb as I}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";var k=e=>({state:e});function v(e,t){e&1&&r(0,2,1)}function y(e,t){e&1&&r(0,2,2)}function U(e,t){e&1&&r(0,2,3)}function G(e,t){e&1&&r(0,2,4)}function K(e,t){if(e&1&&(M(0),_(1,"br")),e&2){let o=t.$implicit;O(" ",o," ")}}var g=class e{#t=C(P);#e=C(B);#n=f(this.#e.params);#o=f(this.#e.queryParams);runId=D(()=>this.#n()?.runId);stateId=D(()=>this.#o()?.state);offset=l(0);status=l("starting");messageLog=l([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(o=>[...o,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=S({type:e,selectors:[["app-commandline-result"]],decls:18,vars:7,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let o;o=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let n;return n=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,n=N(n),[t,o,n,[1,"back"],["type","button","shButton","","routerLink","../",1,"small",3,"queryParams"],["type","button","shButton","",1,"small",3,"click"],[1,"status"]]},template:function(o,n){o&1&&(_(0,"app-status-bar"),a(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"sh-icon"),d(),F()(),a(6,"h3"),c(7,1),a(8,"button",5),L("click",function(){return n.abort()}),F(),d(),F(),a(9,"div",6),c(10,2),s(11,v,1,0),s(12,y,1,0),s(13,U,1,0),s(14,G,1,0),d(),F(),a(15,"code"),p(16,K,2,1,null,null,T),F()()),o&2&&(i(3),E("queryParams",R(5,k,n.stateId())),i(8),u(n.status()==="starting"?11:-1),i(),u(n.status()==="started"?12:-1),i(),u(n.status()==="finished"?13:-1),i(),u(n.status()==="aborted"?14:-1),i(2),I(n.messageLog()))},dependencies:[$,h,b,A],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-S2F2BNOG.js";import{a as te}from"./chunk-RFB5A3B7.js";import{e as ee}from"./chunk-DKA7IP53.js";import{B as Q,L as Y,w as K,x as W,z as q}from"./chunk-YCLTQEU6.js";import{a as H,d as Z}from"./chunk-2LSZ2I43.js";import{b as U,d as j}from"./chunk-BMWZYMK6.js";import{Ab as m,Bb as a,Cb as l,Db as S,Hb as y,Ib as D,Kb as u,Oa as x,Pc as h,Ra as r,Rb as G,Sb as z,Tb as _,Vc as A,Xb as p,Z as d,Zb as s,ca as I,da as f,eb as E,kc as V,lc as P,mc as L,nc as J,oa as v,tc as X,ub as N,uc as B,vb as T,vc as g,yb as b,zb as k}from"./chunk-ERITO7WM.js";function ae(i,t){if(i&1&&(a(0,"div",11),P(1),l()),i&2){s();let e=g(0);r(),J(" ",e.Message," ")}}function re(i,t){if(i&1&&(a(0,"div"),G(1,1),S(2,"a",15),z(),l()),i&2){let e=s();r(2),m("href",e.downloadLink(),x)}}function le(i,t){if(i&1){let e=u();a(0,"button",14),p("click",function(){I(e);let n=s(),c=g(0);return f(n.doRepair(c.BackupID))}),_(1,2),l()}}function ce(i,t){if(i&1){let e=u();a(0,"button",14),p("click",function(){I(e);let n=s(),c=g(0);return f(n.doDownloadBugreport(c))}),_(1,3),l()}}function _e(i,t){if(i&1&&S(0,"sh-progress-bar",17),i&2){let e,o=s(2);m("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function se(i,t){if(i&1){let e=u();a(0,"div",11),y(1),_(2,4),D(),a(3,"a",16),P(4),l(),N(5,_e,1,1,"sh-progress-bar",17),a(6,"button",14),p("click",function(){I(e);let n=s();return f(n.doShowUpdate())}),_(7,5),l()()}if(i&2){let e,o,n=s(),c=g(0);r(3),m("href",(e=n.serverState())==null?null:e.UpdateDownloadLink,x),r(),L(c.Message),r(),T(((o=n.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function de(i,t){if(i&1){let e=u();a(0,"button",14),p("click",function(){I(e);let n=s(),c=g(0);return f(n.doShowLog(c.BackupID))}),_(1,6),l()}}function Ne(i,t){if(i&1){let e=u();a(0,"button",14),p("click",function(){I(e);let n=s();return f(n.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),l()}}function Te(i,t){if(i&1){let e=u();a(0,"button",14),p("click",function(){I(e);let n=s();return f(n.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),l()}}var Ce={Error:"error",Warning:"warn",Information:"primary"},M=class i{#e=d(j);#a=d(U);#r=d(q);#t=d(W);#i=d(F);#n=d(Z);#l=d(ee);#o=v(null);serverState=this.#i.serverState;index=A.required();notification=A.required();downloadLink=h(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ce[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(te,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let n=H.BASE||"",c=this.#l.xsrfQueryParam(),O=`${location.origin}${n}/api/v1/bugreport/${e}?token=${o.Token}${c?`&${c}`:""}`;t.DownloadLink=O,this.#o.set(O),this.triggerDownload(O)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let n;n=$localize`Download`;let c;c=$localize`New update found:`;let O;O=$localize`Show Update`;let $;$=$localize`Show Log`;let w;w=$localize` Show Help `;let R;return R=$localize` Show Help `,[t,e,o,n,c,O,$,w,R,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"message"],[1,"actions"],["shButton","",1,"small","outlined"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1&&(X(0),a(1,"sh-alert")(2,"div",9),P(3),l(),a(4,"div",10),N(5,ae,2,1,"div",11),N(6,re,3,1,"div"),a(7,"div",12),N(8,le,2,0,"button",13),N(9,ce,2,0,"button",13),N(10,se,8,3,"div",11),N(11,de,2,0,"button",13),N(12,Ne,2,0,"button",13),N(13,Te,2,0,"button",13),a(14,"button",14),p("click",function(){return o.deleteNotificationByIndex()}),_(15,0),l()()()()),e&2){let n=B(o.notification());r(),V(o.getAlertType(n.Type)),r(2),L(n.Title),r(2),T(n.Action!=="update:new"&&n.Action!=="update:manual"?5:-1),r(),T(o.downloadLink()?6:-1),r(2),T(n.Message!=null&&n.Message.includes("please run repair")?8:-1),r(),T(n.Action!=null&&n.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),T(n.Action==="update:new"?10:-1),r(),T(n.Action==="backup:show-log"?11:-1),r(),T(n.Action==="config:issue:unencrypted-database"?12:-1),r(),T(n.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,Q,K],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-height:12.5rem;overflow:auto}"],changeDetection:0})};var pe=(i,t)=>t.ID;function Ie(i,t){if(i&1&&S(0,"app-notification",1),i&2){let e=t.$implicit,o=t.$index;m("index",o)("notification",e)}}function fe(i,t){i&1&&(a(0,"div",2)(1,"p"),_(2,0),l()())}var ie=class i{#e=d(F);notificationFilterPredicate=A();notifications=h(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&b(0,Ie,1,2,"app-notification",1,pe,!1,fe,3,0,"div",2),e&2&&k(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,ie as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-
|
|
1
|
+
import{a as K}from"./chunk-YF6ULZXZ.js";import"./chunk-6Q6SSTBK.js";import{a as z}from"./chunk-RFB5A3B7.js";import"./chunk-DWFQAX4H.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import{B as U,H as x,I as V,W as j,b as E,c as A,e as R,f as b,j as y,p as B,q as $,r as v,t as G,v as k,x as L,z as w}from"./chunk-YCLTQEU6.js";import{d as J}from"./chunk-2LSZ2I43.js";import{d as O,e as M}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Ab as p,Bb as a,Cb as i,Db as u,E as T,Ra as l,Rb as D,Sb as h,Tb as _,Wb as I,Xb as d,Z as s,eb as f,ic as P,oa as c,ub as C,vb as S,zc as N}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";var X=()=>["/"];function H(m,o){m&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),i(),u(3,"input",15),i())}var F=new v,g=class m{#t=s(L);#o=s(w);#i=s(J);#n=s(K);#e=s(O);isImporting=c(!1);isSecureFile=c(!1);isValid=c(!1);importForm=F.group({config:F.control(""),cmdline:F.control(!1),import_metadata:F.control(!1),direct:F.control(!1),passphrase:F.control("")});selectedFile=c([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#r.bind(this),t.readAsArrayBuffer(e)}}#r(o){let e=o.target?.result;this.isSecureFile.set(this.#a(e)!=="json"),this.importForm.patchValue({config:this.#s(e)}),this.isValid.set(this.importForm.value.config!=="")}#a(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),n=JSON.parse(t);if(typeof n=="object"&&n!==null)return"json"}catch{}return"unknown"}#s(o){let e=new Uint8Array(o),t=e.byteLength,n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return btoa(n)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#i.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(T(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#t.success("Backup imported successfully."),this.#e.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#e.navigate(["/backup-draft",t])},error:e=>{let t=e.message||$localize`Unknown error`;this.#o.open(z,{data:{title:$localize`Failed to import backup`,message:t,confirmText:$localize`OK`,cancelText:void 0}})}})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=f({type:m,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let n;return n=$localize`Passphrase`,[o,e,t,n,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","autocomplete","disabled","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),D(2,0),a(3,"div",4)(4,"button",5),u(5,"sh-icon"),i(),a(6,"button",6),d("click",function(){return t.submit()}),u(7,"sh-icon"),i()(),h(),i()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),i(),C(10,H,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),i(),u(14,"input",11),i(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),i(),u(18,"input",13),i()()),e&2&&(l(4),p("routerLink",N(7,X)),l(2),P("loading",t.isImporting()),p("disabled",t.isImporting()||!t.isValid()),l(2),p("formGroup",t.importForm),l(),p("files",t.selectedFile()),l(),S(t.isSecureFile()?10:-1))},dependencies:[G,y,A,E,R,b,$,B,M,x,k,U,j,V],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}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-BEXYTIOL.js";import{c as j,e as q}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-BEXYTIOL.js";import{c as j,e as q}from"./chunk-DKA7IP53.js";import{z as b}from"./chunk-YCLTQEU6.js";import{a as x,d as v}from"./chunk-2LSZ2I43.js";import{ma as L}from"./chunk-OQ6BKP5N.js";import{Eb as N,Ec as W,Fb as C,Gb as _,Gc as $,L as O,Pc as p,Ra as M,Rb as A,Sb as w,Tb as P,U as h,Ub as F,Vb as G,Z as c,eb as I,f as m,g as y,oa as n,qa as R}from"./chunk-ERITO7WM.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=R(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),P(2,0),C()(),N(3,"div",3)(4,"p"),A(5,1),_(6,"strong"),W(7,"number"),w(),C()()),t&2&&(M(7),F($(7,1,s.countdown(),"2.0-0")),G(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var T=class r{dialog=c(b);#e=c(v);#i=n("disconnected");#s=n(null);#t=n(-1);#r=n(0);#l=n(!1);#u=new y;connectionStatus=this.#i.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=c(j).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new y,this.#c()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#c(){this.#i.set("connecting"),this.#e.getApiV1Serverstate({lastEventId:this.#t(),longpoll:this.#t()>=0,duration:this.duration}).pipe(O(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,l=Math.min(5e3*s,3e4);this.#r.set(s),s>3&&this.#i.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(l),setTimeout(()=>{this.#c()},l)}})}#a(e){this.#i.set("connected"),this.#s.set(e),this.#t.set(e.LastEventID??-1),this.#r.set(0)}#n(){this.#l()&&this.#c()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var u=!1,k=class r{#e=c(q);#i=c(D);dialog=c(b);#s=null;#t=n("disconnected");#r=n(null);#l=n(null);#u=n(null);#o=n(null);#c=n(null);#a=void 0;#n=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#t.asReadonly();serverState=this.#r.asReadonly();serverProgress=this.#l.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#n.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#c.asReadonly();#h=null;taskCompleted=new m(e=>{this.#h=e});#d=0;start(){this.#p(),this.shouldConnect.set(!0)}#p(){let e=this.#e.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let l=window.location.hostname,g=x.BASE||"",f=this.#e.xsrfQueryParam(),Q=this.#i.hasWebSocketAuth()?`${t}//${l}${s}${g}/notifications${f?`?${f}`:""}`:`${t}//${l}${s}${g}/notifications?token=${e}${f?`&${f}`:""}`;this.#t.set("connecting"),this.#s=new WebSocket(Q),this.#s.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#t.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e,Action:"auth"}))):this.#S()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let o=JSON.parse(d.data);if(o.Success){u&&console.log("WebSocket authentication successful"),this.#S();return}else if(o?.Type==="legacystatus")u&&console.log("WebSocket authentication successful"),this.#S();else{console.error("WebSocket authentication failed:",o.Message),this.#t.set("disconnected");return}}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#t.set("disconnected");return}try{let o=JSON.parse(d.data),a=o?.Type;if(a==="legacystatus"||a==null)u&&console.log("Received legacy status update:",o),this.#r.set(o);else if(a==="reply"){let i=o;i.Success||console.error("WebSocket reply error:",i.Message)}else if(a==="progress"){let i=o;u&&console.log("Received progress update:",i.Data),this.#l.set(i.Data)}else if(a==="serversettings"){let i=o;u&&console.log("Received server settings update:",i.Data),this.#u.set(i.Data)}else if(a==="taskqueue"){let i=o;u&&console.log("Received task update:",i.Data),this.#o.set(i.Data)}else if(a==="taskcompleted"){let i=o;u&&console.log("Received task completed:",i.Data),this.#h?.next(i.Data)}else if(a==="backuplist"){let i=o;u&&console.log("Received backup list update:",i.Data),this.#c.set(i.Data)}else console.warn("Unknown WebSocket message type:",a)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#s.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#t.set("disconnected");var o=d.code===4401;o&&this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:a=>{console.error("Error refreshing token",a)}}),this.shouldConnect()&&(this.#a||(this.#a=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#a.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#p(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#t.set("disconnected")}}#S(){this.#t.set("connected");let e=this.#n();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#a&&this.#a.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#n(),l=s[e];(!l||JSON.stringify(l)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#n.set(s),this.#t()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#n();t[e]&&(delete t[e],this.#n.set(t),this.#t()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var V=10,J=class r{#e=c(k);#i=c(T);#s=c(v);#t=c(D);#r=n("longpoll");#l=n(!1);#u=p(()=>this.#t.hasTaskCompletedOption()&&this.#r()==="websocket");#o={};#c=null;#a=!1;#n=[];constructor(){this.#e.subscribe("taskcompleted"),this.#e.taskCompleted.subscribe(e=>{if(this.#n.unshift(e),this.#n.length>V&&this.#n.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#r()==="websocket"?this.#e.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#r()==="websocket"?this.#e.serverState():this.#i.serverState());progressState=this.#e.serverProgress;taskQueueState=this.#e.serverTaskQueue;activeTaskQueueState=p(()=>this.#r()==="websocket"?this.#e.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#e.backupListState());setConnectionMethod(e){e==="websocket"?(this.#e.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#e.stop()),this.#r.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#r()}subscribe(e,t=null){this.#e.subscribe(e,t)}unsubscribe(e){this.#e.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#n.find(l=>l.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#h()})}#h(){this.#a||this.#u()||(this.#a=!0,this.#d())}#d(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#n.unshift(s),this.#n.length>V&&this.#n.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#c=window.setTimeout(()=>{this.#d()},1e3)},error:s=>{this.#c=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null),this.#a=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{k as a,J as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
1
|
+
import{a as A}from"./chunk-GVXQIOKE.js";import"./chunk-W4HWOC3K.js";import"./chunk-JFUWTLM7.js";import"./chunk-CKVJ36E5.js";import"./chunk-XHUQYWAM.js";import"./chunk-YF6ULZXZ.js";import"./chunk-SLS3DCJP.js";import"./chunk-SUY5AQLW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-I4XRVBRQ.js";import"./chunk-IUJGDYFS.js";import"./chunk-X64LSE6Y.js";import"./chunk-RFB5A3B7.js";import"./chunk-DWFQAX4H.js";import"./chunk-FKYRYVJD.js";import"./chunk-AYOFR344.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import{U as S}from"./chunk-YCLTQEU6.js";import"./chunk-2LSZ2I43.js";import{c as u,e as N,f as c}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Bb as e,Cb as t,Db as T,Tb as n,eb as g}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _e}from"./chunk-
|
|
1
|
+
import{a as _e}from"./chunk-GVXQIOKE.js";import"./chunk-W4HWOC3K.js";import"./chunk-JFUWTLM7.js";import"./chunk-CKVJ36E5.js";import"./chunk-XHUQYWAM.js";import{a as se}from"./chunk-YF6ULZXZ.js";import"./chunk-SLS3DCJP.js";import"./chunk-SUY5AQLW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-I4XRVBRQ.js";import"./chunk-IUJGDYFS.js";import"./chunk-X64LSE6Y.js";import{a as b}from"./chunk-RFB5A3B7.js";import"./chunk-DWFQAX4H.js";import"./chunk-FKYRYVJD.js";import{a as le,b as m}from"./chunk-AYOFR344.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import{B as ae,H as ie,Y as ne,c as Q,e as Y,i as Z,s as x,v as ee,z as te}from"./chunk-YCLTQEU6.js";import{d as oe}from"./chunk-2LSZ2I43.js";import{b as q,e as j}from"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import{Ab as d,B as G,Bb as n,C as g,Cb as i,D as L,Db as c,E as p,Pc as E,Ra as _,Rb as u,Sb as h,Tb as A,Ub as H,Vb as J,Xb as T,Z as F,eb as V,ic as C,kc as K,lc as D,oa as s,p as y,qa as P,qc as X,rc as z,sc as W,ub as w,vb as U}from"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";function re(r,t){r&1&&(n(0,"sh-icon",19),D(1,"spinner"),i())}function ce(r,t){r&1&&(n(0,"sh-icon",20),D(1,"check"),i())}function de(r,t){r&1&&(n(0,"sh-icon",21),D(1,"warning"),i()),r&2&&d("shTooltip","File not found")}function ue(r,t){let a=le(r).pipe(G(t),L());return m(a,{initialValue:r()})}var N=class r{#o=F(q);#s=F(se);#e=F(oe);#a=F(te);#t=s("");backupId=m(this.#o.params.pipe(y(t=>t.id)));activeBackup=E(()=>this.#s.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=s("");lastValidatedPath=s("");isValidatedPath=E(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=E(()=>this.backupFilePath()!==this.#t());isValidatingPath=s(!1);#i=ue(this.backupFilePath,500);#n=s(!1);isWaitingForValidation=E(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=P(()=>{let t=this.#i(),a=this.activeBackup(),e=this.#n();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),p(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=s(!1);isRepairing=s(!1);isDeleting=s(!1);isSavingDbPath=s(!1);isSavingAndRepairing=s(!1);isMovingDb=s(!1);isCreatingBugReport=s(!1);createdReport=s(!1);activeBackupEffect=P(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),p(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId(),requestBody:{refresh_lock_info:!0}}).pipe(g(1),p(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(p(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(p(()=>this.isMovingDb.set(!1))).subscribe(()=>{this.#n.update(a=>!a),this.#t.set(t)})}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(p(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=V({type:r,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let S;S=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Repair `;let I;I=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let M;M=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Recreate (delete and repair) `;let R;R=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Create bug report database `;let B;B=$localize`Placement`;let O;O=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON: Reset `;let $;$=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Save `;let v;v=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Save & Repair `;let k;return k=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SH_ICON: Move existing database `,[t,a,e,o,S,f,I,M,R,B,O,$,v,k,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"actions","maintenance"],["shButton","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"shTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(c(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),u(4,0),c(5,"sh-icon"),h(),i()(),n(6,"article")(7,"h1"),A(8,1),i(),n(9,"p"),A(10,2),i()(),n(11,"article")(12,"h2"),A(13,3),i(),n(14,"p"),A(15,4),i(),n(16,"div",16)(17,"button",17),T("click",function(){return e.repairDatabase()}),u(18,5),c(19,"sh-icon"),h(),i(),n(20,"button",17),T("click",function(){return e.deleteDatabase()}),u(21,6),c(22,"sh-icon"),h(),i(),n(23,"button",17),T("click",function(){return e.restoreDatabase()}),u(24,7),c(25,"sh-icon"),h(),i(),n(26,"button",17),T("click",function(){return e.createErrorReport()}),u(27,8),c(28,"sh-icon"),h(),i()()(),n(29,"article")(30,"h2"),A(31,9),i(),n(32,"sh-form-field")(33,"input",18),W("ngModelChange",function(S){return z(e.backupFilePath,S)||(e.backupFilePath=S),S}),i(),w(34,re,2,0,"sh-icon",19)(35,ce,2,0,"sh-icon",20)(36,de,2,1,"sh-icon",21),i(),n(37,"div",22)(38,"button",17),T("click",function(){return e.resetDatabasePath()}),u(39,10),c(40,"sh-icon"),h(),i(),n(41,"button",17),T("click",function(){return e.saveDatabasePath()}),u(42,11),c(43,"sh-icon"),h(),i(),n(44,"button",17),T("click",function(){return e.saveAndRepairDatabasePath()}),u(45,12),c(46,"sh-icon"),h(),i(),n(47,"button",17),T("click",function(){return e.moveDatabasePath()}),u(48,13),c(49,"sh-icon"),h(),i()()()()),a&2){let o;_(8),H((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),J(8),_(9),C("loading",e.isRepairing()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loading",e.isDeleting()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loading",e.isRestoring()),d("disabled",e.pathHasChanged()),_(3),C("loading",e.isCreatingBugReport()),d("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),_(6),K(e.isValidatedPath()?"success":"error"),_(),X("ngModel",e.backupFilePath),_(),U(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),_(4),d("disabled",!e.pathHasChanged()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[x,Q,Y,Z,_e,ae,ie,ee,ne,j],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-CKVJ36E5.js";import"./chunk-XHUQYWAM.js";import"./chunk-YF6ULZXZ.js";import"./chunk-SLS3DCJP.js";import"./chunk-SUY5AQLW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-I4XRVBRQ.js";import"./chunk-RFB5A3B7.js";import"./chunk-DWFQAX4H.js";import"./chunk-LTVI3WYF.js";import"./chunk-BEXYTIOL.js";import"./chunk-DKA7IP53.js";import"./chunk-YCLTQEU6.js";import"./chunk-2LSZ2I43.js";import"./chunk-BMWZYMK6.js";import"./chunk-7FYL7MVA.js";import"./chunk-NBTTYKXH.js";import"./chunk-OQ6BKP5N.js";import"./chunk-VAQ435AR.js";import"./chunk-ERITO7WM.js";import"./chunk-7CGTOI24.js";export{a as BackupProgressComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ge,c as fe,d as xe}from"./chunk-Q72Y55NB.js";import{h as ue}from"./chunk-LSF3JCSI.js";import{a as Ce}from"./chunk-BEXYTIOL.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,v as re}from"./chunk-YCLTQEU6.js";import{aa as Z}from"./chunk-OQ6BKP5N.js";import{Ab as s,Ac as T,Bb as _,Cb as p,Db as M,Hb as R,Ib as N,Ic as v,Jb as f,Kb as x,Pc as H,Ra as l,Rb as k,Sb as G,Tb as Q,Vc as J,Xb as u,Z as j,Zb as r,Zc as Y,ca as d,da as C,eb as q,gc as g,ic as B,jb as S,lc as m,mc as z,nc as U,oa as b,tc as K,ub as F,uc as E,vb as h,vc as O,wb as $,yb as A,zb as D,zc as W}from"./chunk-ERITO7WM.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),M(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19),m(3),_(4,"p"),m(5),p()()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(3),U(" ",e.shortDescription," "),l(2),z(e.name)}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),M(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),N(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),M(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),N(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Me(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Ne(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Ne,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),M(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Me,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
|
|
1
|
+
import{a as ge,c as fe,d as xe}from"./chunk-Q72Y55NB.js";import{h as ue}from"./chunk-NXF5BMPG.js";import{a as Ce}from"./chunk-BEXYTIOL.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,v as re}from"./chunk-YCLTQEU6.js";import{aa as Z}from"./chunk-OQ6BKP5N.js";import{Ab as s,Ac as T,Bb as _,Cb as p,Db as M,Hb as R,Ib as N,Ic as v,Jb as f,Kb as x,Pc as H,Ra as l,Rb as k,Sb as G,Tb as Q,Vc as J,Xb as u,Z as j,Zb as r,Zc as Y,ca as d,da as C,eb as q,gc as g,ic as B,jb as S,lc as m,mc as z,nc as U,oa as b,tc as K,ub as F,uc as E,vb as h,vc as O,wb as $,yb as A,zb as D,zc as W}from"./chunk-ERITO7WM.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),M(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19),m(3),_(4,"p"),m(5),p()()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(3),U(" ",e.shortDescription," "),l(2),z(e.name)}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),M(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),N(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),M(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),N(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Me(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Ne(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Ne,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),M(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Me,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
|
|
2
2
|
`));updateSettingsFromText(i){if(typeof i!="string")return;let e=ue(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let c=e?.trim().toLowerCase()??"",V=i.FormView.options.find(I=>(I??"").trim().toLocaleLowerCase()===c);if(V)return n[a].Value=V,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:4,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;return a=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disableToggle","isActive"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",a,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(_(0,"sh-toggle-card",9),R(1,10)(2),Q(3,5),N(),_(4,"div",11),F(5,he,3,0,"button",12)(6,Le,8,2),p(),N(),F(7,Ie,1,3,"textarea",13)(8,Tt,3,1),p(),S(9,wt,1,1,"ng-template",null,0,v)),e&2&&(s("disableToggle",!0)("isActive",!0),l(5),h(o.showTextArea()?5:6),l(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,ge,fe,xe,Z,ce,_e,le,pe,de,re,se,me],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.option-col[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{color:var(--base-12)}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};
|