You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/frontend/258.2de3911a919a31a9.js

1 line
330 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[258],{7258:(Pp,ht,_)=>{_.r(ht),_.d(ht,{ECLModule:()=>Op});var u=_(6895),x=_(9116),Mt=_(8878),t=_(4650),m=_(1576),J=_(3162);function Qt(n,a){1&n&&t._UZ(0,"mat-progress-bar",3)}let _t=(()=>{class n{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(i=>{switch(!0){case i instanceof x.OD:this.loading=!0;break;case i instanceof x.m2:case i instanceof x.gk:case i instanceof x.Q3:this.loading=!1}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Qt,1,0,"mat-progress-bar",1),t._UZ(2,"router-outlet",null,2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",i.loading))},dependencies:[u.O5,m.xw,m.Wh,m.yH,J.pW,x.lC],data:{animation:[Mt.g]}}),n})();var p=_(7579),h=_(2722),it=_(1365),gt=_(3396),T=_(2687),s=_(7731),f=_(2501),q=_(5043),A=_(9653),N=_(62),I=_(2216),v=_(5829),F=_(4859),L=_(3546),ft=_(782),Ct=_(7392),at=_(8255),P=_(3848);const xt=function(n){return{backgroundColor:n}};function Yt(n,a){if(1&n&&t._UZ(0,"span",6),2&n){const e=t.oxw();t.Q6J("ngStyle",t.VKq(1,xt,null==e.information?null:e.information.color))}}function Bt(n,a){if(1&n&&(t.TgZ(0,"div")(1,"h4",1),t._uU(2,"Color"),t.qZA(),t.TgZ(3,"div",2),t._UZ(4,"span",7),t._uU(5),t.ALo(6,"uppercase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngStyle",t.VKq(4,xt,null==e.information?null:e.information.color)),t.xp6(1),t.hij(" ",t.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function Ht(n,a){if(1&n&&(t.TgZ(0,"span",2),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}let zt=(()=>{class n{constructor(e){this.commonService=e,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(N.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[t.TTD],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div")(2,"h4",1),t._uU(3,"Alias"),t.qZA(),t.TgZ(4,"div",2),t._uU(5),t.YNc(6,Yt,1,3,"span",3),t.qZA()(),t.YNc(7,Bt,7,6,"div",4),t.TgZ(8,"div")(9,"h4",1),t._uU(10,"Implementation"),t.qZA(),t.TgZ(11,"div",2),t._uU(12),t.qZA()(),t.TgZ(13,"div")(14,"h4",1),t._uU(15,"Chain"),t.qZA(),t.YNc(16,Ht,2,1,"span",5),t.qZA()()),2&e&&(t.xp6(5),t.hij(" ",null==i.information?null:i.information.alias," "),t.xp6(1),t.Q6J("ngIf",!i.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",i.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=i.information&&i.information.lnImplementation||null!=i.information&&i.information.version?(null==i.information?null:i.information.lnImplementation)+" "+(null==i.information?null:i.information.version):""),t.xp6(4),t.Q6J("ngForOf",i.chains))},dependencies:[u.sg,u.O5,u.PC,m.xw,m.Wh,m.yH,v.Zl,u.gd]}),n})();function Vt(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div")(2,"h4",3),t._uU(3,"Lightning"),t.qZA(),t.TgZ(4,"div",4),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",5),t.qZA(),t.TgZ(8,"div")(9,"h4",3),t._uU(10,"On-chain"),t.qZA(),t.TgZ(11,"div",4),t._uU(12),t.ALo(13,"number"),t.qZA(),t._UZ(14,"mat-progress-bar",5),t.qZA(),t.TgZ(15,"div")(16,"h4",3),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"div",4),t._uU(19),t.ALo(20,"number"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.hij("",t.lcZ(6,5,e.balances.lightning)," Sats"),t.xp6(2),t.s9C("value",e.balances.lightning/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(13,7,e.balances.onchain)," Sats"),t.xp6(2),t.s9C("value",e.balances.onchain/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(20,9,e.balances.total)," Sats")}}function Gt(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Kt=(()=>{class n{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-balances-info"]],inputs:{balances:"balances",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Vt,21,11,"div",0),t.YNc(1,Gt,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,J.pW,u.JJ]}),n})();function Wt(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Daily"),t.qZA(),t.TgZ(5,"div",5),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div")(9,"h4",4),t._uU(10,"Weekly"),t.qZA(),t.TgZ(11,"div",5),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.TgZ(14,"div")(15,"h4",4),t._uU(16,"Monthly"),t.qZA(),t.TgZ(17,"div",5),t._uU(18),t.ALo(19,"number"),t.qZA()()(),t.TgZ(20,"div",3)(21,"div")(22,"h4",4),t._uU(23,"Transactions"),t.qZA(),t.TgZ(24,"div",5),t._uU(25),t.ALo(26,"number"),t.qZA()(),t.TgZ(27,"div")(28,"h4",4),t._uU(29,"Transactions"),t.qZA(),t.TgZ(30,"div",5),t._uU(31),t.ALo(32,"number"),t.qZA()(),t.TgZ(33,"div")(34,"h4",4),t._uU(35,"Transactions"),t.qZA(),t.TgZ(36,"div",5),t._uU(37),t.ALo(38,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(6),t.hij("",t.lcZ(7,6,null==e.fees?null:e.fees.daily_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(13,8,null==e.fees?null:e.fees.weekly_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(19,10,null==e.fees?null:e.fees.monthly_fee)," Sats"),t.xp6(7),t.Oqu(t.lcZ(26,12,null==e.fees?null:e.fees.daily_txs)),t.xp6(6),t.Oqu(t.lcZ(32,14,null==e.fees?null:e.fees.weekly_txs)),t.xp6(6),t.Oqu(t.lcZ(38,16,null==e.fees?null:e.fees.monthly_txs))}}function $t(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Xt=(()=>{class n{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){if(this.fees?.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee||0},{name:"Daily ",value:this.fees.daily_fee||0}];const i=10**(Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10)-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/i)*i/5||100,Object.assign(this,this.totalFees)}else this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100,Object.assign(this,this.totalFees)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[t.TTD],decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Wt,39,18,"div",0),t.YNc(1,$t,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,u.JJ]}),n})();function jt(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Active"),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"span",6),t._uU(7),t.ALo(8,"number"),t.qZA()(),t.TgZ(9,"div")(10,"h4",4),t._uU(11,"Pending"),t.qZA(),t.TgZ(12,"div",5),t._UZ(13,"span",7),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div")(17,"h4",4),t._uU(18,"Inactive"),t.qZA(),t.TgZ(19,"div",5),t._UZ(20,"span",8),t._uU(21),t.ALo(22,"number"),t.qZA()()(),t.TgZ(23,"div",3)(24,"div")(25,"h4",4),t._uU(26,"Capacity"),t.qZA(),t.TgZ(27,"div",5),t._uU(28),t.ALo(29,"number"),t.qZA()(),t.TgZ(30,"div")(31,"h4",4),t._uU(32,"Capacity"),t.qZA(),t.TgZ(33,"div",5),t._uU(34),t.ALo(35,"number"),t.qZA()(),t.TgZ(36,"div")(37,"h4",4),t._uU(38,"Capacity"),t.qZA(),t.TgZ(39,"div",5),t._uU(40),t.ALo(41,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(7),t.Oqu(t.lcZ(8,6,(null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(15,8,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(22,10,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),t.xp6(7),t.hij("",t.lcZ(29,12,(null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(35,14,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(41,16,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats")}}function te(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let ee=(()=>{class n{constructor(){this.channelsStatus={}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],[1,"dot","tiny-dot","green"],[1,"dot","tiny-dot","yellow"],[1,"dot","tiny-dot","grey"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,jt,42,18,"div",0),t.YNc(1,te,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,u.JJ]}),n})();var y=_(9549),W=_(4850),G=_(266),Y=_(6839);const ne=function(){return["../connections/channels/open"]},ie=function(n){return{filter:n}};function ae(n,a){if(1&n&&(t.TgZ(0,"div",19)(1,"a",20),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",21)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",22),t._UZ(11,"fa-icon",23),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",24)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",25),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(23,ne))("state",t.VKq(24,ie,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,11,(null==e?null:e.alias)||(null==e?null:e.shortChannelId),0,24),"",((null==e?null:e.alias)||(null==e?null:e.shortChannelId)).length>25?"...":""," "),t.xp6(6),t.hij("",t.xi3(9,15,(null==e?null:e.toLocal)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",i.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,18,(null==e?null:e.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,20,(null==e?null:e.toRemote)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function oe(n,a){if(1&n&&(t.TgZ(0,"div",17),t.YNc(1,ae,20,26,"div",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function se(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",7)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",9),t._UZ(11,"fa-icon",10),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",11)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",12),t.qZA(),t.TgZ(20,"div",13),t._UZ(21,"mat-divider",14),t.qZA(),t.TgZ(22,"div",15),t.YNc(23,oe,2,1,"div",16),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.xp6(8),t.hij("",t.xi3(9,7,(null==e.channelBalances?null:e.channelBalances.localBalance)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",e.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,10,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,12,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",null!=e.channelBalances&&e.channelBalances.localBalance&&(null==e.channelBalances?null:e.channelBalances.localBalance)>0?+(null==e.channelBalances?null:e.channelBalances.localBalance)/(+(null==e.channelBalances?null:e.channelBalances.localBalance)+ +(null==e.channelBalances?null:e.channelBalances.remoteBalance))*100:0),t.xp6(4),t.Q6J("ngIf",e.allChannels&&(null==e.allChannels?null:e.allChannels.length)>0)("ngIfElse",i)}}function le(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t._uU(1," No channels available. "),t.TgZ(2,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.goToChannels())}),t._uU(3,"Open Channel"),t.qZA()()}}function re(n,a){if(1&n&&(t.TgZ(0,"div",28)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let ce=(()=>{class n{constructor(e){this.router=e,this.faBalanceScale=T.DL8,this.faDumbbell=T.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,se,24,15,"div",0),t.YNc(1,le,4,0,"ng-template",null,1,t.W1O),t.YNc(3,re,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.sg,u.O5,I.BN,m.xw,m.Wh,m.yH,F.lW,y.bx,W.d,J.pW,G.gM,Y.$V,x.yS,u.OU,u.JJ],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function ue(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toRemote||0,"1.0-0")," Sats")}}function pe(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toLocal||0,"1.0-0")," Sats")}}function me(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toRemote||0)/i.totalLiquidity*100:0)}}function de(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toLocal||0)/i.totalLiquidity*100:0)}}const he=function(){return["../connections/channels/open"]},_e=function(n){return{filter:n}};function ge(n,a){if(1&n&&(t.TgZ(0,"div",14)(1,"a",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,ue,5,4,"mat-hint",17),t.YNc(6,pe,5,4,"mat-hint",17),t.qZA(),t.YNc(7,me,1,1,"mat-progress-bar",18),t.YNc(8,de,1,1,"mat-progress-bar",18),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(14,he))("state",t.VKq(15,_e,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,10,e.alias||e.shortChannelId,0,24),"",(e.alias||e.shortChannelId).length>25?"...":""," "),t.xp6(3),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction),t.xp6(1),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction)}}function fe(n,a){if(1&n&&(t.TgZ(0,"div",12),t.YNc(1,ge,9,17,"div",13),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const Ce=function(n,a,e){return{"mb-4":n,"mb-2":a,"mb-1":e}};function xe(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"mat-hint",6),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",7),t.qZA(),t.TgZ(8,"div",8),t._UZ(9,"mat-divider",9),t.qZA(),t.TgZ(10,"div",10),t.YNc(11,fe,2,1,"div",11),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,Ce,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD,e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),t.xp6(5),t.hij("",t.xi3(6,4,e.totalLiquidity,"1.0-0")," Sats"),t.xp6(6),t.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",i)}}function ye(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.goToChannels())}),t._uU(1,"Open Channel"),t.qZA()}}function Te(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,ye,2,0,"button",23),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function Le(n,a){if(1&n&&(t.TgZ(0,"div",25)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let be=(()=>{class n{constructor(e,i){this.router=e,this.commonService=i,this.screenSize="",this.screenSizeEnum=s.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0),t.Y36(N.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,xe,12,11,"div",0),t.YNc(1,Te,3,1,"ng-template",null,1,t.W1O),t.YNc(3,Le,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.mk,u.sg,u.O5,m.xw,m.Wh,m.yH,v.oO,F.lW,y.bx,W.d,J.pW,G.gM,Y.$V,x.yS,u.OU,u.JJ]}),n})();var V=_(5698),S=_(8739),b=_(6308),r=_(671),M=_(9300),O=_(2994),D=_(5412),ot=_(3289),K=_(493),yt=_(8104),d=_(4006),Q=_(4144),$=_(3390);const ve=["paymentReq"];function Se(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Ze(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Ae(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Ee(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function we(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",17,18),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.paymentAmount=o)})("change",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onAmountChange(o))}),t.qZA(),t.TgZ(3,"mat-hint"),t._uU(4,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(5,Ee,2,0,"mat-error",11),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.paymentAmount),t.xp6(4),t.Q6J("ngIf",!e.paymentAmount)}}function Ie(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentError)}}function Fe(n,a){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"fa-icon",20),t.YNc(2,Ie,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}}let qe=(()=>{class n{constructor(e,i,o,l,c,g,U,C){this.dialogRef=e,this.store=i,this.eclEffects=o,this.logger=l,this.commonService=c,this.decimalPipe=g,this.actions=U,this.dataService=C,this.faExclamationTriangle=T.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=s.Vc[0],this.feeLimitTypes=s.Vc,this.paymentError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.activeChannels=e.activeChannels,this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,M.h)(e=>e.type===s.lr.UPDATE_API_CALL_STATUS_ECL||e.type===s.lr.SEND_PAYMENT_STATUS_ECL)).subscribe(e=>{e.type===s.lr.SEND_PAYMENT_STATUS_ECL&&this.dialogRef.close(),e.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===s.Bn.ERROR&&"SendPayment"===e.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=e.payload.message)})}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,V.q)(1)).subscribe({next:e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[2])).subscribe({next:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+i.symbol+this.decimalPipe.transform(i.OTHER?i.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+(e.message?e.message:"string"==typeof e?e:JSON.stringify(e)),this.paymentReq.control.setErrors({decodeError:!0})}}))}sendPayment(){this.store.dispatch((0,O.oV)(this.zeroAmtInvoice&&this.paymentAmount?{payload:{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}}:{payload:{invoice:this.paymentRequest,fromDialog:!0}}))}onPaymentRequestEntry(e){this.paymentRequest=e&&"string"==typeof e?e.trim():e,this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentRequest&&this.paymentRequest.length>100&&(this.paymentReq.control.setErrors(null),this.zeroAmtInvoice=!1,this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,V.q)(1)).subscribe({next:i=>{this.paymentDecoded=i,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:i=>{this.logger.error(i),this.paymentDecodedHint="ERROR: "+(i.message?i.message:"string"==typeof i?i:JSON.stringify(i)),this.paymentReq.control.setErrors({decodeError:!0})}}))}onAmountChange(e){delete this.paymentDecoded.amount,this.paymentDecoded.amount=e}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=s.Vc[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(A.yh),t.Y36(ot.o),t.Y36(q.mQ),t.Y36(N.v),t.Y36(u.JJ),t.Y36(K.eX),t.Y36(yt.D))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,i){if(1&e&&t.Gf(ve,5),2&e){let o;t.iGM(o=t.CRH())&&(i.paymentReq=o.first)}},decls:24,vars:7,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",1)(12,"textarea",9,10),t.NdJ("ngModelChange",function(l){return i.onPaymentRequestEntry(l)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(14,Se,2,1,"mat-hint",11),t.YNc(15,Ze,2,0,"mat-error",11),t.YNc(16,Ae,2,1,"mat-error",11),t.qZA(),t.YNc(17,we,6,2,"mat-form-field",12),t.YNc(18,Fe,3,2,"div",13),t.TgZ(19,"div",14)(20,"button",15),t.NdJ("click",function(){return i.resetData()}),t._uU(21,"Clear Fields"),t.qZA(),t.TgZ(22,"button",16),t.NdJ("click",function(){return i.onSendPayment()}),t._uU(23,"Send Payment"),t.qZA()()()()()()),2&e){const o=t.MAs(13);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.paymentRequest),t.xp6(2),t.Q6J("ngIf",i.paymentRequest&&""!==i.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!i.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),t.xp6(1),t.Q6J("ngIf",i.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==i.paymentError)}},dependencies:[u.O5,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,D.ZT,F.lW,L.dk,L.dn,y.TO,y.KE,y.bx,Q.Nt,$.h]}),n})();var B=_(752);const Ne=["scrollContainer"];function Oe(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"div",1)(2,"h4",11),t._uU(3,"Description"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.Oqu(e.description)}}function Pe(n,a){1&n&&t._UZ(0,"mat-divider",14)}function Ue(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-expansion-panel",23),t.NdJ("opened",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!0))})("closed",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!1))}),t.TgZ(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"h4",24),t._uU(4),t.qZA(),t.TgZ(5,"h4",25),t._uU(6),t.ALo(7,"number"),t.qZA()()(),t.TgZ(8,"div",8)(9,"div",9)(10,"div",26)(11,"h4",11),t._uU(12,"Fees (mSats)"),t.qZA(),t.TgZ(13,"span",12),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div",26)(17,"h4",11),t._uU(18,"Date/Time"),t.qZA(),t.TgZ(19,"span",12),t._uU(20),t.ALo(21,"date"),t.qZA()()(),t._UZ(22,"mat-divider",14),t.TgZ(23,"div",9)(24,"div",1)(25,"h4",11),t._uU(26,"ID"),t.qZA(),t.TgZ(27,"span",27),t._uU(28),t.qZA()()(),t._UZ(29,"mat-divider",14),t.TgZ(30,"div",9)(31,"div",1)(32,"h4",11),t._uU(33,"To Channel"),t.qZA(),t.TgZ(34,"span",27),t._uU(35),t.qZA()()()()()}if(2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.Q6J("expanded",o.expansionOpen),t.xp6(4),t.hij("Part ",i+1,""),t.xp6(2),t.hij("",t.lcZ(7,7,e.amount)," (Sats)"),t.xp6(8),t.Oqu(t.lcZ(15,9,e.feesPaid)),t.xp6(6),t.Oqu(t.xi3(21,11,e.timestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(e.id),t.xp6(7),t.Oqu(e.toChannelAlias)}}let Re=(()=>{class n{constructor(e,i){this.dialogRef=e,this.data=i,this.description=null,this.shouldScroll=!0,this.expansionOpen=!0}ngOnInit(){this.payment=this.data.payment,this.data.sentPaymentInfo.length>0&&this.data.sentPaymentInfo[0].paymentRequest&&this.data.sentPaymentInfo[0].paymentRequest.description&&""!==this.data.sentPaymentInfo[0].paymentRequest.description&&(this.description=this.data.sentPaymentInfo[0].paymentRequest.description)}ngAfterViewChecked(){this.shouldScroll=this.scrollContainer.nativeElement.classList.value.includes("ps--active-y")}onScrollDown(){this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollTop+62.6}onExpansionOpen(e){this.expansionOpen=e}onClose(){this.dialogRef.close(!1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ne,5),2&e){let o;t.iGM(o=t.CRH())&&(i.scrollContainer=o.first)}},decls:66,vars:15,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"h-40","padding-gap-x-large",3,"perfectScrollbar"],["scrollContainer",""],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],["fxFlex","70"],[1,"w-100","my-1"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["class","flat-expansion-panel my-1",3,"expanded","opened","closed",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start end",1,"btn-sticky-container","padding-gap-x-large"],["mat-mini-fab","","aria-label","Scroll Down","fxLayoutAlign","center center",3,"click"],["fxLayoutAlign","center center"],["fxLayout","row","fxLayoutAlign","end center",1,"padding-gap-x-large","padding-gap-bottom-large"],["fxLayoutAlign","center center","tabindex","1","mat-button","","color","primary","type","button","default","",1,"mr-1",3,"mat-dialog-close"],[1,"flat-expansion-panel","my-1",3,"expanded","opened","closed"],["fxFlex","30","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","70","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Payment Information"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6,7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h4",11),t._uU(14,"Amount (Sats)"),t.qZA(),t.TgZ(15,"span",12),t._uU(16),t.ALo(17,"number"),t.qZA()(),t.TgZ(18,"div",13)(19,"h4",11),t._uU(20,"Date/Time"),t.qZA(),t.TgZ(21,"span",12),t._uU(22),t.ALo(23,"date"),t.qZA()()(),t._UZ(24,"mat-divider",14),t.TgZ(25,"div",9)(26,"div",1)(27,"h4",11),t._uU(28,"ID"),t.qZA(),t.TgZ(29,"span",12),t._uU(30),t.qZA()()(),t._UZ(31,"mat-divider",14),t.TgZ(32,"div",9)(33,"div",1)(34,"h4",11),t._uU(35,"Payment Hash"),t.qZA(),t.TgZ(36,"span",12),t._uU(37),t.qZA()()(),t._UZ(38,"mat-divider",14),t.TgZ(39,"div",9)(40,"div",1)(41,"h4",11),t._uU(42,"Payment Preimage"),t.qZA(),t.TgZ(43,"span",12),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",1)(48,"h4",11),t._uU(49,"Recipient Node"),t.qZA(),t.TgZ(50,"span",12),t._uU(51),t.qZA()()(),t._UZ(52,"mat-divider",14),t.YNc(53,Oe,6,1,"div",15),t.YNc(54,Pe,1,0,"mat-divider",16),t.TgZ(55,"div",9)(56,"div",1)(57,"mat-accordion"),t.YNc(58,Ue,36,14,"mat-expansion-panel",17),t.qZA()()()()(),t.TgZ(59,"div",18)(60,"button",19),t.NdJ("click",function(){return i.onScrollDown()}),t.TgZ(61,"mat-icon",20),t._uU(62,"arrow_downward"),t.qZA()()(),t.TgZ(63,"div",21)(64,"button",22),t._uU(65,"OK"),t.qZA()()()()),2&e&&(t.xp6(16),t.Oqu(t.lcZ(17,10,i.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,i.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(i.payment.id),t.xp6(7),t.Oqu(i.payment.paymentHash),t.xp6(7),t.Oqu(i.payment.paymentPreimage),t.xp6(7),t.Oqu(i.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",i.description),t.xp6(1),t.Q6J("ngIf",i.description),t.xp6(4),t.Q6J("ngForOf",i.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},dependencies:[u.sg,u.O5,m.xw,m.Wh,m.yH,D.ZT,F.lW,L.dk,L.dn,B.pp,B.ib,B.yz,B.yK,Ct.Hw,W.d,Y.$V,u.JJ,u.uU]}),n})();var Z=_(7861),tt=_(3093),z=_(9445),R=_(4385),H=_(3238);const ke=["sendPaymentForm"];function De(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Je(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Me(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"textarea",7,8),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(5,De,2,1,"mat-hint",9),t.YNc(6,Je,2,0,"mat-error",9),t.qZA(),t.TgZ(7,"div",10)(8,"button",11),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(9,"Clear Field"),t.qZA(),t.TgZ(10,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSendPayment())}),t._uU(11,"Send Payment"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest)}}function Qe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",13)(1,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openSendPaymentModal())}),t._uU(2,"Send Payment"),t.qZA()()}}function Ye(n,a){if(1&n&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Be(n,a){1&n&&t._UZ(0,"mat-progress-bar",60)}function He(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Date/Time"),t.qZA())}function ze(n,a){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,null==e?null:e.firstPartTimestamp,"dd/MMM/y HH:mm"))}}function Ve(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"ID"),t.qZA())}const k=function(n){return{width:n}};function Ge(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id)}}function Ke(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination Node ID"),t.qZA())}function We(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId)}}function $e(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination"),t.qZA())}function Xe(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias)}}function je(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Description"),t.qZA())}function tn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function en(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Payment Hash"),t.qZA())}function nn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function an(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Preimage"),t.qZA())}function on(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage)}}function sn(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Amount (Sats)"),t.qZA())}function ln(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",66),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.recipientAmount))}}function rn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",67)(1,"div",68)(2,"mat-select",69),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",70),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function cn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",71)(1,"button",72),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.onPaymentClick(l))}),t._uU(2,"View Info"),t.qZA()()}}function un(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function pn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function mn(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function dn(n,a){if(1&n&&(t.TgZ(0,"td",73),t.YNc(1,un,2,0,"p",9),t.YNc(2,pn,2,0,"p",9),t.YNc(3,mn,2,1,"p",9),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function hn(n,a){if(1&n&&(t.TgZ(0,"span",74),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.timestamp,"dd/MMM/y HH:mm")," ")}}function _n(n,a){if(1&n&&(t.ynx(0),t.YNc(1,hn,3,4,"span",75),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function gn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",74),t._uU(2),t.qZA(),t.YNc(3,_n,2,1,"ng-container",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" Total Attempts: ",(null==e||null==e.parts?null:e.parts.length)||0," "),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function fn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.id)}}function Cn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,fn,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function xn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Cn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function yn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelId)}}function Tn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,yn,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Ln(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Tn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function bn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelAlias)}}function vn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,bn,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Sn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,vn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Zn(n,a){if(1&n&&(t.TgZ(0,"span",77),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.amount,"1.0-0")," ")}}function An(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Zn,3,4,"span",78),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function En(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",77),t._uU(2),t.ALo(3,"number"),t.qZA(),t.YNc(4,An,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.xi3(3,2,null==e?null:e.recipientAmount,"1.0-0")),t.xp6(2),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function wn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function In(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,wn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Fn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,In,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function qn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Nn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,qn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function On(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Nn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Pn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Un(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Pn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Rn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Un,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function kn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",79)(1,"button",82),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw(2).$implicit,g=t.oxw(2);return t.KtG(g.onPartClick(l,c))}),t._uU(2),t.qZA()()}if(2&n){const e=a.index;t.xp6(2),t.hij("View ",e+1,"")}}function Dn(n,a){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,kn,3,1,"div",81),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Jn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",62)(1,"span",79)(2,"button",80),t.NdJ("click",function(){const l=t.CHM(e).$implicit;return t.KtG(l.is_expanded=!l.is_expanded)}),t._uU(3),t.qZA()(),t.YNc(4,Dn,2,1,"div",9),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(3),t.Oqu(null!=e&&e.is_expanded?"Hide":"Show"),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Mn(n,a){1&n&&t._UZ(0,"tr",83)}const Qn=function(n){return{"display-none":n}};function Yn(n,a){if(1&n&&t._UZ(0,"tr",84),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Qn,(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function Bn(n,a){1&n&&t._UZ(0,"tr",85)}function Hn(n,a){1&n&&t._UZ(0,"tr",83)}const zn=function(){return["all"]},Vn=function(n){return{"error-border":n}},Gn=function(){return["no_payment"]};function Kn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"div",16),t._UZ(3,"fa-icon",17),t.TgZ(4,"span",18),t._uU(5,"Payments History"),t.qZA()(),t.TgZ(6,"div",19)(7,"mat-form-field",20)(8,"mat-select",21),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(9,Ye,2,2,"mat-option",22),t.qZA()(),t.TgZ(10,"mat-form-field",20)(11,"input",23),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(12,"div",24)(13,"div",25),t.YNc(14,Be,1,0,"mat-progress-bar",26),t.TgZ(15,"table",27,28),t.ynx(17,29),t.YNc(18,He,2,0,"th",30),t.YNc(19,ze,3,4,"td",31),t.BQk(),t.ynx(20,32),t.YNc(21,Ve,2,0,"th",30),t.YNc(22,Ge,4,4,"td",31),t.BQk(),t.ynx(23,33),t.YNc(24,Ke,2,0,"th",30),t.YNc(25,We,4,4,"td",31),t.BQk(),t.ynx(26,34),t.YNc(27,$e,2,0,"th",30),t.YNc(28,Xe,4,4,"td",31),t.BQk(),t.ynx(29,35),t.YNc(30,je,2,0,"th",30),t.YNc(31,tn,4,4,"td",31),t.BQk(),t.ynx(32,36),t.YNc(33,en,2,0,"th",30),t.YNc(34,nn,4,4,"td",31),t.BQk(),t.ynx(35,37),t.YNc(36,an,2,0,"th",30),t.YNc(37,on,4,4,"td",31),t.BQk(),t.ynx(38,38),t.YNc(39,sn,2,0,"th",39),t.YNc(40,ln,4,3,"td",31),t.BQk(),t.ynx(41,40),t.YNc(42,rn,6,0,"th",41),t.YNc(43,cn,3,0,"td",42),t.BQk(),t.ynx(44,43),t.YNc(45,dn,4,3,"td",44),t.BQk(),t.ynx(46,45),t.YNc(47,gn,4,2,"td",31),t.BQk(),t.ynx(48,46),t.YNc(49,xn,5,5,"td",31),t.BQk(),t.ynx(50,47),t.YNc(51,Ln,5,5,"td",31),t.BQk(),t.ynx(52,48),t.YNc(53,Sn,5,5,"td",31),t.BQk(),t.ynx(54,49),t.YNc(55,En,5,5,"td",31),t.BQk(),t.ynx(56,50),t.YNc(57,Fn,5,5,"td",31),t.BQk(),t.ynx(58,51),t.YNc(59,On,5,5,"td",31),t.BQk(),t.ynx(60,52),t.YNc(61,Rn,5,5,"td",31),t.BQk(),t.ynx(62,53),t.YNc(63,Jn,5,2,"td",31),t.BQk(),t.YNc(64,Mn,1,0,"tr",54),t.YNc(65,Yn,1,3,"tr",55),t.YNc(66,Bn,1,0,"tr",56),t.YNc(67,Hn,1,0,"tr",57),t.qZA()()(),t._UZ(68,"mat-paginator",58),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(15,zn).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.payments)("ngClass",t.VKq(16,Vn,""!==e.errorMessage)),t.xp6(49),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(18,Gn)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Tt=(()=>{class n{constructor(e,i,o,l,c,g,U,C){this.logger=e,this.commonService=i,this.store=o,this.rtlEffects=l,this.decimalPipe=c,this.dataService=g,this.datePipe=U,this.camelCaseWithSpaces=C,this.calledFrom="transactions",this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"payments",recordsPerPage:s.IV,sortBy:"firstPartTimestamp",sortOrder:s.Pi.DESCENDING},this.faHistory=T.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.payments=new r.by([]),this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(f.nF).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.partColumns=[],this.displayedColumns.map(i=>this.partColumns.push("group_"+i)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.PP).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.paymentJSONArr=e.payments&&e.payments.sent&&e.payments.sent.length>0?e.payments.sent:[],this.paymentJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.payments.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=(e.firstPartTimestamp?this.datePipe.transform(new Date(e.firstPartTimestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"firstPartTimestamp":o=this.datePipe.transform(new Date(e.firstPartTimestamp||0),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadPaymentsTable(e){this.payments=new r.by(e?[...e]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(i,o)=>{switch(o){case"firstPartTimestamp":return this.commonService.sortByKey(i.parts,"timestamp","number",this.sort?.direction),i.firstPartTimestamp;case"id":return this.commonService.sortByKey(i.parts,"id","string",this.sort?.direction),i.id;case"recipientNodeAlias":return this.commonService.sortByKey(i.parts,"toChannelAlias","string",this.sort?.direction),i.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(i.parts,"amount","number",this.sort?.direction),i.recipientAmount;default:return i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null}},this.payments.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.payments.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,V.q)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){this.newlyAddedPayment=this.paymentDecoded.paymentHash||"",this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:50,type:s.Gi.DATE_TIME},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:s.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]]}}})),this.rtlEffects.closeConfirm.pipe((0,V.q)(1)).subscribe(i=>{i&&(this.store.dispatch((0,O.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:40,type:s.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:s.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",getInputs:[{placeholder:"Amount (Sats)",inputType:s.Gi.NUMBER,inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,V.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.amount=o[0].inputValue,this.store.dispatch((0,O.oV)({payload:{invoice:this.paymentRequest,amountMsat:1e3*o[0].inputValue,fromDialog:!1}})),this.resetData())}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,V.q)(1)).subscribe(i=>{this.paymentDecoded=i,this.paymentDecoded.amount?this.selNode&&this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[4])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}openSendPaymentModal(){this.store.dispatch((0,Z.qR)({payload:{data:{component:qe}}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(e,i){return i.parts&&i.parts.length>1}onPaymentClick(e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe((0,V.q)(1)).subscribe({next:i=>{setTimeout(()=>{this.showPaymentView(e,i.length&&i.length>0?i[0]:[])},0)},error:i=>{this.showPaymentView(e,[])}}):this.showPaymentView(e,[])}showPaymentView(e,i){this.store.dispatch((0,Z.qR)({payload:{data:{sentPaymentInfo:i,payment:e,component:Re}}}))}onPartClick(e,i){i.paymentHash&&""!==i.paymentHash.trim()?this.dataService.decodePayments(i.paymentHash).pipe((0,V.q)(1)).subscribe({next:o=>{setTimeout(()=>{this.showPartView(e,i,o.length&&o.length>0?o[0]:[])},0)},error:o=>{this.showPartView(e,i,[])}}):this.showPartView(e,i,[])}showPartView(e,i,o){const l=[[{key:"paymentHash",value:i.paymentHash,title:"Payment Hash",width:100,type:s.Gi.STRING}],[{key:"paymentPreimage",value:i.paymentPreimage,title:"Payment Preimage",width:100,type:s.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"Channel",width:100,type:s.Gi.STRING}],[{key:"id",value:e.id,title:"Part ID",width:50,type:s.Gi.STRING},{key:"timestamp",value:e.timestamp,title:"Time",width:50,type:s.Gi.DATE_TIME}],[{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER},{key:"feesPaid",value:e.feesPaid,title:"Fee (Sats)",width:50,type:s.Gi.NUMBER}]];o&&o.length>0&&o[0].paymentRequest&&o[0].paymentRequest.description&&""!==o[0].paymentRequest.description&&l.splice(3,0,[{key:"description",value:o[0].paymentRequest.description,title:"Description",width:100,type:s.Gi.STRING}]),this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Payment Part Information",message:l}}}))}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const e=JSON.parse(JSON.stringify(this.payments.data)),i=e?.reduce((o,l)=>(l.paymentHash&&""!==l.paymentHash.trim()&&(o=""===o?l.paymentHash:o+","+l.paymentHash),o),"");this.dataService.decodePayments(i).pipe((0,h.R)(this.unSubs[5])).subscribe(o=>{o.forEach((c,g)=>{c.length>0&&c[0].paymentRequest&&c[0].paymentRequest.description&&""!==c[0].paymentRequest.description&&(e[g].description=c[0].paymentRequest.description)});const l=e?.reduce((c,g)=>c.concat(g),[]);this.commonService.downloadFile(l,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh),t.Y36(tt.V),t.Y36(u.JJ),t.Y36(yt.D),t.Y36(u.uU),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(e,i){if(1&e&&(t.Gf(ke,5),t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","colWidth","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["sendPaymentForm","ngForm"],["fxFlex","colWidth"],["matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"perfectScrollbar","ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","colWidth",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","colWidth","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeId"],["matColumnDef","recipientNodeAlias"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","paymentPreimage"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","group_firstPartTimestamp"],["matColumnDef","group_id"],["matColumnDef","group_recipientNodeId"],["matColumnDef","group_recipientNodeAlias"],["matColumnDef","group_recipientAmount"],["matColumnDef","group_description"],["matColumnDef","group_paymentHash"],["matColumnDef","group_paymentPreimage"],["matColumnDef","group_actions"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end start"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["fxLayoutAlign","end start",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-part-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Me,12,3,"form",1),t.YNc(2,Qe,3,0,"div",2),t.YNc(3,Kn,69,19,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},dependencies:[u.mk,u.sg,u.O5,u.PC,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.TO,y.KE,y.bx,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,Y.$V,u.JJ,u.uU],styles:[".mat-column-group_actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{min-width:10rem;width:10rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;min-width:9rem;width:9rem}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%] .part-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:3rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%]{min-width:17rem}"]}),n})();var X=_(6534);function Wn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function $n(n,a){if(1&n&&(t.TgZ(0,"mat-option",25),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(t.lcZ(2,2,e))}}function Xn(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.invoiceError)}}function jn(n,a){if(1&n&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,Xn,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.invoiceError)}}let ti=(()=>{class n{constructor(e,i,o,l,c,g){this.dialogRef=e,this.data=i,this.store=o,this.decimalPipe=l,this.commonService=c,this.actions=g,this.faExclamationTriangle=T.eHv,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=s.IV,this.timeUnitEnum=s.Qk,this.timeUnits=s.LO,this.selTimeUnit=s.Qk.SECS,this.invoiceError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.actions.pipe((0,h.R)(this.unSubs[2]),(0,M.h)(e=>e.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&"CreateInvoice"===e.payload.action&&(e.payload.status===s.Bn.ERROR&&(this.invoiceError=e.payload.message),e.payload.status===s.Bn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(e){if(this.invoiceError="",!this.description)return!0;let i=this.expiry?this.expiry:3600;this.expiry&&this.selTimeUnit!==s.Qk.SECS&&(i=this.commonService.convertTime(this.expiry,this.selTimeUnit,s.Qk.SECS));let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,O.Z$)({payload:o}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=s.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,s.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onTimeUnitChange(e){this.expiry&&this.selTimeUnit!==e.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,e.value)),this.selTimeUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(u.JJ),t.Y36(N.v),t.Y36(K.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-create-invoices"]],decls:35,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","placeholder","Description","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxFlex","40"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","30"],["matInput","","placeholder","Expiry","type","number","name","exp","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Create Invoice"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(c){return i.description=c}),t.qZA(),t.YNc(13,Wn,2,0,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"mat-form-field",13)(16,"input",14),t.NdJ("ngModelChange",function(c){return i.invoiceValue=c})("keyup",function(){return i.onInvoiceValueChange()}),t.qZA(),t.TgZ(17,"span",15),t._uU(18," Sats "),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.qZA()(),t.TgZ(21,"mat-form-field",16)(22,"input",17),t.NdJ("ngModelChange",function(c){return i.expiry=c}),t.qZA(),t.TgZ(23,"span",15),t._uU(24),t.ALo(25,"titlecase"),t.qZA()(),t.TgZ(26,"mat-form-field",18)(27,"mat-select",19),t.NdJ("selectionChange",function(c){return i.onTimeUnitChange(c)}),t.YNc(28,$n,3,4,"mat-option",20),t.qZA()()(),t.YNc(29,jn,3,2,"div",21),t.TgZ(30,"div",22)(31,"button",23),t.NdJ("click",function(){return i.resetData()}),t._uU(32,"Clear Field"),t.qZA(),t.TgZ(33,"button",24),t.NdJ("click",function(){t.CHM(o);const c=t.MAs(10);return t.KtG(i.onAddInvoice(c))}),t._uU(34,"Create Invoice"),t.qZA()()()()()()}2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.description),t.xp6(1),t.Q6J("ngIf",!i.description),t.xp6(3),t.Q6J("ngModel",i.invoiceValue)("step",100)("min",1),t.xp6(4),t.Oqu(i.invoiceValueHint),t.xp6(2),t.Q6J("ngModel",i.expiry)("step",i.selTimeUnit===i.timeUnitEnum.SECS?300:i.selTimeUnit===i.timeUnitEnum.MINS?10:i.selTimeUnit===i.timeUnitEnum.HOURS?2:1)("min",1),t.xp6(2),t.hij("",t.lcZ(25,14,i.selTimeUnit)," "),t.xp6(3),t.Q6J("value",i.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",i.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==i.invoiceError))},dependencies:[u.sg,u.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,D.ZT,F.lW,L.dk,L.dn,y.TO,y.KE,y.bx,y.R9,Q.Nt,R.gD,H.ey,$.h,X.q,u.rS]}),n})();var ei=_(7766);function ni(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function ii(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"input",7),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.description=o)}),t.qZA(),t.YNc(4,ni,2,0,"mat-error",8),t.qZA(),t.TgZ(5,"mat-form-field",9)(6,"input",10,11),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.invoiceValue=o)})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onInvoiceValueChange())}),t.qZA(),t.TgZ(8,"span",12),t._uU(9," Sats "),t.qZA(),t.TgZ(10,"mat-hint"),t._uU(11),t.qZA()(),t.TgZ(12,"div",13)(13,"button",14),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(14,"Clear Field"),t.qZA(),t.TgZ(15,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.MAs(1),l=t.oxw();return t.KtG(l.onAddInvoice(o))}),t._uU(16,"Create Invoice"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(2),t.Q6J("ngModel",e.invoiceValue)("step",100)("min",1),t.xp6(5),t.Oqu(e.invoiceValueHint)}}function ai(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",17),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openCreateInvoiceModal())}),t._uU(2,"Create Invoice"),t.qZA()()}}function oi(n,a){if(1&n&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function si(n,a){1&n&&t._UZ(0,"mat-progress-bar",56)}function li(n,a){1&n&&t._UZ(0,"th",57)}const st=function(n){return{"mr-0":n}};function ri(n,a){if(1&n&&t._UZ(0,"span",62),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,st,e.screenSize===e.screenSizeEnum.XS))}}function ci(n,a){if(1&n&&t._UZ(0,"span",63),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,st,e.screenSize===e.screenSizeEnum.XS))}}function ui(n,a){if(1&n&&t._UZ(0,"span",64),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,st,e.screenSize===e.screenSizeEnum.XS))}}function pi(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,ri,1,3,"span",59),t.YNc(2,ci,1,3,"span",60),t.YNc(3,ui,1,3,"span",61),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","received"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf","unpaid"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.status)||"expired"===(null==e?null:e.status)||"unknown"===(null==e?null:e.status))}}function mi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Created"),t.qZA())}function di(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function hi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Expiry"),t.qZA())}function _i(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.expiresAt),"dd/MMM/y HH:mm")||"-")}}function gi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Settled"),t.qZA())}function fi(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.receivedAt),"dd/MMM/y HH:mm")||"-")}}function Ci(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Node ID"),t.qZA())}const lt=function(n){return{width:n}};function xi(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,lt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function yi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Description"),t.qZA())}function Ti(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,lt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function Li(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Payment Hash"),t.qZA())}function bi(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,lt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function vi(n,a){1&n&&(t.TgZ(0,"th",68),t._uU(1,"Amount (Sats)"),t.qZA())}function Si(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amount?t.xi3(3,1,null==e?null:e.amount,"1.0-0"):"-")}}function Zi(n,a){1&n&&(t.TgZ(0,"th",70),t._uU(1," Amount Settled (Sats)"),t.qZA())}function Ai(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amountSettled?t.xi3(3,1,null==e?null:e.amountSettled,"1.0-0"):"-")}}function Ei(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",71)(1,"div",72)(2,"mat-select",73),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function wi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",75)(1,"div",72)(2,"mat-select",76),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.onInvoiceClick(l))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",74),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.onRefreshInvoice(l))}),t._uU(7,"Refresh"),t.qZA()()()()}}function Ii(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function Fi(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function qi(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Ni(n,a){if(1&n&&(t.TgZ(0,"td",77),t.YNc(1,Ii,2,0,"p",8),t.YNc(2,Fi,2,0,"p",8),t.YNc(3,qi,2,1,"p",8),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Oi=function(n){return{"display-none":n}};function Pi(n,a){if(1&n&&t._UZ(0,"tr",78),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Oi,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function Ui(n,a){1&n&&t._UZ(0,"tr",79)}function Ri(n,a){1&n&&t._UZ(0,"tr",80)}const ki=function(){return["all"]},Di=function(n){return{"error-border":n}},Ji=function(){return["no_invoice"]};function Mi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",20),t._UZ(3,"fa-icon",21),t.TgZ(4,"span",22),t._uU(5,"Invoices History"),t.qZA()(),t.TgZ(6,"div",23)(7,"mat-form-field",24)(8,"mat-select",25),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(9,oi,2,2,"mat-option",26),t.qZA()(),t.TgZ(10,"mat-form-field",24)(11,"input",27),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(12,"div",28),t.YNc(13,si,1,0,"mat-progress-bar",29),t.TgZ(14,"table",30,31),t.ynx(16,32),t.YNc(17,li,1,0,"th",33),t.YNc(18,pi,4,3,"td",34),t.BQk(),t.ynx(19,35),t.YNc(20,mi,2,0,"th",36),t.YNc(21,di,3,4,"td",34),t.BQk(),t.ynx(22,37),t.YNc(23,hi,2,0,"th",36),t.YNc(24,_i,3,4,"td",34),t.BQk(),t.ynx(25,38),t.YNc(26,gi,2,0,"th",36),t.YNc(27,fi,3,4,"td",34),t.BQk(),t.ynx(28,39),t.YNc(29,Ci,2,0,"th",36),t.YNc(30,xi,4,4,"td",34),t.BQk(),t.ynx(31,40),t.YNc(32,yi,2,0,"th",36),t.YNc(33,Ti,4,4,"td",34),t.BQk(),t.ynx(34,41),t.YNc(35,Li,2,0,"th",36),t.YNc(36,bi,4,4,"td",34),t.BQk(),t.ynx(37,42),t.YNc(38,vi,2,0,"th",43),t.YNc(39,Si,4,4,"td",34),t.BQk(),t.ynx(40,44),t.YNc(41,Zi,2,0,"th",45),t.YNc(42,Ai,4,4,"td",34),t.BQk(),t.ynx(43,46),t.YNc(44,Ei,6,0,"th",47),t.YNc(45,wi,8,0,"td",48),t.BQk(),t.ynx(46,49),t.YNc(47,Ni,4,3,"td",50),t.BQk(),t.YNc(48,Pi,1,3,"tr",51),t.YNc(49,Ui,1,0,"tr",52),t.YNc(50,Ri,1,0,"tr",53),t.qZA()(),t._UZ(51,"mat-paginator",54),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,ki).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.invoices)("ngClass",t.VKq(14,Di,""!==e.errorMessage)),t.xp6(34),t.Q6J("matFooterRowDef",t.DdM(16,Ji)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Lt=(()=>{class n{constructor(e,i,o,l,c,g,U){this.logger=e,this.store=i,this.decimalPipe=o,this.commonService=l,this.datePipe=c,this.actions=g,this.camelCaseWithSpaces=U,this.calledFrom="transactions",this.faHistory=T.qO$,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"invoices",recordsPerPage:s.IV,sortBy:"expiresAt",sortOrder:s.Pi.DESCENDING},this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoices=new r.by([]),this.invoiceJSONArr=[],this.information={},this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(f.nF).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.Ef).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.invoiceJSONArr=e.invoices&&e.invoices.length>0?e.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[4]),(0,M.h)(e=>e.type===s.lr.SET_LOOKUP_ECL||e.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===s.lr.SET_LOOKUP_ECL&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&e.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(e.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,Z.qR)({payload:{data:{pageSize:this.pageSize,component:ti}}}))}onAddInvoice(e){if(!this.description)return!0;const i=this.expiry?this.expiry:3600;this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,O.Z$)({payload:o})),this.resetData()}onInvoiceClick(e){this.store.dispatch((0,Z.qR)({payload:{data:{invoice:e,newlyAdded:!1,component:ei.R}}}))}onRefreshInvoice(e){this.store.dispatch((0,O.n7)({payload:e.paymentHash}))}updateInvoicesData(e){this.invoiceJSONArr=this.invoiceJSONArr?.map(i=>i.paymentHash===e.paymentHash?e:i)}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.invoices.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=(e.timestamp?this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"status":o=e?.status&&"expired"!==e?.status&&"unknown"!==e?.status?e.status?.toLowerCase():"expired/unknown";break;case"timestamp":case"expiresAt":case"receivedAt":o=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"amount":case"amountSettled":o=e[this.selFilterBy]?.toString()||"-";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"status"===this.selFilterBy?0===o.indexOf(i):o.includes(i)}}loadInvoicesTable(e){this.invoices=new r.by(e?[...e]:[]),this.invoices.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.invoices.sort=this.sort,this.invoices.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.invoices.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[5])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,s.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(u.JJ),t.Y36(N.v),t.Y36(u.uU),t.Y36(K.eX),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","placeholder","Description","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["invcVal","ngModel"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","9","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","10",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","expiresAt"],["matColumnDef","receivedAt"],["matColumnDef","nodeId"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountSettled"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","p1-3",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Received","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired/Unknown","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Received","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unpaid","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Expired/Unknown","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"p1-3"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,ii,17,6,"form",1),t.YNc(2,ai,3,0,"div",2),t.YNc(3,Mi,52,17,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},dependencies:[u.mk,u.sg,u.O5,u.PC,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.TO,y.KE,y.bx,y.R9,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V,X.q,u.JJ,u.uU],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();function Qi(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(11);t.Q6J("matMenuTriggerFor",e)}}function Yi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,c=t.oxw().$implicit,g=t.oxw(2);return t.KtG(g.onNavigateTo(c.links[l]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Bi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(3);return t.KtG(o.onsortChannelsBy())}),t._uU(1),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(1),t.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function Hi(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function zi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",29),2&n){const e=t.oxw(3);t.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function Vi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function Gi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-capacity-info",31),2&n){const e=t.oxw(3);t.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[2])}}function Ki(n,a){if(1&n&&t._UZ(0,"rtl-ecl-fee-info",32),2&n){const e=t.oxw(3);t.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function Wi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-status-info",33),2&n){const e=t.oxw(3);t.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[2])}}function $i(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const bt=function(n){return{"dashboard-card-content":!0,"error-border":n}};function Xi(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",9)(2,"mat-card-header")(3,"mat-card-title",10)(4,"div"),t._UZ(5,"fa-icon",11),t.TgZ(6,"span"),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t.YNc(9,Qi,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.YNc(12,Yi,2,1,"button",15),t.YNc(13,Bi,2,1,"button",16),t.qZA()()()(),t.TgZ(14,"mat-card-content",17),t.YNc(15,Hi,1,0,"mat-progress-bar",18),t.TgZ(16,"div",19),t.YNc(17,zi,1,2,"rtl-ecl-node-info",20),t.YNc(18,Vi,1,2,"rtl-ecl-balances-info",21),t.YNc(19,Gi,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(20,Ki,1,2,"rtl-ecl-fee-info",23),t.YNc(21,Wi,1,2,"rtl-ecl-channel-status-info",24),t.YNc(22,$i,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(5),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions),t.xp6(1),t.Q6J("ngIf","capacity"===e.id),t.xp6(1),t.s9C("fxFlex","capacity"===e.id?90:70),t.Q6J("ngClass",t.VKq(16,bt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","capacity"),t.xp6(1),t.Q6J("ngSwitchCase","fee"),t.xp6(1),t.Q6J("ngSwitchCase","status")}}function ji(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3),t._UZ(2,"fa-icon",4),t.TgZ(3,"span",5),t._uU(4),t.qZA()(),t.TgZ(5,"mat-grid-list",6),t.YNc(6,Xi,23,18,"mat-grid-tile",7),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("icon",e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),t.xp6(2),t.Oqu(e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),t.xp6(1),t.Q6J("rowHeight",e.operatorCardHeight),t.xp6(1),t.Q6J("ngForOf",e.operatorCards)}}function ta(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(9);t.Q6J("matMenuTriggerFor",e)}}function ea(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,c=t.oxw(2).$implicit,g=t.oxw(2);return t.KtG(g.onNavigateTo(c.links[l]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function na(n,a){if(1&n&&(t.TgZ(0,"mat-card-header")(1,"mat-card-title",10)(2,"div"),t._UZ(3,"fa-icon",11),t.TgZ(4,"span"),t._uU(5),t.qZA()(),t.TgZ(6,"div"),t.YNc(7,ta,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,ea,2,1,"button",15),t.qZA()()()()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions)}}function ia(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function aa(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",43),2&n){const e=t.oxw(3);t.Q6J("information",e.information)}}function oa(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function sa(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function la(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function ra(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,c=t.oxw(3).$implicit,g=t.oxw(2);return t.KtG(g.onNavigateTo(c.links[l]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function ca(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()(),t.TgZ(3,"mat-menu",13,53),t.YNc(5,ra,2,1,"button",15),t.qZA()),2&n){const e=t.MAs(4),i=t.oxw(2).$implicit;t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",i.goToOptions)}}function ua(n,a){1&n&&(t.TgZ(0,"span",45)(1,"mat-tab-group",46)(2,"mat-tab",47),t._UZ(3,"rtl-ecl-lightning-invoices",48),t.qZA(),t.TgZ(4,"mat-tab",49),t._UZ(5,"rtl-ecl-lightning-payments",50),t.qZA(),t.TgZ(6,"mat-tab",51),t.YNc(7,ca,6,2,"ng-template",52),t.qZA()()()),2&n&&(t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(1),t.Q6J("disabled",!0))}function pa(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const ma=function(n){return{"p-0":n}};function da(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",36),t.YNc(2,na,11,4,"mat-card-header",37),t.TgZ(3,"mat-card-content",38),t.YNc(4,ia,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,aa,1,1,"rtl-ecl-node-info",39),t.YNc(7,oa,1,2,"rtl-ecl-balances-info",21),t.YNc(8,sa,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(9,la,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(10,ua,8,3,"span",41),t.YNc(11,pa,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(1),t.Q6J("ngClass",t.VKq(13,ma,"transactions"===e.id)),t.xp6(1),t.Q6J("ngIf","transactions"!==e.id),t.xp6(1),t.s9C("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),t.Q6J("ngClass",t.VKq(15,bt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","inboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","outboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","transactions")}}function ha(n,a){if(1&n&&(t.TgZ(0,"div",34),t._UZ(1,"fa-icon",4),t.TgZ(2,"span",5),t._uU(3),t.qZA()(),t.TgZ(4,"mat-grid-list",35),t.YNc(5,da,12,17,"mat-grid-tile",7),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faSmile),t.xp6(2),t.hij("Welcome ",e.information.alias,"! Your node is up and running."),t.xp6(1),t.Q6J("rowHeight",e.merchantCardHeight),t.xp6(1),t.Q6J("ngForOf",e.merchantCards)}}let _a=(()=>{class n{constructor(e,i,o,l){this.logger=e,this.store=i,this.commonService=o,this.router=l,this.faSmile=gt.ctA,this.faFrown=gt.KfU,this.faAngleDoubleDown=T.Sbq,this.faAngleDoubleUp=T.Vfw,this.faChartPie=T.OS1,this.faBolt=T.BDt,this.faServer=T.xf3,this.faNetworkWired=T.kXW,this.userPersonaEnum=s.ol,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.channels=[],this.onchainBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="405px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo={status:s.Bn.COMPLETED},this.apiCallStatusFees={status:s.Bn.COMPLETED},this.apiCallStatusOCBal={status:s.Bn.COMPLETED},this.apiCallStatusAllChannels={status:s.Bn.COMPLETED},this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===s.cu.XS?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:6,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===s.cu.SM||this.screenSize===s.cu.MD?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:3,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(f.T$).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=e.apiCallStatus,this.apiCallStatusNodeInfo.status===s.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message?this.apiCallStatusNodeInfo.message:""),this.information=e.information}),this.store.select(f.JG).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessages[1]="",this.apiCallStatusFees=e.apiCallStatus,this.apiCallStatusFees.status===s.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message?this.apiCallStatusFees.message:""),this.fees=e.fees}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[3]),(0,it.M)(this.store.select(f.kY))).subscribe(([e,i])=>{this.errorMessages[2]="",this.errorMessages[3]="",this.apiCallStatusAllChannels=e.apiCallStatus,this.apiCallStatusOCBal=i.apiCallStatus,this.apiCallStatusAllChannels.status===s.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusAllChannels.message?JSON.stringify(this.apiCallStatusAllChannels.message):this.apiCallStatusAllChannels.message?this.apiCallStatusAllChannels.message:""),this.apiCallStatusOCBal.status===s.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusOCBal.message?JSON.stringify(this.apiCallStatusOCBal.message):this.apiCallStatusOCBal.message?this.apiCallStatusOCBal.message:""),this.channels=e.activeChannels,this.onchainBalance=i.onchainBalance,this.balances.onchain=this.onchainBalance.total||0,this.balances.lightning=e.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const o=e.lightningBalance.localBalance?+e.lightningBalance.localBalance:0,l=e.lightningBalance.remoteBalance?+e.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:o,remoteBalance:l,balancedness:+(1-Math.abs((o-l)/(o+l))).toFixed(3)},this.channelsStatus=e.channelsStatus,this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels?.filter(g=>(g.toRemote||0)>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels?.filter(g=>(g.toLocal||0)>0),"toLocal"))),this.channels.forEach(g=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(g.toRemote||0),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(g.toLocal||0)}),this.logger.info(e)})}onNavigateTo(e){this.router.navigateByUrl("/ecl/"+e)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort((e,i)=>{const o=+(e.toLocal||0)+ +(e.toRemote||0),l=+(i.toLocal||0)+ +(i.toRemote||0);return o>l?-1:o<l?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(N.v),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-2"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan",4,"ngFor","ngForOf"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",3,"fxFlex","ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"balances","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"balances","errorMessage"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-2"],["cols","6","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start"],["fxLayout","column",1,"w-100","dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(e,i){if(1&e&&(t.YNc(0,ji,7,4,"div",0),t.YNc(1,ha,6,4,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",(null==i.selNode?null:i.selNode.userPersona)===i.userPersonaEnum.OPERATOR)("ngIfElse",o)}},dependencies:[u.mk,u.sg,u.O5,u.RF,u.n9,u.ED,I.BN,m.xw,m.Wh,m.yH,v.oO,F.lW,L.a8,L.dk,L.dn,L.n5,ft.Il,ft.DX,Ct.Hw,at.VK,at.OP,at.p6,J.pW,P.SP,P.uD,P.uX,zt,Kt,Xt,ee,ce,be,Tt,Lt]}),n})();var ga=_(8377);const fa=["form"];function Ca(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function xa(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.amountError)}}function ya(n,a){if(1&n&&(t.TgZ(0,"mat-option",29),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function Ta(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function La(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.sendFundError)}}function ba(n,a){if(1&n&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,La,2,1,"span",12),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.sendFundError)}}let vt=(()=>{class n{constructor(e,i,o,l,c,g){this.dialogRef=e,this.logger=i,this.store=o,this.commonService=l,this.decimalPipe=c,this.actions=g,this.faExclamationTriangle=T.eHv,this.selNode={},this.addressTypes=[],this.selectedAddress=s._t[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=s.uA,this.selAmountUnit=s.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=s.Xz,this.amountError="Amount is Required.",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(ga.dT).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.fiatConversion=e.settings.fiatConversion,this.amountUnits=e.settings.currencyUnits,this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,M.h)(e=>e.type===s.lr.UPDATE_API_CALL_STATUS_ECL||e.type===s.lr.SEND_ONCHAIN_FUNDS_RES_ECL)).subscribe(e=>{e.type===s.lr.SEND_ONCHAIN_FUNDS_RES_ECL&&(this.store.dispatch((0,Z.jW)({payload:"Fund Sent Successfully!"})),this.dialogRef.close()),e.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===s.Bn.ERROR&&"SendOnchainFunds"===e.payload.action&&(this.sendFundError=e.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.transaction.amount&&this.selAmountUnit!==s.NT.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?s.NT.OTHER:this.selAmountUnit,s.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,h.R)(this.unSubs[2])).subscribe({next:e=>{this.transaction.amount=parseInt(e[s.NT.SATS]),this.selAmountUnit=s.NT.SATS,this.store.dispatch((0,O.Iy)({payload:this.transaction}))},error:e=>{this.selAmountUnit=s.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch((0,O.Iy)({payload:this.transaction}))}get invalidValues(){return!this.transaction.address||""===this.transaction.address||!this.transaction.amount||this.transaction.amount<=0||!this.transaction.blocks||this.transaction.blocks<=0}resetData(){this.sendFundError="",this.transaction={}}onAmountUnitChange(e){const i=this,o=this.selAmountUnit===this.amountUnits[2]?s.NT.OTHER:this.selAmountUnit;let l=e.value===this.amountUnits[2]?s.NT.OTHER:e.value;this.transaction.amount&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(this.transaction.amount,o,l,this.amountUnits[2],this.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:c=>{this.selAmountUnit=e.value,i.transaction.amount=+i.decimalPipe.transform(c[l],i.currencyUnitFormats[l]).replace(/,/g,"")},error:c=>{this.amountError="Conversion Error: "+c,this.selAmountUnit=o,l=o}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(q.mQ),t.Y36(A.yh),t.Y36(N.v),t.Y36(u.JJ),t.Y36(K.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,i){if(1&e&&t.Gf(fa,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:36,vars:15,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex","55"],["matInput","","autoFocus","","placeholder","Bitcoin Address","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxFlex","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"ngModel","step","min","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","60","fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Target Confirmation Blocks","type","number","name","blocks","tabindex","8","required","true",3,"ngModel","step","min","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onSendFunds()})("reset",function(){return i.resetData()}),t.TgZ(11,"mat-form-field",9)(12,"input",10,11),t.NdJ("ngModelChange",function(l){return i.transaction.address=l}),t.qZA(),t.YNc(14,Ca,2,0,"mat-error",12),t.qZA(),t.TgZ(15,"mat-form-field",13)(16,"input",14,15),t.NdJ("ngModelChange",function(l){return i.transaction.amount=l}),t.qZA(),t.TgZ(18,"span",16),t._uU(19),t.qZA(),t.YNc(20,xa,2,1,"mat-error",12),t.qZA(),t.TgZ(21,"mat-form-field",17)(22,"mat-select",18),t.NdJ("selectionChange",function(l){return i.onAmountUnitChange(l)}),t.YNc(23,ya,2,2,"mat-option",19),t.qZA()(),t.TgZ(24,"div",20)(25,"mat-form-field",21)(26,"input",22,23),t.NdJ("ngModelChange",function(l){return i.transaction.blocks=l}),t.qZA(),t.YNc(28,Ta,2,0,"mat-error",12),t.qZA()(),t._UZ(29,"div",24),t.YNc(30,ba,3,2,"div",25),t.TgZ(31,"div",26)(32,"button",27),t._uU(33,"Clear Fields"),t.qZA(),t.TgZ(34,"button",28),t._uU(35,"Send Funds"),t.qZA()()()()()()),2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.transaction.address),t.xp6(2),t.Q6J("ngIf",!i.transaction.address),t.xp6(2),t.Q6J("ngModel",i.transaction.amount)("step",100)("min",0),t.xp6(3),t.hij("",i.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!i.transaction.amount),t.xp6(2),t.Q6J("value",i.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",i.amountUnits),t.xp6(3),t.Q6J("ngModel",i.transaction.blocks)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",!i.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==i.sendFundError))},dependencies:[u.sg,u.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,D.ZT,F.lW,L.dk,L.dn,y.TO,y.KE,y.R9,Q.Nt,R.gD,H.ey,$.h,X.q]}),n})();var rt=_(1203);function va(n,a){if(1&n&&(t.TgZ(0,"mat-option",34),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Sa(n,a){1&n&&t._UZ(0,"mat-progress-bar",35)}function Za(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Date/Time"),t.qZA())}function Aa(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function Ea(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Address"),t.qZA())}const ct=function(n){return{width:n}};function wa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.address)}}function Ia(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Blockhash"),t.qZA())}function Fa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.blockHash)}}function qa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Transaction ID"),t.qZA())}function Na(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.txid)}}function Oa(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Amount (Sats)"),t.qZA())}function Pa(n,a){if(1&n&&(t.TgZ(0,"span",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.amount))}}function Ua(n,a){if(1&n&&(t.TgZ(0,"span",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("(",t.lcZ(2,1,-1*(null==e?null:e.amount)),")")}}function Ra(n,a){if(1&n&&(t.TgZ(0,"td",37),t.YNc(1,Pa,3,3,"span",41),t.YNc(2,Ua,3,3,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)>0||0===(null==e?null:e.amount)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)<0)}}function ka(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Fees (Sats)"),t.qZA())}function Da(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.fees))}}function Ja(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Confirmations"),t.qZA())}function Ma(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,1,null==e?null:e.confirmations)," ")}}function Qa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",45)(1,"div",46)(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Ya(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",49)(1,"button",50),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw();return t.KtG(g.onTransactionClick(c,o))}),t._uU(2,"View Info"),t.qZA()()}}function Ba(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function Ha(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function za(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Va(n,a){if(1&n&&(t.TgZ(0,"td",51),t.YNc(1,Ba,2,0,"p",52),t.YNc(2,Ha,2,0,"p",52),t.YNc(3,za,2,1,"p",52),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Ga=function(n){return{"display-none":n}};function Ka(n,a){if(1&n&&t._UZ(0,"tr",53),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Ga,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function Wa(n,a){1&n&&t._UZ(0,"tr",54)}function $a(n,a){1&n&&t._UZ(0,"tr",55)}const Xa=function(){return["all"]},ja=function(n){return{"error-border":n}},to=function(){return["no_transaction"]};let eo=(()=>{class n{constructor(e,i,o,l,c){this.logger=e,this.commonService=i,this.store=o,this.datePipe=l,this.camelCaseWithSpaces=c,this.faHistory=T.qO$,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="on_chain",this.tableSetting={tableId:"transaction",recordsPerPage:s.IV,sortBy:"timestamp",sortOrder:s.Pi.DESCENDING},this.displayedColumns=[],this.listTransactions=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,O.mC)()),this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.dx).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),e.transactions&&this.loadTransactionsTable(e.transactions),this.logger.info(e)})}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.listTransactions.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=(e.timestamp?this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":o=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}onTransactionClick(e,i){this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"blockHash",value:e.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:e.txid,title:"Transaction ID",width:100}],[{key:"timestamp",value:e.timestamp,title:"Date/Time",width:50,type:s.Gi.DATE_TIME},{key:"confirmations",value:e.confirmations,title:"Number of Confirmations",width:50,type:s.Gi.NUMBER}],[{key:"fees",value:e.fees,title:"Fees (Sats)",width:50,type:s.Gi.NUMBER},{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"address",value:e.address,title:"Address",width:100,type:s.Gi.STRING}]]}}}))}loadTransactionsTable(e){this.listTransactions=new r.by([...e]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.listTransactions.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.listTransactions.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh),t.Y36(u.uU),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Transactions")}])],decls:47,vars:17,consts:[["fxLayout","row wrap","fxLayoutAlign","start start","fxLayout.gt-sm","column","fxFlex","100","fxLayoutAlign.gt-sm","start stretch"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","blockHash"],["matColumnDef","txid"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"fa-icon",3),t.TgZ(4,"span",4),t._uU(5,"Transaction History"),t.qZA()(),t.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-select",7),t.NdJ("ngModelChange",function(l){return i.selFilterBy=l})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(9,va,2,2,"mat-option",8),t.qZA()(),t.TgZ(10,"mat-form-field",6)(11,"input",9),t.NdJ("ngModelChange",function(l){return i.selFilter=l})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(12,"div",10)(13,"div",11),t.YNc(14,Sa,1,0,"mat-progress-bar",12),t.TgZ(15,"table",13,14),t.ynx(17,15),t.YNc(18,Za,2,0,"th",16),t.YNc(19,Aa,3,4,"td",17),t.BQk(),t.ynx(20,18),t.YNc(21,Ea,2,0,"th",16),t.YNc(22,wa,4,4,"td",17),t.BQk(),t.ynx(23,19),t.YNc(24,Ia,2,0,"th",16),t.YNc(25,Fa,4,4,"td",17),t.BQk(),t.ynx(26,20),t.YNc(27,qa,2,0,"th",16),t.YNc(28,Na,4,4,"td",17),t.BQk(),t.ynx(29,21),t.YNc(30,Oa,2,0,"th",22),t.YNc(31,Ra,3,2,"td",17),t.BQk(),t.ynx(32,23),t.YNc(33,ka,2,0,"th",22),t.YNc(34,Da,4,3,"td",17),t.BQk(),t.ynx(35,24),t.YNc(36,Ja,2,0,"th",22),t.YNc(37,Ma,4,3,"td",17),t.BQk(),t.ynx(38,25),t.YNc(39,Qa,6,0,"th",26),t.YNc(40,Ya,3,0,"td",27),t.BQk(),t.ynx(41,28),t.YNc(42,Va,4,3,"td",29),t.BQk(),t.YNc(43,Ka,1,3,"tr",30),t.YNc(44,Wa,1,0,"tr",31),t.YNc(45,$a,1,0,"tr",32),t.qZA(),t._UZ(46,"mat-paginator",33),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("icon",i.faHistory),t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,Xa).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(3),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.listTransactions)("ngClass",t.VKq(14,ja,""!==i.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(16,to)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,d.Fj,d.JJ,d.On,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.KE,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,Y.$V,u.JJ,u.uU]}),n})();function no(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let io=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.selNode={},this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"receive",name:"Receive"},{link:"send",name:"Send"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(l=>i.urlAfterRedirects.includes(l.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(f.LR).pipe((0,h.R)(this.unSubs[1])).subscribe(i=>{this.selNode=i}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[2])).subscribe(i=>{this.balances=[{title:"Total Balance",dataValue:i.onchainBalance.total||0},{title:"Confirmed",dataValue:i.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:i.onchainBalance.unconfirmed||0}]})}openSendFundsModal(){this.store.dispatch((0,Z.qR)({payload:{data:{component:vt}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain"]],decls:21,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large","mt-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"On-chain Transactions"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",7),t.YNc(16,no,2,3,"div",8),t.qZA(),t.TgZ(17,"div",9),t._UZ(18,"router-outlet"),t.qZA(),t.TgZ(19,"div",10),t._UZ(20,"rtl-ecl-on-chain-transaction-history",11),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},dependencies:[u.sg,I.BN,m.xw,m.Wh,m.yH,L.a8,L.dn,P.BU,P.Nj,rt.D,x.lC,x.rH,eo]}),n})();var St=_(2673);function ao(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Channels"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activeChannels)}}function oo(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Peers"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activePeers)}}let so=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.activePeers=0,this.activeChannels=0,this.faUsers=T.FVb,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"channels",name:"Channels"},{link:"peers",name:"Peers"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.activeChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.balances=[{title:"Total Balance",dataValue:e.onchainBalance.total||0},{title:"Confirmed",dataValue:e.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:e.onchainBalance.unconfirmed||0}]})}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Connections"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"mat-tab-group",7),t.NdJ("selectedIndexChange",function(l){return i.activeLink=l})("selectedTabChange",function(l){return i.onSelectedTabChange(l)}),t.TgZ(16,"mat-tab"),t.YNc(17,ao,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,oo,2,1,"ng-template",8),t.qZA()(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faUsers),t.xp6(6),t.Q6J("selectedIndex",i.activeLink))},dependencies:[I.BN,m.xw,m.Wh,m.yH,L.a8,L.dn,St.k,P.SP,P.uD,P.uX,rt.D,x.lC]}),n})();function lo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let ro=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.currencyUnits=[],this.balances=[{title:"Local Capacity",dataValue:0,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:0,tooltip:"Amount you can receive"}],this.links=[{link:"payments",name:"Payments"},{link:"invoices",name:"Invoices"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(l=>i.urlAfterRedirects.includes(l.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1]),(0,it.M)(this.store.select(f.LR))).subscribe(([i,o])=>{this.currencyUnits=o?.currencyUnits||[],this.balances=o&&o.userPersona===s.ol.OPERATOR?[{title:"Local Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(i)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions"]],decls:19,vars:4,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Lightning Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",6),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Lightning Transactions"),t.qZA()(),t.TgZ(12,"div",7)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",8),t.YNc(16,lo,2,3,"div",9),t.qZA(),t.TgZ(17,"div",10),t._UZ(18,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},dependencies:[u.sg,I.BN,m.xw,m.Wh,m.yH,L.a8,L.dn,P.BU,P.Nj,rt.D,x.lC,x.rH]}),n})();function co(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let uo=(()=>{class n{constructor(e){this.router=e,this.faMapSigns=T.SuH,this.events=[],this.flgLoading=[!0],this.errorMessage="",this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(l=>i.urlAfterRedirects.includes(l.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing"]],decls:13,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100"],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"fa-icon",2),t.TgZ(3,"span",3),t._uU(4,"Routing"),t.qZA()(),t.TgZ(5,"div",4)(6,"mat-card",5)(7,"mat-card-content",6)(8,"div",7)(9,"nav",8),t.YNc(10,co,2,3,"div",9),t.qZA()(),t.TgZ(11,"div",10),t._UZ(12,"router-outlet"),t.qZA()()()()()),2&e&&(t.xp6(2),t.Q6J("icon",i.faMapSigns),t.xp6(8),t.Q6J("ngForOf",i.links))},dependencies:[u.sg,I.BN,m.xw,m.Wh,m.yH,L.a8,L.dn,P.BU,P.Nj,x.lC,x.rH]}),n})();var et=_(1948),Zt=_(7009),At=_(5199);function po(n,a){if(1&n&&(t.TgZ(0,"span",9)(1,"div"),t._uU(2),t.ALo(3,"titlecase"),t.qZA()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.AsE("",i.nodeFeaturesEnum[e.key]||e.key,": ",t.lcZ(3,2,e.value),"")}}function mo(n,a){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Address"),t.qZA())}function ho(n,a){if(1&n&&(t.TgZ(0,"td",24),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function _o(n,a){1&n&&(t.TgZ(0,"th",25)(1,"div",26),t._uU(2,"Actions"),t.qZA()())}function go(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",24)(1,"span",27)(2,"button",28),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw(2);return t.KtG(l.onCopyNodeURI(o))}),t._uU(3,"Copy Node URI"),t.qZA()()()}if(2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.Q6J("payload",(null==i.lookupResult?null:i.lookupResult.nodeId)+"@"+e)}}function fo(n,a){1&n&&t._UZ(0,"tr",29)}function Co(n,a){1&n&&t._UZ(0,"tr",30)}const xo=function(n){return{"background-color":n}};function yo(n,a){if(1&n&&(t.TgZ(0,"div",1),t._UZ(1,"mat-divider",2),t.TgZ(2,"div",3)(3,"div",4)(4,"h4",5),t._uU(5,"Alias"),t.qZA(),t.TgZ(6,"span",6),t._uU(7),t.TgZ(8,"span",7),t._uU(9),t.qZA()()(),t.TgZ(10,"div",8)(11,"h4",5),t._uU(12,"Pub Key"),t.qZA(),t.TgZ(13,"span",9),t._uU(14),t.qZA()()(),t._UZ(15,"mat-divider",2),t.TgZ(16,"div",3)(17,"div",4)(18,"h4",5),t._uU(19,"Date/Time"),t.qZA(),t.TgZ(20,"span",6),t._uU(21),t.ALo(22,"date"),t.qZA()(),t.TgZ(23,"div",8)(24,"h4",5),t._uU(25,"Features"),t.qZA(),t.YNc(26,po,4,4,"span",10),t.ALo(27,"keyvalue"),t.qZA()(),t._UZ(28,"mat-divider",2),t.TgZ(29,"div",3)(30,"div",11)(31,"h4",5),t._uU(32,"Signature"),t.qZA(),t.TgZ(33,"span",6),t._uU(34),t.qZA()()(),t._UZ(35,"mat-divider",2),t.TgZ(36,"div",1)(37,"h4",12),t._uU(38,"Addresses"),t.qZA(),t.TgZ(39,"div",13)(40,"table",14,15),t.ynx(42,16),t.YNc(43,mo,2,0,"th",17),t.YNc(44,ho,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,_o,3,0,"th",20),t.YNc(47,go,4,1,"td",18),t.BQk(),t.YNc(48,fo,1,0,"tr",21),t.YNc(49,Co,1,0,"tr",22),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.alias),t.xp6(1),t.Q6J("ngStyle",t.VKq(19,xo,null==e.lookupResult?null:e.lookupResult.rgbColor)),t.xp6(1),t.Oqu(null!=e.lookupResult&&e.lookupResult.rgbColor?null==e.lookupResult?null:e.lookupResult.rgbColor:""),t.xp6(5),t.Oqu(null==e.lookupResult?null:e.lookupResult.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.xi3(22,14,1e3*(null==e.lookupResult?null:e.lookupResult.timestamp),"dd/MMM/y HH:mm")),t.xp6(5),t.Q6J("ngForOf",t.lcZ(27,17,null==e.lookupResult?null:e.lookupResult.features.activated)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.signature),t.xp6(1),t.Q6J("inset",!0),t.xp6(5),t.Q6J("dataSource",e.addresses),t.xp6(8),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}let To=(()=>{class n{constructor(e,i){this.logger=e,this.snackBar=i,this.lookupResult={},this.addresses=new r.by([]),this.displayedColumns=["address","actions"],this.nodeFeaturesEnum=s.H_}ngOnInit(){this.addresses=new r.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(Zt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,i){if(1&e&&t.Gf(b.YE,5),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column",4,"ngIf"],["fxLayout","column"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxFlex","100"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","address"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select","btn-action"],["fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",1,"btn-action-copy",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&t.YNc(0,yo,50,21,"div",0),2&e&&t.Q6J("ngIf",i.lookupResult)},dependencies:[u.sg,u.O5,u.PC,m.xw,m.Wh,m.yH,v.Zl,F.lW,W.d,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,Y.$V,At.y,u.rS,u.uU,u.Nd],styles:["div.bordered-box.table-actions-select.btn-action[_ngcontent-%COMP%]{min-width:13rem;width:13rem;min-height:3.6rem}button.mat-stroked-button.btn-action-copy[_ngcontent-%COMP%]{min-width:13rem;width:13rem}"]}),n})();const Lo=["form"];function bo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function vo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Invalid ",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder,".")}}function So(n,a){if(1&n&&(t.TgZ(0,"div"),t._UZ(1,"rtl-ecl-node-lookup",25),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("lookupResult",e.nodeLookupValue)}}function Zo(n,a){if(1&n&&(t.TgZ(0,"span",23),t.YNc(1,So,2,1,"div",24),t.qZA()),2&n){const e=t.oxw(2),i=t.MAs(21);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",i)}}function Ao(n,a){1&n&&(t.TgZ(0,"span",23)(1,"h3"),t._uU(2,"Error! Unable to find details!"),t.qZA()())}function Eo(n,a){if(1&n&&(t.TgZ(0,"div",17)(1,"div",18)(2,"span",19),t._uU(3),t.qZA()(),t.TgZ(4,"div",20),t.YNc(5,Zo,2,2,"span",21),t.YNc(6,Ao,3,0,"span",22),t.qZA()()),2&n){const e=t.oxw();t.xp6(3),t.hij("",e.lookupFields[e.selectedFieldId].name," Details"),t.xp6(1),t.Q6J("ngSwitch",e.selectedFieldId),t.xp6(1),t.Q6J("ngSwitchCase",0)}}function wo(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const Io=function(n){return{"mt-1":!0,"mt-2":n}};let Fo=(()=>{class n{constructor(e,i,o,l){this.logger=e,this.commonService=i,this.store=o,this.actions=l,this.lookupKeyCtrl=new d.p4,this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Node ID"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=T.wn1,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(e=>e.type===s.lr.SET_LOOKUP_ECL||e.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{if(e.type===s.lr.SET_LOOKUP_ECL){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=e.payload[0]?JSON.parse(JSON.stringify(e.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=JSON.parse(JSON.stringify(e.payload))||[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}e.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===s.Bn.ERROR&&"Lookup"===e.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){return this.lookupKeyCtrl.value?this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(","))?(this.lookupKeyCtrl.setErrors({invalid:!0}),!0):void(0===(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId)&&this.store.dispatch((0,O.Sf)({payload:this.lookupKeyCtrl.value.trim()}))):(this.lookupKeyCtrl.setErrors({required:!0}),!0)}onSelectChange(e){this.resetData(),this.selectedFieldId=e.value}resetData(){this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.lookupKeyCtrl.setValue(""),this.lookupKeyCtrl.setErrors(null),this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh),t.Y36(K.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,i){if(1&e&&t.Gf(Lo,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:22,vars:9,consts:[["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],["errorBlock",""],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],["fxFlex","100",4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-content",2)(3,"form",3,4)(5,"div",5)(6,"mat-radio-group",6)(7,"mat-radio-button",7),t._uU(8,"Node"),t.qZA()()(),t.TgZ(9,"mat-form-field",8),t._UZ(10,"input",9,10),t.YNc(12,bo,2,1,"mat-error",11),t.YNc(13,vo,2,1,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"button",13),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",14),t.NdJ("click",function(){return i.onLookup()}),t._uU(18,"Lookup"),t.qZA()()(),t.YNc(19,Eo,7,3,"div",15),t.qZA()()(),t.YNc(20,wo,2,0,"ng-template",null,16,t.W1O)),2&e&&(t.xp6(7),t.Q6J("value",0),t.xp6(2),t.Q6J("ngClass",t.VKq(7,Io,i.screenSize===i.screenSizeEnum.XS||i.screenSize===i.screenSizeEnum.SM)),t.xp6(1),t.Q6J("formControl",i.lookupKeyCtrl)("placeholder",(null==i.lookupFields[i.selectedFieldId]?null:i.lookupFields[i.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(2),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",i.flgSetLookupValue))},dependencies:[u.mk,u.O5,u.RF,u.n9,u.ED,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.F,d.oH,m.xw,m.Wh,m.yH,v.oO,F.lW,L.dn,y.TO,y.KE,Q.Nt,et.VQ,et.U0,To],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}"]}),n})();var qo=_(9122);let No=(()=>{class n{constructor(e,i){this.store=e,this.eclEffects=i,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,O._E)()),this.eclEffects.setNewAddress.pipe((0,V.q)(1)).subscribe(e=>{this.newAddress=e,setTimeout(()=>{this.store.dispatch((0,Z.qR)({payload:{data:{address:this.newAddress,addressType:"",component:qo.n}}}))},0)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.yh),t.Y36(ot.o))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-receive"]],decls:4,vars:0,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA()()())},dependencies:[m.xw,m.Wh,m.yH,F.lW]}),n})(),Oo=(()=>{class n{constructor(e,i){this.store=e,this.activatedRoute=i,this.sweepAll=!1,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.activatedRoute.data.pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.sweepAll=e.sweepAll})}openSendFundsModal(){this.store.dispatch((0,Z.qR)({payload:{data:{sweepAll:this.sweepAll,component:vt}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.yh),t.Y36(x.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.openSendFundsModal()}),t._uU(3),t.qZA()()()),2&e&&(t.xp6(3),t.Oqu(i.sweepAll?"Sweep All":"Send Funds"))},dependencies:[m.xw,m.Wh,m.yH,F.lW]}),n})();var Po=_(8675),Et=_(4004),wt=_(455),It=_(7957),Uo=_(9843);const Ro=["form"];function ko(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e.alias?e.alias:e.nodeId?e.nodeId:"")}}function Do(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function Jo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function Mo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",31),t.NdJ("change",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.qZA(),t.TgZ(2,"mat-autocomplete",32,33),t.NdJ("optionSelected",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.YNc(4,ko,2,2,"mat-option",34),t.ALo(5,"async"),t.qZA(),t.YNc(6,Do,2,0,"mat-error",17),t.YNc(7,Jo,2,0,"mat-error",17),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("formControl",i.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",i.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(5,6,i.filteredPeers)),t.xp6(2),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.notfound)}}function Qo(n,a){1&n&&t.GkF(0)}function Yo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Bo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Ho(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.channelConnectionError)}}function zo(n,a){if(1&n&&(t.TgZ(0,"div",36),t._UZ(1,"fa-icon",37),t.YNc(2,Ho,2,1,"span",17),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.channelConnectionError)}}function Vo(n,a){if(1&n&&(t.TgZ(0,"mat-expansion-panel",39)(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"span"),t._uU(4,"Peer: \xa0"),t.qZA(),t.TgZ(5,"strong",40),t._uU(6),t.qZA()()(),t.TgZ(7,"div",9)(8,"div",0)(9,"div",1)(10,"h4",41),t._uU(11,"Pubkey"),t.qZA(),t.TgZ(12,"span",42),t._uU(13),t.qZA()()(),t._UZ(14,"mat-divider",43),t.TgZ(15,"div",0)(16,"div",44)(17,"h4",41),t._uU(18,"Address"),t.qZA(),t.TgZ(19,"span",45),t._uU(20),t.qZA()(),t.TgZ(21,"div",44)(22,"h4",41),t._uU(23,"State"),t.qZA(),t.TgZ(24,"span",45),t._uU(25),t.ALo(26,"titlecase"),t.qZA()()()()()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.nodeId)),t.xp6(7),t.Oqu(e.peer.nodeId),t.xp6(7),t.Oqu(null==e.peer?null:e.peer.address),t.xp6(5),t.Oqu(t.lcZ(26,4,null==e.peer?null:e.peer.state))}}function Go(n,a){if(1&n&&t.YNc(0,Vo,27,6,"mat-expansion-panel",38),2&n){const e=t.oxw();t.Q6J("ngIf",e.peer)}}let Ft=(()=>{class n{constructor(e,i,o,l){this.dialogRef=e,this.data=i,this.store=o,this.actions=l,this.selNode={},this.selectedPeer=new d.p4,this.faExclamationTriangle=T.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.data.message?(this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[]):(this.information={},this.totalBalance=0,this.peer=null,this.peers=[]),this.alertTitle=this.data.alertTitle||"Alert",this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(o=>{this.selNode=o,this.isPrivate=!!o?.unannouncedChannels}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,M.h)(o=>o.type===s.lr.UPDATE_API_CALL_STATUS_ECL||o.type===s.lr.FETCH_CHANNELS_ECL)).subscribe(o=>{o.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&o.payload.status===s.Bn.ERROR&&"SaveNewChannel"===o.payload.action&&(this.channelConnectionError=o.payload.message),o.type===s.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close()});let e="",i="";this.sortedPeers=this.peers.sort((o,l)=>(e=o.alias?o.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",i=l.alias?l.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",e<i?-1:e>i?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,h.R)(this.unSubs[2]),(0,Po.O)(""),(0,Et.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.nodeId),(0,Et.U)(o=>o?this.filterPeers(o):this.sortedPeers.slice()))}filterPeers(e){return this.sortedPeers?.filter(i=>0===i.alias?.toLowerCase().indexOf(e?e.toLowerCase():""))}displayFn(e){return e&&e.alias?e.alias:e&&e.nodeId?e.nodeId:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:null,"string"==typeof this.selectedPeer.value){const e=this.peers?.filter(i=>i.alias?.length===this.selectedPeer.value.length&&0===i.alias?.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===e.length&&e[0].nodeId&&(this.selectedPubkey=e[0].nodeId)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!!this.selNode?.unannouncedChannels,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(e){this.advancedTitle="Advanced Options",e&&this.feeRate&&this.feeRate>0&&(this.advancedTitle=this.advancedTitle+" | Fee (Sats/vByte): "+this.feeRate)}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;const e={nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate};this.feeRate&&(e.feeRate=this.feeRate),this.store.dispatch((0,O.YX)({payload:e}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(K.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ro,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:48,vars:18,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","11","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["form","ngForm"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","70","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amount",3,"ngModel","step","min","max","ngModelChange"],["amount","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","25","fxLayoutAlign","start center"],["tabindex","2","color","primary","name","isPrivate",3,"ngModel","ngModelChange"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","fxLayout","row","fxLayoutAlign","space-between center"],["fxFlex","49"],["matInput","","placeholder","Fee (Sats/vByte)","type","number","name","fee","tabindex","7",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","9","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","10"],["peerDetailsExpansionBlock",""],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel my-1","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","my-1"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onOpenChannel()})("reset",function(){return i.resetData()}),t.TgZ(11,"div",9),t.YNc(12,Mo,8,8,"mat-form-field",10),t.qZA(),t.YNc(13,Qo,1,0,"ng-container",11),t.TgZ(14,"div",9)(15,"div",12)(16,"mat-form-field",13)(17,"input",14,15),t.NdJ("ngModelChange",function(l){return i.fundingAmount=l}),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"span",16),t._uU(23," Sats "),t.qZA(),t.YNc(24,Yo,2,0,"mat-error",17),t.YNc(25,Bo,2,1,"mat-error",17),t.qZA(),t.TgZ(26,"div",18)(27,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(l){return i.isPrivate=l}),t._uU(28,"Private Channel"),t.qZA()()(),t.TgZ(29,"mat-expansion-panel",20),t.NdJ("closed",function(){return i.onAdvancedPanelToggle(!0)})("opened",function(){return i.onAdvancedPanelToggle(!1)}),t.TgZ(30,"mat-expansion-panel-header")(31,"mat-panel-title")(32,"span"),t._uU(33),t.qZA()()(),t.TgZ(34,"div",21)(35,"div",12)(36,"div",22)(37,"mat-form-field",23)(38,"input",24,25),t.NdJ("ngModelChange",function(l){return i.feeRate=l}),t.qZA()()()()()()(),t.YNc(40,zo,3,2,"div",26),t.TgZ(41,"div",27)(42,"button",28),t._uU(43,"Clear Fields"),t.qZA(),t.TgZ(44,"button",29),t._uU(45,"Open Channel"),t.qZA()()()()()(),t.YNc(46,Go,1,1,"ng-template",null,30,t.W1O)),2&e){const o=t.MAs(18),l=t.MAs(47);t.xp6(5),t.Oqu(i.alertTitle),t.xp6(7),t.Q6J("ngIf",!i.peer&&i.peers&&i.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",l),t.xp6(4),t.Q6J("ngModel",i.fundingAmount)("step",1e3)("min",1)("max",i.totalBalance),t.xp6(3),t.hij("Remaining Bal: ",t.lcZ(21,16,i.totalBalance-(i.fundingAmount?i.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==o.errors?null:o.errors.required),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.max),t.xp6(2),t.Q6J("ngModel",i.isPrivate),t.xp6(6),t.Oqu(i.advancedTitle),t.xp6(5),t.Q6J("ngModel",i.feeRate)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",""!==i.channelConnectionError)}},dependencies:[u.sg,u.O5,u.tP,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.Fd,d.On,d.F,d.oH,I.BN,m.xw,m.Wh,m.yH,F.lW,L.dk,L.dn,B.ib,B.yz,B.yK,y.TO,y.KE,y.bx,y.R9,Q.Nt,W.d,H.ey,wt.Rr,It.XC,It.ZL,$.h,Uo.F,X.q,u.Ov,u.JJ,u.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),n})();function Ko(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Open"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfOpenChannels)}}function Wo(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Pending"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfPendingChannels)}}function $o(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Inactive"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfInactiveChannels)}}let Xo=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.numOfOpenChannels=0,this.numOfPendingChannels=0,this.numOfInactiveChannels=0,this.selNode={},this.information={},this.peers=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"inactive",name:"Inactive"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.numOfOpenChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0,this.numOfPendingChannels=e.channelsStatus&&e.channelsStatus.pending&&e.channelsStatus.pending.channels?e.channelsStatus.pending.channels:0,this.numOfInactiveChannels=e.channelsStatus&&e.channelsStatus.inactive&&e.channelsStatus.inactive.channels?e.channelsStatus.inactive.channels:0,this.logger.info(e)}),this.store.select(f.LR).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.selNode=e}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.information=e}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.peers=e.peers}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}onOpenChannel(){this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:Ft}}}))}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"my-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-tab-group",4),t.NdJ("selectedIndexChange",function(l){return i.activeLink=l})("selectedTabChange",function(l){return i.onSelectedTabChange(l)}),t.TgZ(6,"mat-tab"),t.YNc(7,Ko,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,Wo,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,$o,2,1,"ng-template",5),t.qZA()(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("selectedIndex",i.activeLink))},dependencies:[m.xw,m.Wh,m.yH,F.lW,St.k,P.SP,P.uD,P.uX,x.lC]}),n})();function jo(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"Short Channel ID"),t.qZA(),t.TgZ(3,"span",13),t._uU(4),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(e.channel.shortChannelId)}}function ts(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"State"),t.qZA(),t.TgZ(3,"span",15),t._uU(4),t.ALo(5,"titlecase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(t.lcZ(5,1,e.channel.state))}}function es(n,a){if(1&n&&(t.TgZ(0,"div")(1,"div",9)(2,"div",11)(3,"h4",12),t._uU(4,"Local Balance (Sats)"),t.qZA(),t.TgZ(5,"span",15),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div",11)(9,"h4",12),t._uU(10,"Remote Balance (Sats)"),t.qZA(),t.TgZ(11,"span",15),t._uU(12),t.ALo(13,"number"),t.qZA()()(),t._UZ(14,"mat-divider",14),t.TgZ(15,"div",9)(16,"div",11)(17,"h4",12),t._uU(18,"Base Fee (mSats)"),t.qZA(),t.TgZ(19,"span",15),t._uU(20),t.ALo(21,"number"),t.qZA()(),t.TgZ(22,"div",11)(23,"h4",12),t._uU(24,"Fee Rate (mili mSats)"),t.qZA(),t.TgZ(25,"span",15),t._uU(26),t.ALo(27,"number"),t.qZA()()(),t._UZ(28,"mat-divider",14),t.qZA()),2&n){const e=t.oxw();t.xp6(6),t.Oqu(t.lcZ(7,6,e.channel.toLocal)),t.xp6(6),t.Oqu(t.lcZ(13,8,e.channel.toRemote)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(21,10,e.channel.feeBaseMsat)),t.xp6(6),t.Oqu(t.lcZ(27,12,e.channel.feeProportionalMillionths)),t.xp6(2),t.Q6J("inset",!0)}}function ns(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function is(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function as(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onShowAdvanced())}),t.YNc(1,ns,2,0,"p",22),t.YNc(2,is,2,0,"ng-template",null,23,t.W1O),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("ngIf",!i.showAdvanced)("ngIfElse",e)}}function os(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onCopyChanID(o))}),t._uU(1,"Copy Short Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.shortChannelId)}}function ss(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",25),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onCopyChanID(o))}),t._uU(1,"Copy Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.channelId)}}const ls=function(n){return{"xs-scroll-y":n}},rs=function(n,a){return{"mt-2":n,"mt-1":a}};let ut=(()=>{class n{constructor(e,i,o,l,c){this.dialogRef=e,this.data=i,this.logger=o,this.commonService=l,this.snackBar=c,this.faReceipt=T.dLy,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=s.cu}ngOnInit(){this.channel=this.data.channel,this.channelsType=this.data.channelsType||"",this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(e){this.snackBar.open("open"===this.channelsType?"Short channel ID "+e+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI),t.Y36(q.mQ),t.Y36(N.v),t.Y36(Zt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-information"]],decls:64,vars:28,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50",4,"ngIf"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span",5),t._uU(6,"Channel Information"),t.qZA()(),t.TgZ(7,"button",6),t.NdJ("click",function(){return i.onClose()}),t._uU(8,"X"),t.qZA()(),t.TgZ(9,"mat-card-content",7)(10,"div",8)(11,"div",9),t.YNc(12,jo,5,1,"div",10),t.TgZ(13,"div",11)(14,"h4",12),t._uU(15,"Peer Alias"),t.qZA(),t.TgZ(16,"span",13),t._uU(17),t.qZA()(),t.YNc(18,ts,6,3,"div",10),t.qZA(),t._UZ(19,"mat-divider",14),t.TgZ(20,"div",9)(21,"div",1)(22,"h4",12),t._uU(23,"Channel ID"),t.qZA(),t.TgZ(24,"span",13),t._uU(25),t.qZA()()(),t._UZ(26,"mat-divider",14),t.TgZ(27,"div",9)(28,"div",1)(29,"h4",12),t._uU(30,"Peer Public Key"),t.qZA(),t.TgZ(31,"span",13),t._uU(32),t.qZA()()(),t._UZ(33,"mat-divider",14),t.TgZ(34,"div",9)(35,"div",11)(36,"h4",12),t._uU(37,"Private"),t.qZA(),t.TgZ(38,"span",15),t._uU(39),t.qZA()(),t.TgZ(40,"div",11)(41,"h4",12),t._uU(42,"Funder"),t.qZA(),t.TgZ(43,"span",15),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",11)(48,"h4",12),t._uU(49,"State"),t.qZA(),t.TgZ(50,"span",15),t._uU(51),t.ALo(52,"titlecase"),t.qZA()(),t.TgZ(53,"div",11)(54,"h4",12),t._uU(55,"Buried"),t.qZA(),t.TgZ(56,"span",15),t._uU(57),t.qZA()()(),t._UZ(58,"mat-divider",14),t.YNc(59,es,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,as,4,2,"button",18),t.YNc(62,os,2,1,"button",19),t.YNc(63,ss,2,1,"button",20),t.qZA()()()()()),2&e&&(t.xp6(4),t.Q6J("icon",i.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,ls,i.screenSize===i.screenSizeEnum.XS)),t.xp6(3),t.Q6J("ngIf","open"===i.channelsType),t.xp6(5),t.Oqu(i.channel.alias),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.channelId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.announceChannel?"No":"Yes"),t.xp6(5),t.Oqu(i.channel.isFunder?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(52,21,i.channel.state)),t.xp6(6),t.Oqu(i.channel.buried?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(1),t.Q6J("ngIf",i.showAdvanced&&"open"===i.channelsType),t.xp6(1),t.Q6J("ngClass",t.WLB(25,rs,!i.showAdvanced,i.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType))},dependencies:[u.mk,u.O5,I.BN,m.xw,m.Wh,m.yH,v.oO,F.lW,L.dk,L.dn,W.d,At.y,$.h,u.JJ,u.rS]}),n})();function cs(n,a){if(1&n&&(t.TgZ(0,"mat-option",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function us(n,a){1&n&&t._UZ(0,"mat-progress-bar",39)}function ps(n,a){1&n&&t._UZ(0,"th",40)}function ms(n,a){if(1&n&&(t.TgZ(0,"span",44),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function ds(n,a){if(1&n&&(t.TgZ(0,"span",46),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function hs(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,ms,2,1,"span",42),t.YNc(2,ds,2,1,"span",43),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function _s(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Short Channel ID"),t.qZA())}function gs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function fs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Channel ID"),t.qZA())}const pt=function(n){return{width:n}};function Cs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function xs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Alias"),t.qZA())}function ys(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Ts(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Node ID"),t.qZA())}function Ls(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function bs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Funder"),t.qZA())}function vs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function Ss(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Buried"),t.qZA())}function Zs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function As(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Base Fee (mSats)"),t.qZA())}function Es(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeBaseMsat,"1.0-0")," ")}}function ws(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Rate (mili mSats)"),t.qZA())}function Is(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeProportionalMillionths,"1.0-0")," ")}}function Fs(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Local Balance (Sats)"),t.qZA())}function qs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Ns(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Os(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function Ps(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee/KW"),t.qZA())}function Us(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Rs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Balance Score"),t.qZA())}function ks(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",52)(2,"mat-hint",53),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",54),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",null!=e&&e.toLocal&&(null==e?null:e.toLocal)>0?+(null==e?null:e.toLocal)/(+(null==e?null:e.toLocal)+ +(null==e?null:e.toRemote))*100:0)}}function Ds(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",55)(1,"div",56)(2,"mat-select",57),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onChannelUpdate("all"))}),t._uU(5,"Update Fee Policy"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(7,"Download CSV"),t.qZA()()()()}}function Js(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",59)(1,"div",56)(2,"mat-select",60),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw();return t.KtG(g.onChannelClick(c,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.onChannelUpdate(l))}),t._uU(7,"Update Fee Policy"),t.qZA(),t.TgZ(8,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.onChannelClose(l,!1))}),t._uU(9,"Close Channel"),t.qZA(),t.TgZ(10,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.onChannelClose(l,!0))}),t._uU(11,"Force Close"),t.qZA()()()()}}function Ms(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No peers connected. Add a peer in order to open a channel?."),t.qZA())}function Qs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function Ys(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function Bs(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Hs(n,a){if(1&n&&(t.TgZ(0,"td",61),t.YNc(1,Ms,2,0,"p",62),t.YNc(2,Qs,2,0,"p",62),t.YNc(3,Ys,2,0,"p",62),t.YNc(4,Bs,2,1,"p",62),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const zs=function(n){return{"display-none":n}};function Vs(n,a){if(1&n&&t._UZ(0,"tr",63),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,zs,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Gs(n,a){1&n&&t._UZ(0,"tr",64)}function Ks(n,a){1&n&&t._UZ(0,"tr",65)}const Ws=function(){return["all"]},$s=function(n){return{"error-border":n}},Xs=function(){return["no_peer"]};let js=(()=>{class n{constructor(e,i,o,l,c,g){this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=l,this.router=c,this.camelCaseWithSpaces=g,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"open_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.selFilter=this.router.getCurrentNavigation()?.extras?.state?.filter?this.router.getCurrentNavigation()?.extras?.state?.filter:""}ngOnInit(){this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.activeChannels=e.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(),this.logger.info(e)}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable()}onChannelUpdate(e){"all"!==e&&"NORMAL"!==e.state||(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"all"===e?"Update fee policy for all channels":"Update fee policy for Channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:s.Gi.NUMBER,inputValue:e&&typeof e.feeBaseMsat<"u"?e.feeBaseMsat:1e3,step:100,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:s.Gi.NUMBER,inputValue:e&&typeof e.feeProportionalMillionths<"u"?e.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(l=>{if(l){const c=l[0].inputValue,g=l[1].inputValue;let U=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let C="";"all"===e?(this.activeChannels.forEach(w=>{C=C+","+w.nodeId}),C=C.substring(1),U={baseFeeMsat:c,feeRate:g,nodeIds:C}):U={baseFeeMsat:c,feeRate:g,nodeId:e.nodeId}}else{let C="";"all"===e?(this.activeChannels.forEach(w=>{C=C+","+w.channelId}),C=C.substring(1),U={baseFeeMsat:c,feeRate:g,channelIds:C}):U={baseFeeMsat:c,feeRate:g,channelId:e.channelId}}this.store.dispatch((0,O.pW)({payload:U}))}}),this.applyFilter())}percentHintFunction(e){return(e/1e4).toString()+"%"}onChannelClose(e,i){this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[6])).subscribe(g=>{g&&this.store.dispatch((0,O.BL)({payload:{channelId:e.channelId,force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,Z.qR)({payload:{data:{channel:e,channelsType:"open",component:ut}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new r.by([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"ActiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(tt.V),t.Y36(N.v),t.Y36(x.F0),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:61,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return i.selFilterBy=l})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,cs,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return i.selFilter=l})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,us,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,ps,1,0,"th",13),t.YNc(15,hs,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,_s,2,0,"th",16),t.YNc(18,gs,2,1,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,fs,2,0,"th",16),t.YNc(21,Cs,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,xs,2,0,"th",16),t.YNc(24,ys,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,Ts,2,0,"th",16),t.YNc(27,Ls,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,bs,2,0,"th",16),t.YNc(30,vs,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,Ss,2,0,"th",16),t.YNc(33,Zs,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,As,2,0,"th",23),t.YNc(36,Es,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,ws,2,0,"th",23),t.YNc(39,Is,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,Fs,2,0,"th",23),t.YNc(42,qs,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,Ns,2,0,"th",23),t.YNc(45,Os,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,Ps,2,0,"th",23),t.YNc(48,Us,4,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,Rs,2,0,"th",16),t.YNc(51,ks,6,4,"td",14),t.BQk(),t.ynx(52,29),t.YNc(53,Ds,8,0,"th",30),t.YNc(54,Js,12,0,"td",31),t.BQk(),t.ynx(55,32),t.YNc(56,Hs,5,4,"td",33),t.BQk(),t.YNc(57,Vs,1,3,"tr",34),t.YNc(58,Gs,1,0,"tr",35),t.YNc(59,Ks,1,0,"tr",36),t.qZA()(),t._UZ(60,"mat-paginator",37),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Ws).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,$s,""!==i.errorMessage)),t.xp6(46),t.Q6J("matFooterRowDef",t.DdM(15,Xs)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,d.Fj,d.JJ,d.On,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,y.KE,y.bx,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V,u.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]}),n})();function tl(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function el(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function nl(n,a){1&n&&t._UZ(0,"th",37)}function il(n,a){if(1&n&&(t.TgZ(0,"span",41),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function al(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function ol(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,il,2,1,"span",39),t.YNc(2,al,2,1,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function sl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"State"),t.qZA())}function ll(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function rl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Channel ID"),t.qZA())}const qt=function(n){return{width:n}};function cl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,qt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ul(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Alias"),t.qZA())}function pl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.alias)}}function ml(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Node ID"),t.qZA())}function dl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,qt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function hl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Funder"),t.qZA())}function _l(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function gl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Buried"),t.qZA())}function fl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function Cl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Local Balance (Sats)"),t.qZA())}function xl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function yl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Tl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function Ll(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Fee/KW"),t.qZA())}function bl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function vl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",49)(1,"div",50)(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Sl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",53)(1,"button",54),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw();return t.KtG(g.onChannelClick(c,o))}),t._uU(2,"View Info"),t.qZA()()}}function Zl(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function Al(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function El(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function wl(n,a){if(1&n&&(t.TgZ(0,"td",55),t.YNc(1,Zl,2,0,"p",56),t.YNc(2,Al,2,0,"p",56),t.YNc(3,El,2,1,"p",56),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Il=function(n){return{"display-none":n}};function Fl(n,a){if(1&n&&t._UZ(0,"tr",57),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Il,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function ql(n,a){1&n&&t._UZ(0,"tr",58)}function Nl(n,a){1&n&&t._UZ(0,"tr",59)}const Ol=function(){return["all"]},Pl=function(n){return{"error-border":n}},Ul=function(){return["no_channel"]};let Rl=(()=>{class n{constructor(e,i,o,l){this.logger=e,this.store=i,this.commonService=o,this.camelCaseWithSpaces=l,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"pending_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.pendingChannels=e.pendingChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}onChannelClick(e,i){this.store.dispatch((0,Z.qR)({payload:{data:{channel:e,channelsType:"pending",component:ut}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new r.by([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"PendingChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(N.v),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:52,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return i.selFilterBy=l})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,tl,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return i.selFilter=l})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,el,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,nl,1,0,"th",13),t.YNc(15,ol,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,sl,2,0,"th",16),t.YNc(18,ll,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,rl,2,0,"th",16),t.YNc(21,cl,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,ul,2,0,"th",16),t.YNc(24,pl,2,1,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,ml,2,0,"th",16),t.YNc(27,dl,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,hl,2,0,"th",16),t.YNc(30,_l,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,gl,2,0,"th",16),t.YNc(33,fl,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,Cl,2,0,"th",23),t.YNc(36,xl,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,yl,2,0,"th",23),t.YNc(39,Tl,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,Ll,2,0,"th",23),t.YNc(42,bl,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,vl,6,0,"th",27),t.YNc(45,Sl,3,0,"td",28),t.BQk(),t.ynx(46,29),t.YNc(47,wl,4,3,"td",30),t.BQk(),t.YNc(48,Fl,1,3,"tr",31),t.YNc(49,ql,1,0,"tr",32),t.YNc(50,Nl,1,0,"tr",33),t.qZA()(),t._UZ(51,"mat-paginator",34),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Ol).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,Pl,""!==i.errorMessage)),t.xp6(37),t.Q6J("matFooterRowDef",t.DdM(15,Ul)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,d.Fj,d.JJ,d.On,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.KE,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V,u.JJ,u.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();var mt=_(8425);const kl=["peersForm"],Dl=["stepper"];function Jl(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Ml(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function Ql(n,a){if(1&n&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.peerConnectionError)}}function Yl(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function Bl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Hl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function zl(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Vl(n,a){if(1&n&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.channelConnectionError)}}let Gl=(()=>{class n{constructor(e,i,o,l,c,g){this.dialogRef=e,this.data=i,this.store=o,this.formBuilder=l,this.actions=c,this.logger=g,this.faExclamationTriangle=T.eHv,this.selNode={},this.peerAddress="",this.totalBalance=0,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new p.x,new p.x]}ngOnInit(){this.data.message?(this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.nodeId&&this.data.message.peer.address?this.data.message.peer.nodeId+"@"+this.data.message.peer.address:this.data.message.peer&&this.data.message.peer.nodeId&&!this.data.message.peer.address?this.data.message.peer.nodeId:""):(this.totalBalance=0,this.peerAddress=""),this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[d.kI.required]],peerAddress:[this.peerAddress,[d.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[d.kI.required,d.kI.min(1),d.kI.max(this.totalBalance)]],isPrivate:[!!this.selNode?.unannouncedChannels],feeRate:[null],hiddenAmount:["",[d.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(f.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e,this.channelFormGroup.controls.isPrivate.setValue(!!e?.unannouncedChannels)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,M.h)(e=>e.type===s.lr.NEWLY_ADDED_PEER_ECL||e.type===s.lr.FETCH_CHANNELS_ECL||e.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===s.lr.NEWLY_ADDED_PEER_ECL&&(this.logger.info(e.payload),this.flgEditable=!1,this.newlyAddedPeer=e.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),e.type===s.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close(),e.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===s.Bn.ERROR&&("SaveNewPeer"===e.payload.action?this.peerConnectionError=e.payload.message:"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,O.El)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch((0,O.YX)({payload:{nodeId:this.newlyAddedPeer?.nodeId,amount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.feeRate.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(e){switch(e.selectedIndex){case 0:default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===e.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(d.QS),t.Y36(K.eX),t.Y36(q.mQ))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(e,i){if(1&e&&(t.Gf(kl,5),t.Gf(Dl,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.stepper=o.first)}},decls:48,vars:20,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","30","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","30"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/vByte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["mat-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Connect to a new peer"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"div",7)(10,"mat-vertical-stepper",8,9),t.NdJ("selectionChange",function(l){return i.stepSelectionChanged(l)}),t.TgZ(12,"mat-step",10)(13,"form",11),t.YNc(14,Jl,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",1),t._UZ(16,"input",13),t.YNc(17,Ml,2,0,"mat-error",14),t.qZA(),t.YNc(18,Ql,4,2,"div",15),t.TgZ(19,"div",16)(20,"button",17),t.NdJ("click",function(){return i.onConnectPeer()}),t._uU(21),t.qZA()()()(),t.TgZ(22,"mat-step",10)(23,"form",18),t.YNc(24,Yl,1,1,"ng-template",19),t.TgZ(25,"div",20)(26,"div",21)(27,"mat-form-field",22),t._UZ(28,"input",23),t.TgZ(29,"mat-hint"),t._uU(30),t.qZA(),t.TgZ(31,"span",24),t._uU(32," Sats "),t.qZA(),t.YNc(33,Bl,2,0,"mat-error",14),t.YNc(34,Hl,2,0,"mat-error",14),t.YNc(35,zl,2,1,"mat-error",14),t.qZA(),t.TgZ(36,"mat-form-field",25),t._UZ(37,"input",26),t.qZA(),t.TgZ(38,"div",27)(39,"mat-slide-toggle",28),t._uU(40,"Private Channel"),t.qZA()()()(),t.YNc(41,Vl,4,2,"div",15),t.TgZ(42,"div",16)(43,"button",29),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(44),t.qZA()()()()(),t.TgZ(45,"div",30)(46,"button",31),t.NdJ("click",function(){return i.onClose()}),t._uU(47),t.qZA()()()()()()),2&e&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",i.peerFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.peerFormGroup),t.xp6(4),t.Q6J("ngIf",null==i.peerFormGroup.controls.peerAddress.errors?null:i.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==i.peerConnectionError),t.xp6(3),t.Oqu(""!==i.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",i.channelFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.channelFormGroup),t.xp6(5),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining Bal: ",i.totalBalance-(i.channelFormGroup.controls.fundingAmount.value?i.channelFormGroup.controls.fundingAmount.value:0),""),t.xp6(3),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(2),t.Q6J("step",1)("min",0),t.xp6(4),t.Q6J("ngIf",""!==i.channelConnectionError),t.xp6(3),t.Oqu(""!==i.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=i.newlyAddedPeer&&i.newlyAddedPeer.nodeId?"Do It Later":"Close"))},dependencies:[u.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.sg,d.u,I.BN,m.xw,m.Wh,m.yH,F.lW,L.dk,L.dn,y.TO,y.KE,y.bx,y.R9,Q.Nt,wt.Rr,mt.C0,mt.VY,mt.Vq,$.h,X.q]}),n})();function Kl(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Wl(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function $l(n,a){1&n&&t._UZ(0,"th",37)}const Nt=function(n){return{"mr-0":n}};function Xl(n,a){if(1&n&&t._UZ(0,"span",41),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Nt,e.screenSize===e.screenSizeEnum.XS))}}function jl(n,a){if(1&n&&t._UZ(0,"span",42),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Nt,e.screenSize===e.screenSizeEnum.XS))}}function tr(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,Xl,1,3,"span",39),t.YNc(2,jl,1,3,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function er(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Alias"),t.qZA())}const Ot=function(n){return{width:n}};function nr(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function ir(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Node ID"),t.qZA())}function ar(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function or(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Network Address"),t.qZA())}function sr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function lr(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Channels"),t.qZA())}function rr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.channels)}}function cr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",46)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function ur(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,l=t.oxw();return t.KtG(l.onPeerDetach(o))}),t._uU(1,"Disconnect"),t.qZA()}}function pr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,l=t.oxw();return t.KtG(l.onConnectPeer(o))}),t._uU(1,"Reconnect"),t.qZA()}}function mr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",50)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw();return t.KtG(g.onPeerClick(c,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.onOpenChannel(l))}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,ur,2,0,"mat-option",51),t.YNc(9,pr,2,0,"mat-option",51),t.qZA()()()}if(2&n){const e=a.$implicit;t.xp6(8),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function dr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function hr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function _r(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function gr(n,a){if(1&n&&(t.TgZ(0,"td",52),t.YNc(1,dr,2,0,"p",53),t.YNc(2,hr,2,0,"p",53),t.YNc(3,_r,2,1,"p",53),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const fr=function(n){return{"display-none":n}};function Cr(n,a){if(1&n&&t._UZ(0,"tr",54),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,fr,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function xr(n,a){1&n&&t._UZ(0,"tr",55)}function yr(n,a){1&n&&t._UZ(0,"tr",56)}const Tr=function(){return["all"]},Lr=function(n){return{"error-border":n}},br=function(){return["no_peer"]};let vr=(()=>{class n{constructor(e,i,o,l,c,g){this.logger=e,this.store=i,this.rtlEffects=o,this.actions=l,this.commonService=c,this.camelCaseWithSpaces=g,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"peers",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.faUsers=T.FVb,this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.peers=new r.by([]),this.information={},this.availableBalance=0,this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.yD).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.information=e}),this.store.select(f.nF).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("state"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.peersData=e.peers,this.loadPeersTable(this.peersData),this.logger.info(e)}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.availableBalance=e.onchainBalance.total||0}),this.actions.pipe((0,h.R)(this.unSubs[4]),(0,M.h)(e=>e.type===s.lr.SET_PEERS_ECL)).subscribe(e=>{this.peerAddress=null})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,i){const o=[[{key:"nodeId",value:e.nodeId,title:"Public Key",width:100}],[{key:"address",value:e.address,title:"Address",width:50},{key:"alias",value:e.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(e.state||""),title:"State",width:50},{key:"channels",value:e.channels,title:"Channels",width:50}]];this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.nodeId,message:o}}}))}onConnectPeer(e){this.store.dispatch((0,Z.qR)({payload:{data:{message:{peer:e.nodeId?e:null,information:this.information,balance:this.availableBalance},component:Gl}}}))}onOpenChannel(e){this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:Ft}}}))}onPeerDetach(e){this.store.dispatch(e&&e.channels&&e.channels>0?(0,Z.qR)({payload:{data:{type:s.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(i=>{i&&this.store.dispatch((0,O.GD)({payload:{nodeId:e.nodeId||""}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.peers.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"state":o=e?.state?.toLowerCase()||"";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"state"===this.selFilterBy?0===o.indexOf(i):o.includes(i)}}loadPeersTable(e){this.peers=new r.by(e?[...e]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.peers.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.peers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(tt.V),t.Y36(K.eX),t.Y36(N.v),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Peers")}])],decls:45,vars:17,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["peersForm","ngForm"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","nodeId"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State"],["mat-cell",""],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"form",1,2)(3,"button",3),t.NdJ("click",function(){return i.onConnectPeer({})}),t._uU(4,"Add Peer"),t.qZA()(),t.TgZ(5,"div",4)(6,"div",5)(7,"div",6),t._UZ(8,"fa-icon",7),t.TgZ(9,"span",8),t._uU(10,"Peers"),t.qZA()(),t.TgZ(11,"div",9)(12,"mat-form-field",10)(13,"mat-select",11),t.NdJ("ngModelChange",function(l){return i.selFilterBy=l})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(14,Kl,2,2,"mat-option",12),t.qZA()(),t.TgZ(15,"mat-form-field",10)(16,"input",13),t.NdJ("ngModelChange",function(l){return i.selFilter=l})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(17,"div",14),t.YNc(18,Wl,1,0,"mat-progress-bar",15),t.TgZ(19,"table",16,17),t.ynx(21,18),t.YNc(22,$l,1,0,"th",19),t.YNc(23,tr,3,2,"td",20),t.BQk(),t.ynx(24,21),t.YNc(25,er,2,0,"th",22),t.YNc(26,nr,4,4,"td",20),t.BQk(),t.ynx(27,23),t.YNc(28,ir,2,0,"th",22),t.YNc(29,ar,4,4,"td",20),t.BQk(),t.ynx(30,24),t.YNc(31,or,2,0,"th",22),t.YNc(32,sr,2,1,"td",20),t.BQk(),t.ynx(33,25),t.YNc(34,lr,2,0,"th",22),t.YNc(35,rr,2,1,"td",20),t.BQk(),t.ynx(36,26),t.YNc(37,cr,6,0,"th",27),t.YNc(38,mr,10,2,"td",28),t.BQk(),t.ynx(39,29),t.YNc(40,gr,4,3,"td",30),t.BQk(),t.YNc(41,Cr,1,3,"tr",31),t.YNc(42,xr,1,0,"tr",32),t.YNc(43,yr,1,0,"tr",33),t.qZA()(),t._UZ(44,"mat-paginator",34),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("icon",i.faUsers),t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,Tr).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.peers)("ngClass",t.VKq(14,Lr,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(16,br)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,d._Y,d.Fj,d.JJ,d.JL,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.KE,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V],styles:[".mat-column-state[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();const Sr=["queryRoutesForm"];function Zr(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function Ar(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Er(n,a){1&n&&t._UZ(0,"mat-progress-bar",21)}function wr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Alias"),t.qZA())}const Pt=function(n){return{"max-width":n}};function Ir(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Fr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," ID"),t.qZA())}function qr(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Nr(n,a){1&n&&(t.TgZ(0,"th",39)(1,"div",43),t._uU(2,"Actions"),t.qZA()())}function Or(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",44)(1,"button",45),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.onHopClick(l))}),t._uU(2,"View Info"),t.qZA()()}}function Pr(n,a){1&n&&t._UZ(0,"tr",46)}function Ur(n,a){1&n&&t._UZ(0,"tr",47)}const Rr=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};function kr(n,a){if(1&n&&(t.TgZ(0,"div",22)(1,"mat-expansion-panel",23)(2,"mat-expansion-panel-header")(3,"mat-panel-title",24)(4,"span",25),t._uU(5),t.qZA(),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()(),t.TgZ(9,"mat-panel-description",27)(10,"div",28)(11,"table",29,30),t.ynx(13,31),t.YNc(14,wr,2,0,"th",32),t.YNc(15,Ir,4,4,"td",33),t.BQk(),t.ynx(16,34),t.YNc(17,Fr,2,0,"th",32),t.YNc(18,qr,4,4,"td",33),t.BQk(),t.ynx(19,35),t.YNc(20,Nr,3,0,"th",32),t.YNc(21,Or,3,0,"td",36),t.BQk(),t.YNc(22,Pr,1,0,"tr",37),t.YNc(23,Ur,1,0,"tr",38),t.qZA()()()()()),2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.xp6(5),t.hij("Route ",i+1,""),t.xp6(2),t.Oqu(t.lcZ(8,6,e.amount/1e3)),t.xp6(4),t.Q6J("dataSource",o.qrHops[i])("ngClass",t.VKq(8,Rr,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}let Dr=(()=>{class n{constructor(e,i,o){this.store=e,this.eclEffects=i,this.commonService=o,this.allQRoutes=[],this.nodeId="",this.amount=0,this.qrHops=[],this.displayedColumns=["alias","nodeId","actions"],this.flgLoading=[!1],this.faRoute=T.FpQ,this.faExclamationTriangle=T.eHv,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.qrHops[0]=new r.by([]),this.qrHops[0].data=[],this.eclEffects.setQueryRoutes.pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{e&&e.routes&&e.routes.length?(this.flgLoading[0]=!1,this.allQRoutes=e.routes,this.allQRoutes.forEach((i,o)=>{this.qrHops[o]=new r.by([...i.nodeIds])})):(this.flgLoading[0]="error",this.allQRoutes=[],this.qrHops=[])})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops=[],this.flgLoading[0]=!0,this.store.dispatch((0,O.WO)({payload:{nodeId:this.nodeId,amount:1e3*this.amount}}))}resetData(){this.allQRoutes=[],this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops=[],this.form.resetForm()}onHopClick(e){this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"alias",value:e.alias,title:"Alias",width:100,type:s.Gi.STRING}],[{key:"nodeId",value:e.nodeId,title:"Node ID",width:100,type:s.Gi.STRING}]]}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.yh),t.Y36(ot.o),t.Y36(N.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,i){if(1&e&&t.Gf(Sr,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:28,vars:10,consts:[["fxLayout","column","fxFlex","100"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Node ID","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"ngModel","step","min","ngModelChange"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxLayoutAlign","start center",1,"page-sub-title-container","mt-2","mb-1"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxFlex","100",4,"ngFor","ngForOf"],["mode","indeterminate"],["fxFlex","100"],[1,"flat-expansion-panel","help-expansion","mb-2px"],["fxLayout","row","fxLayoutAlign","space-between start"],["fxFlex","50","fxLayoutAlign","start start"],["fxFlex","50","fxLayoutAlign","end end"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"table-container","mb-2",3,"perfectScrollbar"],["mat-table","",3,"dataSource","ngClass"],["table[i]",""],["matColumnDef","alias"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["fxLayout","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"form",1,2),t.NdJ("ngSubmit",function(){t.CHM(o);const c=t.MAs(2);return t.KtG(c.form.valid&&i.onQueryRoutes())}),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span"),t._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),t.qZA()(),t.TgZ(7,"mat-form-field",5)(8,"input",6,7),t.NdJ("ngModelChange",function(c){return i.nodeId=c}),t.qZA(),t.YNc(10,Zr,2,0,"mat-error",8),t.qZA(),t.TgZ(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(c){return i.amount=c}),t.qZA(),t.YNc(13,Ar,2,0,"mat-error",8),t.qZA(),t.TgZ(14,"div",11)(15,"button",12),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",13),t._uU(18,"Query Route"),t.qZA()()(),t.TgZ(19,"div",14)(20,"div",15),t._UZ(21,"fa-icon",16),t.TgZ(22,"span",17),t._uU(23,"Transaction Route"),t.qZA()()(),t.YNc(24,Er,1,0,"mat-progress-bar",18),t.TgZ(25,"div",19)(26,"div",0),t.YNc(27,kr,24,10,"div",20),t.qZA()()()}2&e&&(t.xp6(4),t.Q6J("icon",i.faExclamationTriangle),t.xp6(4),t.Q6J("ngModel",i.nodeId),t.xp6(2),t.Q6J("ngIf",!i.nodeId),t.xp6(2),t.Q6J("ngModel",i.amount)("step",1e3)("min",0),t.xp6(1),t.Q6J("ngIf",!i.amount),t.xp6(8),t.Q6J("icon",i.faRoute),t.xp6(3),t.Q6J("ngIf",!0===i.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",i.allQRoutes))},dependencies:[u.mk,u.sg,u.O5,u.PC,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,B.ib,B.yz,B.yK,B.u4,y.TO,y.KE,Q.Nt,J.pW,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,Y.$V,X.q,u.JJ]}),n})();function Jr(n,a){if(1&n&&(t.TgZ(0,"mat-option",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Mr(n,a){1&n&&t._UZ(0,"mat-progress-bar",38)}function Qr(n,a){1&n&&t._UZ(0,"th",39)}function Yr(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function Br(n,a){if(1&n&&(t.TgZ(0,"span",45),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function Hr(n,a){if(1&n&&(t.TgZ(0,"td",40),t.YNc(1,Yr,2,1,"span",41),t.YNc(2,Br,2,1,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!e.announceChannel),t.xp6(1),t.Q6J("ngIf",e.announceChannel)}}function zr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"State"),t.qZA())}function Vr(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function Gr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Short Channel ID"),t.qZA())}function Kr(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function Wr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Channel ID"),t.qZA())}const dt=function(n){return{width:n}};function $r(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Xr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Alias"),t.qZA())}function jr(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.alias)}}function tc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Node ID"),t.qZA())}function ec(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function nc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Funder"),t.qZA())}function ic(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function ac(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Buried"),t.qZA())}function oc(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function sc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Balance (Sats)"),t.qZA())}function lc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function rc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function cc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function uc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Fee/KW"),t.qZA())}function pc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function mc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Balance Score"),t.qZA())}function dc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",51)(2,"mat-hint",52),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",53),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function hc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",54)(1,"div",55)(2,"mat-select",56),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function _c(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",58)(1,"div",55)(2,"mat-select",59),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw();return t.KtG(g.onChannelClick(c,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",57),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.onChannelClose(l,!0))}),t._uU(7,"Force Close"),t.qZA()()()()}}function gc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function fc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function Cc(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function xc(n,a){if(1&n&&(t.TgZ(0,"td",60),t.YNc(1,gc,2,0,"p",61),t.YNc(2,fc,2,0,"p",61),t.YNc(3,Cc,2,1,"p",61),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const yc=function(n){return{"display-none":n}};function Tc(n,a){if(1&n&&t._UZ(0,"tr",62),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,yc,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Lc(n,a){1&n&&t._UZ(0,"tr",63)}function bc(n,a){1&n&&t._UZ(0,"tr",64)}const vc=function(){return["all"]},Sc=function(n){return{"error-border":n}},Zc=function(){return["no_channel"]};let Ac=(()=>{class n{constructor(e,i,o,l,c){this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=l,this.camelCaseWithSpaces=c,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"inactive_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.inactiveChannels=e.inactiveChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(f.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(f.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(f.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(e,i){this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(g=>{g&&this.store.dispatch((0,O.BL)({payload:{channelId:e.channelId||"",force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,Z.qR)({payload:{data:{channel:e,channelsType:"inactive",component:ut}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new r.by([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"InactiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(A.yh),t.Y36(tt.V),t.Y36(N.v),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:58,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return i.selFilterBy=l})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,Jr,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return i.selFilter=l})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,Mr,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,Qr,1,0,"th",13),t.YNc(15,Hr,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,zr,2,0,"th",16),t.YNc(18,Vr,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,Gr,2,0,"th",16),t.YNc(21,Kr,2,1,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,Wr,2,0,"th",16),t.YNc(24,$r,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,Xr,2,0,"th",16),t.YNc(27,jr,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,tc,2,0,"th",16),t.YNc(30,ec,4,4,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,nc,2,0,"th",16),t.YNc(33,ic,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,ac,2,0,"th",16),t.YNc(36,oc,2,1,"td",14),t.BQk(),t.ynx(37,23),t.YNc(38,sc,2,0,"th",24),t.YNc(39,lc,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,rc,2,0,"th",24),t.YNc(42,cc,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,uc,2,0,"th",24),t.YNc(45,pc,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,mc,2,0,"th",16),t.YNc(48,dc,6,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,hc,6,0,"th",29),t.YNc(51,_c,8,0,"td",30),t.BQk(),t.ynx(52,31),t.YNc(53,xc,4,3,"td",32),t.BQk(),t.YNc(54,Tc,1,3,"tr",33),t.YNc(55,Lc,1,0,"tr",34),t.YNc(56,bc,1,0,"tr",35),t.qZA()(),t._UZ(57,"mat-paginator",36),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,vc).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,Sc,""!==i.errorMessage)),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(15,Zc)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,d.Fj,d.JJ,d.On,I.BN,m.xw,m.Wh,m.yH,v.oO,v.Zl,y.KE,y.bx,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V,u.JJ,u.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;min-width:15rem;max-width:30rem}"]}),n})();function Ec(n,a){if(1&n&&(t.TgZ(0,"div",5),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function wc(n,a){if(1&n&&(t.TgZ(0,"mat-option",13),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}const Ic=function(){return["all"]};function Fc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t._UZ(1,"div",7),t.TgZ(2,"div",8)(3,"mat-form-field",9)(4,"mat-select",10),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(5,wc,2,2,"mat-option",11),t.qZA()(),t.TgZ(6,"mat-form-field",9)(7,"input",12),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(3,Ic).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter)}}function qc(n,a){1&n&&t._UZ(0,"mat-progress-bar",42)}function Nc(n,a){1&n&&t._UZ(0,"th",43)}const Oc=function(n){return{"ml-0":n}};function Pc(n,a){if(1&n&&(t._UZ(0,"span",46),t.ALo(1,"camelcase")),2&n){const e=t.oxw().$implicit,i=t.oxw(2);t.s9C("matTooltip",t.lcZ(1,2,null==e?null:e.type)),t.Q6J("ngClass",t.VKq(4,Oc,i.screenSize===i.screenSizeEnum.XS))}}function Uc(n,a){if(1&n&&(t.TgZ(0,"td",44),t.YNc(1,Pc,2,6,"span",45),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","payment-relayed"!==(null==e?null:e.type))}}function Rc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Date/Time"),t.qZA())}function kc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,null==e?null:e.timestamp,"dd/MMM/y HH:mm")," ")}}function Dc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel ID"),t.qZA())}const j=function(n){return{width:n}};function Jc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,j,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelId)}}function Mc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel Short ID"),t.qZA())}function Qc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.fromShortChannelId)}}function Yc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel"),t.qZA())}function Bc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,j,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelAlias)}}function Hc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel ID"),t.qZA())}function zc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,j,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelId)}}function Vc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel Short ID"),t.qZA())}function Gc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.toShortChannelId)}}function Kc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel"),t.qZA())}function Wc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,j,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelAlias)}}function $c(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Payment Hash"),t.qZA())}function Xc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,j,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function jc(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount In (Sats)"),t.qZA())}function tu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountIn))}}function eu(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount Out (Sats)"),t.qZA())}function nu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountOut))}}function iu(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function au(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,(null==e?null:e.amountIn)-(null==e?null:e.amountOut)))}}function ou(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",52)(1,"div",53)(2,"mat-select",54),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",55),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function su(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",56)(1,"button",57),t.NdJ("click",function(o){const c=t.CHM(e).$implicit,g=t.oxw(2);return t.KtG(g.onForwardingEventClick(c,o))}),t._uU(2,"View Info"),t.qZA()()}}function lu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function ru(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function cu(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function uu(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,lu,2,0,"p",59),t.YNc(2,ru,2,0,"p",59),t.YNc(3,cu,2,1,"p",59),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const pu=function(n){return{"display-none":n}};function mu(n,a){if(1&n&&t._UZ(0,"tr",60),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,pu,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function du(n,a){1&n&&t._UZ(0,"tr",61)}function hu(n,a){1&n&&t._UZ(0,"tr",62)}const _u=function(){return["no_event"]};function gu(n,a){if(1&n&&(t.TgZ(0,"div",14),t.YNc(1,qc,1,0,"mat-progress-bar",15),t.TgZ(2,"table",16,17),t.ynx(4,18),t.YNc(5,Nc,1,0,"th",19),t.YNc(6,Uc,2,1,"td",20),t.BQk(),t.ynx(7,21),t.YNc(8,Rc,2,0,"th",22),t.YNc(9,kc,3,4,"td",20),t.BQk(),t.ynx(10,23),t.YNc(11,Dc,2,0,"th",22),t.YNc(12,Jc,4,4,"td",20),t.BQk(),t.ynx(13,24),t.YNc(14,Mc,2,0,"th",22),t.YNc(15,Qc,2,1,"td",20),t.BQk(),t.ynx(16,25),t.YNc(17,Yc,2,0,"th",22),t.YNc(18,Bc,4,4,"td",20),t.BQk(),t.ynx(19,26),t.YNc(20,Hc,2,0,"th",22),t.YNc(21,zc,4,4,"td",20),t.BQk(),t.ynx(22,27),t.YNc(23,Vc,2,0,"th",22),t.YNc(24,Gc,2,1,"td",20),t.BQk(),t.ynx(25,28),t.YNc(26,Kc,2,0,"th",22),t.YNc(27,Wc,4,4,"td",20),t.BQk(),t.ynx(28,29),t.YNc(29,$c,2,0,"th",22),t.YNc(30,Xc,4,4,"td",20),t.BQk(),t.ynx(31,30),t.YNc(32,jc,2,0,"th",31),t.YNc(33,tu,4,3,"td",20),t.BQk(),t.ynx(34,32),t.YNc(35,eu,2,0,"th",31),t.YNc(36,nu,4,3,"td",20),t.BQk(),t.ynx(37,33),t.YNc(38,iu,2,0,"th",31),t.YNc(39,au,4,3,"td",20),t.BQk(),t.ynx(40,34),t.YNc(41,ou,6,0,"th",35),t.YNc(42,su,3,0,"td",36),t.BQk(),t.ynx(43,37),t.YNc(44,uu,4,3,"td",38),t.BQk(),t.YNc(45,mu,1,3,"tr",39),t.YNc(46,du,1,0,"tr",40),t.YNc(47,hu,1,0,"tr",41),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.forwardingHistoryEvents),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(5,_u)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function fu(n,a){if(1&n&&t._UZ(0,"mat-paginator",63),2&n){const e=t.oxw();t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Ut=(()=>{class n{constructor(e,i,o,l,c){this.logger=e,this.commonService=i,this.store=o,this.datePipe=l,this.camelCaseWithSpaces=c,this.pageId="routing",this.tableId="forwarding_history",this.eventsData=[],this.selFilter="",this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.tableSetting={tableId:"forwarding_history",recordsPerPage:s.IV,sortBy:"timestamp",sortOrder:s.Pi.DESCENDING},this.displayedColumns=[],this.forwardingHistoryEvents=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting.tableId=this.tableId,this.tableSetting=e.pageSettings.find(i=>i.pageId===this.pageId)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.pageId)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("type"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.PP).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{0===this.eventsData.length&&(this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.eventsData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)}ngOnChanges(e){e.eventsData&&(this.apiCallStatus={status:s.Bn.COMPLETED,action:"FetchPayments"},this.eventsData=e.eventsData.currentValue,e.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),e.selFilter&&!e.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}onForwardingEventClick(e,i){const o=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:s.Gi.STRING}],[{key:"timestamp",value:Math.round((e.timestamp||0)/1e3),title:"Date/Time",width:50,type:s.Gi.DATE_TIME},{key:"fee",value:(e.amountIn||0)-(e.amountOut||0),title:"Fee Earned (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"amountIn",value:e.amountIn,title:"Amount In (Sats)",width:50,type:s.Gi.NUMBER},{key:"amountOut",value:e.amountOut,title:"Amount Out (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"fromChannelAlias",value:e.fromChannelAlias,title:"From Channel Alias",width:50,type:s.Gi.STRING},{key:"fromShortChannelId",value:e.fromShortChannelId,title:"From Short Channel ID",width:50,type:s.Gi.STRING}],[{key:"fromChannelId",value:e.fromChannelId,title:"From Channel ID",width:100,type:s.Gi.STRING}],[{key:"toChannelAlias",value:e.toChannelAlias,title:"To Channel Alias",width:50,type:s.Gi.STRING},{key:"toShortChannelId",value:e.toShortChannelId,title:"To Short Channel ID",width:50,type:s.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"To Channel ID",width:100,type:s.Gi.STRING}]];"payment-relayed"!==e.type&&o?.unshift([{key:"type",value:this.commonService.camelCase(e.type),title:"Relay Type",width:100,type:s.Gi.STRING}]),this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Event Information",message:o}}}))}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.selFilter.trim().toLowerCase())}getLabel(e){const i=this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column):this.commonService.titleCase(e)}setFilterPredicate(){this.forwardingHistoryEvents.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=(e.timestamp?this.datePipe.transform(new Date(e.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":o=this.datePipe.transform(new Date(e.timestamp||0),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"fee":o=(e.amountIn-e.amountOut).toString()||"0";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new r.by([...e]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(i,o)=>"fee"===o?i.amountIn-i.amountOut:i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.forwardingHistoryEvents.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.forwardingHistoryEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh),t.Y36(u.uU),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Events")}]),t.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","fromChannelId"],["matColumnDef","fromShortChannelId"],["matColumnDef","fromChannelAlias"],["matColumnDef","toChannelId"],["matColumnDef","toShortChannelId"],["matColumnDef","toChannelAlias"],["matColumnDef","paymentHash"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)"],["mat-cell",""],["class","dot yellow","matTooltipPosition","right",3,"matTooltip","ngClass",4,"ngIf"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip","ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Ec,2,1,"div",1),t.YNc(2,Fc,8,4,"div",2),t.YNc(3,gu,48,6,"div",3),t.YNc(4,fu,1,3,"mat-paginator",4),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},dependencies:[u.mk,u.sg,u.O5,u.PC,d.Fj,d.JJ,d.On,m.xw,m.Wh,m.yH,v.oO,v.Zl,F.lW,y.KE,Q.Nt,J.pW,R.gD,R.$L,H.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,G.gM,S.NW,Y.$V,u.JJ,u.uU,z.h9],styles:[".mat-column-type[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-type[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{max-width:1.6rem;width:1.6rem}"]}),n})();const Cu=["tableIn"],xu=["tableOut"],yu=["paginatorIn"],Tu=["paginatorOut"];function Lu(n,a){if(1&n&&(t.TgZ(0,"div",3),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function bu(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function vu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}const nt=function(n){return{width:n}};function Su(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,nt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Zu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Au(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,nt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Eu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function wu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Iu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Fu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function qu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Nu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Ou(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function Pu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Uu(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Ru(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,Ou,2,0,"p",42),t.YNc(2,Pu,2,0,"p",42),t.YNc(3,Uu,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Rt=function(n){return{"display-none":n}};function ku(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Rt,(null==e.routingPeersIncoming?null:e.routingPeersIncoming.data)&&(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)>0))}}function Du(n,a){1&n&&t._UZ(0,"tr",44)}function Ju(n,a){1&n&&t._UZ(0,"tr",45)}function Mu(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function Qu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}function Yu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,nt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Bu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Hu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,nt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function zu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Vu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Gu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Ku(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function Wu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function $u(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Xu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function ju(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function tp(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function ep(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,Xu,2,0,"p",42),t.YNc(2,ju,2,0,"p",42),t.YNc(3,tp,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function np(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Rt,(null==e.routingPeersOutgoing?null:e.routingPeersOutgoing.data)&&(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)>0))}}function ip(n,a){1&n&&t._UZ(0,"tr",44)}function ap(n,a){1&n&&t._UZ(0,"tr",45)}const op=function(n,a){return{"mt-2":n,"mt-1":a}},sp=function(){return["no_incoming_event"]},lp=function(n){return{"mt-2":n}},rp=function(){return["no_outgoing_event"]};function cp(n,a){if(1&n&&(t.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7),t._uU(4,"Incoming"),t.qZA(),t._UZ(5,"div",8),t.qZA(),t.TgZ(6,"div",9),t.YNc(7,bu,1,0,"mat-progress-bar",10),t.TgZ(8,"table",11,12),t.ynx(10,13),t.YNc(11,vu,2,0,"th",14),t.YNc(12,Su,4,4,"td",15),t.BQk(),t.ynx(13,16),t.YNc(14,Zu,2,0,"th",14),t.YNc(15,Au,4,4,"td",15),t.BQk(),t.ynx(16,17),t.YNc(17,Eu,2,0,"th",18),t.YNc(18,wu,4,3,"td",15),t.BQk(),t.ynx(19,19),t.YNc(20,Iu,2,0,"th",18),t.YNc(21,Fu,4,3,"td",15),t.BQk(),t.ynx(22,20),t.YNc(23,qu,2,0,"th",18),t.YNc(24,Nu,4,3,"td",15),t.BQk(),t.ynx(25,21),t.YNc(26,Ru,4,3,"td",22),t.BQk(),t.YNc(27,ku,1,3,"tr",23),t.YNc(28,Du,1,0,"tr",24),t.YNc(29,Ju,1,0,"tr",25),t.qZA()(),t._UZ(30,"mat-paginator",26,27),t.qZA(),t.TgZ(32,"div",28)(33,"div",6)(34,"div",7),t._uU(35,"Outgoing"),t.qZA(),t._UZ(36,"div",8),t.qZA(),t.TgZ(37,"div",29),t.YNc(38,Mu,1,0,"mat-progress-bar",10),t.TgZ(39,"table",30,31),t.ynx(41,13),t.YNc(42,Qu,2,0,"th",14),t.YNc(43,Yu,4,4,"td",15),t.BQk(),t.ynx(44,16),t.YNc(45,Bu,2,0,"th",14),t.YNc(46,Hu,4,4,"td",15),t.BQk(),t.ynx(47,17),t.YNc(48,zu,2,0,"th",18),t.YNc(49,Vu,4,3,"td",15),t.BQk(),t.ynx(50,19),t.YNc(51,Gu,2,0,"th",18),t.YNc(52,Ku,4,3,"td",15),t.BQk(),t.ynx(53,20),t.YNc(54,Wu,2,0,"th",18),t.YNc(55,$u,4,3,"td",15),t.BQk(),t.ynx(56,32),t.YNc(57,ep,4,3,"td",22),t.BQk(),t.YNc(58,np,1,3,"tr",23),t.YNc(59,ip,1,0,"tr",24),t.YNc(60,ap,1,0,"tr",25),t.qZA(),t._UZ(61,"mat-paginator",26,33),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.WLB(18,op,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(21,sp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),t.xp6(3),t.Q6J("ngClass",t.VKq(22,lp,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(24,rp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let up=(()=>{class n{constructor(e,i,o,l){this.logger=e,this.commonService=i,this.store=o,this.camelCaseWithSpaces=l,this.nodePageDefs=s.Xk,this.selFilterByIn="all",this.selFilterByOut="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"routing_peers",recordsPerPage:s.IV,sortBy:"totalFee",sortOrder:s.Pi.DESCENDING},this.routingPeersData=[],this.displayedColumns=[],this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/(2*this.displayedColumns.length)/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.PP).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.routingPeersData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(e)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}applyFilterIncoming(){this.routingPeersIncoming.filter=this.filterIn.trim().toLowerCase()}applyFilterOutgoing(){this.routingPeersOutgoing.filter=this.filterOut.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.routingPeersIncoming.filterPredicate=(e,i)=>{let o="";return o="all"===this.selFilterByIn?JSON.stringify(e).toLowerCase():"string"==typeof e[this.selFilterByIn]?e[this.selFilterByIn].toLowerCase():"boolean"==typeof e[this.selFilterByIn]?e[this.selFilterByIn]?"yes":"no":e[this.selFilterByIn].toString(),o.includes(i)},this.routingPeersOutgoing.filterPredicate=(e,i)=>{let o="";switch(this.selFilterByOut){case"all":o=JSON.stringify(e).toLowerCase();break;case"total_amount":case"total_fee":o=(+(e[this.selFilterByOut]||0)/1e3).toString()||"";break;default:o="string"==typeof e[this.selFilterByOut]?e[this.selFilterByOut].toLowerCase():"boolean"==typeof e[this.selFilterByOut]?e[this.selFilterByOut]?"yes":"no":e[this.selFilterByOut].toString()}return o.includes(i)}}loadRoutingPeersTable(e){if(e.length>0){const i=this.groupRoutingPeers(e);this.routingPeersIncoming=new r.by(i[0]),this.routingPeersIncoming.sort=this.sortIn,this.routingPeersIncoming.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new r.by(i[1]),this.routingPeersOutgoing.sort=this.sortOut,this.routingPeersOutgoing.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.routingPeersOutgoing)}else this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]);this.setFilterPredicate(),this.applyFilterIncoming(),this.applyFilterOutgoing()}groupRoutingPeers(e){const i=[],o=[];return e.forEach(l=>{const c=i.find(U=>U.channelId===l.fromChannelId),g=o.find(U=>U.channelId===l.toChannelId);c?(c.events++,c.totalAmount=+c.totalAmount+ +l.amountIn,c.totalFee=l.amountIn-l.amountOut+ +c.totalFee):i.push({channelId:l.fromChannelId,alias:l.fromChannelAlias,events:1,totalAmount:+l.amountIn,totalFee:l.amountIn-l.amountOut}),g?(g.events++,g.totalAmount=+g.totalAmount+ +l.amountOut,g.totalFee=l.amountIn-l.amountOut+ +g.totalFee):o.push({channelId:l.toChannelId,alias:l.toChannelAlias,events:1,totalAmount:+l.amountOut,totalFee:l.amountIn-l.amountOut})}),[this.commonService.sortDescByKey(i,"totalFee"),this.commonService.sortDescByKey(o,"totalFee")]}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh),t.Y36(z.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Cu,5,b.YE),t.Gf(xu,5,b.YE),t.Gf(yu,5),t.Gf(Tu,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sortIn=o.first),t.iGM(o=t.CRH())&&(i.sortOut=o.first),t.iGM(o=t.CRH())&&(i.paginatorIn=o.first),t.iGM(o=t.CRH())&&(i.paginatorOut=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","page-sub-title-container mt-2",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container","mt-2"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mb-4"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","totalAmount"],["matColumnDef","totalFee"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch",1,"mb-4"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Lu,2,1,"div",1),t.YNc(2,cp,63,25,"div",2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},dependencies:[u.mk,u.O5,u.PC,m.xw,m.Wh,m.yH,v.oO,v.Zl,J.pW,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,Y.$V,u.JJ]}),n})();function pp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let mp=(()=>{class n{constructor(e){this.router=e,this.faChartBar=T.koM,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(l=>i.urlAfterRedirects.includes(l.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-reports"]],decls:10,vars:2,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Reports"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,pp,2,3,"div",6),t.qZA(),t._UZ(9,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartBar),t.xp6(7),t.Q6J("ngForOf",i.links))},dependencies:[u.sg,I.BN,m.xw,m.Wh,L.a8,L.dn,P.BU,P.Nj,x.lC,x.rH]}),n})();var kt=_(7772),Dt=_(6883),Jt=_(7671);function dp(n,a){if(1&n&&(t.TgZ(0,"div",13),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.totalFeeSat),t.xp6(1),t.AsE("",t.xi3(2,3,e.totalFeeSat||0,"1.0-2")," Sats/",t.lcZ(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function hp(n,a){1&n&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function _p(n,a){if(1&n&&(t.TgZ(0,"span")(1,"span",17),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"span",17),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=a.model,i=t.oxw(2);t.xp6(2),t.hij("Events: ",t.lcZ(3,2,(i.selReportBy===i.reportBy.EVENTS?e.value:e.extra.totalEvents)||0),""),t.xp6(3),t.hij("Fee: ",t.xi3(6,4,(i.selReportBy===i.reportBy.EVENTS?e.extra.totalFees:e.value)||0,"1.0-2"),"")}}function gp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",15),t.NdJ("select",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartMouseUp(o))}),t.YNc(1,_p,7,7,"ng-template",null,16,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.routingReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function fp(n,a){if(1&n&&t._UZ(0,"rtl-ecl-forwarding-history",18),2&n){const e=t.oxw();t.Q6J("pageId","reports")("tableId","routing")("eventsData",e.filteredEventsBySelectedPeriod)("selFilter",e.eventFilterValue)}}let Cp=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.reportPeriod=s.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.reportBy=s.Xr,this.selReportBy=s.Xr.FEES,this.totalFeeSat=null,this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.routingReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===s.cu.XS||this.screenSize===s.cu.SM),this.store.select(f.PP).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.events=e.payments&&e.payments.relayed?e.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(e)}),this.commonService.containerSizeUpdated.pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{switch(this.screenSize){case s.cu.MD:this.screenPaddingX=e.width/10;break;case s.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(e,i){const o=Math.round(e.getTime()/1e3),l=Math.round(i.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()+" To "+i.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(c=>{Math.floor((c.timestamp||0)/1e3)>=o&&Math.floor((c.timestamp||0)/1e3)<l&&this.filteredEventsBySelectedPeriod.push(c)}),this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(e):this.prepareFeeReport(e)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===s.op[1]?e.name+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+s.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(e){const i=Math.round(e.getTime()/1e3),o=[];if(this.totalFeeSat=0,this.logger.info("Fee Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===s.op[1]){for(let l=0;l<12;l++)o.push({name:s.gg[l].name,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod?.map(l=>{const c=new Date(l.timestamp||0).getMonth();return o[c].value=o[c].value+((l.amountIn||0)-(l.amountOut||0)),o[c].extra.totalEvents=o[c].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((l.amountIn||0)-(l.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let l=0;l<this.getMonthDays(e.getMonth(),e.getFullYear());l++)o.push({name:l+1,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod?.map(l=>{const c=Math.floor((Math.floor((l.timestamp||0)/1e3)-i)/this.secondsInADay);return o[c].value=o[c].value+((l.amountIn||0)-(l.amountOut||0)),o[c].extra.totalEvents=o[c].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((l.amountIn||0)-(l.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),o}prepareEventsReport(e){const i=Math.round(e.getTime()/1e3),o=[];if(this.totalFeeSat=0,this.logger.info("Events Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===s.op[1]){for(let l=0;l<12;l++)o.push({name:s.gg[l].name,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod?.map(l=>{const c=new Date(l.timestamp||0).getMonth();return o[c].value=o[c].value+1,o[c].extra.totalFees=o[c].extra.totalFees+((l.amountIn||0)-(l.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((l.amountIn||0)-(l.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let l=0;l<this.getMonthDays(e.getMonth(),e.getFullYear());l++)o.push({name:l+1,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod?.map(l=>{const c=Math.floor((Math.floor((l.timestamp||0)/1e3)-i)/this.secondsInADay);return o[c].value=o[c].value+1,o[c].extra.totalFees=o[c].extra.totalFees+((l.amountIn||0)-(l.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((l.amountIn||0)-(l.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Events Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),o}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===s.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?s.gg[e].days+1:s.gg[e].days}onSelReportByChange(){this.yAxisLabel=this.selReportBy===this.reportBy.EVENTS?"Events":"Fee (Sats)",this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(this.startDate):this.prepareFeeReport(this.startDate)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(l){return i.onChartMouseUp(l)})},decls:17,vars:7,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start start",1,"my-1",3,"ngModel","ngModelChange","change"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"pageId","tableId","eventsData","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"pageId","tableId","eventsData","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(l){return i.onSelectionChange(l)}),t.qZA(),t.TgZ(2,"div",2)(3,"mat-radio-group",3),t.NdJ("ngModelChange",function(l){return i.selReportBy=l})("change",function(){return i.onSelReportByChange()}),t.TgZ(4,"span",4),t._uU(5,"Report By: "),t.qZA(),t.TgZ(6,"mat-radio-button",5),t._uU(7,"Fees"),t.qZA(),t.TgZ(8,"mat-radio-button",6),t._uU(9,"Events"),t.qZA()()(),t.TgZ(10,"div",7),t.YNc(11,dp,4,8,"div",8),t.YNc(12,hp,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,gp,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,fp,1,4,"rtl-ecl-forwarding-history",12),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngModel",i.selReportBy),t.xp6(3),t.s9C("value",i.reportBy.FEES),t.xp6(2),t.s9C("value",i.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",i.routingReportData.length<=0||i.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",i.filteredEventsBySelectedPeriod.length>0))},dependencies:[u.O5,d.JJ,d.On,m.xw,m.Wh,m.yH,et.VQ,et.U0,Dt.K$,Jt.D,Ut,u.JJ],data:{animation:[kt.J]}}),n})();var xp=_(165);function yp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Paid ",t.xi3(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function Tp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Received ",t.xi3(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Lp(n,a){if(1&n&&(t.TgZ(0,"div",8),t.YNc(1,yp,4,7,"div",9),t.YNc(2,Tp,4,7,"div",9),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.transactionsReportSummary),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function bp(n,a){1&n&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function vp(n,a){if(1&n&&(t.TgZ(0,"span",14),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=a.model;t.xp6(1),t.HOy("",e.name,": ",t.xi3(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",t.lcZ(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function Sp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical-2d",12),t.NdJ("select",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartMouseUp(o))}),t.YNc(1,vp,4,9,"ng-template",null,13,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:8)}}function Zp(n,a){if(1&n&&t._UZ(0,"rtl-transactions-report-table",15),2&n){const e=t.oxw();t.Q6J("displayedColumns",e.displayedColumns)("tableSetting",e.tableSetting)("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("selFilter",e.transactionFilterValue)}}let Ap=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.scrollRanges=s.op,this.reportPeriod=s.op[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.colWidth="20rem",this.PAGE_ID="reports",this.tableSetting={tableId:"transactions",recordsPerPage:s.IV,sortBy:"date",sortOrder:s.Pi.DESCENDING},this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.transactionsReportData=[],this.transactionsNonZeroReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===s.cu.XS||this.screenSize===s.cu.SM),this.store.select(f.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.tableSetting=e.pageSettings.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId)||s.c3.find(i=>i.pageId===this.PAGE_ID)?.tables.find(i=>i.tableId===this.tableSetting.tableId),this.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(f.PP).pipe((0,h.R)(this.unSubs[1]),(0,it.M)(this.store.select(f.Ef))).subscribe(([e,i])=>{this.payments=e.payments.sent?e.payments.sent:[],this.invoices=i.invoices?i.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())}),this.commonService.containerSizeUpdated.pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{switch(this.screenSize){case s.cu.MD:this.screenPaddingX=e.width/10;break;case s.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(e){this.transactionFilterValue=this.reportPeriod===s.op[1]?e.series.toString()+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+s.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,i){const o=Math.round(e.getTime()/1e3),l=Math.round(i.getTime()/1e3),c=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const g=this.payments?.filter(C=>C.firstPartTimestamp&&Math.floor(C.firstPartTimestamp/1e3)>=o&&Math.floor(C.firstPartTimestamp/1e3)<l),U=this.invoices?.filter(C=>"received"===C.status&&C.timestamp&&C.timestamp>=o&&C.timestamp<l);if(this.transactionsReportSummary.paymentsSelectedPeriod=g.length,this.transactionsReportSummary.invoicesSelectedPeriod=U.length,this.reportPeriod===s.op[1]){for(let C=0;C<12;C++)c.push({name:s.gg[C].name,date:new Date(e.getFullYear(),C,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});g?.map(C=>{const w=new Date(C.firstPartTimestamp||0).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(C.recipientAmount||0),c[w].series[0].value=c[w].series[0].value+C.recipientAmount,c[w].series[0].extra.total=c[w].series[0].extra.total+1,this.transactionsReportSummary}),U?.map(C=>{const w=new Date(1e3*(C.timestamp||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(C.amountSettled||0),c[w].series[1].value=c[w].series[1].value+C.amountSettled,c[w].series[1].extra.total=c[w].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let C=0;C<this.getMonthDays(e.getMonth(),e.getFullYear());C++)c.push({name:(C+1).toString(),date:new Date(1e3*(C*this.secondsInADay+o)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});g?.map(C=>{const w=Math.floor((Math.floor((C.firstPartTimestamp||0)/1e3)-o)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(C.recipientAmount||0),c[w].series[0].value=c[w].series[0].value+C.recipientAmount,c[w].series[0].extra.total=c[w].series[0].extra.total+1,this.transactionsReportSummary}),U?.map(C=>{const w=Math.floor(((C.timestamp||0)-o)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(C.amountSettled||0),c[w].series[1].value=c[w].series[1].value+C.amountSettled,c[w].series[1].extra.total=c[w].series[1].extra.total+1,this.transactionsReportSummary})}return c}prepareTableData(){return this.transactionsReportData?.reduce((e,i)=>i.series[0].extra.total>0||i.series[1].extra.total>0?e.concat({date:i.date,amount_paid:i.series[0].value,num_payments:i.series[0].extra.total,amount_received:i.series[1].value,num_invoices:i.series[1].extra.total}):e,[])}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===s.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?s.gg[e].days+1:s.gg[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.mQ),t.Y36(N.v),t.Y36(A.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(l){return i.onChartMouseUp(l)})},decls:9,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(l){return i.onSelectionChange(l)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,Lp,3,3,"div",3),t.YNc(4,bp,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Sp,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Zp,1,5,"rtl-transactions-report-table",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",i.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0))},dependencies:[u.O5,m.xw,m.Wh,m.yH,Dt.H5,Jt.D,xp.g,u.JJ],data:{animation:[kt.J]}}),n})();var E=_(1643),Ep=_(9442);function wp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const l=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}const qp=x.Bz.forChild([{path:"",component:_t,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:_a,canActivate:[E.fY]},{path:"onchain",component:io,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:No,canActivate:[E.fY]},{path:"send",component:Oo,canActivate:[E.fY]}]},{path:"connections",component:so,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:Xo,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:js,canActivate:[E.fY]},{path:"pending",component:Rl,canActivate:[E.fY]},{path:"inactive",component:Ac,canActivate:[E.fY]}]},{path:"peers",component:vr,data:{sweepAll:!1},canActivate:[E.fY]}]},{path:"transactions",component:ro,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:Tt,canActivate:[E.fY]},{path:"invoices",component:Lt,canActivate:[E.fY]}]},{path:"routing",component:uo,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Ut,canActivate:[E.fY]},{path:"peers",component:up,canActivate:[E.fY]}]},{path:"reports",component:mp,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:Cp,canActivate:[E.fY]},{path:"transactions",component:Ap,canActivate:[E.fY]}]},{path:"graph",component:(()=>{class n{constructor(e){this.router=e,this.faSearch=T.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,M.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(l=>i.urlAfterRedirects.includes(l.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-graph"]],decls:11,vars:2,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Graph Lookups"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,wp,2,3,"div",6),t.qZA(),t.TgZ(9,"div",7),t._UZ(10,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faSearch),t.xp6(7),t.Q6J("ngForOf",i.links))},dependencies:[u.sg,I.BN,m.xw,m.Wh,m.yH,L.a8,L.dn,P.BU,P.Nj,x.lC,x.rH]}),n})(),canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Fo,canActivate:[E.fY]},{path:"queryroutes",component:Dr,canActivate:[E.fY]}]},{path:"**",component:Ep.w}]}]);var Np=_(9470);let Op=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[_t]}),n.\u0275inj=t.cJS({providers:[E.fY],imports:[u.ez,Np.m,qp]}),n})()}}]);