import{a as $}from"./chunk-W4XSW6AJ.js";import{b as L,e as V}from"./chunk-MT5VNIHV.js";import{J as U,K as X}from"./chunk-KPL7BGNQ.js";import{$ as w,$a as r,Ac as Y,B as p,Cc as j,Ia as o,Ja as _,Jb as P,Ka as m,Ma as v,Pb as T,Qb as b,Rb as k,Sb as x,Tb as y,U as t,Ub as S,Xb as O,Yb as M,_b as N,ab as a,ac as B,ec as H,ja as I,ka as E,la as g,lc as R,mc as D,na as e,nc as F,oa as n,pa as u,sc as G,ya as d,zc as W}from"./chunk-DRW4ORQZ.js";import"./chunk-BJ5K5KE7.js";import{a as A}from"./chunk-LNEQX42T.js";import"./chunk-3ZOJ5B5W.js";import"./chunk-3ITX5V5R.js";import"./chunk-KOWO2Z3R.js";import"./chunk-ZYIC63LD.js";import"./chunk-F2T7ZI6U.js";import"./chunk-4WFVMWDK.js";import"./chunk-M2X7KQLB.js";import"./chunk-DVVH2KKN.js";import"./chunk-NV3QH4JK.js";import"./chunk-LRFGNCHE.js";import"./chunk-OZYWYLNK.js";import"./chunk-42C7ZIID.js";import{k as C}from"./chunk-24IZEI4V.js";function z(h,s){if(h&1&&(e(0,"ion-item")(1,"span"),o(2),n()()),h&2){let i=s.$implicit;t(2),m("- Error => ",i)}}var c=class c{constructor(){this.modalCtrl=p(F);this.navCtrl=p(P);this.translate=p(W);this.promisesHandler=p(L);this.electron=p(V);A({refresh:X,power:U})}ionViewDidEnter(){this.startCountdown()}presentConfigPasswordModal(){return C(this,null,function*(){this.stopCountdown=!0,(yield this.modalCtrl.create({component:$})).present()})}retry(){this.promisesHandler.activePromises>0?this.countdown=1:this.navCtrl.pop()}exit(){this.electron!==void 0&&this.electron.ipcRenderer.send(this.electron.channels.closeApp)}startCountdown(){return C(this,null,function*(){for(this.countdown=20,this.stopCountdown=!1;this.countdown>0&&(yield this.delay(1e3),!this.stopCountdown);)--this.countdown;!this.stopCountdown&&this.countdown===0&&this.retry()})}delay(s){return new Promise(i=>this.timeout=setTimeout(i,s))}ionViewWillLeave(){this.stopCountdown=!0,this.promisesHandler.promisesErrors=[],this.promisesHandler.error=!1}};c.\u0275fac=function(i){return new(i||c)},c.\u0275cmp=w({type:c,selectors:[["app-error"]],decls:34,vars:22,consts:[["color","medium",1,"ion-text-center"],[1,"ion-text-center"],["fill","outline","color","dark",3,"click"],[3,"click"],["name","settings"],[1,"retry",3,"click"],["name","refresh"],["color","danger",1,"exit",3,"click"],["name","power"]],template:function(i,l){i&1&&(e(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),o(3),r(4,"translate"),n()()(),e(5,"ion-content")(6,"ion-list"),E(7,z,3,1,"ion-item",null,I),n(),e(9,"ion-card")(10,"ion-card-header",1)(11,"ion-card-title"),o(12),r(13,"translate"),r(14,"translate"),n()(),e(15,"ion-card-content",1)(16,"ion-button",2),d("click",function(){return l.stopCountdown=!0}),o(17),r(18,"translate"),n()()()(),e(19,"ion-footer")(20,"ion-buttons")(21,"ion-button",3),d("click",function(){return l.presentConfigPasswordModal()}),u(22,"ion-icon",4),o(23),r(24,"translate"),n(),e(25,"ion-button",5),d("click",function(){return l.retry()}),u(26,"ion-icon",6),e(27,"span"),o(28),r(29,"translate"),n()(),e(30,"ion-button",7),d("click",function(){return l.exit()}),u(31,"ion-icon",8),o(32),r(33,"translate"),n()()()),i&2&&(t(3),_(a(4,8,"ERROR")),t(4),g(l.promisesHandler.promisesErrors),t(5),v(" ",a(13,10,"RETRYING_CONNECTION"),"",l.countdown," ",a(14,12,"SECONDS")," "),t(5),m(" ",a(18,14,"STOP_COUNTDOWN")," "),t(6),m(" ",a(24,16,"GO_TO_CONFIG")," "),t(5),_(a(29,18,"RETRY")),t(4),m(" ",a(33,20,"EXIT")," "))},dependencies:[B,k,S,y,x,G,b,M,H,O,R,N,D,T,j,Y],styles:["ion-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{white-space:normal!important}ion-footer[_ngcontent-%COMP%]   ion-buttons[_ngcontent-%COMP%]{background-color:var(--ion-color-secondary-shade)}"]});var q=c;export{q as ErrorPage};
