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/angular/432.cc664c98c4074918e24a.js

1 line
291 KiB
JavaScript

(self.webpackChunkrtl=self.webpackChunkrtl||[]).push([[432],{1432:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ECLModule:()=>fc});var a=n(1511),i=n(6853),s=n(2865),o=n(1572),l=n(3722),r=n(5994);function c(t,e){1&t&&o._UZ(0,"mat-progress-bar",3)}let u=(()=>{class t{constructor(t){this.router=t,this.loading=!1,this.router.events.subscribe(t=>{switch(!0){case t instanceof i.OD:this.loading=!0;break;case t instanceof i.m2:case t instanceof i.gk:case t instanceof i.Q3:this.loading=!1}})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,c,1,0,"mat-progress-bar",1),o._UZ(2,"router-outlet",null,2),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf",e.loading))},directives:[l.xw,l.yH,l.Wh,a.O5,i.lC,r.pW],styles:[""],data:{animation:[s.g]}}),t})();var d=n(9666),m=n(9568),p=n(7810),h=n(5291),g=n(9421),f=n(3869),x=n(964),Z=n(5573),y=n(1084),A=n(7592),C=n(7271),T=n(7439),w=n(8055),S=n(377),v=n(5980),q=n(3691);const b=function(t){return{backgroundColor:t}};function L(t,e){if(1&t&&o._UZ(0,"span",6),2&t){const t=o.oxw();o.Q6J("ngStyle",o.VKq(1,b,null==t.information?null:t.information.color))}}function F(t,e){if(1&t&&(o.TgZ(0,"div"),o.TgZ(1,"h4",1),o._uU(2,"Color"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"span",7),o._uU(5),o.ALo(6,"uppercase"),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(4),o.Q6J("ngStyle",o.VKq(4,b,null==t.information?null:t.information.color)),o.xp6(1),o.hij(" ",o.lcZ(6,2,null==t.information?null:t.information.color)," ")}}function I(t,e){if(1&t&&(o.TgZ(0,"span",2),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(t)}}let N=(()=>{class t{constructor(t){this.commonService=t,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[o.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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div"),o.TgZ(2,"h4",1),o._uU(3,"Alias"),o.qZA(),o.TgZ(4,"div",2),o._uU(5),o.YNc(6,L,1,3,"span",3),o.qZA(),o.qZA(),o.YNc(7,F,7,6,"div",4),o.TgZ(8,"div"),o.TgZ(9,"h4",1),o._uU(10,"Implementation"),o.qZA(),o.TgZ(11,"div",2),o._uU(12),o.qZA(),o.qZA(),o.TgZ(13,"div"),o.TgZ(14,"h4",1),o._uU(15,"Chain"),o.qZA(),o.YNc(16,I,2,1,"span",5),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.hij(" ",null==e.information?null:e.information.alias," "),o.xp6(1),o.Q6J("ngIf",!e.showColorFieldSeparately),o.xp6(1),o.Q6J("ngIf",e.showColorFieldSeparately),o.xp6(5),o.Oqu(null!=e.information&&e.information.lnImplementation||null!=e.information&&e.information.version?(null==e.information?null:e.information.lnImplementation)+" "+(null==e.information?null:e.information.version):""),o.xp6(4),o.Q6J("ngForOf",e.chains))},directives:[l.xw,l.yH,l.Wh,a.O5,a.sg,a.PC,S.Zl],pipes:[a.gd],styles:[""]}),t})();function _(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div"),o.TgZ(2,"h4",3),o._uU(3,"Lightning"),o.qZA(),o.TgZ(4,"div",4),o._uU(5),o.ALo(6,"number"),o.qZA(),o._UZ(7,"mat-progress-bar",5),o.qZA(),o.TgZ(8,"div"),o.TgZ(9,"h4",3),o._uU(10,"On-chain"),o.qZA(),o.TgZ(11,"div",4),o._uU(12),o.ALo(13,"number"),o.qZA(),o._UZ(14,"mat-progress-bar",5),o.qZA(),o.TgZ(15,"div"),o.TgZ(16,"h4",3),o._uU(17,"Total"),o.qZA(),o.TgZ(18,"div",4),o._uU(19),o.ALo(20,"number"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(5),o.hij("",o.lcZ(6,5,t.balances.lightning)," Sats"),o.xp6(2),o.s9C("value",t.balances.lightning/t.balances.total*100),o.xp6(5),o.hij("",o.lcZ(13,7,t.balances.onchain)," Sats"),o.xp6(2),o.s9C("value",t.balances.onchain/t.balances.total*100),o.xp6(5),o.hij("",o.lcZ(20,9,t.balances.total)," Sats")}}function D(t,e){if(1&t&&(o.TgZ(0,"div",6),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.errorMessage)}}let k=(()=>{class t{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,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(t,e){if(1&t&&(o.YNc(0,_,21,11,"div",0),o.YNc(1,D,3,1,"ng-template",null,1,o.W1O)),2&t){const t=o.MAs(2);o.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",t)}},directives:[a.O5,l.xw,l.yH,l.Wh,r.pW],pipes:[a.JJ],styles:[""]}),t})();var O=n(6283),U=n(6828),R=n(7679),M=n(7038);function J(t,e){if(1&t&&(o.TgZ(0,"div",19),o.TgZ(1,"span",20),o._uU(2),o.ALo(3,"slice"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"mat-hint",21),o.TgZ(6,"strong",8),o._uU(7,"Local:"),o.qZA(),o._uU(8),o.ALo(9,"number"),o.qZA(),o.TgZ(10,"mat-hint",22),o._UZ(11,"fa-icon",23),o._uU(12),o.ALo(13,"number"),o.qZA(),o.TgZ(14,"mat-hint",24),o.TgZ(15,"strong",8),o._uU(16,"Remote:"),o.qZA(),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o._UZ(19,"mat-progress-bar",25),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(3);o.xp6(1),o.s9C("matTooltip",t.alias||t.shortChannelId),o.s9C("matTooltipDisabled",(t.alias||t.shortChannelId).length<26),o.xp6(1),o.AsE("",o.Dn7(3,9,(null==t?null:t.alias)||(null==t?null:t.shortChannelId),0,24),"",((null==t?null:t.alias)||(null==t?null:t.shortChannelId)).length>25?"...":"",""),o.xp6(6),o.hij("",o.xi3(9,13,(null==t?null:t.toLocal)||0,"1.0-0")," Sats"),o.xp6(3),o.Q6J("icon",n.faBalanceScale),o.xp6(1),o.hij(" (",o.lcZ(13,16,(null==t?null:t.balancedness)||0),") "),o.xp6(5),o.hij("",o.xi3(18,18,(null==t?null:t.toRemote)||0,"1.0-0")," Sats"),o.xp6(2),o.s9C("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function P(t,e){if(1&t&&(o.TgZ(0,"div",17),o.YNc(1,J,20,21,"div",18),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",t.allChannels)}}function E(t,e){if(1&t&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o.TgZ(2,"span",5),o._uU(3,"Total Capacity"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"mat-hint",7),o.TgZ(6,"strong",8),o._uU(7,"Local:"),o.qZA(),o._uU(8),o.ALo(9,"number"),o.qZA(),o.TgZ(10,"mat-hint",9),o._UZ(11,"fa-icon",10),o._uU(12),o.ALo(13,"number"),o.qZA(),o.TgZ(14,"mat-hint",11),o.TgZ(15,"strong",8),o._uU(16,"Remote:"),o.qZA(),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o._UZ(19,"mat-progress-bar",12),o.qZA(),o.TgZ(20,"div",13),o._UZ(21,"mat-divider",14),o.qZA(),o.TgZ(22,"div",15),o.YNc(23,P,2,1,"div",16),o.qZA(),o.qZA()),2&t){const t=o.oxw(),e=o.MAs(2);o.xp6(8),o.hij("",o.xi3(9,7,(null==t.channelBalances?null:t.channelBalances.localBalance)||0,"1.0-0")," Sats"),o.xp6(3),o.Q6J("icon",t.faBalanceScale),o.xp6(1),o.hij(" (",o.lcZ(13,10,(null==t.channelBalances?null:t.channelBalances.balancedness)||0),") "),o.xp6(5),o.hij("",o.xi3(18,12,(null==t.channelBalances?null:t.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),o.xp6(2),o.s9C("value",null!=t.channelBalances&&t.channelBalances.localBalance&&(null==t.channelBalances?null:t.channelBalances.localBalance)>0?+(null==t.channelBalances?null:t.channelBalances.localBalance)/(+(null==t.channelBalances?null:t.channelBalances.localBalance)+ +(null==t.channelBalances?null:t.channelBalances.remoteBalance))*100:0),o.xp6(4),o.Q6J("ngIf",t.allChannels&&(null==t.allChannels?null:t.allChannels.length)>0)("ngIfElse",e)}}function Y(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",26),o._uU(1," No channels available. "),o.TgZ(2,"button",27),o.NdJ("click",function(){return o.CHM(t),o.oxw().goToChannels()}),o._uU(3,"Open Channel"),o.qZA(),o.qZA()}}function Q(t,e){if(1&t&&(o.TgZ(0,"div",28),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.errorMessage)}}let B=(()=>{class t{constructor(t){this.router=t,this.faBalanceScale=h.DL8,this.faDumbbell=h.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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,"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(t,e){if(1&t&&(o.YNc(0,E,24,15,"div",0),o.YNc(1,Y,4,0,"ng-template",null,1,o.W1O),o.YNc(3,Q,3,1,"ng-template",null,2,o.W1O)),2&t){const t=o.MAs(4);o.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",t)}},directives:[a.O5,l.xw,l.Wh,l.yH,O.bx,A.BN,U.gM,r.pW,R.d,M.$V,a.sg,v.lW],pipes:[a.JJ,a.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),t})();function H(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div"),o.TgZ(3,"h4",4),o._uU(4,"Daily"),o.qZA(),o.TgZ(5,"div",5),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div"),o.TgZ(9,"h4",4),o._uU(10,"Weekly"),o.qZA(),o.TgZ(11,"div",5),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.TgZ(14,"div"),o.TgZ(15,"h4",4),o._uU(16,"Monthly"),o.qZA(),o.TgZ(17,"div",5),o._uU(18),o.ALo(19,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(20,"div",3),o.TgZ(21,"div"),o.TgZ(22,"h4",4),o._uU(23,"Transactions"),o.qZA(),o.TgZ(24,"div",5),o._uU(25),o.ALo(26,"number"),o.qZA(),o.qZA(),o.TgZ(27,"div"),o.TgZ(28,"h4",4),o._uU(29,"Transactions"),o.qZA(),o.TgZ(30,"div",5),o._uU(31),o.ALo(32,"number"),o.qZA(),o.qZA(),o.TgZ(33,"div"),o.TgZ(34,"h4",4),o._uU(35,"Transactions"),o.qZA(),o.TgZ(36,"div",5),o._uU(37),o.ALo(38,"number"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.hij("",o.lcZ(7,6,null==t.fees?null:t.fees.daily_fee)," Sats"),o.xp6(6),o.hij("",o.lcZ(13,8,null==t.fees?null:t.fees.weekly_fee)," Sats"),o.xp6(6),o.hij("",o.lcZ(19,10,null==t.fees?null:t.fees.monthly_fee)," Sats"),o.xp6(7),o.Oqu(o.lcZ(26,12,null==t.fees?null:t.fees.daily_txs)),o.xp6(6),o.Oqu(o.lcZ(32,14,null==t.fees?null:t.fees.weekly_txs)),o.xp6(6),o.Oqu(o.lcZ(38,16,null==t.fees?null:t.fees.monthly_txs))}}function z(t,e){if(1&t&&(o.TgZ(0,"div",6),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.errorMessage)}}let V=(()=>{class t{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){var t;if(null===(t=this.fees)||void 0===t?void 0:t.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee},{name:"Daily ",value:this.fees.daily_fee}];const t=Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10),e=Math.pow(10,t-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/e)*e/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 t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[o.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(t,e){if(1&t&&(o.YNc(0,H,39,18,"div",0),o.YNc(1,z,3,1,"ng-template",null,1,o.W1O)),2&t){const t=o.MAs(2);o.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",t)}},directives:[a.O5,l.xw,l.yH,l.Wh],pipes:[a.JJ],styles:[""]}),t})();function G(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div"),o.TgZ(3,"h4",4),o._uU(4,"Active"),o.qZA(),o.TgZ(5,"div",5),o._UZ(6,"span",6),o._uU(7),o.ALo(8,"number"),o.qZA(),o.qZA(),o.TgZ(9,"div"),o.TgZ(10,"h4",4),o._uU(11,"Pending"),o.qZA(),o.TgZ(12,"div",5),o._UZ(13,"span",7),o._uU(14),o.ALo(15,"number"),o.qZA(),o.qZA(),o.TgZ(16,"div"),o.TgZ(17,"h4",4),o._uU(18,"Inactive"),o.qZA(),o.TgZ(19,"div",5),o._UZ(20,"span",8),o._uU(21),o.ALo(22,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(23,"div",3),o.TgZ(24,"div"),o.TgZ(25,"h4",4),o._uU(26,"Capacity"),o.qZA(),o.TgZ(27,"div",5),o._uU(28),o.ALo(29,"number"),o.qZA(),o.qZA(),o.TgZ(30,"div"),o.TgZ(31,"h4",4),o._uU(32,"Capacity"),o.qZA(),o.TgZ(33,"div",5),o._uU(34),o.ALo(35,"number"),o.qZA(),o.qZA(),o.TgZ(36,"div"),o.TgZ(37,"h4",4),o._uU(38,"Capacity"),o.qZA(),o.TgZ(39,"div",5),o._uU(40),o.ALo(41,"number"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(7),o.Oqu(o.lcZ(8,6,(null==t.channelsStatus.active?null:t.channelsStatus.active.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(15,8,(null==t.channelsStatus.pending?null:t.channelsStatus.pending.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(22,10,(null==t.channelsStatus.inactive?null:t.channelsStatus.inactive.channels)||0)),o.xp6(7),o.hij("",o.lcZ(29,12,(null==t.channelsStatus.active?null:t.channelsStatus.active.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(35,14,(null==t.channelsStatus.pending?null:t.channelsStatus.pending.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(41,16,(null==t.channelsStatus.inactive?null:t.channelsStatus.inactive.capacity)||0)," Sats")}}function $(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.errorMessage)}}let X=(()=>{class t{constructor(){this.channelsStatus={}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,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(t,e){if(1&t&&(o.YNc(0,G,42,18,"div",0),o.YNc(1,$,3,1,"ng-template",null,1,o.W1O)),2&t){const t=o.MAs(2);o.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",t)}},directives:[a.O5,l.xw,l.yH,l.Wh],pipes:[a.JJ],styles:[""]}),t})();function W(t,e){if(1&t&&(o.TgZ(0,"mat-hint",19),o.TgZ(1,"strong",20),o._uU(2,"Capacity: "),o.qZA(),o._uU(3),o.ALo(4,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(3),o.hij("",o.xi3(4,1,t.toRemote||0,"1.0-0")," Sats")}}function K(t,e){if(1&t&&(o.TgZ(0,"mat-hint",19),o.TgZ(1,"strong",20),o._uU(2,"Capacity: "),o.qZA(),o._uU(3),o.ALo(4,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(3),o.hij("",o.xi3(4,1,t.toLocal||0,"1.0-0")," Sats")}}function j(t,e){if(1&t&&o._UZ(0,"mat-progress-bar",21),2&t){const t=o.oxw().$implicit,e=o.oxw(3);o.s9C("value",e.totalLiquidity>0?(+t.toRemote||0)/e.totalLiquidity*100:0)}}function tt(t,e){if(1&t&&o._UZ(0,"mat-progress-bar",21),2&t){const t=o.oxw().$implicit,e=o.oxw(3);o.s9C("value",e.totalLiquidity>0?(+t.toLocal||0)/e.totalLiquidity*100:0)}}function et(t,e){if(1&t&&(o.TgZ(0,"div",14),o.TgZ(1,"span",15),o._uU(2),o.ALo(3,"slice"),o.qZA(),o.TgZ(4,"div",16),o.YNc(5,W,5,4,"mat-hint",17),o.YNc(6,K,5,4,"mat-hint",17),o.qZA(),o.YNc(7,j,1,1,"mat-progress-bar",18),o.YNc(8,tt,1,1,"mat-progress-bar",18),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(3);o.xp6(1),o.s9C("matTooltip",t.alias||t.shortChannelId),o.s9C("matTooltipDisabled",(t.alias||t.shortChannelId).length<26),o.xp6(1),o.AsE("",o.Dn7(3,8,t.alias||t.shortChannelId,0,24),"",(t.alias||t.shortChannelId).length>25?"...":"",""),o.xp6(3),o.Q6J("ngIf","In"===n.direction),o.xp6(1),o.Q6J("ngIf","Out"===n.direction),o.xp6(1),o.Q6J("ngIf","In"===n.direction),o.xp6(1),o.Q6J("ngIf","Out"===n.direction)}}function nt(t,e){if(1&t&&(o.TgZ(0,"div",12),o.YNc(1,et,9,12,"div",13),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",t.allChannels)}}const at=function(t,e,n){return{"mb-4":t,"mb-2":e,"mb-1":n}};function it(t,e){if(1&t&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o.TgZ(2,"span",5),o._uU(3,"Total Capacity"),o.qZA(),o.TgZ(4,"mat-hint",6),o._uU(5),o.ALo(6,"number"),o.qZA(),o._UZ(7,"mat-progress-bar",7),o.qZA(),o.TgZ(8,"div",8),o._UZ(9,"mat-divider",9),o.qZA(),o.TgZ(10,"div",10),o.YNc(11,nt,2,1,"div",11),o.qZA(),o.qZA()),2&t){const t=o.oxw(),e=o.MAs(2);o.Q6J("ngClass",o.kEZ(7,at,t.screenSize===t.screenSizeEnum.XS||t.screenSize===t.screenSizeEnum.SM,t.screenSize===t.screenSizeEnum.MD,t.screenSize===t.screenSizeEnum.LG||t.screenSize===t.screenSizeEnum.XL)),o.xp6(5),o.hij("",o.xi3(6,4,t.totalLiquidity,"1.0-0")," Sats"),o.xp6(6),o.Q6J("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",e)}}function st(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",24),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).goToChannels()}),o._uU(1,"Open Channel"),o.qZA()}}function ot(t,e){if(1&t&&(o.TgZ(0,"div",22),o._uU(1," No channels available. "),o.YNc(2,st,2,0,"button",23),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngIf","Out"===t.direction)}}function lt(t,e){if(1&t&&(o.TgZ(0,"div",25),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.errorMessage)}}let rt=(()=>{class t{constructor(t,e){this.router=t,this.commonService=e,this.screenSize="",this.screenSizeEnum=g.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.F0),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,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,"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 center",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(t,e){if(1&t&&(o.YNc(0,it,12,11,"div",0),o.YNc(1,ot,3,1,"ng-template",null,1,o.W1O),o.YNc(3,lt,3,1,"ng-template",null,2,o.W1O)),2&t){const t=o.MAs(4);o.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",t)}},directives:[a.O5,l.xw,l.Wh,l.yH,a.mk,S.oO,O.bx,r.pW,R.d,M.$V,a.sg,U.gM,v.lW],pipes:[a.JJ,a.OU],styles:[""]}),t})();var ct=n(5109),ut=n(8868),dt=n(3005),mt=n(2464),pt=n(7033),ht=n(4608),gt=n(6124),ft=n(6073),xt=n(6756),Zt=n(6880),yt=n(5095),At=n(4786),Ct=n(1522);function Tt(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Description is required."),o.qZA())}function wt(t,e){if(1&t&&(o.TgZ(0,"mat-option",25),o._uU(1),o.ALo(2,"titlecase"),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.Oqu(o.lcZ(2,2,t))}}function St(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.invoiceError)}}function vt(t,e){if(1&t&&(o.TgZ(0,"div",26),o._UZ(1,"fa-icon",27),o.YNc(2,St,2,1,"span",11),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.invoiceError)}}let qt=(()=>{class t{constructor(t,e,n,a,i,s){this.dialogRef=t,this.data=e,this.store=n,this.decimalPipe=a,this.commonService=i,this.actions=s,this.faExclamationTriangle=h.eHv,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=g.IV,this.timeUnitEnum=g.Qk,this.timeUnits=g.LO,this.selTimeUnit=g.Qk.SECS,this.invoiceError="",this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.information=t.information}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.f||t.type===gt.Wk)).subscribe(t=>{t.type===gt.Wk&&this.dialogRef.close(),t.type===gt.f&&t.payload.status===g.Bn.ERROR&&"CreateInvoice"===t.payload.action&&(this.invoiceError=t.payload.message)})}onAddInvoice(t){if(this.invoiceError="",!this.description)return!0;let e=this.expiry?this.expiry:3600;this.selTimeUnit!==g.Qk.SECS&&(e=this.commonService.convertTime(this.expiry,this.selTimeUnit,g.Qk.SECS));let n=null;n=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch(new gt.Ks(n))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=g.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,g.NT.SATS,g.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,m.R)(this.unSubs[2])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,g.Xz.OTHER)+" "+t.unit},error:t=>{this.invoiceValueHint="Conversion Error: "+t}}))}onTimeUnitChange(t){this.expiry&&this.selTimeUnit!==t.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,t.value)),this.selTimeUnit=t.value}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(ht.WI),o.Y36(x.yh),o.Y36(a.JJ),o.Y36(y.v),o.Y36(Z.eX))},t.\u0275cmp=o.Xpm({type:t,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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-flat-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(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Create Invoice"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10),o.NdJ("ngModelChange",function(t){return e.description=t}),o.qZA(),o.YNc(13,Tt,2,0,"mat-error",11),o.qZA(),o.TgZ(14,"div",12),o.TgZ(15,"mat-form-field",13),o.TgZ(16,"input",14),o.NdJ("ngModelChange",function(t){return e.invoiceValue=t})("keyup",function(){return e.onInvoiceValueChange()}),o.qZA(),o.TgZ(17,"span",15),o._uU(18," Sats "),o.qZA(),o.TgZ(19,"mat-hint"),o._uU(20),o.qZA(),o.qZA(),o.TgZ(21,"mat-form-field",16),o.TgZ(22,"input",17),o.NdJ("ngModelChange",function(t){return e.expiry=t}),o.qZA(),o.TgZ(23,"span",15),o._uU(24),o.ALo(25,"titlecase"),o.qZA(),o.qZA(),o.TgZ(26,"mat-form-field",18),o.TgZ(27,"mat-select",19),o.NdJ("selectionChange",function(t){return e.onTimeUnitChange(t)}),o.YNc(28,wt,3,4,"mat-option",20),o.qZA(),o.qZA(),o.qZA(),o.YNc(29,vt,3,2,"div",21),o.TgZ(30,"div",22),o.TgZ(31,"button",23),o.NdJ("click",function(){return e.resetData()}),o._uU(32,"Clear Field"),o.qZA(),o.TgZ(33,"button",24),o.NdJ("click",function(){o.CHM(t);const n=o.MAs(10);return e.onAddInvoice(n)}),o._uU(34,"Create Invoice"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}2&t&&(o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",e.description),o.xp6(1),o.Q6J("ngIf",!e.description),o.xp6(3),o.Q6J("ngModel",e.invoiceValue)("step",100)("min",1),o.xp6(4),o.Oqu(e.invoiceValueHint),o.xp6(2),o.Q6J("ngModel",e.expiry)("step",e.selTimeUnit===e.timeUnitEnum.SECS?300:e.selTimeUnit===e.timeUnitEnum.MINS?10:e.selTimeUnit===e.timeUnitEnum.HOURS?2:1)("min",1),o.xp6(2),o.hij(" ",o.lcZ(25,14,e.selTimeUnit)," "),o.xp6(3),o.Q6J("value",e.selTimeUnit),o.xp6(1),o.Q6J("ngForOf",e.timeUnits),o.xp6(1),o.Q6J("ngIf",""!==e.invoiceError))},directives:[l.xw,l.yH,T.dk,l.Wh,v.lW,ht.ZT,T.dn,ft._Y,ft.JL,ft.F,O.KE,xt.Nt,ft.Fj,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,ft.wV,ft.qQ,yt.q,O.R9,O.bx,At.gD,a.sg,O.TO,Ct.ey,A.BN],pipes:[a.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var bt=n(3921),Lt=n(4636),Ft=n(3929);function It(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Description is required."),o.qZA())}function Nt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4,5),o.TgZ(2,"mat-form-field",6),o.TgZ(3,"input",7),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().description=e}),o.qZA(),o.YNc(4,It,2,0,"mat-error",8),o.qZA(),o.TgZ(5,"mat-form-field",9),o.TgZ(6,"input",10,11),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().invoiceValue=e})("keyup",function(){return o.CHM(t),o.oxw().onInvoiceValueChange()}),o.qZA(),o.TgZ(8,"span",12),o._uU(9," Sats "),o.qZA(),o.TgZ(10,"mat-hint"),o._uU(11),o.qZA(),o.qZA(),o.TgZ(12,"div",13),o.TgZ(13,"button",14),o.NdJ("click",function(){return o.CHM(t),o.oxw().resetData()}),o._uU(14,"Clear Field"),o.qZA(),o.TgZ(15,"button",15),o.NdJ("click",function(){o.CHM(t);const e=o.MAs(1);return o.oxw().onAddInvoice(e)}),o._uU(16,"Create Invoice"),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.description),o.xp6(1),o.Q6J("ngIf",!t.description),o.xp6(2),o.Q6J("ngModel",t.invoiceValue)("step",100)("min",1),o.xp6(5),o.Oqu(t.invoiceValueHint)}}function _t(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"button",17),o.NdJ("click",function(){return o.CHM(t),o.oxw().openCreateInvoiceModal()}),o._uU(2,"Create Invoice"),o.qZA(),o.qZA()}}function Dt(t,e){1&t&&o._UZ(0,"mat-progress-bar",47)}function kt(t,e){1&t&&(o.TgZ(0,"th",48),o._uU(1," Date Created "),o.qZA())}const Ot=function(t){return{"mr-0":t}};function Ut(t,e){if(1&t&&o._UZ(0,"span",53),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ot,t.screenSize===t.screenSizeEnum.XS))}}function Rt(t,e){if(1&t&&o._UZ(0,"span",54),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ot,t.screenSize===t.screenSizeEnum.XS))}}function Mt(t,e){if(1&t&&o._UZ(0,"span",55),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ot,t.screenSize===t.screenSizeEnum.XS))}}function Jt(t,e){if(1&t&&(o.TgZ(0,"td",49),o.YNc(1,Ut,1,3,"span",50),o.YNc(2,Rt,1,3,"span",51),o.YNc(3,Mt,1,3,"span",52),o._uU(4),o.ALo(5,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf","received"===t.status),o.xp6(1),o.Q6J("ngIf","unpaid"===t.status),o.xp6(1),o.Q6J("ngIf",!t.status||"expired"===t.status||"unknown"===t.status),o.xp6(1),o.hij(" ",o.xi3(5,4,1e3*t.timestamp,"dd/MMM/YYYY HH:mm")," ")}}function Pt(t,e){1&t&&(o.TgZ(0,"th",48),o._uU(1," Date Settled "),o.qZA())}function Et(t,e){if(1&t&&(o.TgZ(0,"td",49),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(t.receivedAtStr||"-")}}function Yt(t,e){1&t&&(o.TgZ(0,"th",48),o._uU(1," Description "),o.qZA())}const Qt=function(t){return{"max-width":t}};function Bt(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"div",56),o.TgZ(2,"span",57),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Qt,n.screenSize===n.screenSizeEnum.XS?"10rem":"32rem")),o.xp6(2),o.Oqu(t.description)}}function Ht(t,e){1&t&&(o.TgZ(0,"th",58),o._uU(1," Amount (Sats) "),o.qZA())}function zt(t,e){if(1&t&&(o.TgZ(0,"td",59),o.TgZ(1,"span",60),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",t.amount?o.xi3(3,1,t.amount,"1.0-0"):"-","")}}function Vt(t,e){1&t&&(o.TgZ(0,"th",58),o._uU(1," Amount Settled (Sats) "),o.qZA())}function Gt(t,e){if(1&t&&(o.TgZ(0,"td",59),o.TgZ(1,"span",60),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",t.amountSettled?o.xi3(3,1,t.amountSettled,"1.0-0"):"-","")}}function $t(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",61),o.TgZ(1,"div",62),o.TgZ(2,"mat-select",63),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",64),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}const Xt=function(t){return{"px-3":t}};function Wt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",65),o.TgZ(1,"div",66),o.TgZ(2,"mat-select",67),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",64),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).onInvoiceClick(e)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",64),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).onRefreshInvoice(e)}),o._uU(7,"Refresh"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Xt,t.screenSize!==t.screenSizeEnum.XS))}}function Kt(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No invoice available."),o.qZA())}function jt(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting invoices..."),o.qZA())}function te(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.errorMessage)}}function ee(t,e){if(1&t&&(o.TgZ(0,"td",68),o.YNc(1,Kt,2,0,"p",8),o.YNc(2,jt,2,0,"p",8),o.YNc(3,te,2,1,"p",8),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchInvoices.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchInvoices.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchInvoices.status)===t.apiCallStatusEnum.ERROR)}}const ne=function(t){return{"display-none":t}};function ae(t,e){if(1&t&&o._UZ(0,"tr",69),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,ne,(null==t.invoices?null:t.invoices.data)&&(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)>0))}}function ie(t,e){1&t&&o._UZ(0,"tr",70)}function se(t,e){if(1&t&&o._UZ(0,"tr",71),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",t.label===n.newlyAddedInvoiceMemo&&t.value===n.newlyAddedInvoiceValue&&n.flgAnimate?"added":"notAdded")}}const oe=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},le=function(){return["no_invoice"]};function re(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",18),o.TgZ(1,"div",19),o.TgZ(2,"div",20),o._UZ(3,"fa-icon",21),o.TgZ(4,"span",22),o._uU(5,"Invoices History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",23),o.TgZ(7,"input",24),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",25),o.YNc(9,Dt,1,0,"mat-progress-bar",26),o.TgZ(10,"table",27,28),o.ynx(12,29),o.YNc(13,kt,2,0,"th",30),o.YNc(14,Jt,6,7,"td",31),o.BQk(),o.ynx(15,32),o.YNc(16,Pt,2,0,"th",30),o.YNc(17,Et,2,1,"td",31),o.BQk(),o.ynx(18,33),o.YNc(19,Yt,2,0,"th",30),o.YNc(20,Bt,4,4,"td",31),o.BQk(),o.ynx(21,34),o.YNc(22,Ht,2,0,"th",35),o.YNc(23,zt,4,4,"td",36),o.BQk(),o.ynx(24,37),o.YNc(25,Vt,2,0,"th",35),o.YNc(26,Gt,4,4,"td",36),o.BQk(),o.ynx(27,38),o.YNc(28,$t,6,0,"th",39),o.YNc(29,Wt,8,3,"td",40),o.BQk(),o.ynx(30,41),o.YNc(31,ee,4,3,"td",42),o.BQk(),o.YNc(32,ae,1,3,"tr",43),o.YNc(33,ie,1,0,"tr",44),o.YNc(34,se,1,1,"tr",45),o.qZA(),o.qZA(),o._UZ(35,"mat-paginator",46),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("icon",t.faHistory),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchInvoices.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.invoices)("ngClass",o.VKq(11,oe,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(13,le)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let ce=(()=>{class t{constructor(t,e,n,a,i,s){this.logger=t,this.store=e,this.decimalPipe=n,this.commonService=a,this.datePipe=i,this.actions=s,this.calledFrom="transactions",this.faHistory=h.qO$,this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.flgAnimate=!0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoiceJSONArr=[],this.information={},this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===g.cu.SM||this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","amountSettled","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","receivedAt","description","amount","amountSettled","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchInvoices.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchInvoices.message?JSON.stringify(this.apisCallStatus.FetchInvoices.message):this.apisCallStatus.FetchInvoices.message),this.selNode=t.nodeSettings,this.information=t.information,this.invoiceJSONArr=t.invoices&&t.invoices.length>0?t.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.loadInvoicesTable(this.invoiceJSONArr),setTimeout(()=>{this.flgAnimate=!1},5e3),this.logger.info(t)}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.ht||t.type===gt.f)).subscribe(t=>{t.type===gt.ht&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&t.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(t.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch(new Ft.wu({data:{pageSize:this.pageSize,component:qt}}))}onAddInvoice(t){if(!this.description)return!0;const e=this.expiry?this.expiry:3600;this.flgAnimate=!0,this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let n=null;n=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch(new gt.Ks(n)),this.resetData()}onInvoiceClick(t){this.store.dispatch(new Ft.wu({data:{invoice:t,newlyAdded:!1,component:bt.R}}))}onRefreshInvoice(t){this.store.dispatch(new gt.oP(t.paymentHash))}updateInvoicesData(t){this.invoiceJSONArr=this.invoiceJSONArr.map(e=>e.paymentHash===t.paymentHash?t:e)}loadInvoicesTable(t){this.invoices=new pt.by(t?[...t]:[]),this.invoices.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.invoices.sort=this.sort,this.invoices.filterPredicate=(t,e)=>((t.timestamp?this.datePipe.transform(new Date(1e3*t.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.invoices.paginator=this.paginator}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}applyFilter(t){this.invoices.filter=t.value.trim().toLowerCase()}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,g.NT.SATS,g.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,m.R)(this.unSubs[2])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,g.Xz.OTHER)+" "+t.unit},error:t=>{this.invoiceValueHint="Conversion Error: "+t}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(a.JJ),o.Y36(y.v),o.Y36(a.uU),o.Y36(Z.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},inputs:{calledFrom:"calledFrom"},features:[o._Bn([{provide:dt.ye,useValue:(0,g.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","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","column","fxLayoutAlign","start center","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","receivedAt"],["matColumnDef","description"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pr-3",4,"matCellDef"],["matColumnDef","amountSettled"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["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"],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pr-3"],["mat-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,Nt,17,6,"form",1),o.YNc(2,_t,3,0,"div",2),o.YNc(3,re,36,14,"div",3),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf","home"===e.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===e.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===e.calledFrom))},directives:[l.xw,l.yH,l.Wh,a.O5,ft._Y,ft.JL,ft.F,O.KE,xt.Nt,ft.Fj,ft.Q7,ft.JJ,ft.On,ft.wV,ft.qQ,yt.q,O.R9,O.bx,v.lW,O.TO,A.BN,M.$V,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,U.gM,a.PC,S.Zl,At.gD,At.$L,Ct.ey,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.uU,a.JJ],styles:[".mat-column-description[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-description[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[Lt.Q]}}),t})();var ue=n(9056),de=n(4147),me=n(3556);const pe=["paymentReq"];function he(t,e){if(1&t&&(o.TgZ(0,"mat-hint"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.paymentDecodedHint)}}function ge(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function fe(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.paymentDecodedHint)}}function xe(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment amount is required."),o.qZA())}function Ze(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"input",17,18),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().paymentAmount=e})("change",function(e){return o.CHM(t),o.oxw().onAmountChange(e)}),o.qZA(),o.TgZ(3,"mat-hint"),o._uU(4,"It is a zero amount invoice, enter amount to be paid."),o.qZA(),o.YNc(5,xe,2,0,"mat-error",11),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngModel",t.paymentAmount),o.xp6(4),o.Q6J("ngIf",!t.paymentAmount)}}function ye(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.paymentError)}}function Ae(t,e){if(1&t&&(o.TgZ(0,"div",19),o._UZ(1,"fa-icon",20),o.YNc(2,ye,2,1,"span",11),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.paymentError)}}let Ce=(()=>{class t{constructor(t,e,n,a,i,s,o,l){this.dialogRef=t,this.store=e,this.eclEffects=n,this.logger=a,this.commonService=i,this.decimalPipe=s,this.actions=o,this.dataService=l,this.faExclamationTriangle=h.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=g.Vc[0],this.feeLimitTypes=g.Vc,this.paymentError="",this.unSubs=[new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.activeChannels=t.activeChannels,this.logger.info(t)}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.f||t.type===gt.qC)).subscribe(t=>{t.type===gt.qC&&this.dialogRef.close(),t.type===gt.f&&t.payload.status===g.Bn.ERROR&&"SendPayment"===t.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=t.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,ue.q)(1)).subscribe({next:t=>{this.paymentDecoded=t,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.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,g.NT.SATS,g.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,m.R)(this.unSubs[2])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,g.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{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:t=>{this.logger.error(t),this.paymentDecodedHint="ERROR: "+(t.message?t.message:"string"==typeof t?t:JSON.stringify(t)),this.paymentReq.control.setErrors({decodeError:!0})}}))}sendPayment(){this.store.dispatch(new gt.Ar(this.zeroAmtInvoice?{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}:{invoice:this.paymentRequest,fromDialog:!0}))}onPaymentRequestEntry(t){this.paymentRequest=t,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,ue.q)(1)).subscribe({next:t=>{this.paymentDecoded=t,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.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,g.NT.SATS,g.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,m.R)(this.unSubs[3])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,g.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{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:t=>{this.logger.error(t),this.paymentDecodedHint="ERROR: "+(t.message?t.message:"string"==typeof t?t:JSON.stringify(t)),this.paymentReq.control.setErrors({decodeError:!0})}}))}onAmountChange(t){delete this.paymentDecoded.amount,this.paymentDecoded.amount=t}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=g.Vc[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(x.yh),o.Y36(de.o),o.Y36(f.mQ),o.Y36(y.v),o.Y36(a.JJ),o.Y36(Z.eX),o.Y36(me.D))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(t,e){if(1&t&&o.Gf(pe,5),2&t){let t;o.iGM(t=o.CRH())&&(e.paymentReq=t.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","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-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-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(t,e){if(1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Send Payment"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.TgZ(11,"mat-form-field",1),o.TgZ(12,"textarea",9,10),o.NdJ("ngModelChange",function(t){return e.onPaymentRequestEntry(t)})("matTextareaAutosize",function(){return!0}),o.qZA(),o.YNc(14,he,2,1,"mat-hint",11),o.YNc(15,ge,2,0,"mat-error",11),o.YNc(16,fe,2,1,"mat-error",11),o.qZA(),o.YNc(17,Ze,6,2,"mat-form-field",12),o.YNc(18,Ae,3,2,"div",13),o.TgZ(19,"div",14),o.TgZ(20,"button",15),o.NdJ("click",function(){return e.resetData()}),o._uU(21,"Clear Fields"),o.qZA(),o.TgZ(22,"button",16),o.NdJ("click",function(){return e.onSendPayment()}),o._uU(23,"Send Payment"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.MAs(13);o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",e.paymentRequest),o.xp6(2),o.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),o.xp6(1),o.Q6J("ngIf",!e.paymentRequest),o.xp6(1),o.Q6J("ngIf",null==t.errors?null:t.errors.decodeError),o.xp6(1),o.Q6J("ngIf",e.zeroAmtInvoice),o.xp6(1),o.Q6J("ngIf",""!==e.paymentError)}},directives:[l.xw,l.yH,T.dk,l.Wh,v.lW,ht.ZT,T.dn,ft._Y,ft.JL,ft.F,O.KE,xt.Nt,ft.Fj,xt.D7,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,O.bx,O.TO,A.BN],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-payment_hash[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();var Te=n(5001);const we=["scrollContainer"];function Se(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"div",1),o.TgZ(2,"h4",11),o._uU(3,"Description"),o.qZA(),o.TgZ(4,"span",12),o._uU(5),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(5),o.Oqu(t.description)}}function ve(t,e){1&t&&o._UZ(0,"mat-divider",14)}function qe(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-expansion-panel",23),o.NdJ("opened",function(){return o.CHM(t),o.oxw().onExpansionOpen(!0)})("closed",function(){return o.CHM(t),o.oxw().onExpansionOpen(!1)}),o.TgZ(1,"mat-expansion-panel-header"),o.TgZ(2,"mat-panel-title"),o.TgZ(3,"h4",24),o._uU(4),o.qZA(),o.TgZ(5,"h4",25),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",8),o.TgZ(9,"div",9),o.TgZ(10,"div",26),o.TgZ(11,"h4",11),o._uU(12,"Fees (mSats)"),o.qZA(),o.TgZ(13,"span",12),o._uU(14),o.ALo(15,"number"),o.qZA(),o.qZA(),o.TgZ(16,"div",26),o.TgZ(17,"h4",11),o._uU(18,"Date/Time"),o.qZA(),o.TgZ(19,"span",12),o._uU(20),o.ALo(21,"date"),o.qZA(),o.qZA(),o.qZA(),o._UZ(22,"mat-divider",14),o.TgZ(23,"div",9),o.TgZ(24,"div",1),o.TgZ(25,"h4",11),o._uU(26,"ID"),o.qZA(),o.TgZ(27,"span",27),o._uU(28),o.qZA(),o.qZA(),o.qZA(),o._UZ(29,"mat-divider",14),o.TgZ(30,"div",9),o.TgZ(31,"div",1),o.TgZ(32,"h4",11),o._uU(33,"To Channel"),o.qZA(),o.TgZ(34,"span",27),o._uU(35),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=e.index,a=o.oxw();o.Q6J("expanded",a.expansionOpen),o.xp6(4),o.hij("Part ",n+1,""),o.xp6(2),o.hij("",o.lcZ(7,7,t.amount)," (Sats)"),o.xp6(8),o.Oqu(o.lcZ(15,9,t.feesPaid)),o.xp6(6),o.Oqu(o.xi3(21,11,t.timestamp,"dd/MMM/YYYY HH:mm")),o.xp6(8),o.Oqu(t.id),o.xp6(7),o.Oqu(t.toChannelAlias)}}let be=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,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(t){this.expansionOpen=t}onClose(){this.dialogRef.close(!1)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(ht.WI))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(t,e){if(1&t&&o.Gf(we,5),2&t){let t;o.iGM(t=o.CRH())&&(e.scrollContainer=t.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-stroked-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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Payment Information"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return e.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6,7),o.TgZ(10,"div",8),o.TgZ(11,"div",9),o.TgZ(12,"div",10),o.TgZ(13,"h4",11),o._uU(14,"Amount (Sats)"),o.qZA(),o.TgZ(15,"span",12),o._uU(16),o.ALo(17,"number"),o.qZA(),o.qZA(),o.TgZ(18,"div",13),o.TgZ(19,"h4",11),o._uU(20,"Date/Time"),o.qZA(),o.TgZ(21,"span",12),o._uU(22),o.ALo(23,"date"),o.qZA(),o.qZA(),o.qZA(),o._UZ(24,"mat-divider",14),o.TgZ(25,"div",9),o.TgZ(26,"div",1),o.TgZ(27,"h4",11),o._uU(28,"ID"),o.qZA(),o.TgZ(29,"span",12),o._uU(30),o.qZA(),o.qZA(),o.qZA(),o._UZ(31,"mat-divider",14),o.TgZ(32,"div",9),o.TgZ(33,"div",1),o.TgZ(34,"h4",11),o._uU(35,"Payment Hash"),o.qZA(),o.TgZ(36,"span",12),o._uU(37),o.qZA(),o.qZA(),o.qZA(),o._UZ(38,"mat-divider",14),o.TgZ(39,"div",9),o.TgZ(40,"div",1),o.TgZ(41,"h4",11),o._uU(42,"Payment Preimage"),o.qZA(),o.TgZ(43,"span",12),o._uU(44),o.qZA(),o.qZA(),o.qZA(),o._UZ(45,"mat-divider",14),o.TgZ(46,"div",9),o.TgZ(47,"div",1),o.TgZ(48,"h4",11),o._uU(49,"Recipient Node"),o.qZA(),o.TgZ(50,"span",12),o._uU(51),o.qZA(),o.qZA(),o.qZA(),o._UZ(52,"mat-divider",14),o.YNc(53,Se,6,1,"div",15),o.YNc(54,ve,1,0,"mat-divider",16),o.TgZ(55,"div",9),o.TgZ(56,"div",1),o.TgZ(57,"mat-accordion"),o.YNc(58,qe,36,14,"mat-expansion-panel",17),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(59,"div",18),o.TgZ(60,"button",19),o.NdJ("click",function(){return e.onScrollDown()}),o.TgZ(61,"mat-icon",20),o._uU(62,"arrow_downward"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(63,"div",21),o.TgZ(64,"button",22),o._uU(65,"OK"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(16),o.Oqu(o.lcZ(17,10,e.payment.recipientAmount)),o.xp6(6),o.Oqu(o.xi3(23,12,e.payment.firstPartTimestamp,"dd/MMM/YYYY HH:mm")),o.xp6(8),o.Oqu(e.payment.id),o.xp6(7),o.Oqu(e.payment.paymentHash),o.xp6(7),o.Oqu(e.payment.paymentPreimage),o.xp6(7),o.Oqu(e.payment.recipientNodeAlias),o.xp6(2),o.Q6J("ngIf",e.description),o.xp6(1),o.Q6J("ngIf",e.description),o.xp6(4),o.Q6J("ngForOf",e.payment.parts),o.xp6(6),o.Q6J("mat-dialog-close",!1))},directives:[l.xw,l.Wh,l.yH,T.dk,v.lW,T.dn,M.$V,R.d,a.O5,Te.pp,a.sg,q.Hw,ht.ZT,Te.ib,Te.yz,Te.yK],pipes:[a.JJ,a.uU],styles:[""]}),t})();var Le=n(8914);const Fe=["sendPaymentForm"];function Ie(t,e){if(1&t&&(o.TgZ(0,"mat-hint"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.paymentDecodedHint)}}function Ne(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function _e(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4,5),o.TgZ(2,"mat-form-field",6),o.TgZ(3,"textarea",7,8),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().onPaymentRequestEntry(e)})("matTextareaAutosize",function(){return!0}),o.qZA(),o.YNc(5,Ie,2,1,"mat-hint",9),o.YNc(6,Ne,2,0,"mat-error",9),o.qZA(),o.TgZ(7,"div",10),o.TgZ(8,"button",11),o.NdJ("click",function(){return o.CHM(t),o.oxw().resetData()}),o._uU(9,"Clear Field"),o.qZA(),o.TgZ(10,"button",12),o.NdJ("click",function(){return o.CHM(t),o.oxw().onSendPayment()}),o._uU(11,"Send Payment"),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.paymentRequest),o.xp6(2),o.Q6J("ngIf",t.paymentRequest&&""!==t.paymentDecodedHint),o.xp6(1),o.Q6J("ngIf",!t.paymentRequest)}}function De(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",13),o.TgZ(1,"button",12),o.NdJ("click",function(){return o.CHM(t),o.oxw().openSendPaymentModal()}),o._uU(2,"Send Payment"),o.qZA(),o.qZA()}}function ke(t,e){1&t&&o._UZ(0,"mat-progress-bar",48)}function Oe(t,e){1&t&&(o.TgZ(0,"th",49),o._uU(1,"Date/Time"),o.qZA())}function Ue(t,e){if(1&t&&(o.TgZ(0,"td",50),o._uU(1),o.ALo(2,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(o.xi3(2,1,null==t?null:t.firstPartTimestamp,"dd/MMM/YYYY HH:mm"))}}function Re(t,e){1&t&&(o.TgZ(0,"th",49),o._uU(1,"ID"),o.qZA())}const Me=function(t){return{"max-width":t}};function Je(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"div",51),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(t.id)}}function Pe(t,e){1&t&&(o.TgZ(0,"th",49),o._uU(1,"Destination"),o.qZA())}function Ee(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"div",51),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(t.recipientNodeAlias)}}function Ye(t,e){1&t&&(o.TgZ(0,"th",53),o._uU(1,"Amount (Sats)"),o.qZA())}function Qe(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"span",54),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,null==t?null:t.recipientAmount))}}function Be(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",55),o.TgZ(1,"div",56),o.TgZ(2,"mat-select",57),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",58),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function He(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",59),o.TgZ(1,"button",60),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).onPaymentClick(e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function ze(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No payment available."),o.qZA())}function Ve(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting payments..."),o.qZA())}function Ge(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.errorMessage)}}function $e(t,e){if(1&t&&(o.TgZ(0,"td",61),o.YNc(1,ze,2,0,"p",9),o.YNc(2,Ve,2,0,"p",9),o.YNc(3,Ge,2,1,"p",9),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.ERROR)}}function Xe(t,e){if(1&t&&(o.TgZ(0,"span",64),o._uU(1),o.ALo(2,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,t.timestamp,"dd/MMM/YYYY HH:mm")," ")}}function We(t,e){if(1&t&&(o.ynx(0),o.YNc(1,Xe,3,4,"span",63),o.BQk()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.parts)}}function Ke(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"span",62),o._uU(2),o.qZA(),o.YNc(3,We,2,1,"ng-container",9),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" Total Attempts: ",null==t||null==t.parts?null:t.parts.length," "),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function je(t,e){if(1&t&&(o.TgZ(0,"span",62),o.TgZ(1,"span",65),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(4);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(t.id)}}function tn(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,je,4,4,"span",66),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.parts)}}function en(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"div",65),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.YNc(4,tn,2,1,"span",9),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(3,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(t.id),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function nn(t,e){if(1&t&&(o.TgZ(0,"span",62),o.TgZ(1,"span",65),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(4);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(t.toChannelAlias)}}function an(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,nn,4,4,"span",66),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.parts)}}function sn(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"div",65),o.TgZ(2,"span",52),o._uU(3),o.qZA(),o.qZA(),o.YNc(4,an,2,1,"span",9),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(3,Me,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(null==t?null:t.recipientNodeAlias),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function on(t,e){if(1&t&&(o.TgZ(0,"span",67),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,t.amount,"1.0-0")," ")}}function ln(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,on,3,4,"span",68),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.parts)}}function rn(t,e){if(1&t&&(o.TgZ(0,"td",50),o.TgZ(1,"span",67),o._uU(2),o.ALo(3,"number"),o.qZA(),o.YNc(4,ln,2,1,"span",9),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.xi3(3,2,null==t?null:t.recipientAmount,"1.0-0")),o.xp6(2),o.Q6J("ngIf",t.is_expanded)}}function cn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",70),o.TgZ(1,"button",73),o.NdJ("click",function(){const e=o.CHM(t).$implicit,n=o.oxw(2).$implicit;return o.oxw(2).onPartClick(e,n)}),o._uU(2),o.qZA(),o.qZA()}if(2&t){const t=e.index;o.xp6(2),o.hij("View ",t+1,"")}}function un(t,e){if(1&t&&(o.TgZ(0,"div"),o.YNc(1,cn,3,1,"div",72),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.parts)}}function dn(t,e){if(1&t&&(o.TgZ(0,"td",69),o.TgZ(1,"span",70),o.TgZ(2,"button",71),o.NdJ("click",function(){const t=e.$implicit;return t.is_expanded=!t.is_expanded}),o._uU(3),o.qZA(),o.qZA(),o.YNc(4,un,2,1,"div",9),o.qZA()),2&t){const t=e.$implicit;o.xp6(3),o.Oqu(t.is_expanded?"Hide":"Show"),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function mn(t,e){if(1&t&&o._UZ(0,"tr",74),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",t.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const pn=function(t){return{"display-none":t}};function hn(t,e){if(1&t&&o._UZ(0,"tr",75),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,pn,(null==t.payments?null:t.payments.data)&&(null==t.payments||null==t.payments.data?null:t.payments.data.length)>0))}}function gn(t,e){1&t&&o._UZ(0,"tr",76)}function fn(t,e){if(1&t&&o._UZ(0,"tr",74),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",t.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const xn=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Zn=function(){return["no_payment"]};function yn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",14),o.TgZ(1,"div",15),o.TgZ(2,"div",16),o._UZ(3,"fa-icon",17),o.TgZ(4,"span",18),o._uU(5,"Payments History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",19),o.TgZ(7,"input",20),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",21),o.YNc(9,ke,1,0,"mat-progress-bar",22),o.TgZ(10,"table",23,24),o.ynx(12,25),o.YNc(13,Oe,2,0,"th",26),o.YNc(14,Ue,3,4,"td",27),o.BQk(),o.ynx(15,28),o.YNc(16,Re,2,0,"th",26),o.YNc(17,Je,4,4,"td",27),o.BQk(),o.ynx(18,29),o.YNc(19,Pe,2,0,"th",26),o.YNc(20,Ee,4,4,"td",27),o.BQk(),o.ynx(21,30),o.YNc(22,Ye,2,0,"th",31),o.YNc(23,Qe,4,3,"td",27),o.BQk(),o.ynx(24,32),o.YNc(25,Be,6,0,"th",33),o.YNc(26,He,3,0,"td",34),o.BQk(),o.ynx(27,35),o.YNc(28,$e,4,3,"td",36),o.BQk(),o.ynx(29,37),o.YNc(30,Ke,4,2,"td",27),o.BQk(),o.ynx(31,38),o.YNc(32,en,5,5,"td",27),o.BQk(),o.ynx(33,39),o.YNc(34,sn,5,5,"td",27),o.BQk(),o.ynx(35,40),o.YNc(36,rn,5,5,"td",27),o.BQk(),o.ynx(37,41),o.YNc(38,dn,5,2,"td",42),o.BQk(),o.YNc(39,mn,1,1,"tr",43),o.YNc(40,hn,1,3,"tr",44),o.YNc(41,gn,1,0,"tr",45),o.YNc(42,fn,1,1,"tr",46),o.qZA(),o.qZA(),o._UZ(43,"mat-paginator",47),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("icon",t.faHistory),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.payments)("ngClass",o.VKq(13,xn,""!==t.errorMessage)),o.xp6(29),o.Q6J("matRowDefColumns",t.partColumns)("matRowDefWhen",t.is_group),o.xp6(1),o.Q6J("matFooterRowDef",o.DdM(15,Zn)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let An=(()=>{class t{constructor(t,e,n,a,i,s,o){this.logger=t,this.commonService=e,this.store=n,this.rtlEffects=a,this.decimalPipe=i,this.dataService=s,this.datePipe=o,this.calledFrom="transactions",this.faHistory=h.qO$,this.newlyAddedPayment="",this.flgAnimate=!0,this.selNode={},this.information={},this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","actions"],this.partColumns=["groupTotal","groupAction"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","recipientAmount","actions"],this.partColumns=["groupTotal","groupAmount","groupAction"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","id","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupAmount","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["firstPartTimestamp","id","recipientNodeAlias","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupChannelAlias","groupAmount","groupAction"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPayments.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPayments.message?JSON.stringify(this.apisCallStatus.FetchPayments.message):this.apisCallStatus.FetchPayments.message),this.information=t.information,this.selNode=t.nodeSettings,t.payments.sent&&t.payments.sent.map(e=>{const n=t.peers.find(t=>t.nodeId===e.recipientNodeId);return e.recipientNodeAlias=n?n.alias:e.recipientNodeId,e.parts&&e.parts.map(n=>{const a=t.activeChannels.find(t=>t.channelId===n.toChannelId);return n.toChannelAlias=a?a.alias:n.toChannelId,e.parts}),t.payments.sent}),this.paymentJSONArr=t.payments&&t.payments.sent&&t.payments.sent.length>0?t.payments.sent:[],this.loadPaymentsTable(this.paymentJSONArr),setTimeout(()=>{this.flgAnimate=!1},3e3),this.logger.info(t)})}ngAfterViewInit(){this.loadPaymentsTable(this.paymentJSONArr)}loadPaymentsTable(t){this.payments=new pt.by(t?[...t]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(t,e)=>{switch(e){case"firstPartTimestamp":return this.commonService.sortByKey(t.parts,"timestamp","number",this.sort.direction),t.firstPartTimestamp;case"id":return this.commonService.sortByKey(t.parts,"id","string",this.sort.direction),t.id;case"recipientNodeAlias":return this.commonService.sortByKey(t.parts,"toChannelAlias","string",this.sort.direction),t.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(t.parts,"amount","number",this.sort.direction),t.recipientAmount;default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},this.payments.filterPredicate=(t,e)=>((t.firstPartTimestamp?this.datePipe.transform(new Date(t.firstPartTimestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.payments.paginator=this.paginator}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,ue.q)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){this.flgAnimate=!0,this.newlyAddedPayment=this.paymentDecoded.paymentHash,this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch(new Ft.b_({data:{type:g.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:g.Gi.DATE_TIME},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:g.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:g.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe((0,ue.q)(1)).subscribe(t=>{t&&(this.store.dispatch(new gt.Ar({invoice:this.paymentRequest,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new Ft.b_({data:{type:g.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:g.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:g.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:g.Gi.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe((0,ue.q)(1)).subscribe(t=>{t&&(this.paymentDecoded.amount=t[0].inputValue,this.store.dispatch(new gt.Ar({invoice:this.paymentRequest,amountMsat:1e3*t[0].inputValue,fromDialog:!1})),this.resetData())}))}onPaymentRequestEntry(t){this.paymentRequest=t,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,ue.q)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.amount?this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,g.NT.SATS,g.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,m.R)(this.unSubs[1])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,g.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{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(new Ft.wu({data:{component:Ce}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(t,e){return e.parts&&e.parts.length>1}onPaymentClick(t){t.paymentHash&&""!==t.paymentHash.trim()?this.dataService.decodePayments(t.paymentHash).pipe((0,ue.q)(1)).subscribe({next:e=>{this.showPaymentView(t,e.length&&e.length>0?e[0]:[])},error:e=>{this.showPaymentView(t,[])}}):this.showPaymentView(t,[])}showPaymentView(t,e){this.store.dispatch(new Ft.wu({data:{sentPaymentInfo:e,payment:t,component:be}}))}onPartClick(t,e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe((0,ue.q)(1)).subscribe({next:n=>{this.showPartView(t,e,n)},error:n=>{this.showPartView(t,e,[])}}):this.showPartView(t,e,[])}showPartView(t,e,n){const a=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:g.Gi.STRING}],[{key:"paymentPreimage",value:e.paymentPreimage,title:"Payment Preimage",width:100,type:g.Gi.STRING}],[{key:"toChannelId",value:t.toChannelId,title:"Channel",width:100,type:g.Gi.STRING}],[{key:"id",value:t.id,title:"Part ID",width:50,type:g.Gi.STRING},{key:"timestamp",value:t.timestamp,title:"Time",width:50,type:g.Gi.DATE_TIME}],[{key:"amount",value:t.amount,title:"Amount (Sats)",width:50,type:g.Gi.NUMBER},{key:"feesPaid",value:t.feesPaid,title:"Fee (Sats)",width:50,type:g.Gi.NUMBER}]];n.length>0&&n[0].paymentRequest&&n[0].paymentRequest.description&&""!==n[0].paymentRequest.description&&a.splice(3,0,[{key:"description",value:n[0].paymentRequest.description,title:"Description",width:100,type:g.Gi.STRING}]),this.store.dispatch(new Ft.wu({data:{type:g.n_.INFORMATION,alertTitle:"Payment Part Information",message:a}}))}applyFilter(t){this.payments.filter=t.value.trim().toLowerCase()}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const t=JSON.parse(JSON.stringify(this.payments.data)),e=t.reduce((t,e)=>(e.paymentHash&&""!==e.paymentHash.trim()&&(t=""===t?e.paymentHash:t+","+e.paymentHash),t),"");this.dataService.decodePayments(e).pipe((0,m.R)(this.unSubs[2])).subscribe(e=>{e.forEach((e,n)=>{e.length>0&&e[0].paymentRequest&&e[0].paymentRequest.description&&""!==e[0].paymentRequest.description&&(t[n].description=e[0].paymentRequest.description)});const n=t.reduce((t,e)=>t.concat(e),[]);this.commonService.downloadFile(n,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh),o.Y36(Le.V),o.Y36(a.JJ),o.Y36(me.D),o.Y36(a.uU))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Fe,5),o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first),o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},inputs:{calledFrom:"calledFrom"},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","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","100"],["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","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeAlias"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","groupTotal"],["matColumnDef","groupId"],["matColumnDef","groupChannelAlias"],["matColumnDef","groupAmount"],["matColumnDef","groupAction"],["mat-cell","","class","px-3",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["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","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"part-row-span","pl-3"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-3"],["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(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,_e,12,3,"form",1),o.YNc(2,De,3,0,"div",2),o.YNc(3,yn,44,16,"div",3),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf","home"===e.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===e.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===e.calledFrom))},directives:[l.xw,l.yH,l.Wh,a.O5,ft._Y,ft.JL,ft.F,O.KE,xt.Nt,ft.Fj,xt.D7,ft.Q7,M.$V,ft.JJ,ft.On,v.lW,O.bx,O.TO,A.BN,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.nj,pt.Ke,pt.as,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,At.gD,At.$L,Ct.ey,pt.yh,a.sg,pt.Gk,pt.Q2,pt.XQ],pipes:[a.uU,a.JJ],styles:[".mat-column-groupChannelAlias[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%], .mat-column-id[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%]{padding:0 1rem;flex:0 0 25%;width:25%}.mat-column-groupChannelAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-id[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%], .mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:15rem}"],data:{animation:[Lt.Q]}}),t})();function Cn(t,e){if(1&t&&(o.TgZ(0,"button",26),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA()),2&t){o.oxw();const t=o.MAs(11);o.Q6J("matMenuTriggerFor",t)}}function Tn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw(3).onNavigateTo("/ecl/reports")}),o._uU(1,"Fees Summary"),o.qZA()}}function wn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw(3).onsortChannelsBy()}),o._uU(1),o.qZA()}if(2&t){const t=o.oxw(3);o.xp6(1),o.hij("Sort By ","Balance Score"===t.sortField?"Capacity":"Balance Score","")}}function Sn(t,e){1&t&&o._UZ(0,"mat-progress-bar",27)}function vn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-node-info",28),2&t){const t=o.oxw(3);o.Q6J("information",t.information)("showColorFieldSeparately",!1)}}function qn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-balances-info",29),2&t){const t=o.oxw(3);o.Q6J("balances",t.balances)("errorMessage",t.errorMessages[2]+" "+t.errorMessages[3])}}function bn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-channel-capacity-info",30),2&t){const t=o.oxw(3);o.Q6J("sortBy",t.sortField)("channelBalances",t.channelBalances)("allChannels",t.allChannelsCapacity)("errorMessage",t.errorMessages[2])}}function Ln(t,e){if(1&t&&o._UZ(0,"rtl-ecl-fee-info",31),2&t){const t=o.oxw(3);o.Q6J("fees",t.fees)("errorMessage",t.errorMessages[1])}}function Fn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-channel-status-info",32),2&t){const t=o.oxw(3);o.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[2])}}function In(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const Nn=function(t){return{"dashboard-card-content":!0,"error-border":t}};function _n(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-grid-tile",8),o.TgZ(1,"mat-card",9),o.TgZ(2,"mat-card-header"),o.TgZ(3,"mat-card-title",10),o.TgZ(4,"div"),o._UZ(5,"fa-icon",11),o.TgZ(6,"span"),o._uU(7),o.qZA(),o.qZA(),o.TgZ(8,"div"),o.YNc(9,Cn,3,1,"button",12),o.TgZ(10,"mat-menu",13,14),o.TgZ(12,"button",15),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).onNavigateTo(e.link)}),o._uU(13),o.qZA(),o.YNc(14,Tn,2,0,"button",16),o.YNc(15,wn,2,1,"button",16),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"mat-card-content",17),o.YNc(17,Sn,1,0,"mat-progress-bar",18),o.TgZ(18,"div",19),o.YNc(19,vn,1,2,"rtl-ecl-node-info",20),o.YNc(20,qn,1,2,"rtl-ecl-balances-info",21),o.YNc(21,bn,1,4,"rtl-ecl-channel-capacity-info",22),o.YNc(22,Ln,1,2,"rtl-ecl-fee-info",23),o.YNc(23,Fn,1,2,"rtl-ecl-channel-status-info",24),o.YNc(24,In,2,0,"h3",25),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("colspan",t.cols)("rowspan",t.rows),o.xp6(5),o.Q6J("icon",t.icon),o.xp6(2),o.Oqu(t.title),o.xp6(2),o.Q6J("ngIf",t.link),o.xp6(4),o.hij("Go To ",t.goTo,""),o.xp6(1),o.Q6J("ngIf","fee"===t.id),o.xp6(1),o.Q6J("ngIf","capacity"===t.id),o.xp6(1),o.s9C("fxFlex","capacity"===t.id?90:70),o.Q6J("ngClass",o.VKq(17,Nn,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchOnchainBalance.status)===n.apiCallStatusEnum.ERROR)||("capacity"===t.id||"status"===t.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||"fee"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchOnchainBalance.status)===n.apiCallStatusEnum.INITIATED)||("capacity"===t.id||"status"===t.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||"fee"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngSwitch",t.id),o.xp6(1),o.Q6J("ngSwitchCase","node"),o.xp6(1),o.Q6J("ngSwitchCase","balance"),o.xp6(1),o.Q6J("ngSwitchCase","capacity"),o.xp6(1),o.Q6J("ngSwitchCase","fee"),o.xp6(1),o.Q6J("ngSwitchCase","status")}}function Dn(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o._UZ(2,"fa-icon",4),o.TgZ(3,"span",5),o._uU(4),o.qZA(),o.qZA(),o.TgZ(5,"mat-grid-list",6),o.YNc(6,_n,25,19,"mat-grid-tile",7),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("icon",(null==t.apisCallStatus?null:t.apisCallStatus.FetchInfo.status)===t.apiCallStatusEnum.ERROR?t.faFrown:t.faSmile),o.xp6(2),o.Oqu((null==t.apisCallStatus?null:t.apisCallStatus.FetchInfo.status)===t.apiCallStatusEnum.COMPLETED?"Welcome "+t.information.alias+"! Your node is up and running.":(null==t.apisCallStatus?null:t.apisCallStatus.FetchInfo.status)===t.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),o.xp6(1),o.Q6J("rowHeight",t.operatorCardHeight),o.xp6(1),o.Q6J("ngForOf",t.operatorCards)}}function kn(t,e){if(1&t&&(o.TgZ(0,"button",26),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA()),2&t){o.oxw();const t=o.MAs(9);o.Q6J("matMenuTriggerFor",t)}}function On(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-card-header"),o.TgZ(1,"mat-card-title",10),o.TgZ(2,"div"),o._UZ(3,"fa-icon",11),o.TgZ(4,"span"),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"div"),o.YNc(7,kn,3,1,"button",12),o.TgZ(8,"mat-menu",13,41),o.TgZ(10,"button",15),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).onNavigateTo(e.link)}),o._uU(11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().$implicit;o.xp6(3),o.Q6J("icon",t.icon),o.xp6(2),o.Oqu(t.title),o.xp6(2),o.Q6J("ngIf",t.link),o.xp6(4),o.hij("Go To ",t.goTo,"")}}function Un(t,e){1&t&&o._UZ(0,"mat-progress-bar",27)}function Rn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-node-info",42),2&t){const t=o.oxw(3);o.Q6J("information",t.information)}}function Mn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-balances-info",29),2&t){const t=o.oxw(3);o.Q6J("balances",t.balances)("errorMessage",t.errorMessages[2]+" "+t.errorMessages[3])}}function Jn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-channel-liquidity-info",43),2&t){const t=o.oxw(3);o.Q6J("direction","In")("totalLiquidity",t.totalInboundLiquidity)("allChannels",t.allInboundChannels)("errorMessage",t.errorMessages[2])}}function Pn(t,e){if(1&t&&o._UZ(0,"rtl-ecl-channel-liquidity-info",43),2&t){const t=o.oxw(3);o.Q6J("direction","Out")("totalLiquidity",t.totalOutboundLiquidity)("allChannels",t.allOutboundChannels)("errorMessage",t.errorMessages[2])}}function En(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",52),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA(),o.TgZ(3,"mat-menu",13,53),o.TgZ(5,"button",15),o.NdJ("click",function(){o.CHM(t);const e=o.oxw(2).$implicit;return o.oxw(2).onNavigateTo(e.link)}),o._uU(6),o.qZA(),o.TgZ(7,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw(4).onNavigateTo("/ecl/reports/transactions")}),o._uU(8,"Transactions Summary"),o.qZA(),o.qZA()}if(2&t){const t=o.MAs(4),e=o.oxw(2).$implicit;o.Q6J("matMenuTriggerFor",t),o.xp6(6),o.hij("Go To ",e.goTo,"")}}function Yn(t,e){1&t&&(o.TgZ(0,"span",44),o.TgZ(1,"mat-tab-group",45),o.TgZ(2,"mat-tab",46),o._UZ(3,"rtl-ecl-lightning-invoices",47),o.qZA(),o.TgZ(4,"mat-tab",48),o._UZ(5,"rtl-ecl-lightning-payments",49),o.qZA(),o.TgZ(6,"mat-tab",50),o.YNc(7,En,9,2,"ng-template",51),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("calledFrom","home"),o.xp6(2),o.Q6J("calledFrom","home"),o.xp6(1),o.Q6J("disabled",!0))}function Qn(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const Bn=function(t){return{"p-0":t}};function Hn(t,e){if(1&t&&(o.TgZ(0,"mat-grid-tile",8),o.TgZ(1,"mat-card",35),o.YNc(2,On,12,4,"mat-card-header",36),o.TgZ(3,"mat-card-content",37),o.YNc(4,Un,1,0,"mat-progress-bar",18),o.TgZ(5,"div",19),o.YNc(6,Rn,1,1,"rtl-ecl-node-info",38),o.YNc(7,Mn,1,2,"rtl-ecl-balances-info",21),o.YNc(8,Jn,1,4,"rtl-ecl-channel-liquidity-info",39),o.YNc(9,Pn,1,4,"rtl-ecl-channel-liquidity-info",39),o.YNc(10,Yn,8,3,"span",40),o.YNc(11,Qn,2,0,"h3",25),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("colspan",t.cols)("rowspan",t.rows),o.xp6(1),o.Q6J("ngClass",o.VKq(13,Bn,"transactions"===t.id)),o.xp6(1),o.Q6J("ngIf","transactions"!==t.id),o.xp6(1),o.s9C("fxFlex","transactions"===t.id?100:"balance"===t.id?70:90),o.Q6J("ngClass",o.VKq(15,Nn,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchOnchainBalance.status)===n.apiCallStatusEnum.ERROR)||("inboundLiq"===t.id||"outboundLiq"===t.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchOnchainBalance.status)===n.apiCallStatusEnum.INITIATED)||("inboundLiq"===t.id||"outboundLiq"===t.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngSwitch",t.id),o.xp6(1),o.Q6J("ngSwitchCase","node"),o.xp6(1),o.Q6J("ngSwitchCase","balance"),o.xp6(1),o.Q6J("ngSwitchCase","inboundLiq"),o.xp6(1),o.Q6J("ngSwitchCase","outboundLiq"),o.xp6(1),o.Q6J("ngSwitchCase","transactions")}}function zn(t,e){if(1&t&&(o.TgZ(0,"div",33),o._UZ(1,"fa-icon",4),o.TgZ(2,"span",5),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"mat-grid-list",34),o.YNc(5,Hn,12,17,"mat-grid-tile",7),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faSmile),o.xp6(2),o.hij("Welcome ",t.information.alias,"! Your node is up and running."),o.xp6(1),o.Q6J("rowHeight",t.merchantCardHeight),o.xp6(1),o.Q6J("ngForOf",t.merchantCards)}}let Vn=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.actions=n,this.commonService=a,this.router=i,this.faSmile=p.I3,this.faFrown=p.Kf,this.faAngleDoubleDown=h.Sbq,this.faAngleDoubleUp=h.Vfw,this.faChartPie=h.OS1,this.faBolt=h.BDt,this.faServer=h.xf3,this.faNetworkWired=h.kXW,this.userPersonaEnum=g.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="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:6,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===g.cu.SM||this.screenSize===g.cu.MD?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCardHeight=(window.screen.height-200)/2+"px",this.merchantCardHeight=(window.screen.height-210)/10+"px",this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:2,rows:5}])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.errorMessages=["","","",""],this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchInfo.status===g.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apisCallStatus.FetchInfo.message?JSON.stringify(this.apisCallStatus.FetchInfo.message):this.apisCallStatus.FetchInfo.message),t.apisCallStatus.FetchFees.status===g.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apisCallStatus.FetchFees.message?JSON.stringify(this.apisCallStatus.FetchFees.message):this.apisCallStatus.FetchFees.message),t.apisCallStatus.FetchChannels.status===g.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),t.apisCallStatus.FetchOnchainBalance.status===g.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apisCallStatus.FetchOnchainBalance.message?JSON.stringify(this.apisCallStatus.FetchOnchainBalance.message):this.apisCallStatus.FetchOnchainBalance.message),this.selNode=t.nodeSettings,this.information=t.information,this.fees=t.fees,this.channels=t.activeChannels,this.onchainBalance=t.onchainBalance,this.balances.onchain=this.onchainBalance.total,this.balances.lightning=t.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const e=t.lightningBalance.localBalance?+t.lightningBalance.localBalance:0,n=t.lightningBalance.remoteBalance?+t.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:e,remoteBalance:n,balancedness:+(1-Math.abs((e-n)/(e+n))).toFixed(3)},this.channelsStatus=t.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(t=>t.toRemote>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels.filter(t=>t.toLocal>0),"toLocal"))),this.channels.forEach(t=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(t.toRemote),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(t.toLocal)}),this.logger.info(t)})}onNavigateTo(t){this.router.navigateByUrl(t)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort((t,e)=>{const n=+t.toLocal+ +t.toRemote,a=+e.toLocal+ +e.toRemote;return n>a?-1:n<a?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(Z.eX),o.Y36(y.v),o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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-0"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10",3,"rowHeight"],[3,"colspan","rowspan",4,"ngFor","ngForOf"],[3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4"],["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"],["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"],["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-0"],["cols","6",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4",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",""],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",2,"max-width","20px",3,"matMenuTriggerFor"],["menuTransactions","matMenu"]],template:function(t,e){if(1&t&&(o.YNc(0,Dn,7,4,"div",0),o.YNc(1,zn,6,4,"ng-template",null,1,o.W1O)),2&t){const t=o.MAs(2);o.Q6J("ngIf",e.selNode.userPersona===e.userPersonaEnum.OPERATOR)("ngIfElse",t)}},directives:[a.O5,l.xw,l.Wh,A.BN,C.Il,a.sg,C.DX,T.a8,l.yH,T.dk,T.n5,w.VK,w.OP,T.dn,a.mk,S.oO,a.RF,a.n9,a.ED,v.lW,w.p6,q.Hw,r.pW,N,k,B,V,X,rt,ct.SP,ct.uX,ce,An,ct.uD],styles:[""]}),t})();const Gn=["form"];function $n(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Bitcoin address is required."),o.qZA())}function Xn(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.amountError)}}function Wn(t,e){if(1&t&&(o.TgZ(0,"mat-option",29),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.Oqu(t)}}function Kn(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Target Confirmation Blocks is required."),o.qZA())}function jn(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.sendFundError)}}function ta(t,e){if(1&t&&(o.TgZ(0,"div",30),o._UZ(1,"fa-icon",31),o.YNc(2,jn,2,1,"span",12),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.sendFundError)}}let ea=(()=>{class t{constructor(t,e,n,a,i,s){this.dialogRef=t,this.logger=e,this.store=n,this.commonService=a,this.decimalPipe=i,this.actions=s,this.faExclamationTriangle=h.eHv,this.selNode={},this.addressTypes=[],this.selectedAddress=g._t[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=g.uA,this.selAmountUnit=g.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=g.Xz,this.amountError="Amount is Required.",this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.store.select("root").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.fiatConversion=t.selNode.settings.fiatConversion,this.amountUnits=t.selNode.settings.currencyUnits,this.appConfig=t.appConfig,this.nodeData=t.nodeData,this.logger.info(t)}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.f||t.type===gt.wL)).subscribe(t=>{t.type===gt.wL&&(this.store.dispatch(new Ft.Lw("Fund Sent Successfully!")),this.dialogRef.close()),t.type===gt.f&&t.payload.status===g.Bn.ERROR&&"SendOnchainFunds"===t.payload.action&&(this.sendFundError=t.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.transaction.amount&&this.selAmountUnit!==g.NT.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?g.NT.OTHER:this.selAmountUnit,g.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,m.R)(this.unSubs[2])).subscribe({next:t=>{this.transaction.amount=parseInt(t[g.NT.SATS]),this.selAmountUnit=g.NT.SATS,this.store.dispatch(new gt.J6(this.transaction))},error:t=>{this.transaction.amount=null,this.selAmountUnit=g.NT.SATS,this.amountError="Conversion Error: "+t}}):this.store.dispatch(new gt.J6(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(t){const e=this,n=this.selAmountUnit===this.amountUnits[2]?g.NT.OTHER:this.selAmountUnit;let a=t.value===this.amountUnits[2]?g.NT.OTHER:t.value;this.transaction.amount&&this.selAmountUnit!==t.value&&this.commonService.convertCurrency(this.transaction.amount,n,a,this.amountUnits[2],this.fiatConversion).pipe((0,m.R)(this.unSubs[3])).subscribe({next:n=>{this.selAmountUnit=t.value,e.transaction.amount=+e.decimalPipe.transform(n[a],e.currencyUnitFormats[a]).replace(/,/g,"")},error:t=>{e.transaction.amount=null,this.amountError="Conversion Error: "+t,this.selAmountUnit=n,a=n}})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(f.mQ),o.Y36(x.yh),o.Y36(y.v),o.Y36(a.JJ),o.Y36(Z.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(t,e){if(1&t&&o.Gf(Gn,7),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-flat-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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Send Payment"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.NdJ("submit",function(){return e.onSendFunds()})("reset",function(){return e.resetData()}),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10,11),o.NdJ("ngModelChange",function(t){return e.transaction.address=t}),o.qZA(),o.YNc(14,$n,2,0,"mat-error",12),o.qZA(),o.TgZ(15,"mat-form-field",13),o.TgZ(16,"input",14,15),o.NdJ("ngModelChange",function(t){return e.transaction.amount=t}),o.qZA(),o.TgZ(18,"span",16),o._uU(19),o.qZA(),o.YNc(20,Xn,2,1,"mat-error",12),o.qZA(),o.TgZ(21,"mat-form-field",17),o.TgZ(22,"mat-select",18),o.NdJ("selectionChange",function(t){return e.onAmountUnitChange(t)}),o.YNc(23,Wn,2,2,"mat-option",19),o.qZA(),o.qZA(),o.TgZ(24,"div",20),o.TgZ(25,"mat-form-field",21),o.TgZ(26,"input",22,23),o.NdJ("ngModelChange",function(t){return e.transaction.blocks=t}),o.qZA(),o.YNc(28,Kn,2,0,"mat-error",12),o.qZA(),o.qZA(),o._UZ(29,"div",24),o.YNc(30,ta,3,2,"div",25),o.TgZ(31,"div",26),o.TgZ(32,"button",27),o._uU(33,"Clear Fields"),o.qZA(),o.TgZ(34,"button",28),o._uU(35,"Send Funds"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",e.transaction.address),o.xp6(2),o.Q6J("ngIf",!e.transaction.address),o.xp6(2),o.Q6J("ngModel",e.transaction.amount)("step",100)("min",0),o.xp6(3),o.hij(" ",e.selAmountUnit," "),o.xp6(1),o.Q6J("ngIf",!e.transaction.amount),o.xp6(2),o.Q6J("value",e.selAmountUnit),o.xp6(1),o.Q6J("ngForOf",e.amountUnits),o.xp6(3),o.Q6J("ngModel",e.transaction.blocks)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.transaction.blocks),o.xp6(2),o.Q6J("ngIf",""!==e.sendFundError))},directives:[l.xw,l.yH,T.dk,l.Wh,v.lW,ht.ZT,T.dn,ft._Y,ft.JL,ft.F,O.KE,xt.Nt,ft.Fj,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,ft.wV,ft.qQ,yt.q,O.R9,At.gD,a.sg,O.TO,Ct.ey,A.BN],styles:[""]}),t})();var na=n(882);function aa(t,e){1&t&&o._UZ(0,"mat-progress-bar",31)}function ia(t,e){1&t&&(o.TgZ(0,"th",32),o._uU(1," Date/Time "),o.qZA())}function sa(t,e){if(1&t&&(o.TgZ(0,"td",33),o._uU(1),o.ALo(2,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(o.xi3(2,1,1e3*t.timestamp,"dd/MMM/YYYY HH:mm"))}}function oa(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Amount (Sats) "),o.qZA())}function la(t,e){if(1&t&&(o.TgZ(0,"span",37),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,t.amount))}}function ra(t,e){if(1&t&&(o.TgZ(0,"span",38),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij("(",o.lcZ(2,1,-1*t.amount),")")}}function ca(t,e){if(1&t&&(o.TgZ(0,"td",33),o.YNc(1,la,3,3,"span",35),o.YNc(2,ra,3,3,"span",36),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf",t.amount>0||0===t.amount),o.xp6(1),o.Q6J("ngIf",t.amount<0)}}function ua(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Fees (Sats) "),o.qZA())}function da(t,e){if(1&t&&(o.TgZ(0,"td",33),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.fees))}}function ma(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Confirmations "),o.qZA())}function pa(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==t?null:t.confirmations)," ")}}function ha(t,e){1&t&&(o.TgZ(0,"th",32),o._uU(1," Address "),o.qZA())}function ga(t,e){if(1&t&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(t.address)}}function fa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",41),o.TgZ(1,"div",42),o.TgZ(2,"mat-select",43),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",44),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function xa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",45),o.TgZ(1,"button",46),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onTransactionClick(n,e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Za(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No transaction available."),o.qZA())}function ya(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting transactions..."),o.qZA())}function Aa(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.errorMessage)}}function Ca(t,e){if(1&t&&(o.TgZ(0,"td",47),o.YNc(1,Za,2,0,"p",48),o.YNc(2,ya,2,0,"p",48),o.YNc(3,Aa,2,1,"p",48),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchTransactions.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchTransactions.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchTransactions.status)===t.apiCallStatusEnum.ERROR)}}const Ta=function(t){return{"display-none":t}};function wa(t,e){if(1&t&&o._UZ(0,"tr",49),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,Ta,(null==t.listTransactions?null:t.listTransactions.data)&&(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)>0))}}function Sa(t,e){1&t&&o._UZ(0,"tr",50)}function va(t,e){1&t&&o._UZ(0,"tr",51)}const qa=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},ba=function(){return["no_transaction"]};let La=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.datePipe=a,this.faHistory=h.qO$,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unsub=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","confirmations","fees","actions"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"])}ngOnInit(){this.store.dispatch(new gt.eL),this.store.select("ecl").pipe((0,m.R)(this.unsub[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchTransactions.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPayments.message?JSON.stringify(this.apisCallStatus.FetchPayments.message):this.apisCallStatus.FetchPayments.message),t.transactions&&this.loadTransactionsTable(t.transactions),this.logger.info(t)})}applyFilter(t){this.listTransactions.filter=t.value.trim().toLowerCase()}onTransactionClick(t,e){this.store.dispatch(new Ft.wu({data:{type:g.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"blockHash",value:t.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:t.txid,title:"Transaction ID",width:100}],[{key:"timestamp",value:t.timestamp,title:"Date/Time",width:50,type:g.Gi.DATE_TIME},{key:"confirmations",value:t.confirmations,title:"Number of Confirmations",width:50,type:g.Gi.NUMBER}],[{key:"fees",value:t.fees,title:"Fees (Sats)",width:50,type:g.Gi.NUMBER},{key:"amount",value:t.amount,title:"Amount (Sats)",width:50,type:g.Gi.NUMBER}],[{key:"address",value:t.address,title:"Address",width:100,type:g.Gi.STRING}]]}}))}loadTransactionsTable(t){this.listTransactions=new pt.by([...t]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.listTransactions.filterPredicate=(t,e)=>((t.timestamp?this.datePipe.transform(new Date(1e3*t.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.listTransactions.paginator=this.paginator,this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unsub.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh),o.Y36(a.uU))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Transactions")}])],decls:37,vars:14,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","30"],["matInput","","placeholder","Filter",3,"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","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-2",4,"matHeaderCellDef"],["mat-cell","","class","pr-2",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["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","","mat-sort-header","","arrowPosition","before",1,"pr-2"],["mat-cell","",1,"pr-2"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o._UZ(3,"fa-icon",3),o.TgZ(4,"span",4),o._uU(5,"Transaction History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",5),o.TgZ(7,"input",6),o.NdJ("keyup",function(t){return e.applyFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"div",8),o.YNc(10,aa,1,0,"mat-progress-bar",9),o.TgZ(11,"table",10,11),o.ynx(13,12),o.YNc(14,ia,2,0,"th",13),o.YNc(15,sa,3,4,"td",14),o.BQk(),o.ynx(16,15),o.YNc(17,oa,2,0,"th",16),o.YNc(18,ca,3,2,"td",14),o.BQk(),o.ynx(19,17),o.YNc(20,ua,2,0,"th",16),o.YNc(21,da,4,3,"td",14),o.BQk(),o.ynx(22,18),o.YNc(23,ma,2,0,"th",19),o.YNc(24,pa,4,3,"td",20),o.BQk(),o.ynx(25,21),o.YNc(26,ha,2,0,"th",13),o.YNc(27,ga,2,1,"td",14),o.BQk(),o.ynx(28,22),o.YNc(29,fa,6,0,"th",23),o.YNc(30,xa,3,0,"td",24),o.BQk(),o.ynx(31,25),o.YNc(32,Ca,4,3,"td",26),o.BQk(),o.YNc(33,wa,1,3,"tr",27),o.YNc(34,Sa,1,0,"tr",28),o.YNc(35,va,1,0,"tr",29),o.qZA(),o._UZ(36,"mat-paginator",30),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("icon",e.faHistory),o.xp6(7),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchTransactions.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.listTransactions)("ngClass",o.VKq(11,qa,""!==e.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(13,ba)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,A.BN,O.KE,xt.Nt,M.$V,a.O5,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,At.gD,At.$L,Ct.ey,v.lW,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.uU,a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();function Fa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",12),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().activeLink=e.link}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.s9C("routerLink",t.link),o.Q6J("active",n.activeLink===t.link),o.xp6(1),o.Oqu(t.name)}}let Ia=(()=>{class t{constructor(t,e){this.store=t,this.router=e,this.selNode={},this.faExchangeAlt=h.Ssp,this.faChartPie=h.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 d.x,new d.x,new d.x,new d.x]}ngOnInit(){const t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{const e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link}),this.store.select("ecl").pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.selNode=t.nodeSettings,this.balances=[{title:"Total Balance",dataValue:t.onchainBalance.total||0},{title:"Confirmed",dataValue:t.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:t.onchainBalance.unconfirmed}]})}openSendFundsModal(){this.store.dispatch(new Ft.wu({data:{component:ea}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(x.yh),o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"On-chain Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"On-chain Transactions"),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"nav",7),o.YNc(16,Fa,2,3,"div",8),o.qZA(),o.TgZ(17,"div",9),o._UZ(18,"router-outlet"),o.qZA(),o.TgZ(19,"div",10),o._UZ(20,"rtl-ecl-on-chain-transaction-history",11),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("icon",e.faChartPie),o.xp6(6),o.Q6J("values",e.balances),o.xp6(2),o.Q6J("icon",e.faExchangeAlt),o.xp6(7),o.Q6J("ngForOf",e.links))},directives:[l.xw,l.Wh,A.BN,T.a8,T.dn,na.D,ct.BU,a.sg,l.yH,i.lC,La,ct.Nj,i.rH],styles:[""]}),t})();var Na=n(1050);function _a(t,e){if(1&t&&(o.TgZ(0,"span",10),o._uU(1,"Channels"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.activeChannels)}}function Da(t,e){if(1&t&&(o.TgZ(0,"span",10),o._uU(1,"Peers"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.activePeers)}}let ka=(()=>{class t{constructor(t,e){this.store=t,this.router=e,this.activePeers=0,this.activeChannels=0,this.faUsers=h.FVb,this.faChartPie=h.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 d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("ecl").pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.activePeers=t.peers&&t.peers.length?t.peers.length:0,this.activeChannels=t.channelsStatus&&t.channelsStatus.active&&t.channelsStatus.active.channels?t.channelsStatus.active.channels:0,this.balances=[{title:"Total Balance",dataValue:t.onchainBalance.total||0},{title:"Confirmed",dataValue:t.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:t.onchainBalance.unconfirmed}]})}onSelectedTabChange(t){this.router.navigateByUrl("/ecl/connections/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(x.yh),o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"On-chain Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"Connections"),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"mat-tab-group",7),o.NdJ("selectedIndexChange",function(t){return e.activeLink=t})("selectedTabChange",function(t){return e.onSelectedTabChange(t)}),o.TgZ(16,"mat-tab"),o.YNc(17,_a,2,1,"ng-template",8),o.qZA(),o.TgZ(18,"mat-tab"),o.YNc(19,Da,2,1,"ng-template",8),o.qZA(),o.qZA(),o.TgZ(20,"div",9),o._UZ(21,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("icon",e.faChartPie),o.xp6(6),o.Q6J("values",e.balances),o.xp6(2),o.Q6J("icon",e.faUsers),o.xp6(6),o.Q6J("selectedIndex",e.activeLink))},directives:[l.xw,l.Wh,A.BN,T.a8,T.dn,na.D,ct.SP,ct.uX,ct.uD,l.yH,i.lC,Na.k],styles:[""]}),t})();function Oa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",11),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().activeLink=e.link}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.s9C("routerLink",t.link),o.Q6J("active",n.activeLink===t.link),o.xp6(1),o.Oqu(t.name)}}let Ua=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.router=n,this.faExchangeAlt=h.Ssp,this.faChartPie=h.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"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new d.x,new d.x,new d.x,new d.x]}ngOnInit(){const t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{const e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link}),this.store.select("ecl").pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.currencyUnits=t.nodeSettings.currencyUnits,this.balances=t.nodeSettings.userPersona===g.ol.OPERATOR?[{title:"Local Capacity",dataValue:t.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:t.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:t.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:t.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(t)})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Lightning Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",6),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"Lightning Transactions"),o.qZA(),o.qZA(),o.TgZ(12,"div",7),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"nav",8),o.YNc(16,Oa,2,3,"div",9),o.qZA(),o.TgZ(17,"div",10),o._UZ(18,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("icon",e.faChartPie),o.xp6(6),o.Q6J("values",e.balances),o.xp6(2),o.Q6J("icon",e.faExchangeAlt),o.xp6(7),o.Q6J("ngForOf",e.links))},directives:[l.xw,l.Wh,A.BN,T.a8,T.dn,na.D,ct.BU,a.sg,l.yH,i.lC,ct.Nj,i.rH],styles:[""]}),t})();function Ra(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",11),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().activeLink=e.link}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.s9C("routerLink",t.link),o.Q6J("active",n.activeLink===t.link),o.xp6(1),o.Oqu(t.name)}}let Ma=(()=>{class t{constructor(t){this.router=t,this.faMapSigns=h.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 d.x,new d.x,new d.x]}ngOnInit(){const t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{const e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"fa-icon",2),o.TgZ(3,"span",3),o._uU(4,"Routing"),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"mat-card",5),o.TgZ(7,"mat-card-content",6),o.TgZ(8,"div",7),o.TgZ(9,"nav",8),o.YNc(10,Ra,2,3,"div",9),o.qZA(),o.qZA(),o.TgZ(11,"div",10),o._UZ(12,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(2),o.Q6J("icon",e.faMapSigns),o.xp6(8),o.Q6J("ngForOf",e.links))},directives:[l.xw,l.Wh,A.BN,l.yH,T.a8,T.dn,ct.BU,a.sg,i.lC,ct.Nj,i.rH],styles:[""]}),t})();var Ja=n(4810),Pa=n(1403),Ea=n(2609);function Ya(t,e){1&t&&(o.TgZ(0,"th",24),o._uU(1,"Address"),o.qZA())}function Qa(t,e){if(1&t&&(o.TgZ(0,"td",25),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",t," ")}}function Ba(t,e){1&t&&(o.TgZ(0,"th",26),o.TgZ(1,"span",27),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Ha(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",28),o.TgZ(1,"span",27),o.TgZ(2,"button",29),o.NdJ("copied",function(e){return o.CHM(t),o.oxw(2).onCopyNodeURI(e)}),o._uU(3,"Copy Node URI"),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(2),o.Q6J("payload",(null==n.lookupResult?null:n.lookupResult.nodeId)+"@"+t)}}function za(t,e){1&t&&o._UZ(0,"tr",30)}function Va(t,e){1&t&&o._UZ(0,"tr",31)}const Ga=function(t){return{"background-color":t}};function $a(t,e){if(1&t&&(o.TgZ(0,"div",1),o._UZ(1,"mat-divider",2),o.TgZ(2,"div",3),o.TgZ(3,"div",4),o.TgZ(4,"h4",5),o._uU(5,"Pub Key"),o.qZA(),o.TgZ(6,"span",6),o._uU(7),o.qZA(),o.qZA(),o.qZA(),o._UZ(8,"mat-divider",7),o.TgZ(9,"div",3),o.TgZ(10,"div",4),o.TgZ(11,"h4",5),o._uU(12,"Signature"),o.qZA(),o.TgZ(13,"span",8),o._uU(14),o.qZA(),o.qZA(),o.qZA(),o._UZ(15,"mat-divider",7),o.TgZ(16,"div",3),o.TgZ(17,"div",9),o.TgZ(18,"h4",5),o._uU(19,"Alias"),o.qZA(),o.TgZ(20,"span",8),o._uU(21),o.TgZ(22,"span",10),o._uU(23),o.qZA(),o.qZA(),o.qZA(),o.TgZ(24,"div",9),o.TgZ(25,"h4",5),o._uU(26,"Date/Time"),o.qZA(),o.TgZ(27,"span",8),o._uU(28),o.ALo(29,"date"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(30,"div",11),o.TgZ(31,"h4",12),o._uU(32,"Addresses"),o.qZA(),o.TgZ(33,"div",13),o.TgZ(34,"table",14,15),o.ynx(36,16),o.YNc(37,Ya,2,0,"th",17),o.YNc(38,Qa,2,1,"td",18),o.BQk(),o.ynx(39,19),o.YNc(40,Ba,3,0,"th",20),o.YNc(41,Ha,4,1,"td",21),o.BQk(),o.YNc(42,za,1,0,"tr",22),o.YNc(43,Va,1,0,"tr",23),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(null==t.lookupResult?null:t.lookupResult.nodeId),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(null==t.lookupResult?null:t.lookupResult.signature),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(null==t.lookupResult?null:t.lookupResult.alias),o.xp6(1),o.Q6J("ngStyle",o.VKq(15,Ga,null==t.lookupResult?null:t.lookupResult.rgbColor)),o.xp6(1),o.Oqu(null!=t.lookupResult&&t.lookupResult.rgbColor?null==t.lookupResult?null:t.lookupResult.rgbColor:""),o.xp6(5),o.Oqu(o.xi3(29,12,1e3*(null==t.lookupResult?null:t.lookupResult.timestamp),"dd/MMM/YYYY HH:mm")),o.xp6(6),o.Q6J("dataSource",t.addresses),o.xp6(8),o.Q6J("matHeaderRowDef",t.displayedColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)}}let Xa=(()=>{class t{constructor(t,e){this.logger=t,this.snackBar=e,this.lookupResult={},this.displayedColumns=["address","actions"]}ngOnInit(){this.addresses=new pt.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses?this.lookupResult.addresses:[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}onCopyNodeURI(t){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(Pa.ux))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(t,e){if(1&t&&o.Gf(mt.YE,5),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],[1,"mb-1",3,"inset"],["fxLayout","row"],["fxFlex","100"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text","w-100"],[1,"my-1",3,"inset"],[1,"foreground-secondary-text"],["fxFlex","50"],[1,"ml-2",3,"ngStyle"],["fxLayout","column",1,"mt-2"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxLayoutAlign","start center","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","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-1"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&o.YNc(0,$a,44,17,"div",0),2&t&&o.Q6J("ngIf",e.lookupResult)},directives:[a.O5,l.xw,R.d,l.yH,l.Wh,a.PC,S.Zl,M.$V,pt.BZ,mt.YE,pt.w1,pt.fO,pt.Dz,pt.as,pt.nj,pt.ge,mt.nU,pt.ev,v.lW,Ea.y,pt.XQ,pt.Gk],pipes:[a.uU],styles:[""]}),t})();const Wa=["form"];function Ka(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij("",null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder," is required.")}}function ja(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij("Invalid ",null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder,".")}}function ti(t,e){if(1&t&&(o.TgZ(0,"div"),o._UZ(1,"rtl-ecl-node-lookup",29),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Q6J("lookupResult",t.nodeLookupValue)}}function ei(t,e){if(1&t&&(o.TgZ(0,"span",27),o.YNc(1,ti,2,1,"div",28),o.qZA()),2&t){const t=o.oxw(2),e=o.MAs(26);o.xp6(1),o.Q6J("ngIf",t.nodeLookupValue.nodeId)("ngIfElse",e)}}function ni(t,e){1&t&&(o.TgZ(0,"span",27),o.TgZ(1,"h3"),o._uU(2,"Error! Unable to find details!"),o.qZA(),o.qZA())}function ai(t,e){if(1&t&&(o.TgZ(0,"div",21),o.TgZ(1,"div",22),o.TgZ(2,"span",23),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"div",24),o.YNc(5,ei,2,2,"span",25),o.YNc(6,ni,3,0,"span",26),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(3),o.hij("",t.lookupFields[t.selectedFieldId].name," Details"),o.xp6(1),o.Q6J("ngSwitch",t.selectedFieldId),o.xp6(1),o.Q6J("ngSwitchCase",0)}}function ii(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find details!"),o.qZA())}const si=function(t){return{"mt-2":t}};let oi=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.actions=a,this.lookupKeyCtrl=new ft.NI,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=h.wn1,this.screenSize="",this.screenSizeEnum=g.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t.type===gt.ht||t.type===gt.f)).subscribe(t=>{if(t.type===gt.ht){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=t.payload[0]?JSON.parse(JSON.stringify(t.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=t.payload?JSON.parse(JSON.stringify(t.payload)):[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}t.type===gt.f&&t.payload.status===g.Bn.ERROR&&"Lookup"===t.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){if(!this.lookupKeyCtrl.value)return this.lookupKeyCtrl.setErrors({required:!0}),!0;if(this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(",")))return this.lookupKeyCtrl.setErrors({invalid:!0}),!0;switch(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId){case 0:this.store.dispatch(new gt.x$(this.lookupKeyCtrl.value.trim()))}}onSelectChange(t){this.resetData(),this.selectedFieldId=t.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(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh),o.Y36(Z.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-lookups"]],viewQuery:function(t,e){if(1&t&&o.Gf(Wa,7),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first)}},decls:27,vars:10,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start end",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"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"card-content-gap","mt-1"],["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","20","fxFlex.gt-md","15","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","80","fxFlex.gt-md","85","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row",1,"mt-2"],["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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"fa-icon",2),o.TgZ(3,"span",3),o._uU(4,"Graph Lookups"),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"mat-card",5),o.TgZ(7,"mat-card-content",6),o.TgZ(8,"form",7,8),o.TgZ(10,"div",9),o.TgZ(11,"mat-radio-group",10),o.TgZ(12,"mat-radio-button",11),o._uU(13,"Node"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(14,"mat-form-field",12),o._UZ(15,"input",13,14),o.YNc(17,Ka,2,1,"mat-error",15),o.YNc(18,ja,2,1,"mat-error",15),o.qZA(),o.TgZ(19,"div",16),o.TgZ(20,"button",17),o.NdJ("click",function(){return e.resetData()}),o._uU(21,"Clear"),o.qZA(),o.TgZ(22,"button",18),o.NdJ("click",function(){return e.onLookup()}),o._uU(23,"Lookup"),o.qZA(),o.qZA(),o.qZA(),o.YNc(24,ai,7,3,"div",19),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(25,ii,2,0,"ng-template",null,20,o.W1O)),2&t&&(o.xp6(2),o.Q6J("icon",e.faSearch),o.xp6(10),o.Q6J("value",0),o.xp6(2),o.Q6J("ngClass",o.VKq(8,si,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM)),o.xp6(1),o.Q6J("formControl",e.lookupKeyCtrl)("placeholder",(null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder)||"Lookup Key"),o.xp6(2),o.Q6J("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.invalid),o.xp6(6),o.Q6J("ngIf",e.flgSetLookupValue))},directives:[l.xw,l.Wh,A.BN,l.yH,T.a8,T.dn,ft._Y,ft.JL,ft.F,Ja.VQ,Ja.U0,O.KE,a.mk,S.oO,xt.Nt,ft.Fj,ft.Q7,ft.JJ,ft.oH,a.O5,v.lW,O.TO,a.RF,a.n9,a.ED,Xa],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}.pl-3[_ngcontent-%COMP%]{padding-left:3rem}"]}),t})();var li=n(7969);let ri=(()=>{class t{constructor(t,e){this.store=t,this.eclEffects=e,this.newAddress=""}onGenerateAddress(){this.store.dispatch(new gt.ER),this.eclEffects.setNewAddress.pipe((0,ue.q)(1)).subscribe(t=>{this.newAddress=t,this.store.dispatch(new Ft.wu({width:"58%",data:{address:this.newAddress,addressType:"",component:li.n}}))})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(x.yh),o.Y36(de.o))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return e.onGenerateAddress()}),o._uU(3,"Generate Address"),o.qZA(),o.qZA(),o.qZA())},directives:[l.xw,l.yH,l.Wh,v.lW],styles:[""]}),t})(),ci=(()=>{class t{constructor(t,e){this.store=t,this.activatedRoute=e,this.sweepAll=!1,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.activatedRoute.data.pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.sweepAll=t.sweepAll})}openSendFundsModal(){this.store.dispatch(new Ft.wu({data:{sweepAll:this.sweepAll,component:ea}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(x.yh),o.Y36(i.gz))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return e.openSendFundsModal()}),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Oqu(e.sweepAll?"Sweep All":"Send Funds"))},directives:[l.xw,l.yH,l.Wh,v.lW],styles:[""]}),t})();var ui=n(1258),di=n(1681),mi=n(3474),pi=n(7521),hi=n(84);const gi=["form"];function fi(t,e){if(1&t&&(o.TgZ(0,"mat-option",34),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.Oqu(t.alias?t.alias:t.nodeId?t.nodeId:"")}}function xi(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer alias is required."),o.qZA())}function Zi(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer not found in the list."),o.qZA())}function yi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"input",30),o.NdJ("change",function(){return o.CHM(t),o.oxw().onSelectedPeerChanged()}),o.qZA(),o.TgZ(2,"mat-autocomplete",31,32),o.NdJ("optionSelected",function(){return o.CHM(t),o.oxw().onSelectedPeerChanged()}),o.YNc(4,fi,2,2,"mat-option",33),o.ALo(5,"async"),o.qZA(),o.YNc(6,xi,2,0,"mat-error",17),o.YNc(7,Zi,2,0,"mat-error",17),o.qZA()}if(2&t){const t=o.MAs(3),e=o.oxw();o.xp6(1),o.Q6J("formControl",e.selectedPeer)("matAutocomplete",t),o.xp6(1),o.Q6J("displayWith",e.displayFn),o.xp6(2),o.Q6J("ngForOf",o.lcZ(5,6,e.filteredPeers)),o.xp6(2),o.Q6J("ngIf",null==e.selectedPeer.errors?null:e.selectedPeer.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.selectedPeer.errors?null:e.selectedPeer.errors.notfound)}}function Ai(t,e){1&t&&o.GkF(0)}function Ci(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Ti(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij("Amount must be less than or equal to ",t.totalBalance,".")}}function wi(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.channelConnectionError)}}function Si(t,e){if(1&t&&(o.TgZ(0,"div",35),o._UZ(1,"fa-icon",36),o.YNc(2,wi,2,1,"span",17),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.channelConnectionError)}}function vi(t,e){if(1&t&&(o.TgZ(0,"mat-expansion-panel",38),o.TgZ(1,"mat-expansion-panel-header"),o.TgZ(2,"mat-panel-title"),o.TgZ(3,"span"),o._uU(4,"Peer: \xa0"),o.qZA(),o.TgZ(5,"strong",39),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"div",0),o.TgZ(9,"div",1),o.TgZ(10,"h4",40),o._uU(11,"Pubkey"),o.qZA(),o.TgZ(12,"span",41),o._uU(13),o.qZA(),o.qZA(),o.qZA(),o._UZ(14,"mat-divider",42),o.TgZ(15,"div",0),o.TgZ(16,"div",43),o.TgZ(17,"h4",40),o._uU(18,"Address"),o.qZA(),o.TgZ(19,"span",44),o._uU(20),o.qZA(),o.qZA(),o.TgZ(21,"div",43),o.TgZ(22,"h4",40),o._uU(23,"State"),o.qZA(),o.TgZ(24,"span",44),o._uU(25),o.ALo(26,"titlecase"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw(2);o.xp6(6),o.Oqu((null==t.peer?null:t.peer.alias)||(null==t.peer?null:t.peer.nodeId)),o.xp6(7),o.Oqu(t.peer.nodeId),o.xp6(7),o.Oqu(null==t.peer?null:t.peer.address),o.xp6(5),o.Oqu(o.lcZ(26,4,null==t.peer?null:t.peer.state))}}function qi(t,e){if(1&t&&o.YNc(0,vi,27,6,"mat-expansion-panel",37),2&t){const t=o.oxw();o.Q6J("ngIf",t.peer)}}let bi=(()=>{class t{constructor(t,e,n,a){this.dialogRef=t,this.data=e,this.store=n,this.actions=a,this.selectedPeer=new ft.NI,this.faExclamationTriangle=h.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.alertTitle=this.data.alertTitle,this.peer=this.data.message.peer?this.data.message.peer:null,this.peers=this.data.message.peers&&this.data.message.peers.length?this.data.message.peers:[],this.actions.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t.type===gt.f||t.type===gt.M8)).subscribe(t=>{t.type===gt.f&&t.payload.status===g.Bn.ERROR&&"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message),t.type===gt.M8&&this.dialogRef.close()});let t="",e="";this.sortedPeers=this.peers.sort((n,a)=>(t=n.alias?n.alias.toLowerCase():n.nodeId?n.nodeId.toLowerCase():"",e=a.alias?a.alias.toLowerCase():n.nodeId.toLowerCase(),t<e?-1:t>e?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,m.R)(this.unSubs[1]),(0,ui.O)(""),(0,di.U)(t=>"string"==typeof t?t:t.alias?t.alias:t.nodeId),(0,di.U)(t=>t?this.filterPeers(t):this.sortedPeers.slice()))}filterPeers(t){return this.sortedPeers.filter(e=>0===e.alias.toLowerCase().indexOf(t?t.toLowerCase():""))}displayFn(t){return t&&t.alias?t.alias:t&&t.nodeId?t.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 t=this.peers.filter(t=>t.alias.length===this.selectedPeer.value.length&&0===t.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===t.length&&t[0].nodeId&&(this.selectedPubkey=t[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=!1,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(t){this.advancedTitle=t&&this.feeRate&&this.feeRate>0?"Advanced Options | Fee (Sats/vByte): "+this.feeRate:"Advanced Options"}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;this.store.dispatch(new gt.nb({nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate,feeRate:this.feeRate}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(ht.WI),o.Y36(x.yh),o.Y36(Z.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(t,e){if(1&t&&o.Gf(gi,7),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.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","8","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","48","fxLayout","row","fxLayoutAlign","start center"],["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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["autoFocus","","mat-flat-button","","color","primary","type","submit","tabindex","9"],["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(t,e){if(1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return e.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.NdJ("submit",function(){return e.onOpenChannel()})("reset",function(){return e.resetData()}),o.TgZ(11,"div",9),o.YNc(12,yi,8,8,"mat-form-field",10),o.qZA(),o.YNc(13,Ai,1,0,"ng-container",11),o.TgZ(14,"div",9),o.TgZ(15,"div",12),o.TgZ(16,"mat-form-field",13),o.TgZ(17,"input",14,15),o.NdJ("ngModelChange",function(t){return e.fundingAmount=t}),o.qZA(),o.TgZ(19,"mat-hint"),o._uU(20),o.ALo(21,"number"),o.qZA(),o.TgZ(22,"span",16),o._uU(23," Sats "),o.qZA(),o.YNc(24,Ci,2,0,"mat-error",17),o.YNc(25,Ti,2,1,"mat-error",17),o.qZA(),o.TgZ(26,"div",18),o.TgZ(27,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(t){return e.isPrivate=t}),o._uU(28,"Private Channel"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(29,"mat-expansion-panel",20),o.NdJ("closed",function(){return e.onAdvancedPanelToggle(!0)})("opened",function(){return e.onAdvancedPanelToggle(!1)}),o.TgZ(30,"mat-expansion-panel-header"),o.TgZ(31,"mat-panel-title"),o.TgZ(32,"span"),o._uU(33),o.qZA(),o.qZA(),o.qZA(),o.TgZ(34,"div",21),o.TgZ(35,"div",12),o.TgZ(36,"div",22),o.TgZ(37,"mat-form-field",1),o.TgZ(38,"input",23,24),o.NdJ("ngModelChange",function(t){return e.feeRate=t}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(40,Si,3,2,"div",25),o.TgZ(41,"div",26),o.TgZ(42,"button",27),o._uU(43,"Clear Fields"),o.qZA(),o.TgZ(44,"button",28),o._uU(45,"Open Channel"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(46,qi,1,1,"ng-template",null,29,o.W1O)),2&t){const t=o.MAs(18),n=o.MAs(47);o.xp6(5),o.Oqu(e.alertTitle),o.xp6(7),o.Q6J("ngIf",!e.peer&&e.peers&&e.peers.length>0),o.xp6(1),o.Q6J("ngTemplateOutlet",n),o.xp6(4),o.Q6J("ngModel",e.fundingAmount)("step",1e3)("min",1)("max",e.totalBalance),o.xp6(3),o.hij("Remaining Bal: ",o.lcZ(21,16,e.totalBalance-(e.fundingAmount?e.fundingAmount:0)),""),o.xp6(4),o.Q6J("ngIf",null==t.errors?null:t.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.errors?null:t.errors.max),o.xp6(2),o.Q6J("ngModel",e.isPrivate),o.xp6(6),o.Oqu(e.advancedTitle),o.xp6(5),o.Q6J("ngModel",e.feeRate)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",""!==e.channelConnectionError)}},directives:[l.xw,l.yH,T.dk,l.Wh,v.lW,T.dn,ft._Y,ft.JL,ft.F,a.O5,a.tP,O.KE,xt.Nt,ft.wV,ft.qQ,ft.Fd,ft.Fj,yt.q,mi.F,ft.Q7,ft.JJ,ft.On,O.bx,O.R9,pi.Rr,Te.ib,Te.yz,Te.yK,Zt.h,hi.ZL,ft.oH,hi.XC,a.sg,Ct.ey,O.TO,A.BN,R.d],pipes:[a.JJ,a.Ov,a.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),t})();function Li(t,e){if(1&t&&(o.TgZ(0,"span",7),o._uU(1,"Open"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.numOfOpenChannels)}}function Fi(t,e){if(1&t&&(o.TgZ(0,"span",7),o._uU(1,"Pending"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.numOfPendingChannels)}}function Ii(t,e){if(1&t&&(o.TgZ(0,"span",7),o._uU(1,"Inactive"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.numOfInactiveChannels)}}let Ni=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.router=n,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 d.x,new d.x]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("ecl").pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.numOfOpenChannels=t.channelsStatus&&t.channelsStatus.active&&t.channelsStatus.active.channels?t.channelsStatus.active.channels:0,this.numOfPendingChannels=t.channelsStatus&&t.channelsStatus.pending&&t.channelsStatus.pending.channels?t.channelsStatus.pending.channels:0,this.numOfInactiveChannels=t.channelsStatus&&t.channelsStatus.inactive&&t.channelsStatus.inactive.channels?t.channelsStatus.inactive.channels:0,this.selNode=t.nodeSettings,this.information=t.information,this.peers=t.peers,this.totalBalance=t.onchainBalance.total,this.logger.info(t)})}onOpenChannel(){this.store.dispatch(new Ft.wu({data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:bi}}))}onSelectedTabChange(t){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return e.onOpenChannel()}),o._uU(3,"Open Channel"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-tab-group",4),o.NdJ("selectedIndexChange",function(t){return e.activeLink=t})("selectedTabChange",function(t){return e.onSelectedTabChange(t)}),o.TgZ(6,"mat-tab"),o.YNc(7,Li,2,1,"ng-template",5),o.qZA(),o.TgZ(8,"mat-tab"),o.YNc(9,Fi,2,1,"ng-template",5),o.qZA(),o.TgZ(10,"mat-tab"),o.YNc(11,Ii,2,1,"ng-template",5),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o._UZ(13,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("selectedIndex",e.activeLink))},directives:[l.xw,l.yH,l.Wh,v.lW,ct.SP,ct.uX,ct.uD,i.lC,Na.k],styles:[""]}),t})();function _i(t,e){if(1&t&&(o.TgZ(0,"div",11),o.TgZ(1,"h4",12),o._uU(2,"Short Channel ID"),o.qZA(),o.TgZ(3,"span",13),o._uU(4),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(4),o.Oqu(t.channel.shortChannelId)}}function Di(t,e){if(1&t&&(o.TgZ(0,"div",11),o.TgZ(1,"h4",12),o._uU(2,"State"),o.qZA(),o.TgZ(3,"span",15),o._uU(4),o.ALo(5,"titlecase"),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(4),o.Oqu(o.lcZ(5,1,t.channel.state))}}function ki(t,e){if(1&t&&(o.TgZ(0,"div"),o.TgZ(1,"div",9),o.TgZ(2,"div",11),o.TgZ(3,"h4",12),o._uU(4,"Local Balance (Sats)"),o.qZA(),o.TgZ(5,"span",15),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div",11),o.TgZ(9,"h4",12),o._uU(10,"Remote Balance (Sats)"),o.qZA(),o.TgZ(11,"span",15),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(14,"mat-divider",14),o.TgZ(15,"div",9),o.TgZ(16,"div",11),o.TgZ(17,"h4",12),o._uU(18,"Base Fee (mSats)"),o.qZA(),o.TgZ(19,"span",15),o._uU(20),o.ALo(21,"number"),o.qZA(),o.qZA(),o.TgZ(22,"div",11),o.TgZ(23,"h4",12),o._uU(24,"Fee Rate (mili mSats)"),o.qZA(),o.TgZ(25,"span",15),o._uU(26),o.ALo(27,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(28,"mat-divider",14),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.Oqu(o.lcZ(7,6,t.channel.toLocal)),o.xp6(6),o.Oqu(o.lcZ(13,8,t.channel.toRemote)),o.xp6(2),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(21,10,t.channel.feeBaseMsat)),o.xp6(6),o.Oqu(o.lcZ(27,12,t.channel.feeProportionalMillionths)),o.xp6(2),o.Q6J("inset",!0)}}function Oi(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Show Advanced"),o.qZA())}function Ui(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Hide Advanced"),o.qZA())}function Ri(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",21),o.NdJ("click",function(){return o.CHM(t),o.oxw().onShowAdvanced()}),o.YNc(1,Oi,2,0,"p",22),o.YNc(2,Ui,2,0,"ng-template",null,23,o.W1O),o.qZA()}if(2&t){const t=o.MAs(3),e=o.oxw();o.xp6(1),o.Q6J("ngIf",!e.showAdvanced)("ngIfElse",t)}}function Mi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",24),o.NdJ("copied",function(e){return o.CHM(t),o.oxw().onCopyChanID(e)}),o._uU(1,"Copy Short Channel ID"),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("payload",t.channel.shortChannelId)}}function Ji(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",25),o.NdJ("copied",function(e){return o.CHM(t),o.oxw().onCopyChanID(e)}),o._uU(1,"Copy Channel ID"),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("payload",t.channel.channelId)}}const Pi=function(t){return{"xs-scroll-y":t}},Ei=function(t,e){return{"mt-2":t,"mt-1":e}};let Yi=(()=>{class t{constructor(t,e,n,a,i){this.dialogRef=t,this.data=e,this.logger=n,this.commonService=a,this.snackBar=i,this.faReceipt=h.dLy,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=g.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(t){this.snackBar.open("open"===this.channelsType?"Short channel ID "+t+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(ht.WI),o.Y36(f.mQ),o.Y36(y.v),o.Y36(Pa.ux))},t.\u0275cmp=o.Xpm({type:t,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-stroked-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-stroked-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-flat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o._UZ(4,"fa-icon",4),o.TgZ(5,"span",5),o._uU(6,"Channel Information"),o.qZA(),o.qZA(),o.TgZ(7,"button",6),o.NdJ("click",function(){return e.onClose()}),o._uU(8,"X"),o.qZA(),o.qZA(),o.TgZ(9,"mat-card-content",7),o.TgZ(10,"div",8),o.TgZ(11,"div",9),o.YNc(12,_i,5,1,"div",10),o.TgZ(13,"div",11),o.TgZ(14,"h4",12),o._uU(15,"Peer Alias"),o.qZA(),o.TgZ(16,"span",13),o._uU(17),o.qZA(),o.qZA(),o.YNc(18,Di,6,3,"div",10),o.qZA(),o._UZ(19,"mat-divider",14),o.TgZ(20,"div",9),o.TgZ(21,"div",1),o.TgZ(22,"h4",12),o._uU(23,"Channel ID"),o.qZA(),o.TgZ(24,"span",13),o._uU(25),o.qZA(),o.qZA(),o.qZA(),o._UZ(26,"mat-divider",14),o.TgZ(27,"div",9),o.TgZ(28,"div",1),o.TgZ(29,"h4",12),o._uU(30,"Peer Public Key"),o.qZA(),o.TgZ(31,"span",13),o._uU(32),o.qZA(),o.qZA(),o.qZA(),o._UZ(33,"mat-divider",14),o.TgZ(34,"div",9),o.TgZ(35,"div",11),o.TgZ(36,"h4",12),o._uU(37,"Private"),o.qZA(),o.TgZ(38,"span",15),o._uU(39),o.qZA(),o.qZA(),o.TgZ(40,"div",11),o.TgZ(41,"h4",12),o._uU(42,"Funder"),o.qZA(),o.TgZ(43,"span",15),o._uU(44),o.qZA(),o.qZA(),o.qZA(),o._UZ(45,"mat-divider",14),o.TgZ(46,"div",9),o.TgZ(47,"div",11),o.TgZ(48,"h4",12),o._uU(49,"State"),o.qZA(),o.TgZ(50,"span",15),o._uU(51),o.ALo(52,"titlecase"),o.qZA(),o.qZA(),o.TgZ(53,"div",11),o.TgZ(54,"h4",12),o._uU(55,"Buried"),o.qZA(),o.TgZ(56,"span",15),o._uU(57),o.qZA(),o.qZA(),o.qZA(),o._UZ(58,"mat-divider",14),o.YNc(59,ki,29,14,"div",16),o.TgZ(60,"div",17),o.YNc(61,Ri,4,2,"button",18),o.YNc(62,Mi,2,1,"button",19),o.YNc(63,Ji,2,1,"button",20),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("icon",e.faReceipt),o.xp6(5),o.Q6J("ngClass",o.VKq(23,Pi,e.screenSize===e.screenSizeEnum.XS)),o.xp6(3),o.Q6J("ngIf","open"===e.channelsType),o.xp6(5),o.Oqu(e.channel.alias),o.xp6(1),o.Q6J("ngIf","open"!==e.channelsType),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(e.channel.channelId),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(e.channel.nodeId),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(0===e.channel.channelFlags?"Yes":"No"),o.xp6(5),o.Oqu(e.channel.isFunder?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(52,21,e.channel.state)),o.xp6(6),o.Oqu(e.channel.buried?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(1),o.Q6J("ngIf",e.showAdvanced&&"open"===e.channelsType),o.xp6(1),o.Q6J("ngClass",o.WLB(25,Ei,!e.showAdvanced,e.showAdvanced)),o.xp6(1),o.Q6J("ngIf","open"===e.channelsType),o.xp6(1),o.Q6J("ngIf","open"===e.channelsType),o.xp6(1),o.Q6J("ngIf","open"!==e.channelsType))},directives:[l.xw,l.Wh,l.yH,T.dk,A.BN,v.lW,T.dn,a.mk,S.oO,a.O5,R.d,Zt.h,Ea.y],pipes:[a.rS,a.JJ],styles:[""]}),t})();function Qi(t,e){1&t&&o._UZ(0,"mat-progress-bar",30)}function Bi(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Short Channel ID "),o.qZA())}function Hi(t,e){if(1&t&&(o.TgZ(0,"span",37),o._UZ(1,"fa-icon",38),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEyeSlash)}}function zi(t,e){if(1&t&&(o.TgZ(0,"span",39),o._UZ(1,"fa-icon",38),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEye)}}const Vi=function(t){return{"max-width":t}};function Gi(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"div",33),o.YNc(2,Hi,2,1,"span",34),o.YNc(3,zi,2,1,"span",35),o.TgZ(4,"span",36),o._uU(5),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(4,Vi,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),o.xp6(1),o.Q6J("ngIf",0===t.channelFlags),o.xp6(1),o.Q6J("ngIf",0!==t.channelFlags),o.xp6(2),o.Oqu(null==t?null:t.shortChannelId)}}function $i(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Alias "),o.qZA())}function Xi(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"div",33),o.TgZ(2,"span",36),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Vi,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),o.xp6(2),o.Oqu(t.alias)}}function Wi(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Base Fee (mSats) "),o.qZA())}function Ki(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.feeBaseMsat,"1.0-0")," ")}}function ji(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Fee Rate (mili mSats) "),o.qZA())}function ts(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.feeProportionalMillionths,"1.0-0")," ")}}function es(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Local Balance (Sats) "),o.qZA())}function ns(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function as(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Remote Balance (Sats) "),o.qZA())}function is(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function ss(t,e){1&t&&(o.TgZ(0,"th",42),o._uU(1,"Balance Score "),o.qZA())}function os(t,e){if(1&t&&(o.TgZ(0,"td",43),o.TgZ(1,"div",44),o.TgZ(2,"mat-hint",45),o._uU(3),o.ALo(4,"number"),o.qZA(),o.qZA(),o._UZ(5,"mat-progress-bar",46),o.qZA()),2&t){const t=e.$implicit;o.xp6(3),o.Oqu(o.lcZ(4,2,(null==t?null:t.balancedness)||0)),o.xp6(2),o.s9C("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function ls(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",47),o.TgZ(1,"div",48),o.TgZ(2,"mat-select",49),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",50),o.NdJ("click",function(){return o.CHM(t),o.oxw().onChannelUpdate("all")}),o._uU(5,"Update Fee Policy"),o.qZA(),o.TgZ(6,"mat-option",50),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDownloadCSV()}),o._uU(7,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function rs(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",51),o.TgZ(1,"div",52),o.TgZ(2,"mat-select",53),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",50),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onChannelClick(n,e)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",50),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelUpdate(e)}),o._uU(7,"Update Fee Policy"),o.qZA(),o.TgZ(8,"mat-option",50),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelClose(e,!1)}),o._uU(9,"Close Channel"),o.qZA(),o.TgZ(10,"mat-option",50),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelClose(e,!0)}),o._uU(11,"Force Close"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function cs(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No peers connected. Add a peer in order to open a channel."),o.qZA())}function us(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No channel available."),o.qZA())}function ds(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting channels..."),o.qZA())}function ms(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.errorMessage)}}function ps(t,e){if(1&t&&(o.TgZ(0,"td",54),o.YNc(1,cs,2,0,"p",55),o.YNc(2,us,2,0,"p",55),o.YNc(3,ds,2,0,"p",55),o.YNc(4,ms,2,1,"p",55),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",t.numPeers<1&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",t.numPeers>0&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.ERROR)}}const hs=function(t){return{"display-none":t}};function gs(t,e){if(1&t&&o._UZ(0,"tr",56),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,hs,t.numPeers>0&&(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function fs(t,e){1&t&&o._UZ(0,"tr",57)}function xs(t,e){1&t&&o._UZ(0,"tr",58)}const Zs=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},ys=function(){return["no_peer"]};let As=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.store=e,this.rtlEffects=n,this.commonService=a,this.faEye=h.Mdf,this.faEyeSlash=h.Aq,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=g.vn,this.selFilter="",this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","toLocal","toRemote","actions"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["shortChannelId","alias","toLocal","toRemote","actions"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["shortChannelId","alias","feeBaseMsat","feeProportionalMillionths","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["shortChannelId","alias","feeBaseMsat","feeProportionalMillionths","toLocal","toRemote","balancedness","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchChannels.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.activeChannels=t.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.loadChannelsTable(),this.logger.info(t)})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.loadChannelsTable()}onChannelUpdate(t){"all"!==t&&"NORMAL"!==t.state||(this.store.dispatch(new Ft.b_({data:{type:g.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"all"===t?"Update fee policy for selected/all channels":"Update fee policy for Channel: "+t.channelId,flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:t&&t.feeBaseMsat?t.feeBaseMsat:1e3,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:t&&t.feeProportionalMillionths?t.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}})),this.rtlEffects.closeConfirm.pipe((0,m.R)(this.unSubs[1])).subscribe(e=>{if(e){const n=e[0].inputValue,a=e[1].inputValue;let i=null,s="";"all"===t?(this.activeChannels.forEach(t=>{s=s+","+t.channelId}),s=s.substring(1),i={baseFeeMsat:n,feeRate:a,channelIds:s}):i={baseFeeMsat:n,feeRate:a,channelId:t.channelId},this.store.dispatch(new gt.k(i))}}),this.applyFilter())}percentHintFunction(t){return(t/1e4).toString()+"%"}onChannelClose(t,e){this.store.dispatch(new Ft.b_({data:{type:g.n_.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage:e?"Force closing channel: "+t.channelId:"Closing channel: "+t.channelId,noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}})),this.rtlEffects.closeConfirm.pipe((0,m.R)(this.unSubs[3])).subscribe(n=>{n&&this.store.dispatch(new gt.e8({channelId:t.channelId,force:e}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,e){this.store.dispatch(new Ft.wu({data:{channel:t,channelsType:"open",component:Yi}}))}loadChannelsTable(){this.activeChannels.sort((t,e)=>t.alias===e.alias?0:e.alias?1:-1),this.channels=new pt.by([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(Le.V),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Channels")}])],decls:39,vars:14,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","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-1",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,Qi,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,Bi,2,0,"th",10),o.YNc(11,Gi,6,6,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,$i,2,0,"th",10),o.YNc(14,Xi,4,4,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,Wi,2,0,"th",14),o.YNc(17,Ki,4,4,"td",11),o.BQk(),o.ynx(18,15),o.YNc(19,ji,2,0,"th",14),o.YNc(20,ts,4,4,"td",11),o.BQk(),o.ynx(21,16),o.YNc(22,es,2,0,"th",14),o.YNc(23,ns,4,4,"td",11),o.BQk(),o.ynx(24,17),o.YNc(25,as,2,0,"th",14),o.YNc(26,is,4,4,"td",11),o.BQk(),o.ynx(27,18),o.YNc(28,ss,2,0,"th",19),o.YNc(29,os,6,4,"td",20),o.BQk(),o.ynx(30,21),o.YNc(31,ls,8,0,"th",22),o.YNc(32,rs,12,0,"td",23),o.BQk(),o.ynx(33,24),o.YNc(34,ps,5,4,"td",25),o.BQk(),o.YNc(35,gs,1,3,"tr",26),o.YNc(36,fs,1,0,"tr",27),o.YNc(37,xs,1,0,"tr",28),o.qZA(),o.qZA(),o._UZ(38,"mat-paginator",29),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.selFilter),o.xp6(2),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.channels)("ngClass",o.VKq(11,Zs,""!==e.errorMessage)),o.xp6(28),o.Q6J("matFooterRowDef",o.DdM(13,ys)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,O.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,M.$V,a.O5,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,U.gM,A.BN,O.bx,At.gD,At.$L,Ct.ey,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.JJ],styles:[".mat-column-shortChannelId[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-shortChannelId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{padding-left:1rem;flex:0 0 15%;width:15%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;flex:0 0 17%;width:17%}.mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-state[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 10%;width:10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:56.25em){.mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-state[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset;flex:1 1 20%;width:20%}}@media only screen and (max-width:37.5em){.mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-state[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width:56.25em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 90%}}@media only screen and (max-width:37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),t})();function Cs(t,e){1&t&&o._UZ(0,"mat-progress-bar",25)}function Ts(t,e){1&t&&(o.TgZ(0,"th",26),o._uU(1," State "),o.qZA())}function ws(t,e){if(1&t&&(o.TgZ(0,"td",27),o._uU(1),o.ALo(2,"titlecase"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",o.lcZ(2,1,null==t?null:t.state),"")}}function Ss(t,e){1&t&&(o.TgZ(0,"th",26),o._uU(1," Alias "),o.qZA())}function vs(t,e){if(1&t&&(o.TgZ(0,"td",27),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.alias)}}function qs(t,e){1&t&&(o.TgZ(0,"th",28),o._uU(1," Local Balance (Sats) "),o.qZA())}function bs(t,e){if(1&t&&(o.TgZ(0,"td",27),o.TgZ(1,"span",29),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function Ls(t,e){1&t&&(o.TgZ(0,"th",28),o._uU(1," Remote Balance (Sats) "),o.qZA())}function Fs(t,e){if(1&t&&(o.TgZ(0,"td",27),o.TgZ(1,"span",29),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function Is(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",30),o.TgZ(1,"div",31),o.TgZ(2,"mat-select",32),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",33),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Ns(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",34),o.TgZ(1,"button",35),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onChannelClick(n,e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function _s(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No pending channel available."),o.qZA())}function Ds(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting pending channels..."),o.qZA())}function ks(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.errorMessage)}}function Os(t,e){if(1&t&&(o.TgZ(0,"td",36),o.YNc(1,_s,2,0,"p",37),o.YNc(2,Ds,2,0,"p",37),o.YNc(3,ks,2,1,"p",37),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.ERROR)}}const Us=function(t){return{"display-none":t}};function Rs(t,e){if(1&t&&o._UZ(0,"tr",38),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,Us,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Ms(t,e){1&t&&o._UZ(0,"tr",39)}function Js(t,e){1&t&&o._UZ(0,"tr",40)}const Ps=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Es=function(){return["no_channel"]};let Ys=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.commonService=n,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=g.vn,this.selFilter="",this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["state","alias","actions"]):this.screenSize===g.cu.SM||this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","alias","toLocal","toRemote","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchChannels.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.pendingChannels=t.pendingChannels,this.loadChannelsTable(),this.logger.info(t)})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,e){this.store.dispatch(new Ft.wu({data:{channel:t,channelsType:"pending",component:Yi}}))}loadChannelsTable(){this.pendingChannels.sort((t,e)=>t.alias===e.alias?0:e.alias?1:-1),this.channels=new pt.by([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Channels")}])],decls:30,vars:14,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","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","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","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,Cs,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,Ts,2,0,"th",10),o.YNc(11,ws,3,3,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,Ss,2,0,"th",10),o.YNc(14,vs,2,1,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,qs,2,0,"th",14),o.YNc(17,bs,4,4,"td",11),o.BQk(),o.ynx(18,15),o.YNc(19,Ls,2,0,"th",14),o.YNc(20,Fs,4,4,"td",11),o.BQk(),o.ynx(21,16),o.YNc(22,Is,6,0,"th",17),o.YNc(23,Ns,3,0,"td",18),o.BQk(),o.ynx(24,19),o.YNc(25,Os,4,3,"td",20),o.BQk(),o.YNc(26,Rs,1,3,"tr",21),o.YNc(27,Ms,1,0,"tr",22),o.YNc(28,Js,1,0,"tr",23),o.qZA(),o.qZA(),o._UZ(29,"mat-paginator",24),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.selFilter),o.xp6(2),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.channels)("ngClass",o.VKq(11,Ps,""!==e.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(13,Es)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,O.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,M.$V,a.O5,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,At.gD,At.$L,Ct.ey,v.lW,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.rS,a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var Qs=n(7753);const Bs=["peersForm"],Hs=["stepper"];function zs(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw();o.Oqu(t.peerFormLabel)}}function Vs(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Address is required."),o.qZA())}function Gs(t,e){if(1&t&&(o.TgZ(0,"div",33),o._UZ(1,"fa-icon",34),o.TgZ(2,"span"),o._uU(3),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(2),o.Oqu(t.peerConnectionError)}}function $s(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw();o.Oqu(t.channelFormLabel)}}function Xs(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Ws(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount must be a positive number."),o.qZA())}function Ks(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij("Amount must be less than or equal to ",t.totalBalance,".")}}function js(t,e){if(1&t&&(o.TgZ(0,"div",33),o._UZ(1,"fa-icon",34),o.TgZ(2,"span"),o._uU(3),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(2),o.Oqu(t.channelConnectionError)}}let to=(()=>{class t{constructor(t,e,n,a,i,s){this.dialogRef=t,this.data=e,this.store=n,this.formBuilder=a,this.actions=i,this.logger=s,this.faExclamationTriangle=h.eHv,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 d.x,new d.x]}ngOnInit(){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.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[ft.kI.required]],peerAddress:[this.peerAddress,[ft.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[ft.kI.required,ft.kI.min(1),ft.kI.max(this.totalBalance)]],isPrivate:[!1],feeRate:[null],hiddenAmount:["",[ft.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.Ae||t.type===gt.M8||t.type===gt.f)).subscribe(t=>{t.type===gt.Ae&&(this.logger.info(t.payload),this.flgEditable=!1,this.newlyAddedPeer=t.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),t.type===gt.M8&&this.dialogRef.close(),t.type===gt.f&&t.payload.status===g.Bn.ERROR&&("SaveNewPeer"===t.payload.action?this.peerConnectionError=t.payload.message:"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch(new gt.rF({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(new gt.nb({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(t){switch(t.selectedIndex){case 0: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)";break;default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)"}t.selectedIndex<t.previouslySelectedIndex&&(0===t.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===t.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ht.so),o.Y36(ht.WI),o.Y36(x.yh),o.Y36(ft.qu),o.Y36(Z.eX),o.Y36(f.mQ))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Bs,5),o.Gf(Hs,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first),o.iGM(t=o.CRH())&&(e.stepper=t.first)}},decls:50,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-stroked-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","60","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",1,"mt-1"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/vByte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["mat-stroked-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Connect to a new peer"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return e.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"div",7),o.TgZ(10,"mat-vertical-stepper",8,9),o.NdJ("selectionChange",function(t){return e.stepSelectionChanged(t)}),o.TgZ(12,"mat-step",10),o.TgZ(13,"form",11),o.YNc(14,zs,1,1,"ng-template",12),o.TgZ(15,"mat-form-field",1),o._UZ(16,"input",13),o.YNc(17,Vs,2,0,"mat-error",14),o.qZA(),o.YNc(18,Gs,4,2,"div",15),o.TgZ(19,"div",16),o.TgZ(20,"button",17),o.NdJ("click",function(){return e.onConnectPeer()}),o._uU(21),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"mat-step",10),o.TgZ(23,"form",18),o.YNc(24,$s,1,1,"ng-template",19),o.TgZ(25,"div",20),o.TgZ(26,"div",21),o.TgZ(27,"mat-form-field",22),o._UZ(28,"input",23),o.TgZ(29,"mat-hint"),o._uU(30),o.qZA(),o.TgZ(31,"span",24),o._uU(32," Sats "),o.qZA(),o.YNc(33,Xs,2,0,"mat-error",14),o.YNc(34,Ws,2,0,"mat-error",14),o.YNc(35,Ks,2,1,"mat-error",14),o.qZA(),o.TgZ(36,"div",25),o.TgZ(37,"mat-slide-toggle",26),o._uU(38,"Private Channel"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"div",27),o.TgZ(40,"div",28),o.TgZ(41,"mat-form-field",1),o._UZ(42,"input",29),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(43,js,4,2,"div",15),o.TgZ(44,"div",16),o.TgZ(45,"button",30),o.NdJ("click",function(){return e.onOpenChannel()}),o._uU(46),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(47,"div",31),o.TgZ(48,"button",32),o.NdJ("click",function(){return e.onClose()}),o._uU(49),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(10),o.Q6J("linear",!0),o.xp6(2),o.Q6J("stepControl",e.peerFormGroup)("editable",e.flgEditable),o.xp6(1),o.Q6J("formGroup",e.peerFormGroup),o.xp6(4),o.Q6J("ngIf",null==e.peerFormGroup.controls.peerAddress.errors?null:e.peerFormGroup.controls.peerAddress.errors.required),o.xp6(1),o.Q6J("ngIf",""!==e.peerConnectionError),o.xp6(3),o.Oqu(""!==e.peerConnectionError?"Retry":"Add Peer"),o.xp6(1),o.Q6J("stepControl",e.channelFormGroup)("editable",e.flgEditable),o.xp6(1),o.Q6J("formGroup",e.channelFormGroup),o.xp6(5),o.Q6J("step",1e3),o.xp6(2),o.hij("Remaining Bal: ",e.totalBalance-(e.channelFormGroup.controls.fundingAmount.value?e.channelFormGroup.controls.fundingAmount.value:0),""),o.xp6(3),o.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.min),o.xp6(1),o.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.max),o.xp6(7),o.Q6J("step",1)("min",0),o.xp6(1),o.Q6J("ngIf",""!==e.channelConnectionError),o.xp6(3),o.Oqu(""!==e.channelConnectionError?"Retry":"Open Channel"),o.xp6(3),o.Oqu(null!=e.newlyAddedPeer&&e.newlyAddedPeer.nodeId?"Do It Later":"Close"))},directives:[l.xw,l.yH,T.dk,l.Wh,v.lW,T.dn,Qs.Vq,Qs.C0,ft._Y,ft.JL,ft.sg,Qs.VY,O.KE,xt.Nt,ft.Fj,Zt.h,ft.JJ,ft.u,ft.Q7,a.O5,ft.wV,O.bx,O.R9,pi.Rr,ft.qQ,yt.q,O.TO,A.BN],styles:[""]}),t})();function eo(t,e){1&t&&o._UZ(0,"mat-progress-bar",35)}function no(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1," ID "),o.qZA())}const ao=function(t){return{"max-width":t}};function io(t,e){if(1&t&&(o.TgZ(0,"td",37),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,ao,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),o.xp6(1),o.hij(" ",null==t?null:t.nodeId," ")}}function so(t,e){1&t&&(o.TgZ(0,"th",38),o._uU(1," Alias "),o.qZA())}const oo=function(t){return{"mr-0":t}};function lo(t,e){if(1&t&&o._UZ(0,"span",42),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,oo,t.screenSize===t.screenSizeEnum.XS))}}function ro(t,e){if(1&t&&o._UZ(0,"span",43),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,oo,t.screenSize===t.screenSizeEnum.XS))}}function co(t,e){if(1&t&&(o.TgZ(0,"td",39),o.YNc(1,lo,1,3,"span",40),o.YNc(2,ro,1,3,"span",41),o._uU(3),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(4,ao,n.screenSize===n.screenSizeEnum.XS?"10rem":"25rem")),o.xp6(1),o.Q6J("ngIf","CONNECTED"===t.state),o.xp6(1),o.Q6J("ngIf","DISCONNECTED"===t.state),o.xp6(1),o.hij(" ",null==t?null:t.alias," ")}}function uo(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1," State "),o.qZA())}function mo(t,e){if(1&t&&(o.TgZ(0,"td",44),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.state," ")}}function po(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1," Network Address "),o.qZA())}function ho(t,e){if(1&t&&(o.TgZ(0,"td",44),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.address," ")}}function go(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1," Channels "),o.qZA())}function fo(t,e){if(1&t&&(o.TgZ(0,"td",44),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.channels," ")}}function xo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",45),o.TgZ(1,"div",46),o.TgZ(2,"mat-select",47),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",48),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Zo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",48),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onPeerDetach(e)}),o._uU(1,"Disconnect"),o.qZA()}}function yo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",48),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onConnectPeer(e)}),o._uU(1,"Reconnect"),o.qZA()}}function Ao(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",49),o.TgZ(1,"div",46),o.TgZ(2,"mat-select",47),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",48),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onPeerClick(n,e)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",48),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onOpenChannel(e)}),o._uU(7,"Open Channel"),o.qZA(),o.YNc(8,Zo,2,0,"mat-option",50),o.YNc(9,yo,2,0,"mat-option",50),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.xp6(8),o.Q6J("ngIf","CONNECTED"===t.state),o.xp6(1),o.Q6J("ngIf","DISCONNECTED"===t.state)}}function Co(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No connected peer."),o.qZA())}function To(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting peers..."),o.qZA())}function wo(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.errorMessage)}}function So(t,e){if(1&t&&(o.TgZ(0,"td",51),o.YNc(1,Co,2,0,"p",52),o.YNc(2,To,2,0,"p",52),o.YNc(3,wo,2,1,"p",52),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers||null==t.peers.data?null:t.peers.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPeers.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers||null==t.peers.data?null:t.peers.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPeers.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers||null==t.peers.data?null:t.peers.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPeers.status)===t.apiCallStatusEnum.ERROR)}}const vo=function(t){return{"display-none":t}};function qo(t,e){if(1&t&&o._UZ(0,"tr",53),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,vo,(null==t.peers?null:t.peers.data)&&(null==t.peers||null==t.peers.data?null:t.peers.data.length)>0))}}function bo(t,e){1&t&&o._UZ(0,"tr",54)}function Lo(t,e){if(1&t&&o._UZ(0,"tr",55),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("@newlyAddedRowAnimation",t.pub_key===n.newlyAddedPeer&&n.flgAnimate?"added":"notAdded")}}const Fo=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Io=function(){return["no_peer"]};let No=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.rtlEffects=n,this.actions=a,this.commonService=i,this.faUsers=h.FVb,this.newlyAddedPeer="",this.flgAnimate=!0,this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.information={},this.availableBalance=0,this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","actions"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","channels","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","address","channels","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPeers.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPeers.message?JSON.stringify(this.apisCallStatus.FetchPeers.message):this.apisCallStatus.FetchPeers.message),this.information=t.information,this.availableBalance=t.onchainBalance.total||0,this.peersData=t.peers,this.loadPeersTable(this.peersData),setTimeout(()=>{this.flgAnimate=!1},3e3),this.logger.info(t)}),this.actions.pipe((0,m.R)(this.unSubs[1]),(0,ut.h)(t=>t.type===gt.IH)).subscribe(t=>{this.peerAddress=null,this.flgAnimate=!0})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(t,e){const n=[[{key:"nodeId",value:t.nodeId,title:"Public Key",width:100}],[{key:"address",value:t.address,title:"Address",width:50},{key:"alias",value:t.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(t.state),title:"State",width:50},{key:"channels",value:t.channels,title:"Channels",width:50}]];this.store.dispatch(new Ft.wu({data:{type:g.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:t.nodeId,message:n}}))}onConnectPeer(t){this.store.dispatch(new Ft.wu({data:{message:{peer:t.nodeId?t:null,information:this.information,balance:this.availableBalance},component:to}}))}onOpenChannel(t){this.store.dispatch(new Ft.wu({data:{alertTitle:"Open Channel",message:{peer:t,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:bi}}))}onPeerDetach(t){this.store.dispatch(t.channels>0?new Ft.wu({data:{type:g.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}):new Ft.b_({data:{type:g.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(t.alias?t.alias:t.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe((0,m.R)(this.unSubs[3])).subscribe(e=>{e&&this.store.dispatch(new gt.hF({nodeId:t.nodeId}))})}applyFilter(t){this.peers.filter=t.value.trim().toLowerCase()}loadPeersTable(t){this.peers=new pt.by(t?[...t]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.peers.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.peers.paginator=this.paginator}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(Le.V),o.Y36(Z.eX),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-peers"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Peers")}])],decls:42,vars:14,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","30"],["fxLayout","row","fxLayoutAlign","start start"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","nodeId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3",3,"ngStyle",4,"matCellDef"],["matColumnDef","state"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","",1,"px-3"],["mat-cell","",1,"px-3",3,"ngStyle"],["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-cell",""],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.TgZ(3,"button",3),o.NdJ("click",function(){return e.onConnectPeer({})}),o._uU(4,"Add Peer"),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"div",5),o.TgZ(7,"div",6),o._UZ(8,"fa-icon",7),o.TgZ(9,"span",8),o._uU(10,"Peers"),o.qZA(),o.qZA(),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"div",10),o.TgZ(13,"input",11),o.NdJ("keyup",function(t){return e.applyFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(14,"div",12),o.YNc(15,eo,1,0,"mat-progress-bar",13),o.TgZ(16,"table",14,15),o.ynx(18,16),o.YNc(19,no,2,0,"th",17),o.YNc(20,io,2,4,"td",18),o.BQk(),o.ynx(21,19),o.YNc(22,so,2,0,"th",20),o.YNc(23,co,4,6,"td",21),o.BQk(),o.ynx(24,22),o.YNc(25,uo,2,0,"th",17),o.YNc(26,mo,2,1,"td",23),o.BQk(),o.ynx(27,24),o.YNc(28,po,2,0,"th",17),o.YNc(29,ho,2,1,"td",23),o.BQk(),o.ynx(30,25),o.YNc(31,go,2,0,"th",17),o.YNc(32,fo,2,1,"td",23),o.BQk(),o.ynx(33,26),o.YNc(34,xo,6,0,"th",27),o.YNc(35,Ao,10,2,"td",28),o.BQk(),o.ynx(36,29),o.YNc(37,So,4,3,"td",30),o.BQk(),o.YNc(38,qo,1,3,"tr",31),o.YNc(39,bo,1,0,"tr",32),o.YNc(40,Lo,1,1,"tr",33),o.qZA(),o.qZA(),o._UZ(41,"mat-paginator",34),o.qZA(),o.qZA()),2&t&&(o.xp6(8),o.Q6J("icon",e.faUsers),o.xp6(7),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchPeers.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.peers)("ngClass",o.VKq(11,Fo,""!==e.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(13,Io)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[l.xw,l.yH,l.Wh,ft._Y,ft.JL,ft.F,v.lW,A.BN,O.KE,xt.Nt,M.$V,a.O5,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,U.gM,At.gD,At.$L,Ct.ey,pt.yh,pt.Q2,pt.XQ,pt.Gk],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-nodeId[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-nodeId[_ngcontent-%COMP%]{padding-right:2rem}.mat-column-address[_ngcontent-%COMP%]{flex:1 1 15%;width:15%}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[Lt.Q]}}),t})();const _o=["queryRoutesForm"];function Do(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Destination Node ID is required."),o.qZA())}function ko(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Oo(t,e){1&t&&o._UZ(0,"mat-progress-bar",31)}function Uo(t,e){1&t&&(o.TgZ(0,"th",32),o._uU(1," Alias "),o.qZA())}function Ro(t,e){if(1&t&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.alias," ")}}function Mo(t,e){1&t&&(o.TgZ(0,"th",32),o._uU(1," ID "),o.qZA())}function Jo(t,e){if(1&t&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.nodeId," ")}}function Po(t,e){1&t&&(o.TgZ(0,"th",34),o.TgZ(1,"span",35),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Eo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",36),o.TgZ(1,"button",37),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onHopClick(n,e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Yo(t,e){1&t&&o._UZ(0,"tr",38)}function Qo(t,e){1&t&&o._UZ(0,"tr",39)}const Bo=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}};let Ho=(()=>{class t{constructor(t,e,n){this.store=t,this.eclEffects=e,this.commonService=n,this.nodeId="",this.amount=0,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=h.FpQ,this.faExclamationTriangle=h.eHv,this.screenSize="",this.screenSizeEnum=g.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===g.cu.SM||this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","actions"])}ngOnInit(){this.qrHops=new pt.by([]),this.eclEffects.setQueryRoutes.pipe((0,m.R)(this.unSubs[1])).subscribe(t=>{this.qrHops.data=[],t?(this.flgLoading[0]=!1,this.qrHops=new pt.by([...t]),this.qrHops.data=t):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops.data=[],this.flgLoading[0]=!0,this.store.dispatch(new gt.bm({nodeId:this.nodeId,amount:1e3*this.amount}))}resetData(){this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(t,e){this.store.dispatch(new Ft.wu({data:{type:g.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"alias",value:t.alias,title:"Alias",width:100,type:g.Gi.STRING}],[{key:"nodeId",value:t.nodeId,title:"Node ID",width:100,type:g.Gi.STRING}]]}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(x.yh),o.Y36(de.o),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(_o,7)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.form=t.first)}},decls:39,vars:16,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-2"],["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"],[1,"table-container","mb-6",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-4","pr-3"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.NdJ("ngSubmit",function(){return o.CHM(t),o.MAs(2).form.valid&&e.onQueryRoutes()}),o.TgZ(3,"div",3),o._UZ(4,"fa-icon",4),o.TgZ(5,"span"),o._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),o.qZA(),o.qZA(),o.TgZ(7,"mat-form-field",5),o.TgZ(8,"input",6,7),o.NdJ("ngModelChange",function(t){return e.nodeId=t}),o.qZA(),o.YNc(10,Do,2,0,"mat-error",8),o.qZA(),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10),o.NdJ("ngModelChange",function(t){return e.amount=t}),o.qZA(),o.YNc(13,ko,2,0,"mat-error",8),o.qZA(),o.TgZ(14,"div",11),o.TgZ(15,"button",12),o.NdJ("click",function(){return e.resetData()}),o._uU(16,"Clear"),o.qZA(),o.TgZ(17,"button",13),o._uU(18,"Query Route"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",14),o.TgZ(20,"div",15),o._UZ(21,"fa-icon",16),o.TgZ(22,"span",17),o._uU(23,"Transaction Route"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(24,"div",18),o.YNc(25,Oo,1,0,"mat-progress-bar",19),o.TgZ(26,"table",20,21),o.ynx(28,22),o.YNc(29,Uo,2,0,"th",23),o.YNc(30,Ro,2,1,"td",24),o.BQk(),o.ynx(31,25),o.YNc(32,Mo,2,0,"th",23),o.YNc(33,Jo,2,1,"td",24),o.BQk(),o.ynx(34,26),o.YNc(35,Po,3,0,"th",27),o.YNc(36,Eo,3,0,"td",28),o.BQk(),o.YNc(37,Yo,1,0,"tr",29),o.YNc(38,Qo,1,0,"tr",30),o.qZA(),o.qZA(),o.qZA()}2&t&&(o.xp6(4),o.Q6J("icon",e.faExclamationTriangle),o.xp6(4),o.Q6J("ngModel",e.nodeId),o.xp6(2),o.Q6J("ngIf",!e.nodeId),o.xp6(2),o.Q6J("ngModel",e.amount)("step",1e3)("min",0),o.xp6(1),o.Q6J("ngIf",!e.amount),o.xp6(8),o.Q6J("icon",e.faRoute),o.xp6(4),o.Q6J("ngIf",!0===e.flgLoading[0]),o.xp6(1),o.Q6J("dataSource",e.qrHops)("ngClass",o.VKq(14,Bo,"error"===e.flgLoading[0])),o.xp6(11),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns))},directives:[l.xw,l.yH,ft._Y,ft.JL,ft.F,l.Wh,A.BN,O.KE,xt.Nt,ft.Fj,ft.Q7,ft.JJ,ft.On,a.O5,ft.wV,ft.qQ,yt.q,v.lW,M.$V,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.as,pt.nj,O.TO,r.pW,pt.ge,mt.nU,pt.ev,pt.XQ,pt.Gk],styles:[".mat-column-actions[_ngcontent-%COMP%]{flex:0 0 5%;width:5%}.mat-column-pubkey_alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function zo(t,e){1&t&&o._UZ(0,"mat-progress-bar",29)}function Vo(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1," State "),o.qZA())}function Go(t,e){if(1&t&&(o.TgZ(0,"span",36),o._UZ(1,"fa-icon",37),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEyeSlash)}}function $o(t,e){if(1&t&&(o.TgZ(0,"span",38),o._UZ(1,"fa-icon",37),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEye)}}const Xo=function(t){return{"max-width":t}};function Wo(t,e){if(1&t&&(o.TgZ(0,"td",31),o.TgZ(1,"div",32),o.YNc(2,Go,2,1,"span",33),o.YNc(3,$o,2,1,"span",34),o.TgZ(4,"span",35),o._uU(5),o.ALo(6,"titlecase"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(6,Xo,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(1),o.Q6J("ngIf",0===t.channelFlags),o.xp6(1),o.Q6J("ngIf",0!==t.channelFlags),o.xp6(2),o.Oqu(o.lcZ(6,4,null==t?null:t.state))}}function Ko(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1," Short Channel ID "),o.qZA())}function jo(t,e){if(1&t&&(o.TgZ(0,"td",31),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.shortChannelId)}}function tl(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1," Alias "),o.qZA())}function el(t,e){if(1&t&&(o.TgZ(0,"td",31),o.TgZ(1,"div",32),o.TgZ(2,"span",35),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Xo,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(2),o.Oqu(t.alias)}}function nl(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Local Balance (Sats) "),o.qZA())}function al(t,e){if(1&t&&(o.TgZ(0,"td",31),o.TgZ(1,"span",40),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function il(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Remote Balance (Sats) "),o.qZA())}function sl(t,e){if(1&t&&(o.TgZ(0,"td",31),o.TgZ(1,"span",40),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.hij(" ",o.xi3(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function ol(t,e){1&t&&(o.TgZ(0,"th",41),o._uU(1,"Balance Score "),o.qZA())}function ll(t,e){if(1&t&&(o.TgZ(0,"td",42),o.TgZ(1,"div",43),o.TgZ(2,"mat-hint",44),o._uU(3),o.ALo(4,"number"),o.qZA(),o.qZA(),o._UZ(5,"mat-progress-bar",45),o.qZA()),2&t){const t=e.$implicit;o.xp6(3),o.Oqu(o.lcZ(4,2,(null==t?null:t.balancedness)||0)),o.xp6(2),o.s9C("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function rl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",46),o.TgZ(1,"div",47),o.TgZ(2,"mat-select",48),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",49),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function cl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",50),o.TgZ(1,"div",51),o.TgZ(2,"mat-select",52),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",49),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onChannelClick(n,e)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",49),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelClose(e,!0)}),o._uU(7,"Force Close"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function ul(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No inactive channel available."),o.qZA())}function dl(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting inactive channels..."),o.qZA())}function ml(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.errorMessage)}}function pl(t,e){if(1&t&&(o.TgZ(0,"td",53),o.YNc(1,ul,2,0,"p",54),o.YNc(2,dl,2,0,"p",54),o.YNc(3,ml,2,1,"p",54),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchChannels.status)===t.apiCallStatusEnum.ERROR)}}const hl=function(t){return{"display-none":t}};function gl(t,e){if(1&t&&o._UZ(0,"tr",55),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,hl,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function fl(t,e){1&t&&o._UZ(0,"tr",56)}function xl(t,e){1&t&&o._UZ(0,"tr",57)}const Zl=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},yl=function(){return["no_channel"]};let Al=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.store=e,this.rtlEffects=n,this.commonService=a,this.faEye=h.Mdf,this.faEyeSlash=h.Aq,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=g.vn,this.selFilter="",this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS||this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","balancedness","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchChannels.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.inactiveChannels=t.inactiveChannels,this.loadChannelsTable(),this.logger.info(t)})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(t,e){this.store.dispatch(new Ft.b_({data:{type:g.n_.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage:e?"Force closing channel: "+t.channelId:"Closing channel: "+t.channelId,noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}})),this.rtlEffects.closeConfirm.pipe((0,m.R)(this.unSubs[1])).subscribe(n=>{n&&this.store.dispatch(new gt.e8({channelId:t.channelId,force:e}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}onChannelClick(t,e){this.store.dispatch(new Ft.wu({data:{channel:t,channelsType:"inactive",component:Yi}}))}loadChannelsTable(){this.inactiveChannels.sort((t,e)=>t.alias===e.alias?0:e.alias?1:-1),this.channels=new pt.by([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(x.yh),o.Y36(Le.V),o.Y36(y.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Channels")}])],decls:36,vars:14,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","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","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","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["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(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,zo,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,Vo,2,0,"th",10),o.YNc(11,Wo,7,8,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,Ko,2,0,"th",10),o.YNc(14,jo,2,1,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,tl,2,0,"th",10),o.YNc(17,el,4,4,"td",11),o.BQk(),o.ynx(18,14),o.YNc(19,nl,2,0,"th",15),o.YNc(20,al,4,4,"td",11),o.BQk(),o.ynx(21,16),o.YNc(22,il,2,0,"th",15),o.YNc(23,sl,4,4,"td",11),o.BQk(),o.ynx(24,17),o.YNc(25,ol,2,0,"th",18),o.YNc(26,ll,6,4,"td",19),o.BQk(),o.ynx(27,20),o.YNc(28,rl,6,0,"th",21),o.YNc(29,cl,8,0,"td",22),o.BQk(),o.ynx(30,23),o.YNc(31,pl,4,3,"td",24),o.BQk(),o.YNc(32,gl,1,3,"tr",25),o.YNc(33,fl,1,0,"tr",26),o.YNc(34,xl,1,0,"tr",27),o.qZA(),o.qZA(),o._UZ(35,"mat-paginator",28),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.selFilter),o.xp6(2),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.channels)("ngClass",o.VKq(11,Zl,""!==e.errorMessage)),o.xp6(25),o.Q6J("matFooterRowDef",o.DdM(13,yl)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,O.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,M.$V,a.O5,pt.BZ,mt.YE,a.mk,S.oO,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,U.gM,A.BN,O.bx,At.gD,At.$L,Ct.ey,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.rS,a.JJ],styles:[".mat-column-state[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-state[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;flex:0 0 20%;width:20%}.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 15%;width:15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:37.5em){.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width:37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),t})();function Cl(t,e){if(1&t&&(o.TgZ(0,"div",5),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errorMessage)}}function Tl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",6),o._UZ(1,"div",7),o.TgZ(2,"mat-form-field",8),o.TgZ(3,"input",9),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().filterValue=e})("input",function(){return o.CHM(t),o.oxw().applyFilter()})("keyup",function(){return o.CHM(t),o.oxw().applyFilter()}),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.filterValue)}}function wl(t,e){1&t&&o._UZ(0,"mat-progress-bar",32)}function Sl(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"Date/Time"),o.qZA())}function vl(t,e){if(1&t&&(o.TgZ(0,"td",34),o._uU(1),o.ALo(2,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(o.xi3(2,1,null==t?null:t.timestamp,"dd/MMM/YYYY HH:mm"))}}function ql(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"In Channel"),o.qZA())}const bl=function(t){return{"max-width":t}};function Ll(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,bl,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(1),o.Oqu(null==t?null:t.fromChannelAlias)}}function Fl(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1,"Out Channel"),o.qZA())}function Il(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,bl,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(1),o.Oqu(null==t?null:t.toChannelAlias)}}function Nl(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Amount In (Sats)"),o.qZA())}function _l(t,e){if(1&t&&(o.TgZ(0,"td",34),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,null==t?null:t.amountIn))}}function Dl(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Amount Out (Sats)"),o.qZA())}function kl(t,e){if(1&t&&(o.TgZ(0,"td",34),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,null==t?null:t.amountOut))}}function Ol(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Fee Earned (Sats)"),o.qZA())}function Ul(t,e){if(1&t&&(o.TgZ(0,"td",34),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,(null==t?null:t.amountIn)-(null==t?null:t.amountOut)))}}function Rl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",38),o.TgZ(1,"div",39),o.TgZ(2,"mat-select",40),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",41),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Ml(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",42),o.TgZ(1,"button",43),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw(2).onForwardingEventClick(n,e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Jl(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No forwarding history available."),o.qZA())}function Pl(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting forwarding history..."),o.qZA())}function El(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.errorMessage)}}function Yl(t,e){if(1&t&&(o.TgZ(0,"td",44),o.YNc(1,Jl,2,0,"p",45),o.YNc(2,Pl,2,0,"p",45),o.YNc(3,El,2,1,"p",45),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.ERROR)}}const Ql=function(t){return{"display-none":t}};function Bl(t,e){if(1&t&&o._UZ(0,"tr",46),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Ql,(null==t.forwardingHistoryEvents?null:t.forwardingHistoryEvents.data)&&(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)>0))}}function Hl(t,e){1&t&&o._UZ(0,"tr",47)}function zl(t,e){1&t&&o._UZ(0,"tr",48)}const Vl=function(){return["no_event"]};function Gl(t,e){if(1&t&&(o.TgZ(0,"div",10),o.YNc(1,wl,1,0,"mat-progress-bar",11),o.TgZ(2,"table",12,13),o.ynx(4,14),o.YNc(5,Sl,2,0,"th",15),o.YNc(6,vl,3,4,"td",16),o.BQk(),o.ynx(7,17),o.YNc(8,ql,2,0,"th",15),o.YNc(9,Ll,2,4,"td",18),o.BQk(),o.ynx(10,19),o.YNc(11,Fl,2,0,"th",15),o.YNc(12,Il,2,4,"td",18),o.BQk(),o.ynx(13,20),o.YNc(14,Nl,2,0,"th",21),o.YNc(15,_l,4,3,"td",16),o.BQk(),o.ynx(16,22),o.YNc(17,Dl,2,0,"th",21),o.YNc(18,kl,4,3,"td",16),o.BQk(),o.ynx(19,23),o.YNc(20,Ol,2,0,"th",21),o.YNc(21,Ul,4,3,"td",16),o.BQk(),o.ynx(22,24),o.YNc(23,Rl,6,0,"th",25),o.YNc(24,Ml,3,0,"td",26),o.BQk(),o.ynx(25,27),o.YNc(26,Yl,4,3,"td",28),o.BQk(),o.YNc(27,Bl,1,3,"tr",29),o.YNc(28,Hl,1,0,"tr",30),o.YNc(29,zl,1,0,"tr",31),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.forwardingHistoryEvents),o.xp6(25),o.Q6J("matFooterRowDef",o.DdM(6,Vl)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)}}function $l(t,e){if(1&t&&o._UZ(0,"mat-paginator",49),2&t){const t=o.oxw();o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Xl=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.datePipe=a,this.eventsData=[],this.filterValue="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","actions"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","fee","actions"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","amountOut","fee","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","fromChannelAlias","toChannelAlias","amountIn","amountOut","fee","actions"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.eventsData.length<=0&&(this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPayments.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPayments.message?JSON.stringify(this.apisCallStatus.FetchPayments.message):this.apisCallStatus.FetchPayments.message),this.eventsData=t.payments&&t.payments.relayed?t.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)}ngOnChanges(t){t.eventsData&&(this.eventsData=t.eventsData.currentValue,t.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),t.filterValue&&!t.filterValue.firstChange&&this.applyFilter()}onForwardingEventClick(t,e){const n=[[{key:"paymentHash",value:t.paymentHash,title:"Payment Hash",width:100,type:g.Gi.STRING}],[{key:"timestamp",value:Math.round(t.timestamp/1e3),title:"Date/Time",width:50,type:g.Gi.DATE_TIME},{key:"fee",value:t.amountIn-t.amountOut,title:"Fee Earned (Sats)",width:50,type:g.Gi.NUMBER}],[{key:"amountIn",value:t.amountIn,title:"Amount In (Sats)",width:50,type:g.Gi.NUMBER},{key:"amountOut",value:t.amountOut,title:"Amount Out (Sats)",width:50,type:g.Gi.NUMBER}],[{key:"fromChannelAlias",value:t.fromChannelAlias,title:"From Channel Alias",width:50,type:g.Gi.STRING},{key:"fromShortChannelId",value:t.fromShortChannelId,title:"From Short Channel ID",width:50,type:g.Gi.STRING}],[{key:"fromChannelId",value:t.fromChannelId,title:"From Channel Id",width:100,type:g.Gi.STRING}],[{key:"toChannelAlias",value:t.toChannelAlias,title:"To Channel Alias",width:50,type:g.Gi.STRING},{key:"toShortChannelId",value:t.toShortChannelId,title:"To Short Channel ID",width:50,type:g.Gi.STRING}],[{key:"toChannelId",value:t.toChannelId,title:"To Channel Id",width:100,type:g.Gi.STRING}]];this.store.dispatch(new Ft.wu({data:{type:g.n_.INFORMATION,alertTitle:"Event Information",message:n}}))}loadForwardingEventsTable(t){this.forwardingHistoryEvents=new pt.by([...t]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(t,e)=>{switch(e){case"fee":return t.amountIn-t.amountOut;default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},this.forwardingHistoryEvents.filterPredicate=(t,e)=>((t.timestamp?this.datePipe.transform(new Date(t.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.forwardingHistoryEvents.paginator=this.paginator,this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.filterValue.trim().toLowerCase())}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh),o.Y36(a.uU))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mt.YE,5),o.Gf(dt.NW,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.paginator=t.first)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[o._Bn([{provide:dt.ye,useValue:(0,g.pt)("Events")}]),o.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","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["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","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","fromChannelAlias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","toChannelAlias"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",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(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,Cl,2,1,"div",1),o.YNc(2,Tl,4,1,"div",2),o.YNc(3,Gl,30,7,"div",3),o.YNc(4,$l,1,3,"mat-paginator",4),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf",""!==e.errorMessage),o.xp6(1),o.Q6J("ngIf",""===e.errorMessage),o.xp6(1),o.Q6J("ngIf",""===e.errorMessage),o.xp6(1),o.Q6J("ngIf",""===e.errorMessage))},directives:[l.xw,l.Wh,a.O5,l.yH,O.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,M.$V,pt.BZ,mt.YE,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,At.gD,At.$L,Ct.ey,v.lW,pt.yh,pt.Q2,a.mk,S.oO,pt.XQ,pt.Gk,dt.NW],pipes:[a.uU,a.JJ],styles:[".mat-column-fromAlias[_ngcontent-%COMP%]{padding-left:2rem}.mat-column-fromAlias[_ngcontent-%COMP%], .mat-column-toAlias[_ngcontent-%COMP%]{flex:1 1 20%;width:20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-toAlias[_ngcontent-%COMP%]{padding-left:1rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();const Wl=["tableIn"],Kl=["tableOut"],jl=["paginatorIn"],tr=["paginatorOut"];function er(t,e){if(1&t&&(o.TgZ(0,"div",3),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errorMessage)}}function nr(t,e){1&t&&o._UZ(0,"mat-progress-bar",36)}function ar(t,e){1&t&&(o.TgZ(0,"th",37),o._uU(1,"Channel ID"),o.qZA())}const ir=function(t){return{"max-width":t}};function sr(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,ir,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.channelId)}}function or(t,e){1&t&&(o.TgZ(0,"th",37),o._uU(1,"Peer Alias"),o.qZA())}function lr(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,ir,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.alias)}}function rr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Events"),o.qZA())}function cr(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.events))}}function ur(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Amount (Sats)"),o.qZA())}function dr(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.totalAmount))}}function mr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Fee (Sats)"),o.qZA())}function pr(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.totalFee))}}function hr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No incoming routing peer available."),o.qZA())}function gr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting incoming routing peers..."),o.qZA())}function fr(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.errorMessage)}}function xr(t,e){if(1&t&&(o.TgZ(0,"td",42),o.YNc(1,hr,2,0,"p",43),o.YNc(2,gr,2,0,"p",43),o.YNc(3,fr,2,1,"p",43),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.ERROR)}}const Zr=function(t){return{"display-none":t}};function yr(t,e){if(1&t&&o._UZ(0,"tr",44),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Zr,(null==t.RoutingPeersIncoming?null:t.RoutingPeersIncoming.data)&&(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)>0))}}function Ar(t,e){1&t&&o._UZ(0,"tr",45)}function Cr(t,e){1&t&&o._UZ(0,"tr",46)}function Tr(t,e){1&t&&o._UZ(0,"mat-progress-bar",36)}function wr(t,e){1&t&&(o.TgZ(0,"th",37),o._uU(1,"Channel ID"),o.qZA())}function Sr(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,ir,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.channelId)}}function vr(t,e){1&t&&(o.TgZ(0,"th",37),o._uU(1,"Peer Alias"),o.qZA())}function qr(t,e){if(1&t&&(o.TgZ(0,"td",38),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,ir,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.alias)}}function br(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Events"),o.qZA())}function Lr(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.events))}}function Fr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Amount (Sats)"),o.qZA())}function Ir(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.totalAmount))}}function Nr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1,"Fee (Sats)"),o.qZA())}function _r(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",41),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,t.totalFee))}}function Dr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No outgoing routing peer available."),o.qZA())}function kr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting outgoing routing peers..."),o.qZA())}function Or(t,e){if(1&t&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.errorMessage)}}function Ur(t,e){if(1&t&&(o.TgZ(0,"td",42),o.YNc(1,Dr,2,0,"p",43),o.YNc(2,kr,2,0,"p",43),o.YNc(3,Or,2,1,"p",43),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.ERROR)}}function Rr(t,e){if(1&t&&o._UZ(0,"tr",44),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Zr,(null==t.RoutingPeersOutgoing?null:t.RoutingPeersOutgoing.data)&&(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)>0))}}function Mr(t,e){1&t&&o._UZ(0,"tr",45)}function Jr(t,e){1&t&&o._UZ(0,"tr",46)}const Pr=function(t,e){return{"mt-2":t,"mt-1":e}},Er=function(){return["no_incoming_event"]},Yr=function(t){return{"mt-2":t}},Qr=function(){return["no_outgoing_event"]};function Br(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",7),o._uU(4,"Incoming"),o.qZA(),o.TgZ(5,"mat-form-field",8),o.TgZ(6,"input",9),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyIncomingFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",10),o.YNc(8,nr,1,0,"mat-progress-bar",11),o.TgZ(9,"table",12,13),o.ynx(11,14),o.YNc(12,ar,2,0,"th",15),o.YNc(13,sr,2,4,"td",16),o.BQk(),o.ynx(14,17),o.YNc(15,or,2,0,"th",15),o.YNc(16,lr,2,4,"td",16),o.BQk(),o.ynx(17,18),o.YNc(18,rr,2,0,"th",19),o.YNc(19,cr,4,3,"td",20),o.BQk(),o.ynx(20,21),o.YNc(21,ur,2,0,"th",19),o.YNc(22,dr,4,3,"td",20),o.BQk(),o.ynx(23,22),o.YNc(24,mr,2,0,"th",19),o.YNc(25,pr,4,3,"td",20),o.BQk(),o.ynx(26,23),o.YNc(27,xr,4,3,"td",24),o.BQk(),o.YNc(28,yr,1,3,"tr",25),o.YNc(29,Ar,1,0,"tr",26),o.YNc(30,Cr,1,0,"tr",27),o.qZA(),o.qZA(),o._UZ(31,"mat-paginator",28,29),o.qZA(),o.TgZ(33,"div",30),o.TgZ(34,"div",6),o.TgZ(35,"div",7),o._uU(36,"Outgoing"),o.qZA(),o.TgZ(37,"mat-form-field",8),o.TgZ(38,"input",9),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyOutgoingFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"div",31),o.YNc(40,Tr,1,0,"mat-progress-bar",11),o.TgZ(41,"table",32,33),o.ynx(43,14),o.YNc(44,wr,2,0,"th",15),o.YNc(45,Sr,2,4,"td",16),o.BQk(),o.ynx(46,17),o.YNc(47,vr,2,0,"th",15),o.YNc(48,qr,2,4,"td",16),o.BQk(),o.ynx(49,18),o.YNc(50,br,2,0,"th",19),o.YNc(51,Lr,4,3,"td",20),o.BQk(),o.ynx(52,21),o.YNc(53,Fr,2,0,"th",19),o.YNc(54,Ir,4,3,"td",20),o.BQk(),o.ynx(55,22),o.YNc(56,Nr,2,0,"th",19),o.YNc(57,_r,4,3,"td",20),o.BQk(),o.ynx(58,34),o.YNc(59,Ur,4,3,"td",24),o.BQk(),o.YNc(60,Rr,1,3,"tr",25),o.YNc(61,Mr,1,0,"tr",26),o.YNc(62,Jr,1,0,"tr",27),o.qZA(),o._UZ(63,"mat-paginator",28,35),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngClass",o.WLB(20,Pr,t.screenSize===t.screenSizeEnum.XS,t.screenSize===t.screenSizeEnum.SM)),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.RoutingPeersIncoming),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(23,Er)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS),o.xp6(3),o.Q6J("ngClass",o.VKq(24,Yr,t.screenSize!==t.screenSizeEnum.LG)),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.RoutingPeersOutgoing),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(26,Qr)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Hr=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.routingPeersData=[],this.displayedColumns=[],this.flgSticky=!1,this.pageSize=g.IV,this.pageSizeOptions=g.TJ,this.screenSize="",this.screenSizeEnum=g.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=g.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===g.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","totalFee"]):this.screenSize===g.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalFee"]):this.screenSize===g.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalAmount","totalFee"]):(this.flgSticky=!0,this.displayedColumns=["channelId","alias","events","totalAmount","totalFee"])}ngOnInit(){this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPayments.status===g.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPayments.message?JSON.stringify(this.apisCallStatus.FetchPayments.message):this.apisCallStatus.FetchPayments.message),this.routingPeersData=t.payments&&t.payments.relayed?t.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(t)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}loadRoutingPeersTable(t){if(t.length>0){const e=this.groupRoutingPeers(t);this.RoutingPeersIncoming=new pt.by(e[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.RoutingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new pt.by(e[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.RoutingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new pt.by([]),this.RoutingPeersOutgoing=new pt.by([])}groupRoutingPeers(t){const e=[],n=[];return t.forEach(t=>{const a=e.find(e=>e.channelId===t.fromChannelId),i=n.find(e=>e.channelId===t.toChannelId);a?(a.events++,a.totalAmount=+a.totalAmount+ +t.amountIn,a.totalFee=t.amountIn-t.amountOut+ +a.totalFee):e.push({channelId:t.fromChannelId,alias:t.fromChannelAlias,events:1,totalAmount:+t.amountIn,totalFee:t.amountIn-t.amountOut}),i?(i.events++,i.totalAmount=+i.totalAmount+ +t.amountOut,i.totalFee=t.amountIn-t.amountOut+ +i.totalFee):n.push({channelId:t.toChannelId,alias:t.toChannelAlias,events:1,totalAmount:+t.amountOut,totalFee:t.amountIn-t.amountOut})}),[this.commonService.sortDescByKey(e,"totalFee"),this.commonService.sortDescByKey(n,"totalFee")]}applyIncomingFilter(t){this.RoutingPeersIncoming.filter=t.value.trim().toLowerCase()}applyOutgoingFilter(t){this.RoutingPeersOutgoing.filter=t.value.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Wl,5,mt.YE),o.Gf(Kl,5,mt.YE),o.Gf(jl,5),o.Gf(tr,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.sortIn=t.first),o.iGM(t=o.CRH())&&(e.sortOut=t.first),o.iGM(t=o.CRH())&&(e.paginatorIn=t.first),o.iGM(t=o.CRH())&&(e.paginatorOut=t.first)}},features:[o._Bn([{provide:dt.ye,useValue:(0,g.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",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"],["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","30"],["matInput","","placeholder","Filter",3,"keyup"],["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","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["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","matHeaderRowDefSticky"],["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","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,er,2,1,"div",1),o.YNc(2,Br,65,27,"div",2),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf",""!==e.errorMessage),o.xp6(1),o.Q6J("ngIf",""===e.errorMessage))},directives:[l.xw,l.Wh,a.O5,l.yH,a.mk,S.oO,O.KE,xt.Nt,M.$V,pt.BZ,mt.YE,pt.w1,pt.fO,pt.Dz,pt.mD,pt.Ke,pt.as,pt.nj,dt.NW,r.pW,pt.ge,mt.nU,pt.ev,a.PC,S.Zl,pt.yh,pt.Q2,pt.XQ,pt.Gk],pipes:[a.JJ],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-channelId[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function zr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",7),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().activeLink=e.link}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.s9C("routerLink",t.link),o.Q6J("active",n.activeLink===t.link),o.xp6(1),o.Oqu(t.name)}}let Vr=(()=>{class t{constructor(t){this.router=t,this.faChartBar=h.koM,this.links=[{link:"routingfees",name:"Routing Fees"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new d.x,new d.x,new d.x,new d.x]}ngOnInit(){const t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,m.R)(this.unSubs[0]),(0,ut.h)(t=>t instanceof i.Av)).subscribe(t=>{const e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.F0))},t.\u0275cmp=o.Xpm({type:t,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(t,e){1&t&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Reports"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o.TgZ(7,"nav",5),o.YNc(8,zr,2,3,"div",6),o.qZA(),o._UZ(9,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("icon",e.faChartBar),o.xp6(7),o.Q6J("ngForOf",e.links))},directives:[l.xw,l.Wh,A.BN,T.a8,T.dn,ct.BU,a.sg,i.lC,ct.Nj,i.rH],styles:[""]}),t})();var Gr=n(4833),$r=n(4018),Xr=n(1905);function Wr(t,e){if(1&t&&(o.TgZ(0,"div",8),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&t){const t=o.oxw();o.Q6J("@fadeIn",t.totalFeeSat),o.xp6(1),o.AsE("",o.xi3(2,3,t.totalFeeSat||0,"1.0-2")," Sats/",o.lcZ(3,6,t.filteredEventsBySelectedPeriod.length||0)," Events")}}function Kr(t,e){1&t&&(o.TgZ(0,"div",9),o._uU(1,"No fee report for the selected period"),o.qZA())}function jr(t,e){if(1&t&&(o.TgZ(0,"span"),o.TgZ(1,"span",12),o._uU(2),o.ALo(3,"number"),o.qZA(),o.TgZ(4,"span",12),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA()),2&t){const t=e.model;o.xp6(2),o.hij("Events: ",o.lcZ(3,2,t.extra.totalEvents||0),""),o.xp6(3),o.hij("Fee: ",o.xi3(6,4,t.value||0,"1.0-2"),"")}}function tc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"ngx-charts-bar-vertical",10),o.NdJ("select",function(e){return o.CHM(t),o.oxw().onChartBarSelected(e)})("mouseup",function(e){return o.CHM(t),o.oxw().onChartMouseUp(e)}),o.YNc(1,jr,7,7,"ng-template",null,11,o.W1O),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("view",t.view)("results",t.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function ec(t,e){if(1&t&&o._UZ(0,"rtl-ecl-forwarding-history",13),2&t){const t=o.oxw();o.Q6J("eventsData",t.filteredEventsBySelectedPeriod)("filterValue",t.eventFilterValue)}}let nc=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.reportPeriod=g.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",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.feeReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=g.cu,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===g.cu.XS||this.screenSize===g.cu.SM),this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.events=t.payments&&t.payments.relayed?t.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(t)})}ngAfterContentInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case g.cu.MD:this.screenPaddingX=t.width/10;break;case g.cu.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2]}filterForwardingEvents(t,e){const n=Math.round(t.getTime()/1e3),a=Math.round(e.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+t.toLocaleString()+" To "+e.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.feeReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(t=>{Math.floor(t.timestamp/1e3)>=n&&Math.floor(t.timestamp/1e3)<a&&this.filteredEventsBySelectedPeriod.push(t)}),this.feeReportData=this.prepareFeeReport(t)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(t){this.eventFilterValue=this.reportPeriod===g.op[1]?t.name+"/"+this.startDate.getFullYear():t.name.toString().padStart(2,"0")+"/"+g.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(t){const e=Math.round(t.getTime()/1e3),n=[];if(this.logger.info("Fee Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+t.toLocaleString()),this.reportPeriod===g.op[1]){for(let t=0;t<12;t++)n.push({name:g.gg[t].name,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(t=>{const e=new Date(t.timestamp).getMonth();return n[e].value=n[e].value+(t.amountIn-t.amountOut),n[e].extra.totalEvents=n[e].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(t.amountIn-t.amountOut),this.filteredEventsBySelectedPeriod})}else{for(let e=0;e<this.getMonthDays(t.getMonth(),t.getFullYear());e++)n.push({name:e+1,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(t=>{const a=Math.floor((Math.floor(t.timestamp/1e3)-e)/this.secondsInADay);return n[a].value=n[a].value+(t.amountIn-t.amountOut),n[a].extra.totalEvents=n[a].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(t.amountIn-t.amountOut),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),n}onSelectionChange(t){const e=t.selDate.getMonth(),n=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===g.op[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,e,1,0,0,0),this.endDate=new Date(n,e,this.getMonthDays(e,n),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(t,e){return 1===t&&e%4==0?g.gg[t].days+1:g.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(f.mQ),o.Y36(y.v),o.Y36(x.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-fee-report"]],hostBindings:function(t,e){1&t&&o.NdJ("mouseup",function(t){return e.onChartMouseUp(t)})},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","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"eventsData","filterValue",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,"eventsData","filterValue"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"rtl-horizontal-scroller",1),o.NdJ("stepChanged",function(t){return e.onSelectionChange(t)}),o.qZA(),o.TgZ(2,"div",2),o.YNc(3,Wr,4,8,"div",3),o.YNc(4,Kr,2,0,"div",4),o.TgZ(5,"div",5),o.YNc(6,tc,3,11,"ngx-charts-bar-vertical",6),o.qZA(),o.TgZ(7,"div",5),o.YNc(8,ec,1,2,"rtl-ecl-forwarding-history",7),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngIf",e.feeReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),o.xp6(1),o.Q6J("ngIf",e.feeReportData.length<=0||e.filteredEventsBySelectedPeriod.length<=0),o.xp6(2),o.Q6J("ngIf",e.feeReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),o.xp6(2),o.Q6J("ngIf",e.filteredEventsBySelectedPeriod.length>0))},directives:[l.xw,l.Wh,l.yH,$r.D,a.O5,Xr.K$,Xl],pipes:[a.JJ],styles:[""],data:{animation:[Gr.J]}}),t})();var ac=n(6590);function ic(t,e){if(1&t&&(o.TgZ(0,"div",10),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.AsE(" Paid ",o.xi3(2,2,t.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-2")," Sats/",o.lcZ(3,5,t.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function sc(t,e){if(1&t&&(o.TgZ(0,"div",10),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.AsE(" Received ",o.xi3(2,2,t.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-2")," Sats/",o.lcZ(3,5,t.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function oc(t,e){if(1&t&&(o.TgZ(0,"div",8),o.YNc(1,ic,4,7,"div",9),o.YNc(2,sc,4,7,"div",9),o.qZA()),2&t){const t=o.oxw();o.Q6J("@fadeIn",t.transactionsReportSummary),o.xp6(1),o.Q6J("ngIf",t.transactionsReportSummary.paymentsSelectedPeriod),o.xp6(1),o.Q6J("ngIf",t.transactionsReportSummary.invoicesSelectedPeriod)}}function lc(t,e){1&t&&(o.TgZ(0,"div",11),o._uU(1,"No transactions report for the selected period"),o.qZA())}function rc(t,e){if(1&t&&(o.TgZ(0,"span",14),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&t){const t=e.model;o.xp6(1),o.HOy("",t.name,": ",o.xi3(2,4,t.value||0,"1.0-2"),"/# ","Paid"===t.name?"Payments":"Invoices",": ",o.lcZ(3,7,(null==t.extra?null:t.extra.total)||0),"")}}function cc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"ngx-charts-bar-vertical-2d",12),o.NdJ("select",function(e){return o.CHM(t),o.oxw().onChartBarSelected(e)})("mouseup",function(e){return o.CHM(t),o.oxw().onChartMouseUp(e)}),o.YNc(1,rc,4,9,"ng-template",null,13,o.W1O),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("view",t.view)("results",t.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",t.reportPeriod===t.scrollRanges[0]?2:8)}}function uc(t,e){if(1&t&&o._UZ(0,"rtl-transactions-report-table",15),2&t){const t=o.oxw();o.Q6J("dataList",t.transactionsNonZeroReportData)("dataRange",t.reportPeriod)("filterValue",t.transactionFilterValue)}}let dc=(()=>{class t{constructor(t,e){this.commonService=t,this.store=e,this.scrollRanges=g.op,this.reportPeriod=g.op[0],this.secondsInADay=86400,this.payments=[],this.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=g.cu,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===g.cu.XS||this.screenSize===g.cu.SM),this.store.select("ecl").pipe((0,m.R)(this.unSubs[0])).subscribe(t=>{this.payments=t.payments.sent?t.payments.sent:[],this.invoices=t.invoices?t.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())})}ngAfterContentInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case g.cu.MD:this.screenPaddingX=t.width/10;break;case g.cu.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2]}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(t){this.transactionFilterValue=this.reportPeriod===g.op[1]?t.series.toString()+"/"+this.startDate.getFullYear():t.series.toString().padStart(2,"0")+"/"+g.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(t,e){const n=Math.round(t.getTime()/1e3),a=Math.round(e.getTime()/1e3),i=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const s=this.payments.filter(t=>Math.floor(t.firstPartTimestamp/1e3)>=n&&Math.floor(t.firstPartTimestamp/1e3)<a),o=this.invoices.filter(t=>"received"===t.status&&t.timestamp>=n&&t.timestamp<a);if(this.transactionsReportSummary.paymentsSelectedPeriod=s.length,this.transactionsReportSummary.invoicesSelectedPeriod=o.length,this.reportPeriod===g.op[1]){for(let e=0;e<12;e++)i.push({name:g.gg[e].name,date:new Date(t.getFullYear(),e,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});s.map(t=>{const e=new Date(t.firstPartTimestamp).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.recipientAmount,i[e].series[0].value=i[e].series[0].value+t.recipientAmount,i[e].series[0].extra.total=i[e].series[0].extra.total+1,this.transactionsReportSummary}),o.map(t=>{const e=new Date(1e3*t.timestamp).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.amountSettled,i[e].series[1].value=i[e].series[1].value+t.amountSettled,i[e].series[1].extra.total=i[e].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let e=0;e<this.getMonthDays(t.getMonth(),t.getFullYear());e++)i.push({name:(e+1).toString(),date:new Date(1e3*(e*this.secondsInADay+n)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});s.map(t=>{const e=Math.floor((Math.floor(t.firstPartTimestamp/1e3)-n)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.recipientAmount,i[e].series[0].value=i[e].series[0].value+t.recipientAmount,i[e].series[0].extra.total=i[e].series[0].extra.total+1,this.transactionsReportSummary}),o.map(t=>{const e=Math.floor((t.timestamp-n)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.amountSettled,i[e].series[1].value=i[e].series[1].value+t.amountSettled,i[e].series[1].extra.total=i[e].series[1].extra.total+1,this.transactionsReportSummary})}return i}prepareTableData(){return this.transactionsReportData.reduce((t,e)=>e.series[0].extra.total>0||e.series[1].extra.total>0?t.concat({date:e.date,amount_paid:e.series[0].value,num_payments:e.series[0].extra.total,amount_received:e.series[1].value,num_invoices:e.series[1].extra.total}):t,[])}onSelectionChange(t){const e=t.selDate.getMonth(),n=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===g.op[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,e,1,0,0,0),this.endDate=new Date(n,e,this.getMonthDays(e,n),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(t,e){return 1===t&&e%4==0?g.gg[t].days+1:g.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.v),o.Y36(x.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(t,e){1&t&&o.NdJ("mouseup",function(t){return e.onChartMouseUp(t)})},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,"dataList","dataRange","filterValue",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,"dataList","dataRange","filterValue"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"rtl-horizontal-scroller",1),o.NdJ("stepChanged",function(t){return e.onSelectionChange(t)}),o.qZA(),o.TgZ(2,"div",2),o.YNc(3,oc,3,3,"div",3),o.YNc(4,lc,2,0,"div",4),o.TgZ(5,"div",5),o.YNc(6,cc,3,13,"ngx-charts-bar-vertical-2d",6),o.qZA(),o.TgZ(7,"div",5),o.YNc(8,uc,1,3,"rtl-transactions-report-table",7),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngIf",e.transactionsNonZeroReportData.length>0),o.xp6(1),o.Q6J("ngIf",e.transactionsNonZeroReportData.length<=0),o.xp6(2),o.Q6J("ngIf",e.transactionsNonZeroReportData.length>0),o.xp6(2),o.Q6J("ngIf",e.transactionsNonZeroReportData.length>0))},directives:[l.xw,l.Wh,l.yH,$r.D,a.O5,Xr.H5,ac.g],pipes:[a.JJ],styles:[""],data:{animation:[Gr.J]}}),t})();var mc=n(6013),pc=n(8016);const hc=i.Bz.forChild([{path:"",component:u,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:Vn,canActivate:[mc.fY]},{path:"onchain",component:Ia,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:ri,canActivate:[mc.fY]},{path:"send",component:ci,canActivate:[mc.fY]}]},{path:"connections",component:ka,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:Ni,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:As,canActivate:[mc.fY]},{path:"pending",component:Ys,canActivate:[mc.fY]},{path:"inactive",component:Al,canActivate:[mc.fY]}]},{path:"peers",component:No,data:{sweepAll:!1},canActivate:[mc.fY]}]},{path:"transactions",component:Ua,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:An,canActivate:[mc.fY]},{path:"invoices",component:ce,canActivate:[mc.fY]},{path:"queryroutes",component:Ho,canActivate:[mc.fY]}]},{path:"routing",component:Ma,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Xl,canActivate:[mc.fY]},{path:"peers",component:Hr,canActivate:[mc.fY]}]},{path:"reports",component:Vr,canActivate:[mc.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:nc,canActivate:[mc.fY]},{path:"transactions",component:dc,canActivate:[mc.fY]}]},{path:"lookups",component:oi,canActivate:[mc.fY]},{path:"**",component:pc.w}]}]);var gc=n(253);let fc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t,bootstrap:[u]}),t.\u0275inj=o.cJS({providers:[mc.fY],imports:[[a.ez,gc.m,hc]]}),t})()}}]);