import{d as $}from"./chunk-7A3WMPGM.js";import{a as U}from"./chunk-SFVTPFJH.js";import{a as A}from"./chunk-NK52YOIU.js";import{G as V}from"./chunk-P5ZTPV5Q.js";import"./chunk-LZAJN7X2.js";import"./chunk-7GLTULNV.js";import{Ba as O}from"./chunk-JNANLRYG.js";import"./chunk-HQJI5M5I.js";import{a as w}from"./chunk-PTMJTNEU.js";import"./chunk-X6YHEMIY.js";import{$d as E,Ib as P,Jc as v,Lc as g,Mb as m,Nb as u,Pb as h,Qb as _,Rb as x,Sb as T,Tb as a,Ub as o,Vb as p,Xd as k,Za as b,ab as i,ae as M,cc as y,ea as s,ec as f,nb as S,sc as r,tc as L,uc as C,vc as I}from"./chunk-PCDQIHDN.js";import"./chunk-2PV2FVC7.js";function F(e,t){if(e&1&&(a(0,"div",6),r(1,"An update for vSolution Link Pro is ready for installation"),o(),p(2,"div",2),a(3,"div",7),r(4),v(5,"translate"),o(),a(6,"div",8),r(7),v(8,"translate"),o()),e&2){let n=f();i(4),I("",g(5,4,"Latest version",n.locale.language),": ",n.newVersion),i(3),I("",g(8,7,"Current version",n.locale.language),": ",n.currentVersion)}}function B(e,t){if(e&1&&(a(0,"span",10),r(1),v(2,"translate"),o()),e&2){let n=f(2);i(),C("\xA0\xA0-\xA0",g(2,1,"Latest version",n.locale.language))}}function D(e,t){if(e&1&&(a(0,"li"),r(1),o()),e&2){let n=t.$implicit;i(),L(n)}}function N(e,t){if(e&1&&(a(0,"div",9),r(1),m(2,B,3,4,"span",10),o(),a(3,"ul"),_(4,D,2,1,"li",null,h),o()),e&2){let n=t.$implicit,d=t.$index;i(),C(" ",n.version),i(),u(d===0?2:-1),i(2),x(n.changes)}}function j(e,t){if(e&1&&(p(0,"div",2),a(1,"div")(2,"a",11),r(3,"Visit our download page"),o()()),e&2){let n=f();i(2),P("href",n.downloadPageLink,b)}}var Z=(()=>{let t=class t{constructor(){this.locale=s(k),this.updateService=s(A),this.viewService=s(V)}ngOnInit(){this.updateService.updateAvailability.subscribe(d=>this.updateInfo=d)}get updateAvailable(){return!!this.updateInfo}get newVersion(){return this.updateInfo?this.updateInfo.version:"---"}get currentVersion(){let d=w.appVersion,l=w.buildNumber;return l&&l.toLowerCase().indexOf("beta")>=0?`${d} (${l})`:`${d}.${l}`}get versionInfos(){return this.updateInfo?this.updateInfo.changelog:[]}get pageTitle(){return this.updateAvailable?"Update available":"Version up to date"}get downloadPageLink(){return this.updateInfo&&this.updateInfo.downloadPage&&this.updateInfo.downloadPage.length>0?this.updateInfo.downloadPage:null}downloadLatestVersion(){U.downloadFile(this.updateInfo.url),this.viewService.showToastNotification("Download started")}};t.\u0275fac=function(l){return new(l||t)},t.\u0275cmp=S({type:t,selectors:[["wv-update-info"]],decls:13,vars:3,consts:[[3,"centered"],[1,"update-container","custom-scrollbar"],[1,"spacer"],[1,"changelog","custom-scrollbar"],["l10nTranslate","",1,"mat-caption"],["mat-flat-button","","color","primary","l10nTranslate","",3,"click"],["l10nTranslate","",1,"mat-body-1"],[1,"mat-headline-6"],[1,"mat-caption"],[1,"changelog-version"],[1,"mat-caption","new-version-hint"],["target","_blank","l10nTranslate",""]],template:function(l,c){l&1&&(a(0,"wv-static-page-container",0)(1,"div",1),m(2,F,9,10),p(3,"div",2),a(4,"div",3)(5,"div",4),r(6,"Changelog"),o(),_(7,N,6,2,null,null,h),o(),m(9,j,4,1),p(10,"div",2),a(11,"button",5),y("click",function(){return c.downloadLatestVersion()}),r(12,"Download"),o()()()),l&2&&(T("centered",!0),i(2),u(c.updateAvailable?2:-1),i(5),x(c.versionInfos),i(2),u(c.downloadPageLink?9:-1))},dependencies:[$,M,O,E],styles:[".update-container[_ngcontent-%COMP%]{display:inline-block;border-radius:6px;padding:48px;background-color:#35373d;max-width:640px;max-height:calc(100vh - 200px);overflow-y:auto}.update-container[_ngcontent-%COMP%]   .spacer[_ngcontent-%COMP%]{height:24px}.update-container[_ngcontent-%COMP%]   .mat-caption[_ngcontent-%COMP%]{text-transform:none;margin-bottom:16px}.update-container[_ngcontent-%COMP%]   .changelog[_ngcontent-%COMP%]{text-align:left;padding:16px;overflow-y:auto;max-height:30vh}.update-container[_ngcontent-%COMP%]   .mat-caption[_ngcontent-%COMP%]{line-height:18px}"]});let e=t;return e})();export{Z as UpdateInfoComponent};
