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/145.bd793f88eee8abcb2b20.js

1 line
378 KiB
JavaScript

(self.webpackChunkrtl=self.webpackChunkrtl||[]).push([[145],{2462:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CLModule:()=>Id});var a=n(1511),s=n(6853),i=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 s.OD:this.loading=!0;break;case t instanceof s.m2:case t instanceof s.gk:case t instanceof s.Q3:this.loading=!1}})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,s.lC,r.pW],styles:[""],data:{animation:[i.g]}}),t})();var d=n(9666),p=n(9568),h=n(8868),m=n(7810),g=n(5291),f=n(9421),x=n(9939),Z=n(3869),y=n(964),A=n(5573),T=n(1084),C=n(7592),w=n(7271),v=n(7439),S=n(8055),b=n(377),q=n(5980),_=n(3691);const F=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,F,"#"+(null==t.information?null:t.information.color)))}}function U(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,F,"#"+(null==t.information?null:t.information.color))),o.xp6(1),o.hij(" ",o.lcZ(6,2,null==t.information?null:t.information.color)," ")}}function R(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 k=(()=>{class t{constructor(t){this.commonService=t,this.chains=[""]}ngOnChanges(){this.information&&this.information.chains&&this.information.chains.length>0&&(this.chains=[""],this.information.chains.forEach(t=>{this.chains.push(this.commonService.titleCase(t.chain)+" "+this.commonService.titleCase(t.network))}))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,U,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,R,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,b.Zl],pipes:[a.gd],styles:[""]}),t})();function N(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 I(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 O=(()=>{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-cl-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,N,21,11,"div",0),o.YNc(1,I,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 M=n(6283),E=n(6828),J=n(7679),D=n(7038);function Y(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.id),o.s9C("matTooltipDisabled",(t.alias||t.id).length<26),o.xp6(1),o.AsE("",o.Dn7(3,9,t.alias||t.id,0,24),"",(t.alias||t.id).length>25?"...":"",""),o.xp6(6),o.hij("",o.xi3(9,13,t.msatoshi_to_us/1e3||0,"1.0-0")," Sats"),o.xp6(3),o.Q6J("icon",n.faBalanceScale),o.xp6(1),o.hij(" (",o.lcZ(13,16,t.balancedness||0),") "),o.xp6(5),o.hij("",o.xi3(18,18,t.msatoshi_to_them/1e3||0,"1.0-0")," Sats"),o.xp6(2),o.s9C("value",t.msatoshi_to_us&&t.msatoshi_to_us>0?+t.msatoshi_to_us/(+t.msatoshi_to_us+ +t.msatoshi_to_them)*100:0)}}function Q(t,e){if(1&t&&(o.TgZ(0,"div",17),o.YNc(1,Y,20,21,"div",18),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",t.allChannels)}}function P(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,Q,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&&t.allChannels.length>0)("ngIfElse",e)}}function B(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 H(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 z=(()=>{class t{constructor(t){this.router=t,this.faBalanceScale=g.DL8,this.faDumbbell=g.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/cl/connections")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,P,24,15,"div",0),o.YNc(1,B,4,0,"ng-template",null,1,o.W1O),o.YNc(3,H,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,M.bx,C.BN,E.gM,r.pW,J.d,D.$V,a.sg,q.lW],pipes:[a.JJ,a.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),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,"Total"),o.qZA(),o.TgZ(5,"div",5),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",3),o.TgZ(9,"div"),o.TgZ(10,"h4",4),o._uU(11,"Transactions"),o.qZA(),o.TgZ(12,"div",5),o._uU(13),o.ALo(14,"number"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.hij("",o.lcZ(7,2,(null==t.fees?null:t.fees.feeCollected)/1e3)," Sats"),o.xp6(7),o.Oqu(o.lcZ(14,4,null==t.fees?null:t.fees.totalTxCount))}}function V(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 X=(()=>{class t{constructor(){this.totalFees=[{name:"Total",value:0}]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-fee-info"]],inputs:{fees:"fees",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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,e){if(1&t&&(o.YNc(0,G,15,6,"div",0),o.YNc(1,V,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,"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||null==t.channelsStatus.active?null:t.channelsStatus.active.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(15,8,(null==t.channelsStatus||null==t.channelsStatus.pending?null:t.channelsStatus.pending.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(22,10,(null==t.channelsStatus||null==t.channelsStatus.inactive?null:t.channelsStatus.inactive.channels)||0)),o.xp6(7),o.hij("",o.lcZ(29,12,(null==t.channelsStatus||null==t.channelsStatus.active?null:t.channelsStatus.active.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(35,14,(null==t.channelsStatus||null==t.channelsStatus.pending?null:t.channelsStatus.pending.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(41,16,(null==t.channelsStatus||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 K=(()=>{class t{constructor(){this.channelsStatus={}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,W,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 j(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.msatoshi_to_them/1e3||0,"1.0-0")," Sats")}}function tt(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.msatoshi_to_us/1e3||0,"1.0-0")," Sats")}}function et(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.msatoshi_to_them/1e3||0)/e.totalLiquidity*100:0)}}function nt(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.msatoshi_to_us/1e3||0)/e.totalLiquidity*100:0)}}function at(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,j,5,4,"mat-hint",17),o.YNc(6,tt,5,4,"mat-hint",17),o.qZA(),o.YNc(7,et,1,1,"mat-progress-bar",18),o.YNc(8,nt,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.id),o.s9C("matTooltipDisabled",(t.alias||t.id).length<26),o.xp6(1),o.AsE("",o.Dn7(3,8,t.alias||t.id,0,24),"",(t.alias||t.id).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 st(t,e){if(1&t&&(o.TgZ(0,"div",12),o.YNc(1,at,9,12,"div",13),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",t.allChannels)}}const it=function(t,e,n){return{"mb-4":t,"mb-2":e,"mb-1":n}};function ot(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,st,2,1,"div",11),o.qZA(),o.qZA()),2&t){const t=o.oxw(),e=o.MAs(2);o.Q6J("ngClass",o.kEZ(7,it,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 lt(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 rt(t,e){if(1&t&&(o.TgZ(0,"div",22),o._uU(1," No channels available. "),o.YNc(2,lt,2,0,"button",23),o.qZA()),2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngIf","Out"===t.direction)}}function ct(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 ut=(()=>{class t{constructor(t,e){this.router=t,this.commonService=e,this.screenSize="",this.screenSizeEnum=f.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/cl/connections")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.F0),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,ot,12,11,"div",0),o.YNc(1,rt,3,1,"ng-template",null,1,o.W1O),o.YNc(3,ct,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,b.oO,M.bx,r.pW,J.d,D.$V,a.sg,E.gM,q.lW],pipes:[a.JJ,a.OU],styles:[""]}),t})();var dt=n(5109),pt=n(3005),ht=n(2464),mt=n(7033),gt=n(4608),ft=n(6073),xt=n(6756),Zt=n(6880),yt=n(5095),At=n(4786),Tt=n(7521),Ct=n(1522);function wt(t,e){if(1&t&&(o.TgZ(0,"mat-option",26),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 vt(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 St(t,e){if(1&t&&(o.TgZ(0,"div",27),o._UZ(1,"fa-icon",28),o.YNc(2,vt,2,1,"span",29),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 bt=(()=>{class t{constructor(t,e,n,a,s,i){this.dialogRef=t,this.data=e,this.store=n,this.decimalPipe=a,this.commonService=s,this.actions=i,this.faExclamationTriangle=g.eHv,this.selNode={},this.description="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=f.IV,this.timeUnitEnum=f.Qk,this.timeUnits=f.LO,this.selTimeUnit=f.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("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.information=t.information}),this.actions.pipe((0,p.R)(this.unSubs[1]),(0,h.h)(t=>t.type===x.qe||t.type===x.G0)).subscribe(t=>{t.type===x.G0&&this.dialogRef.close(),t.type===x.qe&&t.payload.status===f.Bn.ERROR&&"SaveNewInvoice"===t.payload.action&&(this.invoiceError=t.payload.message)})}onAddInvoice(t){this.invoiceError="",this.invoiceValue||(this.invoiceValue=0);let e=this.expiry?this.expiry:3600;this.selTimeUnit!==f.Qk.SECS&&(e=this.commonService.convertTime(this.expiry,this.selTimeUnit,f.Qk.SECS)),this.store.dispatch(new x.H1({label:"ulbl"+Math.random().toString(36).slice(2)+Date.now(),amount:1e3*this.invoiceValue,description:this.description,expiry:e,private:this.private}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=f.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,p.R)(this.unSubs[2])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,f.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(gt.so),o.Y36(gt.WI),o.Y36(y.yh),o.Y36(a.JJ),o.Y36(T.v),o.Y36(A.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-create-invoices"]],decls:37,vars:17,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",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxFlex","40"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invoiceValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","30"],["matInput","","name","expiry","placeholder","Expiry","type","number","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","50","fxLayoutAlign","start center",1,"mt-2"],["tabindex","6","color","primary","matTooltip","Include routing hints for private channels","name","private",3,"ngModel","matTooltipPosition","ngModelChange"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-1"],["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"],[4,"ngIf"]],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.qZA(),o.TgZ(13,"div",11),o.TgZ(14,"mat-form-field",12),o.TgZ(15,"input",13),o.NdJ("ngModelChange",function(t){return e.invoiceValue=t})("keyup",function(){return e.onInvoiceValueChange()}),o.qZA(),o.TgZ(16,"span",14),o._uU(17," Sats "),o.qZA(),o.TgZ(18,"mat-hint"),o._uU(19),o.qZA(),o.qZA(),o.TgZ(20,"mat-form-field",15),o.TgZ(21,"input",16),o.NdJ("ngModelChange",function(t){return e.expiry=t}),o.qZA(),o.TgZ(22,"span",14),o._uU(23),o.ALo(24,"titlecase"),o.qZA(),o.qZA(),o.TgZ(25,"mat-form-field",17),o.TgZ(26,"mat-select",18),o.NdJ("selectionChange",function(t){return e.onTimeUnitChange(t)}),o.YNc(27,wt,3,4,"mat-option",19),o.qZA(),o.qZA(),o.qZA(),o.TgZ(28,"div",20),o.TgZ(29,"mat-slide-toggle",21),o.NdJ("ngModelChange",function(t){return e.private=t}),o._uU(30,"Private Routing Hints"),o.qZA(),o.qZA(),o.YNc(31,St,3,2,"div",22),o.TgZ(32,"div",23),o.TgZ(33,"button",24),o.NdJ("click",function(){return e.resetData()}),o._uU(34,"Clear Field"),o.qZA(),o.TgZ(35,"button",25),o.NdJ("click",function(){o.CHM(t);const n=o.MAs(10);return e.onAddInvoice(n)}),o._uU(36,"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(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(24,15,e.selTimeUnit)," "),o.xp6(3),o.Q6J("value",e.selTimeUnit),o.xp6(1),o.Q6J("ngForOf",e.timeUnits),o.xp6(2),o.Q6J("ngModel",e.private)("matTooltipPosition","above"),o.xp6(2),o.Q6J("ngIf",""!==e.invoiceError))},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,gt.ZT,v.dn,ft._Y,ft.JL,ft.F,M.KE,xt.Nt,ft.Fj,Zt.h,ft.JJ,ft.On,ft.wV,ft.qQ,yt.q,M.R9,M.bx,At.gD,a.sg,Tt.Rr,E.gM,a.O5,Ct.ey,C.BN],pipes:[a.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var qt=n(3793),_t=n(4636),Ft=n(3929),Lt=n(8914);function Ut(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.qZA(),o.TgZ(4,"mat-form-field",8),o.TgZ(5,"input",9),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(6,"span",10),o._uU(7," Sats "),o.qZA(),o.TgZ(8,"mat-hint"),o._uU(9),o.qZA(),o.qZA(),o.TgZ(10,"div",11),o.TgZ(11,"button",12),o.NdJ("click",function(){return o.CHM(t),o.oxw().resetData()}),o._uU(12,"Clear Field"),o.qZA(),o.TgZ(13,"button",13),o.NdJ("click",function(){o.CHM(t);const e=o.MAs(1);return o.oxw().onAddInvoice(e)}),o._uU(14,"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(2),o.Q6J("ngModel",t.invoiceValue)("step",100)("min",1),o.xp6(4),o.Oqu(t.invoiceValueHint)}}function Rt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",14),o.TgZ(1,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw().onDeleteExpiredInvoices()}),o._uU(2,"Delete Expired"),o.qZA(),o.TgZ(3,"button",16),o.NdJ("click",function(){return o.CHM(t),o.oxw().openCreateInvoiceModal()}),o._uU(4,"Create Invoice"),o.qZA(),o.qZA()}}function kt(t,e){1&t&&o._UZ(0,"mat-progress-bar",45)}function Nt(t,e){1&t&&(o.TgZ(0,"th",46),o._uU(1," Expiry Date "),o.qZA())}const It=function(t){return{"mr-0":t}};function Ot(t,e){if(1&t&&o._UZ(0,"span",50),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,It,t.screenSize===t.screenSizeEnum.XS))}}function Mt(t,e){if(1&t&&o._UZ(0,"span",51),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,It,t.screenSize===t.screenSizeEnum.XS))}}function Et(t,e){if(1&t&&(o.TgZ(0,"td",47),o.YNc(1,Ot,1,3,"span",48),o.YNc(2,Mt,1,3,"span",49),o._uU(3),o.ALo(4,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf","paid"===t.status),o.xp6(1),o.Q6J("ngIf","paid"!==t.status),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*t.expires_at,"dd/MMM/YYYY HH:mm")," ")}}function Jt(t,e){1&t&&(o.TgZ(0,"th",46),o._uU(1," Date Settled "),o.qZA())}function Dt(t,e){if(1&t&&(o.TgZ(0,"td",47),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.paid_at,"dd/MMM/YYYY HH:mm")||"-")}}function Yt(t,e){1&t&&(o.TgZ(0,"th",46),o._uU(1," Description "),o.qZA())}const Qt=function(t){return{"max-width":t}};function Pt(t,e){if(1&t&&(o.TgZ(0,"td",47),o.TgZ(1,"div",52),o.TgZ(2,"span",53),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 Bt(t,e){1&t&&(o.TgZ(0,"th",54),o._uU(1," Amount (Sats) "),o.qZA())}function Ht(t,e){if(1&t&&(o.TgZ(0,"td",47),o.TgZ(1,"span",55),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,t.msatoshi/1e3,t.msatoshi<1e3?"1.0-4":"1.0-0"),"")}}function zt(t,e){1&t&&(o.TgZ(0,"th",54),o._uU(1," Amount Settled (Sats) "),o.qZA())}function Gt(t,e){if(1&t&&(o.TgZ(0,"td",47),o.TgZ(1,"span",55),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,t.msatoshi_received/1e3,t.msatoshi_received<1e3?"1.0-4":"1.0-0"),"")}}function Vt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",56),o.TgZ(1,"div",57),o.TgZ(2,"mat-select",58),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",59),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",60),o.TgZ(1,"div",61),o.TgZ(2,"mat-select",62),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",59),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",59),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 $t(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No invoice available."),o.qZA())}function Kt(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting invoices..."),o.qZA())}function jt(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 te(t,e){if(1&t&&(o.TgZ(0,"td",63),o.YNc(1,$t,2,0,"p",64),o.YNc(2,Kt,2,0,"p",64),o.YNc(3,jt,2,1,"p",64),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 ee=function(t){return{"display-none":t}};function ne(t,e){if(1&t&&o._UZ(0,"tr",65),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,ee,(null==t.invoices?null:t.invoices.data)&&(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)>0))}}function ae(t,e){1&t&&o._UZ(0,"tr",66)}function se(t,e){if(1&t&&o._UZ(0,"tr",67),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 ie=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},oe=function(){return["no_invoice"]};function le(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",17),o.TgZ(1,"div",18),o.TgZ(2,"div",19),o._UZ(3,"fa-icon",20),o.TgZ(4,"span",21),o._uU(5,"Invoices History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",22),o.TgZ(7,"input",23),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",24),o.YNc(9,kt,1,0,"mat-progress-bar",25),o.TgZ(10,"table",26,27),o.ynx(12,28),o.YNc(13,Nt,2,0,"th",29),o.YNc(14,Et,5,6,"td",30),o.BQk(),o.ynx(15,31),o.YNc(16,Jt,2,0,"th",29),o.YNc(17,Dt,3,4,"td",30),o.BQk(),o.ynx(18,32),o.YNc(19,Yt,2,0,"th",29),o.YNc(20,Pt,4,4,"td",30),o.BQk(),o.ynx(21,33),o.YNc(22,Bt,2,0,"th",34),o.YNc(23,Ht,4,4,"td",30),o.BQk(),o.ynx(24,35),o.YNc(25,zt,2,0,"th",34),o.YNc(26,Gt,4,4,"td",30),o.BQk(),o.ynx(27,36),o.YNc(28,Vt,6,0,"th",37),o.YNc(29,Wt,8,3,"td",38),o.BQk(),o.ynx(30,39),o.YNc(31,te,4,3,"td",40),o.BQk(),o.YNc(32,ne,1,3,"tr",41),o.YNc(33,ae,1,0,"tr",42),o.YNc(34,se,1,1,"tr",43),o.qZA(),o.qZA(),o._UZ(35,"mat-paginator",44),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,ie,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(13,oe)),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 re=(()=>{class t{constructor(t,e,n,a,s,i,o){this.logger=t,this.store=e,this.decimalPipe=n,this.commonService=a,this.rtlEffects=s,this.datePipe=i,this.actions=o,this.calledFrom="transactions",this.faHistory=g.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.private=!1,this.expiryStep=100,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["expires_at","msatoshi","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["expires_at","description","msatoshi","actions"]):this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["expires_at","description","msatoshi","msatoshi_received","actions"]):(this.flgSticky=!0,this.displayedColumns=["expires_at","paid_at","description","msatoshi","msatoshi_received","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchInvoices.status===f.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.invoices&&t.invoices.invoices.length>0?t.invoices.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,p.R)(this.unSubs[1]),(0,h.h)(t=>t.type===x.CR||t.type===x.qe)).subscribe(t=>{t.type===x.CR&&this.invoiceJSONArr&&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:bt}}))}onAddInvoice(t){this.invoiceValue||(this.invoiceValue=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,this.store.dispatch(new x.H1({label:this.newlyAddedInvoiceMemo,amount:1e3*this.invoiceValue,description:this.description,expiry:e,private:this.private})),this.resetData()}onDeleteExpiredInvoices(){this.store.dispatch(new Ft.b_({data:{type:"CONFIRM",titleMessage:"Delete Expired Invoices",noBtnText:"Cancel",yesBtnText:"Delete Invoices"}})),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[2])).subscribe(t=>{t&&this.store.dispatch(new x.nB)})}onInvoiceClick(t){this.store.dispatch(new Ft.wu({data:{invoice:{msatoshi:t.msatoshi,label:t.label,expires_at:t.expires_at,paid_at:t.paid_at,bolt11:t.bolt11,payment_hash:t.payment_hash,description:t.description,status:t.status,msatoshi_received:t.msatoshi_received},newlyAdded:!1,component:qt.$}}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,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,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,p.R)(this.unSubs[3])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,f.Xz.OTHER)+" "+t.unit},error:t=>{this.invoiceValueHint="Conversion Error: "+t}}))}onRefreshInvoice(t){this.store.dispatch(new x.oP(t.label))}updateInvoicesData(t){this.invoiceJSONArr=this.invoiceJSONArr.map(e=>e.label===t.label?t:e)}loadInvoicesTable(t){this.invoices=new mt.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.paid_at?this.datePipe.transform(new Date(1e3*t.paid_at),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(t.expires_at?this.datePipe.transform(new Date(1e3*t.expires_at),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.invoices.paginator=this.paginator}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(Z.mQ),o.Y36(y.yh),o.Y36(a.JJ),o.Y36(T.v),o.Y36(Lt.V),o.Y36(a.uU),o.Y36(A.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-lightning-invoices"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap"],["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",3,"ngModel","ngModelChange"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","name","invoiceValue","type","number","tabindex","3",3,"ngModel","step","min","ngModelChange","keyup"],["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-stroked-button","","color","warn","tabindex","7","type","button",1,"mr-1",3,"click"],["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","expires_at"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","paid_at"],["matColumnDef","description"],["matColumnDef","msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi_received"],["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","Settled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unsettled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Settled","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unsettled","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],[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",3,"ngClass"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","4",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.YNc(1,Ut,15,5,"form",1),o.YNc(2,Rt,5,0,"div",2),o.YNc(3,le,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,M.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,ft.wV,ft.qQ,yt.q,M.R9,M.bx,q.lW,C.BN,D.$V,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,E.gM,a.PC,b.Zl,At.gD,At.$L,Ct.ey,mt.yh,mt.Q2,mt.XQ,mt.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:[_t.Q]}}),t})();var ce=n(9056),ue=n(8640),de=n(4810);const pe=["paymentReq"];function he(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-radio-group",17),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().paymentType=e})("change",function(){return o.CHM(t),o.oxw().onPaymentTypeChange()}),o.TgZ(1,"mat-radio-button",18),o._uU(2,"Invoice Payment"),o.qZA(),o.TgZ(3,"mat-radio-button",19),o._uU(4,"Keysend Payment"),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("ngModel",t.paymentType)}}function me(t,e){1&t&&o.GkF(0)}function ge(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 fe(t,e){if(1&t&&(o.TgZ(0,"div",20),o._UZ(1,"fa-icon",21),o.YNc(2,ge,2,1,"span",22),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.paymentError)}}function xe(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 Ze(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function ye(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.paymentDecodedHint)}}function Ae(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment amount is required."),o.qZA())}function Te(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"input",26,27),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).paymentAmount=e})("change",function(e){return o.CHM(t),o.oxw(2).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,Ae,2,0,"mat-error",22),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngModel",t.paymentAmount),o.xp6(4),o.Q6J("ngIf",!t.paymentAmount)}}function Ce(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"textarea",23,24),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().onPaymentRequestEntry(e)})("matTextareaAutosize",function(){return!0}),o.qZA(),o.YNc(3,xe,2,1,"mat-hint",22),o.YNc(4,Ze,2,0,"mat-error",22),o.YNc(5,ye,2,1,"mat-error",22),o.qZA(),o.YNc(6,Te,6,2,"mat-form-field",25)}if(2&t){const t=o.MAs(2),e=o.oxw();o.xp6(1),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)}}function we(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Pubkey is required."),o.qZA())}function ve(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Keysend amount is required."),o.qZA())}function Se(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"input",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().pubkey=e}),o.qZA(),o.YNc(2,we,2,0,"mat-error",22),o.qZA(),o.TgZ(3,"mat-form-field",1),o.TgZ(4,"input",29,30),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().keysendAmount=e}),o.qZA(),o.YNc(6,ve,2,0,"mat-error",22),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngModel",t.pubkey),o.xp6(1),o.Q6J("ngIf",!t.pubkey),o.xp6(2),o.Q6J("ngModel",t.keysendAmount),o.xp6(2),o.Q6J("ngIf",!t.keysendAmount)}}let be=(()=>{class t{constructor(t,e,n,a,s,i,o){this.dialogRef=t,this.store=e,this.clEffects=n,this.logger=a,this.commonService=s,this.decimalPipe=i,this.actions=o,this.faExclamationTriangle=g.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentType="invoice",this.pubkey="",this.keysendAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=f.Vc[0],this.feeLimitTypes=f.Vc,this.paymentError="",this.isCompatibleVersion=!1,this.unSubs=[new d.x,new d.x,new d.x,new d.x]}set payReq(t){t&&(this.paymentReq=t)}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.activeChannels=t.allChannels.filter(t=>"CHANNELD_NORMAL"===t.state&&t.connected),this.isCompatibleVersion=this.commonService.isVersionCompatible(t.information.version,"0.9.0")&&this.commonService.isVersionCompatible(t.information.api_version,"0.4.0"),this.logger.info(t)}),this.actions.pipe((0,p.R)(this.unSubs[1]),(0,h.h)(t=>t.type===x.qe||t.type===x.zm)).subscribe(t=>{t.type===x.zm&&this.dialogRef.close(),t.type===x.qe&&t.payload.status===f.Bn.ERROR&&("SendPayment"===t.payload.action&&(delete this.paymentDecoded.msatoshi,this.paymentError=t.payload.message),"DecodePayment"===t.payload.action&&(this.paymentDecodedHint="ERROR: "+t.payload.message,this.paymentReq.control.setErrors({decodeError:!0})))})}onSendPayment(){if("invoice"===this.paymentType&&!this.paymentRequest||"keysend"===this.paymentType&&(!this.pubkey||""===this.pubkey.trim()||!this.keysendAmount||this.keysendAmount<=0))return!0;"keysend"===this.paymentType?this.keysendPayment():this.paymentDecoded.created_at?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.store.dispatch(new x.pu({routeParam:this.paymentRequest,fromDialog:!0})),this.clEffects.setDecodedPaymentCL.pipe((0,ce.q)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.created_at&&!this.paymentDecoded.msatoshi?(this.paymentDecoded.msatoshi=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode.fiatConversion?this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,p.R)(this.unSubs[2])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,f.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description)}))}keysendPayment(){this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_KEYSEND,pubkey:this.pubkey,amount:1e3*this.keysendAmount,fromDialog:!0}))}sendPayment(){this.store.dispatch(new x.Ar(this.zeroAmtInvoice?{uiMessage:f.m6.SEND_PAYMENT,invoice:this.paymentRequest,amount:1e3*this.paymentAmount,fromDialog:!0}:{uiMessage:f.m6.SEND_PAYMENT,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.store.dispatch(new x.pu({routeParam:this.paymentRequest,fromDialog:!0})),this.clEffects.setDecodedPaymentCL.subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.created_at&&!this.paymentDecoded.msatoshi?(this.paymentDecoded.msatoshi=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode.fiatConversion?this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,p.R)(this.unSubs[3])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,f.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description)}))}onAmountChange(t){delete this.paymentDecoded.msatoshi,this.paymentDecoded.msatoshi=t}onPaymentTypeChange(){this.paymentError=""}resetData(){"keysend"===this.paymentType?(this.pubkey="",this.keysendAmount=null):(this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=f.Vc[0],this.paymentReq.control.setErrors(null),this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentAmount=null),this.paymentError=""}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(gt.so),o.Y36(y.yh),o.Y36(ue.s),o.Y36(Z.mQ),o.Y36(T.v),o.Y36(a.JJ),o.Y36(A.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-lightning-send-payments"]],viewQuery:function(t,e){if(1&t&&o.Gf(pe,5),2&t){let t;o.iGM(t=o.CRH())&&(e.payReq=t.first)}},decls:23,vars:4,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","12","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["class","my-1","color","primary","name","paymentType","fxFlex","100","fxLayoutAlign","start stretch",3,"ngModel","ngModelChange","change",4,"ngIf"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],[4,"ngTemplateOutlet"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","8","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","7",3,"click"],["invoiceBlock",""],["keysendBlock",""],["color","primary","name","paymentType","fxFlex","100","fxLayoutAlign","start stretch",1,"my-1",3,"ngModel","ngModelChange","change"],["fxFlex","25","tabindex","1","value","invoice",1,"mr-2"],["fxFlex","25","tabindex","2","value","keysend"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","3","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],["fxFlex","100",4,"ngIf"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","4","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["autoFocus","","matInput","","placeholder","Pubkey","name","pubkey","tabindex","5","required","",3,"ngModel","ngModelChange"],["matInput","","placeholder","Amount (Sats)","name","keysendAmount","tabindex","6","required","",3,"ngModel","ngModelChange"],["keysendAmt","ngModel"]],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.YNc(9,he,5,1,"mat-radio-group",7),o.TgZ(10,"form",8,9),o.YNc(12,me,1,0,"ng-container",10),o.YNc(13,fe,3,2,"div",11),o.TgZ(14,"div",12),o.TgZ(15,"button",13),o.NdJ("click",function(){return e.resetData()}),o._uU(16,"Clear Fields"),o.qZA(),o.TgZ(17,"button",14),o.NdJ("click",function(){return e.onSendPayment()}),o._uU(18,"Send Payment"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(19,Ce,7,5,"ng-template",null,15,o.W1O),o.YNc(21,Se,7,4,"ng-template",null,16,o.W1O)),2&t){const t=o.MAs(20),n=o.MAs(22);o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(3),o.Q6J("ngIf",e.isCompatibleVersion),o.xp6(3),o.Q6J("ngTemplateOutlet","keysend"===e.paymentType?n:t),o.xp6(1),o.Q6J("ngIf",""!==e.paymentError)}},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,gt.ZT,v.dn,a.O5,ft._Y,ft.JL,ft.F,a.tP,de.VQ,ft.JJ,ft.On,de.U0,C.BN,M.KE,xt.Nt,ft.Fj,xt.D7,Zt.h,ft.Q7,M.bx,M.TO],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})();const qe=["sendPaymentForm"];function _e(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 Fe(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function Le(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,_e,2,1,"mat-hint",9),o.YNc(6,Fe,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 Ue(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 Re(t,e){1&t&&o._UZ(0,"mat-progress-bar",47)}function ke(t,e){1&t&&(o.TgZ(0,"th",48),o._uU(1,"Created At"),o.qZA())}const Ne=function(t){return{"mr-0":t}};function Ie(t,e){if(1&t&&o._UZ(0,"span",52),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function Oe(t,e){if(1&t&&o._UZ(0,"span",53),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function Me(t,e){if(1&t&&(o.TgZ(0,"td",49),o.YNc(1,Ie,1,3,"span",50),o.YNc(2,Oe,1,3,"span",51),o._uU(3),o.ALo(4,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf","complete"===t.status),o.xp6(1),o.Q6J("ngIf","complete"!==t.status),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*(null==t?null:t.created_at),"dd/MMM/YYYY HH:mm")," ")}}function Ee(t,e){1&t&&(o.TgZ(0,"th",48),o._uU(1,"Payment Hash"),o.qZA())}function Je(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"div"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(null==t?null:t.payment_hash)}}function De(t,e){1&t&&(o.TgZ(0,"th",54),o._uU(1,"Sats Sent"),o.qZA())}function Ye(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",55),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.xi3(3,1,(null==t?null:t.msatoshi_sent)/1e3,(null==t?null:t.msatoshi_sent)<1e3?"1.0-4":"1.0-0"))}}function Qe(t,e){1&t&&(o.TgZ(0,"th",54),o._uU(1,"Sats Received"),o.qZA())}function Pe(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",55),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.xi3(3,1,(null==t?null:t.msatoshi)/1e3,(null==t?null:t.msatoshi)<1e3?"1.0-4":"1.0-0"))}}function Be(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",56),o.TgZ(1,"div",57),o.TgZ(2,"mat-select",58),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",59),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",60),o.TgZ(1,"button",61),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 Ge(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting payments..."),o.qZA())}function Ve(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 Xe(t,e){if(1&t&&(o.TgZ(0,"td",62),o.YNc(1,ze,2,0,"p",9),o.YNc(2,Ge,2,0,"p",9),o.YNc(3,Ve,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 We(t,e){if(1&t&&o._UZ(0,"span",66),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function $e(t,e){if(1&t&&o._UZ(0,"span",67),2&t){const t=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function Ke(t,e){if(1&t&&o._UZ(0,"span",66),2&t){const t=o.oxw(5);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function je(t,e){if(1&t&&o._UZ(0,"span",67),2&t){const t=o.oxw(5);o.Q6J("ngClass",o.VKq(1,Ne,t.screenSize===t.screenSizeEnum.XS))}}function tn(t,e){if(1&t&&(o.TgZ(0,"span",69),o.YNc(1,Ke,1,3,"span",64),o.YNc(2,je,1,3,"span",65),o._uU(3),o.ALo(4,"date"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf","complete"===t.status),o.xp6(1),o.Q6J("ngIf","complete"!==t.status),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*t.created_at,"dd/MMM/YYYY HH:mm")," ")}}function en(t,e){if(1&t&&(o.ynx(0),o.YNc(1,tn,5,6,"span",68),o.BQk()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.mpps)}}function nn(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",63),o.YNc(2,We,1,3,"span",64),o.YNc(3,$e,1,3,"span",65),o._uU(4),o.qZA(),o.YNc(5,en,2,1,"ng-container",9),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Q6J("ngIf","complete"===t.status),o.xp6(1),o.Q6J("ngIf","complete"!==t.status),o.xp6(1),o.hij(" Total Attempts: ",null==t?null:t.total_parts," "),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function an(t,e){if(1&t&&(o.TgZ(0,"span",63),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" Part ID ",t.partid?t.partid:0," ")}}function sn(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,an,2,1,"span",70),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.mpps)}}function on(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",63),o._uU(2),o.qZA(),o.YNc(3,sn,2,1,"span",9),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(null==t?null:t.payment_hash),o.xp6(1),o.Q6J("ngIf",t.is_expanded)}}function ln(t,e){if(1&t&&(o.TgZ(0,"span",71),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.msatoshi_sent/1e3,t.msatoshi_sent<1e3?"1.0-4":"1.0-0")," ")}}function rn(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,ln,3,4,"span",72),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.mpps)}}function cn(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",71),o._uU(2),o.ALo(3,"number"),o.qZA(),o.YNc(4,rn,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.msatoshi_sent)/1e3,(null==t?null:t.msatoshi_sent)<1e3?"1.0-4":"1.0-0")),o.xp6(2),o.Q6J("ngIf",t.is_expanded)}}function un(t,e){if(1&t&&(o.TgZ(0,"span",71),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.msatoshi/1e3,t.msatoshi<1e3?"1.0-4":"1.0-0")," ")}}function dn(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,un,3,4,"span",72),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.mpps)}}function pn(t,e){if(1&t&&(o.TgZ(0,"td",49),o.TgZ(1,"span",71),o._uU(2),o.ALo(3,"number"),o.qZA(),o.YNc(4,dn,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.msatoshi)/1e3,(null==t?null:t.msatoshi)<1e3?"1.0-4":"1.0-0")),o.xp6(2),o.Q6J("ngIf",t.is_expanded)}}function hn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",55),o.TgZ(1,"button",76),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(4).onPaymentClick(e)}),o._uU(2),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.xp6(2),o.hij("View ",t.partid?t.partid:0,"")}}function mn(t,e){if(1&t&&(o.TgZ(0,"div"),o.YNc(1,hn,3,1,"div",75),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==t?null:t.mpps)}}function gn(t,e){if(1&t&&(o.TgZ(0,"td",73),o.TgZ(1,"span",55),o.TgZ(2,"button",74),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,mn,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 fn(t,e){if(1&t&&o._UZ(0,"tr",77),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{"display-none":t}};function Zn(t,e){if(1&t&&o._UZ(0,"tr",78),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,xn,(null==t.payments?null:t.payments.data)&&(null==t.payments||null==t.payments.data?null:t.payments.data.length)>0))}}function yn(t,e){1&t&&o._UZ(0,"tr",79)}function An(t,e){if(1&t&&o._UZ(0,"tr",77),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",t.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const Tn=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Cn=function(){return["no_payment"]};function wn(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,Re,1,0,"mat-progress-bar",22),o.TgZ(10,"table",23,24),o.ynx(12,25),o.YNc(13,ke,2,0,"th",26),o.YNc(14,Me,5,6,"td",27),o.BQk(),o.ynx(15,28),o.YNc(16,Ee,2,0,"th",26),o.YNc(17,Je,3,1,"td",27),o.BQk(),o.ynx(18,29),o.YNc(19,De,2,0,"th",30),o.YNc(20,Ye,4,4,"td",27),o.BQk(),o.ynx(21,31),o.YNc(22,Qe,2,0,"th",30),o.YNc(23,Pe,4,4,"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,Xe,4,3,"td",36),o.BQk(),o.ynx(29,37),o.YNc(30,nn,6,4,"td",27),o.BQk(),o.ynx(31,38),o.YNc(32,on,4,2,"td",27),o.BQk(),o.ynx(33,39),o.YNc(34,cn,5,5,"td",27),o.BQk(),o.ynx(35,40),o.YNc(36,pn,5,5,"td",27),o.BQk(),o.ynx(37,41),o.YNc(38,gn,5,2,"td",42),o.BQk(),o.YNc(39,fn,1,1,"tr",43),o.YNc(40,Zn,1,3,"tr",44),o.YNc(41,yn,1,0,"tr",45),o.YNc(42,An,1,1,"tr",43),o.qZA(),o.qZA(),o._UZ(43,"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.FetchPayments.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.payments)("ngClass",o.VKq(14,Tn,""!==t.errorMessage)),o.xp6(29),o.Q6J("matRowDefColumns",t.mppColumns)("matRowDefWhen",t.is_group),o.xp6(1),o.Q6J("matFooterRowDef",o.DdM(16,Cn)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)("matRowDefWhen",!t.is_group),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let vn=(()=>{class t{constructor(t,e,n,a,s,i,o,l){this.logger=t,this.commonService=e,this.store=n,this.rtlEffects=a,this.clEffects=s,this.decimalPipe=i,this.titleCasePipe=o,this.datePipe=l,this.calledFrom="transactions",this.faHistory=g.qO$,this.newlyAddedPayment="",this.flgAnimate=!0,this.selNode={},this.information={},this.paymentJSONArr=[],this.displayedColumns=[],this.mppColumns=[],this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["created_at","actions"],this.mppColumns=["groupTotal","groupAction"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["created_at","msatoshi","actions"],this.mppColumns=["groupTotal","groupAmtRecv","groupAction"]):this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["created_at","msatoshi_sent","msatoshi","actions"],this.mppColumns=["groupTotal","groupAmtSent","groupAmtRecv","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["created_at","payment_hash","msatoshi_sent","msatoshi","actions"],this.mppColumns=["groupTotal","groupHash","groupAmtSent","groupAmtRecv","groupAction"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPayments.status===f.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,this.paymentJSONArr=t.payments&&t.payments.length>0?t.payments:[],this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr),setTimeout(()=>{this.flgAnimate=!1},3e3),this.logger.info(t)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}is_group(t,e){return e.is_group}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.created_at?this.sendPayment():(this.store.dispatch(new x.pu({routeParam:this.paymentRequest,fromDialog:!1})),this.clEffects.setDecodedPaymentCL.pipe((0,ce.q)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.created_at?(this.paymentDecoded.msatoshi||(this.paymentDecoded.msatoshi=0),this.sendPayment()):this.resetData()}))}sendPayment(){this.flgAnimate=!0,this.newlyAddedPayment=this.paymentDecoded.payment_hash,this.paymentDecoded.msatoshi&&0!==this.paymentDecoded.msatoshi?(this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"payee",value:this.paymentDecoded.payee,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"created_at",value:this.paymentDecoded.created_at,title:"Creation Date",width:50,type:f.Gi.DATE_TIME},{key:"num_satoshis",value:this.paymentDecoded.msatoshi/1e3,title:"Amount (Sats)",width:50,type:f.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:f.Gi.NUMBER},{key:"min_finaltv_expiry",value:this.paymentDecoded.min_final_cltv_expiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe((0,ce.q)(1)).subscribe(t=>{t&&(this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,invoice:this.paymentRequest,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"payee",value:this.paymentDecoded.payee,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"created_at",value:this.paymentDecoded.created_at,title:"Creation Date",width:40,type:f.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:f.Gi.NUMBER},{key:"min_finaltv_expiry",value:this.paymentDecoded.min_final_cltv_expiry,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:f.Gi.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe((0,ce.q)(1)).subscribe(t=>{t&&(this.paymentDecoded.msatoshi=t[0].inputValue,this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,invoice:this.paymentRequest,amount:1e3*t[0].inputValue,fromDialog:!1})),this.resetData())}))}onPaymentRequestEntry(t){this.paymentRequest=t,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&(this.store.dispatch(new x.pu({routeParam:this.paymentRequest,fromDialog:!1})),this.clEffects.setDecodedPaymentCL.subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.msatoshi?this.selNode.fiatConversion?this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,p.R)(this.unSubs[1])).subscribe({next:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,f.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:t=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description}))}openSendPaymentModal(){this.store.dispatch(new Ft.wu({data:{component:be}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}onPaymentClick(t){const e=[[{key:"bolt11",value:t.bolt11,title:"Bolt 11",width:100,type:f.Gi.STRING}],[{key:"payment_preimage",value:t.payment_preimage,title:"Payment Preimage",width:100,type:f.Gi.STRING}],[{key:"id",value:t.id,title:"ID",width:20,type:f.Gi.STRING},{key:"destination",value:t.destination,title:"Destination",width:80,type:f.Gi.STRING}],[{key:"created_at",value:t.created_at,title:"Creation Date",width:50,type:f.Gi.DATE_TIME},{key:"status",value:this.titleCasePipe.transform(t.status),title:"Status",width:50,type:f.Gi.STRING}],[{key:"msatoshi",value:t.msatoshi,title:"Amount (mSats)",width:50,type:f.Gi.NUMBER},{key:"msatoshi_sent",value:t.msatoshi_sent,title:"Amount Sent (mSats)",width:50,type:f.Gi.NUMBER}]];t.memo&&""!==t.memo&&e.splice(2,0,[{key:"memo",value:t.memo,title:"Memo",width:100,type:f.Gi.STRING}]),t.hasOwnProperty("partid")?e.unshift([{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:80,type:f.Gi.STRING},{key:"partid",value:t.partid,title:"Part ID",width:20,type:f.Gi.STRING}]):e.unshift([{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:f.Gi.STRING}]),this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Payment Information",message:e}}))}applyFilter(t){this.payments.filter=t.value.trim().toLowerCase()}loadPaymentsTable(t){this.payments=new mt.by(t?[...t]:[]),this.payments.data=this.paymentJSONArr,this.payments.sort=this.sort,this.payments.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.payments.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.payments.filterPredicate=(t,e)=>((t.created_at?this.datePipe.transform(new Date(1e3*t.created_at),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(t).toLowerCase()).includes(e),this.payments.paginator=this.paginator}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const t=JSON.parse(JSON.stringify(this.payments.data)).reduce((t,e)=>e.mpps?t.concat(e.mpps):(delete e.is_group,delete e.is_expanded,delete e.total_parts,t.concat(e)),[]);this.commonService.downloadFile(t,"Payments")}}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(T.v),o.Y36(y.yh),o.Y36(Lt.V),o.Y36(ue.s),o.Y36(a.JJ),o.Y36(a.rS),o.Y36(a.uU))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-lightning-payments"]],viewQuery:function(t,e){if(1&t&&(o.Gf(qe,5),o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap"],["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","created_at"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","payment_hash"],["matColumnDef","msatoshi_sent"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi"],["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","groupHash"],["matColumnDef","groupAmtSent"],["matColumnDef","groupAmtRecv"],["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"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot green","matTooltip","Completed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Failed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Completed","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Failed","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["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,"mpp-row-span"],["class","dot green mt-0","matTooltip","Completed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow mt-0","matTooltip","Incomplete/Failed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Completed","matTooltipPosition","right",1,"dot","green","mt-0",3,"ngClass"],["matTooltip","Incomplete/Failed","matTooltipPosition","right",1,"dot","yellow","mt-0",3,"ngClass"],["fxLayoutAlign","start center","class","mpp-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"mpp-row-span","pl-3"],["fxLayoutAlign","start center","class","mpp-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"mpp-row-span"],["fxLayoutAlign","end center","class","mpp-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-3"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-mpp-expand",3,"click"],["fxLayoutAlign","end center",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-mpp-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,Le,12,3,"form",1),o.YNc(2,Ue,3,0,"div",2),o.YNc(3,wn,44,17,"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,M.KE,xt.Nt,ft.Fj,xt.D7,ft.Q7,D.$V,ft.JJ,ft.On,q.lW,M.bx,M.TO,C.BN,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.nj,mt.Ke,mt.as,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,E.gM,At.gD,At.$L,Ct.ey,mt.yh,a.sg,mt.Gk,mt.Q2,mt.XQ],pipes:[a.uU,a.JJ],styles:[".mat-column-bolt11[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%], .mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-mpp-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-mpp-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.mpp-row-span[_ngcontent-%COMP%]{min-height:4.2rem}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:17rem}"],data:{animation:[_t.Q]}}),t})();function Sn(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 bn(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("/cl/reports")}),o._uU(1,"Fees Summary"),o.qZA()}}function qn(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 _n(t,e){1&t&&o._UZ(0,"mat-progress-bar",27)}function Fn(t,e){if(1&t&&o._UZ(0,"rtl-cl-node-info",28),2&t){const t=o.oxw(3);o.Q6J("information",t.information)("showColorFieldSeparately",!1)}}function Ln(t,e){if(1&t&&o._UZ(0,"rtl-cl-balances-info",29),2&t){const t=o.oxw(3);o.Q6J("balances",t.balances)("errorMessage",t.errorMessages[2]+" "+t.errorMessages[3])}}function Un(t,e){if(1&t&&o._UZ(0,"rtl-cl-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[4]+" "+t.errorMessages[3])}}function Rn(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-info",31),2&t){const t=o.oxw(3);o.Q6J("fees",t.fees)("errorMessage",t.errorMessages[1]+" "+t.errorMessages[4]+" "+t.errorMessages[5])}}function kn(t,e){if(1&t&&o._UZ(0,"rtl-cl-channel-status-info",32),2&t){const t=o.oxw(3);o.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[0]+" "+t.errorMessages[3])}}function Nn(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const In=function(t){return{"dashboard-card-content":!0,"error-border":t}};function On(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,Sn,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,bn,2,0,"button",16),o.YNc(15,qn,2,1,"button",16),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"mat-card-content",17),o.YNc(17,_n,1,0,"mat-progress-bar",18),o.TgZ(18,"div",19),o.YNc(19,Fn,1,2,"rtl-cl-node-info",20),o.YNc(20,Ln,1,2,"rtl-cl-balances-info",21),o.YNc(21,Un,1,4,"rtl-cl-channel-capacity-info",22),o.YNc(22,Rn,1,2,"rtl-cl-fee-info",23),o.YNc(23,kn,1,2,"rtl-cl-channel-status-info",24),o.YNc(24,Nn,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,In,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchBalance.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.ERROR)||"capacity"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.ERROR)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.ERROR)||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.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.FetchBalance.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.INITIATED)||"capacity"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.INITIATED)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.INITIATED)||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.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 Mn(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,On,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 En(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 Jn(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,En,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 Dn(t,e){1&t&&o._UZ(0,"mat-progress-bar",27)}function Yn(t,e){if(1&t&&o._UZ(0,"rtl-cl-node-info",42),2&t){const t=o.oxw(3);o.Q6J("information",t.information)}}function Qn(t,e){if(1&t&&o._UZ(0,"rtl-cl-balances-info",29),2&t){const t=o.oxw(3);o.Q6J("balances",t.balances)("errorMessage",t.errorMessages[2]+" "+t.errorMessages[3])}}function Pn(t,e){if(1&t&&o._UZ(0,"rtl-cl-channel-liquidity-info",43),2&t){const t=o.oxw(3);o.Q6J("direction","In")("totalLiquidity",t.totalInboundLiquidity)("allChannels",t.allInboundChannels)("errorMessage",t.errorMessages[4])}}function Bn(t,e){if(1&t&&o._UZ(0,"rtl-cl-channel-liquidity-info",43),2&t){const t=o.oxw(3);o.Q6J("direction","Out")("totalLiquidity",t.totalOutboundLiquidity)("allChannels",t.allOutboundChannels)("errorMessage",t.errorMessages[4])}}function Hn(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("/cl/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 zn(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-cl-lightning-invoices",47),o.qZA(),o.TgZ(4,"mat-tab",48),o._UZ(5,"rtl-cl-lightning-payments",49),o.qZA(),o.TgZ(6,"mat-tab",50),o.YNc(7,Hn,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 Gn(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const Vn=function(t){return{"p-0":t}};function Xn(t,e){if(1&t&&(o.TgZ(0,"mat-grid-tile",8),o.TgZ(1,"mat-card",35),o.YNc(2,Jn,12,4,"mat-card-header",36),o.TgZ(3,"mat-card-content",37),o.YNc(4,Dn,1,0,"mat-progress-bar",18),o.TgZ(5,"div",19),o.YNc(6,Yn,1,1,"rtl-cl-node-info",38),o.YNc(7,Qn,1,2,"rtl-cl-balances-info",21),o.YNc(8,Pn,1,4,"rtl-cl-channel-liquidity-info",39),o.YNc(9,Bn,1,4,"rtl-cl-channel-liquidity-info",39),o.YNc(10,zn,8,3,"span",40),o.YNc(11,Gn,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,Vn,"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,In,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchBalance.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.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.FetchBalance.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.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 Wn(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,Xn,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 $n=(()=>{class t{constructor(t,e,n,a,s){this.logger=t,this.store=e,this.actions=n,this.commonService=a,this.router=s,this.faSmile=m.I3,this.faFrown=m.Kf,this.faAngleDoubleDown=g.Sbq,this.faAngleDoubleUp=g.Vfw,this.faChartPie=g.OS1,this.faBolt=g.BDt,this.faServer=g.xf3,this.faNetworkWired=g.kXW,this.flgChildInfoUpdated=!1,this.userPersonaEnum=f.ol,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.totalBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.allChannels=[],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=f.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/cl/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/cl/transactions",title:"",cols:6,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/cl/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/cl/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCardHeight=.77*window.screen.height/2+"px",this.merchantCardHeight=.76*window.screen.height/10+"px",this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/cl/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/cl/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/cl/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/cl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/cl/transactions",title:"",cols:2,rows:5}])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.errorMessages=["","","","","",""],this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchInfo.status===f.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===f.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apisCallStatus.FetchFees.message?JSON.stringify(this.apisCallStatus.FetchFees.message):this.apisCallStatus.FetchFees.message),t.apisCallStatus.FetchBalance.status===f.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apisCallStatus.FetchBalance.message?JSON.stringify(this.apisCallStatus.FetchBalance.message):this.apisCallStatus.FetchBalance.message),t.apisCallStatus.FetchLocalRemoteBalance.status===f.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apisCallStatus.FetchLocalRemoteBalance.message?JSON.stringify(this.apisCallStatus.FetchLocalRemoteBalance.message):this.apisCallStatus.FetchLocalRemoteBalance.message),t.apisCallStatus.FetchChannels.status===f.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),t.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessages[5]="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),this.selNode=t.nodeSettings,this.information=t.information,this.fees=t.fees,this.totalBalance=t.balance,this.balances.onchain=t.balance.totalBalance,this.balances.lightning=t.localRemoteBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const e=t.localRemoteBalance.localBalance?+t.localRemoteBalance.localBalance:0,n=t.localRemoteBalance.remoteBalance?+t.localRemoteBalance.remoteBalance:0;this.channelBalances={localBalance:e,remoteBalance:n,balancedness:+(1-Math.abs((e-n)/(e+n))).toFixed(3)},this.channelsStatus={active:{channels:t.information.num_active_channels,capacity:t.localRemoteBalance.localBalance},pending:{channels:t.information.num_pending_channels,capacity:t.localRemoteBalance.pendingBalance||0},inactive:{channels:t.information.num_inactive_channels,capacity:t.localRemoteBalance.inactiveBalance||0}},this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannels=t.allChannels.filter(t=>"CHANNELD_NORMAL"===t.state&&t.connected),this.allChannelsCapacity=this.allChannels.length>0?JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))):[],this.allInboundChannels=this.allChannels.length>0?JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(t=>t.msatoshi_to_them>0),"msatoshi_to_them"))):[],this.allOutboundChannels=this.allChannels.length>0?JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(t=>t.msatoshi_to_us>0),"msatoshi_to_us"))):[],this.allChannels.forEach(t=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(t.msatoshi_to_them/1e3),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(t.msatoshi_to_us/1e3)}),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.feeCollected>=0,this.logger.info(t)}),this.actions.pipe((0,p.R)(this.unSubs[2]),(0,h.h)(t=>t.type===x.yA||t.type===x.iK)).subscribe(t=>{t.type===x.yA&&(this.flgChildInfoUpdated=!1),t.type===x.iK&&(this.flgChildInfoUpdated=!0)})}onNavigateTo(t){this.router.navigateByUrl(t)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.allChannels.sort((t,e)=>{const n=+t.msatoshi_to_us+ +t.msatoshi_to_them,a=+e.msatoshi_to_them+ +e.msatoshi_to_them;return n>a?-1:n<a?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=this.allChannels.length>0?JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))):[])}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(A.eX),o.Y36(T.v),o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,Mn,7,4,"div",0),o.YNc(1,Wn,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,C.BN,w.Il,a.sg,w.DX,v.a8,l.yH,v.dk,v.n5,S.VK,S.OP,v.dn,a.mk,b.oO,a.RF,a.n9,a.ED,q.lW,S.p6,_.Hw,r.pW,k,O,z,X,K,ut,dt.SP,dt.uX,re,vn,dt.uD],styles:[""]}),t})();var Kn=n(5868),jn=n(1339),ta=n(1403),ea=n(9236),na=n(5001),aa=n(7753);const sa=["form"],ia=["formSweepAll"],oa=["stepper"];function la(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Bitcoin address is required."),o.qZA())}function ra(t,e){1&t&&(o.TgZ(0,"mat-hint"),o._uU(1,"Amount replaced by UTXO balance"),o.qZA())}function ca(t,e){if(1&t&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Oqu(t.amountError)}}function ua(t,e){if(1&t&&(o.TgZ(0,"mat-option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.Oqu(t)}}function da(t,e){if(1&t&&(o.TgZ(0,"mat-option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.feeRateId),o.xp6(1),o.hij(" ",t.feeRateType," ")}}function pa(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Min Confirmation Blocks is required."),o.qZA())}function ha(t,e){if(1&t&&(o.TgZ(0,"mat-option",36),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.hij("",o.lcZ(2,2,t.value)," Sats")}}function ma(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",37),o.TgZ(1,"mat-expansion-panel",38),o.NdJ("closed",function(){return o.CHM(t),o.oxw(2).onAdvancedPanelToggle(!0)})("opened",function(){return o.CHM(t),o.oxw(2).onAdvancedPanelToggle(!1)}),o.TgZ(2,"mat-expansion-panel-header"),o.TgZ(3,"mat-panel-title"),o.TgZ(4,"span"),o._uU(5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(6,"div",31),o.TgZ(7,"div",39),o.TgZ(8,"mat-form-field",40),o.TgZ(9,"mat-select",41),o.NdJ("selectionChange",function(e){return o.CHM(t),o.oxw(2).onUTXOSelectionChange(e)})("valueChange",function(e){return o.CHM(t),o.oxw(2).selUTXOs=e}),o.TgZ(10,"mat-select-trigger"),o._uU(11),o.ALo(12,"number"),o.qZA(),o.YNc(13,ha,3,4,"mat-option",21),o.qZA(),o.qZA(),o.TgZ(14,"mat-slide-toggle",42),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).flgUseAllBalance=e})("change",function(){return o.CHM(t),o.oxw(2).onUTXOAllBalanceChange()}),o._uU(15," Use selected UTXOs balance "),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(5),o.Oqu(t.advancedTitle),o.xp6(4),o.Q6J("value",t.selUTXOs),o.xp6(2),o.AsE("",o.lcZ(12,7,t.totalSelectedUTXOAmount)," Sats (",t.selUTXOs.length>1?t.selUTXOs.length+" UTXOs":"1 UTXO",")"),o.xp6(2),o.Q6J("ngForOf",t.utxos),o.xp6(1),o.Q6J("ngModel",t.flgUseAllBalance)("disabled",t.selUTXOs.length<1)}}function ga(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.sendFundError)}}function fa(t,e){if(1&t&&(o.TgZ(0,"div",43),o._UZ(1,"fa-icon",44),o.YNc(2,ga,2,1,"span",14),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.sendFundError)}}function xa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",9,10),o.NdJ("submit",function(){return o.CHM(t),o.oxw().onSendFunds()})("reset",function(){return o.CHM(t),o.oxw().resetData()}),o.TgZ(2,"mat-form-field",11),o.TgZ(3,"input",12,13),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().transaction.address=e}),o.qZA(),o.YNc(5,la,2,0,"mat-error",14),o.qZA(),o.TgZ(6,"mat-form-field",15),o.TgZ(7,"input",16,17),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().transaction.satoshis=e}),o.qZA(),o.YNc(9,ra,2,0,"mat-hint",14),o.TgZ(10,"span",18),o._uU(11),o.qZA(),o.YNc(12,ca,2,1,"mat-error",14),o.qZA(),o.TgZ(13,"mat-form-field",19),o.TgZ(14,"mat-select",20),o.NdJ("selectionChange",function(e){return o.CHM(t),o.oxw().onAmountUnitChange(e)}),o.YNc(15,ua,2,2,"mat-option",21),o.qZA(),o.qZA(),o.TgZ(16,"div",22),o.TgZ(17,"mat-form-field",23),o.TgZ(18,"mat-select",24),o.NdJ("valueChange",function(e){return o.CHM(t),o.oxw().transaction.feeRate=e}),o.YNc(19,da,2,2,"mat-option",21),o.qZA(),o.qZA(),o.TgZ(20,"div",25),o.TgZ(21,"mat-checkbox",26),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().flgMinConf=e})("change",function(){o.CHM(t);const e=o.oxw();return e.flgMinConf?e.transaction.feeRate=null:e.transaction.minconf=null}),o.qZA(),o.TgZ(22,"mat-form-field",27),o.TgZ(23,"input",28,29),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().transaction.minconf=e}),o.qZA(),o.YNc(25,pa,2,0,"mat-error",14),o.qZA(),o.qZA(),o.qZA(),o.YNc(26,ma,16,9,"div",30),o._UZ(27,"div",31),o.YNc(28,fa,3,2,"div",32),o.TgZ(29,"div",33),o.TgZ(30,"button",34),o._uU(31,"Clear Fields"),o.qZA(),o.TgZ(32,"button",35),o._uU(33,"Send Funds"),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.transaction.address),o.xp6(2),o.Q6J("ngIf",!t.transaction.address),o.xp6(2),o.Q6J("ngModel",t.transaction.satoshis)("type",t.flgUseAllBalance?"text":"number")("step",100)("min",0)("disabled",t.flgUseAllBalance),o.xp6(2),o.Q6J("ngIf",t.flgUseAllBalance),o.xp6(2),o.hij(" ",t.selAmountUnit," "),o.xp6(1),o.Q6J("ngIf",!t.transaction.satoshis),o.xp6(2),o.Q6J("value",t.selAmountUnit)("disabled",t.flgUseAllBalance),o.xp6(1),o.Q6J("ngForOf",t.amountUnits),o.xp6(3),o.Q6J("value",t.transaction.feeRate)("disabled",t.flgMinConf),o.xp6(1),o.Q6J("ngForOf",t.feeRateTypes),o.xp6(2),o.Q6J("ngModel",t.flgMinConf),o.xp6(2),o.Q6J("ngModel",t.transaction.minconf)("step",1)("min",0)("required",t.flgMinConf)("disabled",!t.flgMinConf),o.xp6(2),o.Q6J("ngIf",t.flgMinConf&&!t.transaction.minconf),o.xp6(1),o.Q6J("ngIf",t.isCompatibleVersion),o.xp6(2),o.Q6J("ngIf",""!==t.sendFundError)}}function Za(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw(3);o.Oqu(t.passwordFormLabel)}}function ya(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Password is required."),o.qZA())}function Aa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-step",49),o.TgZ(1,"form",69),o.YNc(2,Za,1,1,"ng-template",63),o.TgZ(3,"div",0),o.TgZ(4,"mat-form-field",1),o._UZ(5,"input",70),o.YNc(6,ya,2,0,"mat-error",14),o.qZA(),o.qZA(),o.TgZ(7,"div",71),o.TgZ(8,"button",72),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).onAuthenticate()}),o._uU(9,"Confirm"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.Q6J("stepControl",t.passwordFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.passwordFormGroup),o.xp6(5),o.Q6J("ngIf",null==t.passwordFormGroup.controls.password.errors?null:t.passwordFormGroup.controls.password.errors.required)}}function Ta(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw(2);o.Oqu(t.sendFundFormLabel)}}function Ca(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Bitcoin address is required."),o.qZA())}function wa(t,e){if(1&t&&(o.TgZ(0,"mat-option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.feeRateId),o.xp6(1),o.hij(" ",t.feeRateType," ")}}function va(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees Rate is required."),o.qZA())}function Sa(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Min confirmation blocks is required."),o.qZA())}function ba(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw(2);o.Oqu(t.confirmFormLabel)}}function qa(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Oqu(t.sendFundError)}}function _a(t,e){if(1&t&&(o.TgZ(0,"div",43),o._UZ(1,"fa-icon",44),o.YNc(2,qa,2,1,"span",14),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==t.sendFundError)}}function Fa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",45),o.TgZ(1,"mat-vertical-stepper",46,47),o.NdJ("selectionChange",function(e){return o.CHM(t),o.oxw().stepSelectionChanged(e)}),o.YNc(3,Aa,10,4,"mat-step",48),o.TgZ(4,"mat-step",49),o.TgZ(5,"form",50),o.YNc(6,Ta,1,1,"ng-template",51),o.TgZ(7,"div",31),o.TgZ(8,"mat-form-field",1),o._UZ(9,"input",52),o.YNc(10,Ca,2,0,"mat-error",14),o.qZA(),o.TgZ(11,"div",53),o.TgZ(12,"mat-form-field",54),o.TgZ(13,"mat-select",55),o.YNc(14,wa,2,2,"mat-option",21),o.qZA(),o.YNc(15,va,2,0,"mat-error",14),o.qZA(),o.TgZ(16,"div",56),o._UZ(17,"mat-checkbox",57),o.TgZ(18,"mat-form-field",27),o._UZ(19,"input",58),o.YNc(20,Sa,2,0,"mat-error",14),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(21,"div",59),o.TgZ(22,"button",60),o._uU(23,"Next"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(24,"mat-step",61),o.TgZ(25,"form",62),o.YNc(26,ba,1,1,"ng-template",63),o.TgZ(27,"div",45),o.TgZ(28,"div",64),o._UZ(29,"fa-icon",65),o.TgZ(30,"span"),o._uU(31,"You are about to sweep all funds from RTL. Are you sure?"),o.qZA(),o.qZA(),o.YNc(32,_a,3,2,"div",32),o.TgZ(33,"div",59),o.TgZ(34,"button",66),o.NdJ("click",function(){return o.CHM(t),o.oxw().onSendFunds()}),o._uU(35,"Sweep All Funds"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(36,"div",67),o.TgZ(37,"button",68),o._uU(38),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("linear",!0),o.xp6(2),o.Q6J("ngIf",!t.appConfig.sso.rtlSSO),o.xp6(1),o.Q6J("stepControl",t.sendFundFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.sendFundFormGroup),o.xp6(5),o.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionAddress.errors?null:t.sendFundFormGroup.controls.transactionAddress.errors.required),o.xp6(4),o.Q6J("ngForOf",t.feeRateTypes),o.xp6(1),o.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionFeeRate.errors?null:t.sendFundFormGroup.controls.transactionFeeRate.errors.required),o.xp6(4),o.Q6J("step",1)("min",0),o.xp6(1),o.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionBlocks.errors?null:t.sendFundFormGroup.controls.transactionBlocks.errors.required),o.xp6(4),o.Q6J("stepControl",t.confirmFormGroup),o.xp6(1),o.Q6J("formGroup",t.confirmFormGroup),o.xp6(4),o.Q6J("icon",t.faExclamationTriangle),o.xp6(3),o.Q6J("ngIf",""!==t.sendFundError),o.xp6(5),o.Q6J("mat-dialog-close",!1),o.xp6(1),o.Oqu(t.flgValidated?"Close":"Cancel")}}let La=(()=>{class t{constructor(t,e,n,a,s,i,o,l,r,c){this.dialogRef=t,this.data=e,this.logger=n,this.store=a,this.commonService=s,this.decimalPipe=i,this.actions=o,this.formBuilder=l,this.rtlEffects=r,this.snackBar=c,this.faExclamationTriangle=g.eHv,this.sweepAll=!1,this.selNode={},this.addressTypes=[],this.utxos=[],this.selUTXOs=[],this.flgUseAllBalance=!1,this.totalSelectedUTXOAmount=null,this.selectedAddress=f._t[1],this.blockchainBalance={},this.information={},this.isCompatibleVersion=!1,this.newAddress="",this.transaction={},this.feeRateTypes=f.vn,this.flgMinConf=!1,this.sendFundError="",this.fiatConversion=!1,this.amountUnits=f.uA,this.selAmountUnit=f.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=f.Xz,this.advancedTitle="Advanced Options",this.flgValidated=!1,this.flgEditable=!0,this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds",this.confirmFormLabel="Confirm sweep",this.amountError="Amount is Required.",this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[ft.kI.required]],password:["",[ft.kI.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",ft.kI.required],transactionFeeRate:[null],flgMinConf:[!1],transactionBlocks:[{value:null,disabled:!0}]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.flgMinConf.valueChanges.pipe((0,p.R)(this.unSubs[4])).subscribe(t=>{t?(this.sendFundFormGroup.controls.transactionBlocks.enable(),this.sendFundFormGroup.controls.transactionBlocks.setValidators([ft.kI.required]),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionFeeRate.disable(),this.sendFundFormGroup.controls.transactionFeeRate.setValue(null)):(this.sendFundFormGroup.controls.transactionBlocks.disable(),this.sendFundFormGroup.controls.transactionBlocks.setValidators(null),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionBlocks.setErrors(null),this.sendFundFormGroup.controls.transactionFeeRate.enable(),this.sendFundFormGroup.controls.transactionFeeRate.setValue(null))}),(0,Kn.a)([this.store.select("root"),this.store.select("cl")]).pipe((0,p.R)(this.unSubs[0])).subscribe(([t,e])=>{this.fiatConversion=t.selNode.settings.fiatConversion,this.amountUnits=t.selNode.settings.currencyUnits,this.appConfig=t.appConfig,this.nodeData=t.nodeData,this.information=e.information,this.isCompatibleVersion=this.commonService.isVersionCompatible(this.information.version,"0.9.0")&&this.commonService.isVersionCompatible(this.information.api_version,"0.4.0"),this.utxos=this.commonService.sortAscByKey(e.utxos.filter(t=>"confirmed"===t.status),"value"),this.logger.info(t),this.logger.info(e)}),this.actions.pipe((0,p.R)(this.unSubs[1]),(0,h.h)(t=>t.type===x.qe||t.type===x.ob)).subscribe(t=>{t.type===x.ob&&(this.store.dispatch(new Ft.Lw("Fund Sent Successfully!")),this.dialogRef.close()),t.type===x.qe&&t.payload.status===f.Bn.ERROR&&"SetChannelTransaction"===t.payload.action&&(this.sendFundError=t.payload.message)})}onAuthenticate(){if(!this.passwordFormGroup.controls.password.value)return!0;this.flgValidated=!1,this.store.dispatch(new Ft.ZF(jn(this.passwordFormGroup.controls.password.value))),this.rtlEffects.isAuthorizedRes.pipe((0,ce.q)(1)).subscribe(t=>{"ERROR"!==t?(this.passwordFormGroup.controls.hiddenPassword.setValue(this.passwordFormGroup.controls.password.value),this.stepper.next()):(this.dialogRef.close(),this.snackBar.open("Unauthorized User. Logging out from RTL."))})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.flgUseAllBalance&&(this.transaction.satoshis="all"),this.selUTXOs.length&&this.selUTXOs.length>0&&(this.transaction.utxos=[],this.selUTXOs.forEach(t=>this.transaction.utxos.push(t.txid+":"+t.output))),this.sweepAll?(this.transaction.satoshis="all",this.transaction.address=this.sendFundFormGroup.controls.transactionAddress.value,this.sendFundFormGroup.controls.flgMinConf.value?(delete this.transaction.feeRate,this.transaction.minconf=this.sendFundFormGroup.controls.transactionBlocks.value):(delete this.transaction.minconf,this.sendFundFormGroup.controls.transactionFeeRate.value?this.transaction.feeRate=this.sendFundFormGroup.controls.transactionFeeRate.value:delete this.transaction.feeRate),delete this.transaction.utxos,this.store.dispatch(new x.uj(this.transaction))):this.transaction.satoshis&&"all"!==this.transaction.satoshis&&this.selAmountUnit!==f.NT.SATS?this.commonService.convertCurrency(+this.transaction.satoshis,this.selAmountUnit===this.amountUnits[2]?f.NT.OTHER:this.selAmountUnit,f.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,p.R)(this.unSubs[2])).subscribe({next:t=>{this.transaction.satoshis=t[f.NT.SATS],this.selAmountUnit=f.NT.SATS,this.store.dispatch(new x.uj(this.transaction))},error:t=>{this.transaction.satoshis=null,this.selAmountUnit=f.NT.SATS,this.amountError="Conversion Error: "+t}}):this.store.dispatch(new x.uj(this.transaction))}get invalidValues(){return this.sweepAll?!this.sendFundFormGroup.controls.transactionAddress.value||""===this.sendFundFormGroup.controls.transactionAddress.value||this.sendFundFormGroup.controls.flgMinConf.value&&(!this.sendFundFormGroup.controls.transactionBlocks.value||this.sendFundFormGroup.controls.transactionBlocks.value<=0):!this.transaction.address||""===this.transaction.address||!this.transaction.satoshis||+this.transaction.satoshis<=0||this.flgMinConf&&(!this.transaction.minconf||this.transaction.minconf<=0)}resetData(){this.sendFundError="",this.transaction={},this.flgMinConf=!1,this.totalSelectedUTXOAmount=null,this.selUTXOs=[],this.flgUseAllBalance=!1,this.selAmountUnit=f.uA[0]}stepSelectionChanged(t){switch(this.sendFundError="",t.selectedIndex){case 0:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds";break;case 1:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds";break;case 2:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds | Address: "+this.sendFundFormGroup.controls.transactionAddress.value+(this.sendFundFormGroup.controls.flgMinConf.value?" | Min Confirmation Blocks: "+this.sendFundFormGroup.controls.transactionBlocks.value:this.sendFundFormGroup.controls.transactionFeeRate.value?" | Fee Rate: "+this.feeRateTypes.find(t=>t.feeRateId===this.sendFundFormGroup.controls.transactionFeeRate.value).feeRateType:"");break;default:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds"}t.selectedIndex<t.previouslySelectedIndex&&0===t.selectedIndex&&this.passwordFormGroup.controls.hiddenPassword.setValue("")}onUTXOSelectionChange(t){const e={value:0};this.selUTXOs.length&&this.selUTXOs.length>0?(this.totalSelectedUTXOAmount=this.selUTXOs.reduce((t,n)=>(e.value=t.value+n.value,e)).value,this.flgUseAllBalance&&this.onUTXOAllBalanceChange()):(this.totalSelectedUTXOAmount=null,this.transaction.satoshis=null,this.flgUseAllBalance=!1)}onUTXOAllBalanceChange(){this.flgUseAllBalance?(this.transaction.satoshis=this.totalSelectedUTXOAmount,this.selAmountUnit=f.uA[0]):this.transaction.satoshis=null}onAmountUnitChange(t){const e=this,n=this.selAmountUnit===this.amountUnits[2]?f.NT.OTHER:this.selAmountUnit;let a=t.value===this.amountUnits[2]?f.NT.OTHER:t.value;this.transaction.satoshis&&this.selAmountUnit!==t.value&&this.commonService.convertCurrency(+this.transaction.satoshis,n,a,this.amountUnits[2],this.fiatConversion).pipe((0,p.R)(this.unSubs[3])).subscribe({next:n=>{this.selAmountUnit=t.value,e.transaction.satoshis=e.decimalPipe.transform(n[a],e.currencyUnitFormats[a]).replace(/,/g,"")},error:t=>{e.transaction.satoshis=null,this.amountError="Conversion Error: "+t,this.selAmountUnit=n,a=n}})}onAdvancedPanelToggle(t){this.advancedTitle=t&&this.selUTXOs.length&&this.selUTXOs.length>0?"Advanced Options | Selected UTXOs: "+this.selUTXOs.length+" | Selected UTXO Amount: "+this.decimalPipe.transform(this.totalSelectedUTXOAmount)+" Sats":"Advanced Options"}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(gt.so),o.Y36(gt.WI),o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(T.v),o.Y36(a.JJ),o.Y36(A.eX),o.Y36(ft.qu),o.Y36(Lt.V),o.Y36(ta.ux))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-on-chain-send-modal"]],viewQuery:function(t,e){if(1&t&&(o.Gf(sa,7),o.Gf(ia,5),o.Gf(oa,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first),o.iGM(t=o.CRH())&&(e.formSweepAll=t.first),o.iGM(t=o.CRH())&&(e.stepper=t.first)}},decls:12,vars:4,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","space-between start","fxFlex","100","class","overflow-x-hidden",3,"submit","reset",4,"ngIf","ngIfElse"],["sweepAllBlock",""],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex","55"],["matInput","","autoFocus","","placeholder","Bitcoin Address","tabindex","1","name","address","required","",3,"ngModel","ngModelChange"],["address","ngModel"],[4,"ngIf"],["fxFlex","30"],["matInput","","placeholder","Amount","name","amount","tabindex","2","required","",3,"ngModel","type","step","min","disabled","ngModelChange"],["amount","ngModel"],["matSuffix",""],["fxFlex","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","disabled","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","60","fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["fxFlex","48","fxLayoutAlign","start end"],["tabindex","6","placeholder","Fee Rate",3,"value","disabled","valueChange"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","7","color","primary","name","flgMinConf","fxLayoutAlign","stretch start",1,"mr-2",3,"ngModel","ngModelChange","change"],["fxFlex","98"],["matInput","","placeholder","Min Confirmation Blocks","type","number","name","blocks","tabindex","8",3,"ngModel","step","min","required","disabled","ngModelChange"],["blocks","ngModel"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["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"],["mat-flat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","100","expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","35","fxLayoutAlign","start end"],["tabindex","8","placeholder","Coin Selection","multiple","",3,"value","selectionChange","valueChange"],["fxFlex","60","tabindex","9","color","primary","name","flgUseAllBalance","matTooltip","Use selected UTXOs balance as the amount to be sent. Final amount sent will be less the mining fee.","matTooltipPosition","above",3,"ngModel","disabled","ngModelChange","change"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable",4,"ngIf"],[3,"stepControl","editable"],["fxLayout","column",1,"my-1","pr-1",3,"formGroup"],["matStepLabel","","disabled","true"],["matInput","","formControlName","transactionAddress","placeholder","Bitcoin Address","tabindex","4","name","address","required",""],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex.gt-sm","48","fxLayoutAlign","start end"],["tabindex","5","placeholder","Fee Rate","formControlName","transactionFeeRate"],["fxFlex.gt-sm","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","6","color","primary","formControlName","flgMinConf","name","flgMinCon",1,"mr-2"],["matInput","","formControlName","transactionBlocks","placeholder","Min Confirmation Blocks","type","number","name","blocks","tabindex","7","required","",3,"step","min"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","8","type","default","matStepperNext",""],[3,"stepControl"],["fxLayout","column","fxLayoutAlign","start",1,"my-1","pr-1",3,"formGroup"],["matStepLabel",""],["fxFlex","100",1,"w-100","alert","alert-warn"],[1,"mt-1","mr-1","alert-icon",3,"icon"],["mat-stroked-button","","color","primary","tabindex","9","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["fxLayout","column","fxLayoutAlign","space-between",1,"my-1","pr-1",3,"formGroup"],["autoFocus","","matInput","","placeholder","Password","type","password","tabindex","1","formControlName","password","required",""],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","default",3,"click"]],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._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.YNc(9,xa,34,25,"form",7),o.qZA(),o.qZA(),o.qZA(),o.YNc(10,Fa,39,17,"ng-template",null,8,o.W1O)),2&t){const t=o.MAs(11);o.xp6(5),o.Oqu(e.sweepAll?"Sweep All Funds":"Send Funds"),o.xp6(1),o.Q6J("mat-dialog-close",!1),o.xp6(3),o.Q6J("ngIf",!e.sweepAll)("ngIfElse",t)}},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,gt.ZT,v.dn,a.O5,ft._Y,ft.JL,ft.F,M.KE,xt.Nt,ft.Fj,Zt.h,ft.Q7,ft.JJ,ft.On,yt.q,M.R9,At.gD,a.sg,ea.oG,ft.wV,ft.qQ,M.TO,M.bx,Ct.ey,na.ib,na.yz,na.yK,At.$L,Tt.Rr,E.gM,C.BN,aa.Vq,aa.C0,ft.sg,aa.VY,ft.u,aa.Ic],pipes:[a.JJ],styles:[""]}),t})();var Ua=n(882);function Ra(t,e){1&t&&o._UZ(0,"mat-progress-bar",27)}function ka(t,e){1&t&&(o.TgZ(0,"th",28),o._uU(1," Transaction ID "),o.qZA())}function Na(t,e){1&t&&(o.TgZ(0,"span",36),o.TgZ(1,"mat-icon",37),o._uU(2,"warning"),o.qZA(),o.qZA())}function Ia(t,e){if(1&t&&(o.TgZ(0,"span"),o.YNc(1,Na,3,0,"span",35),o.qZA()),2&t){const t=o.oxw().$implicit;o.oxw();const e=o.MAs(32);o.xp6(1),o.Q6J("ngIf",t.value<1e3)("ngIfElse",e)}}function Oa(t,e){1&t&&o._UZ(0,"span",38)}function Ma(t,e){if(1&t&&(o._UZ(0,"span",39),o.ALo(1,"titlecase")),2&t){const t=o.oxw().$implicit;o.s9C("matTooltip",o.lcZ(1,1,t.status))}}const Ea=function(t){return{"max-width":t}};function Ja(t,e){if(1&t&&(o.TgZ(0,"td",29),o.TgZ(1,"span",30),o.YNc(2,Ia,2,2,"span",31),o.YNc(3,Oa,1,0,"span",32),o.YNc(4,Ma,2,3,"span",33),o.TgZ(5,"span",34),o._uU(6),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(5,Ea,n.screenSize===n.screenSizeEnum.XS?"10rem":"50rem")),o.xp6(1),o.Q6J("ngIf",n.numDustUTXOs>0&&!n.isDustUTXO),o.xp6(1),o.Q6J("ngIf","confirmed"===t.status),o.xp6(1),o.Q6J("ngIf","confirmed"!==t.status),o.xp6(2),o.Oqu(t.txid)}}function Da(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Output "),o.qZA())}function Ya(t,e){if(1&t&&(o.TgZ(0,"td",29),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.lcZ(3,1,null==t?null:t.output)," ")}}function Qa(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Value (Sats) "),o.qZA())}function Pa(t,e){if(1&t&&(o.TgZ(0,"span",41),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.value))}}function Ba(t,e){if(1&t&&(o.TgZ(0,"span",44),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.value),")")}}function Ha(t,e){if(1&t&&(o.TgZ(0,"td",29),o.YNc(1,Pa,3,3,"span",42),o.YNc(2,Ba,3,3,"span",43),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngIf",t.value>0||0===t.value),o.xp6(1),o.Q6J("ngIf",t.value<0)}}function za(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1," Blockheight "),o.qZA())}function Ga(t,e){if(1&t&&(o.TgZ(0,"td",29),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.lcZ(3,1,null==t?null:t.blockheight)," ")}}function Va(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 Xa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",49),o.TgZ(1,"button",50),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw().onUTXOClick(n,e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Wa(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No utxos available."),o.qZA())}function $a(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting utxos..."),o.qZA())}function Ka(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 ja(t,e){if(1&t&&(o.TgZ(0,"td",51),o.YNc(1,Wa,2,0,"p",31),o.YNc(2,$a,2,0,"p",31),o.YNc(3,Ka,2,1,"p",31),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchUTXOs.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchUTXOs.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.FetchUTXOs.status)===t.apiCallStatusEnum.ERROR)}}const ts=function(t){return{"display-none":t}};function es(t,e){if(1&t&&o._UZ(0,"tr",52),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,ts,(null==t.listUTXOs?null:t.listUTXOs.data)&&(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)>0))}}function ns(t,e){1&t&&o._UZ(0,"tr",53)}function as(t,e){1&t&&o._UZ(0,"tr",54)}function ss(t,e){1&t&&o._UZ(0,"mat-icon",37)}const is=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},os=function(){return["no_utxo"]};let ls=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.numDustUTXOs=0,this.isDustUTXO=!1,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["txid","value","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["txid","output","value","blockheight","actions"]):(this.flgSticky=!0,this.displayedColumns=["txid","output","value","blockheight","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchUTXOs.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchUTXOs.message?JSON.stringify(this.apisCallStatus.FetchUTXOs.message):this.apisCallStatus.FetchUTXOs.message),this.logger.info(t)})}ngAfterViewInit(){this.utxos&&this.utxos.length>0&&this.sort&&this.paginator&&this.loadUTXOsTable(this.utxos)}ngOnChanges(){this.utxos&&this.utxos.length>0&&this.loadUTXOsTable(this.utxos)}applyFilter(t){this.listUTXOs.filter=t.value.trim().toLowerCase()}onUTXOClick(t,e){const n=[[{key:"txid",value:t.txid,title:"Transaction ID",width:100}],[{key:"output",value:t.output,title:"Output",width:50,type:f.Gi.NUMBER},{key:"value",value:t.value,title:"Value (Sats)",width:50,type:f.Gi.NUMBER}],[{key:"status",value:this.commonService.titleCase(t.status),title:"Status",width:50,type:f.Gi.STRING},{key:"blockheight",value:t.blockheight,title:"Blockheight",width:50,type:f.Gi.NUMBER}],[{key:"address",value:t.address,title:"Address",width:100}]];this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"UTXO Information",message:n}}))}loadUTXOsTable(t){this.listUTXOs=new mt.by([...t]),this.listUTXOs.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.listUTXOs.sort=this.sort,this.listUTXOs.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.listUTXOs.paginator=this.paginator,this.logger.info(this.listUTXOs)}onDownloadCSV(){this.listUTXOs.data&&this.listUTXOs.data.length>0&&this.commonService.downloadFile(this.listUTXOs.data,"UTXOs")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(T.v),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-on-chain-utxos"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:{numDustUTXOs:"numDustUTXOs",isDustUTXO:"isDustUTXO",utxos:"utxos"},features:[o._Bn([{provide:pt.ye,useValue:(0,f.pt)("UTXOs")}]),o.TTD],decls:33,vars:13,consts:[["fxLayout","row wrap","fxLayoutAlign","start start","fxLayout.gt-sm","column","fxFlex","100","fxLayoutAlign.gt-sm","start stretch",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","txid"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","output"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","value"],["matColumnDef","blockheight"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_utxo"],["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"],["emptySpace",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayout","row",1,"ellipsis-parent",3,"ngStyle"],[4,"ngIf"],["class","dot green","matTooltip","Confirmed","matTooltipPosition","right",4,"ngIf"],["class","dot yellow","matTooltipPosition","right",3,"matTooltip",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Risk of dust attack","matTooltipPosition","right",4,"ngIf","ngIfElse"],["matTooltip","Risk of dust attack","matTooltipPosition","right"],["fxLayoutAlign","start center","color","warn",1,"mr-1"],["matTooltip","Confirmed","matTooltipPosition","right",1,"dot","green"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center",1,"red"],["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"],["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(t){return e.applyFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"div",6),o.YNc(7,Ra,1,0,"mat-progress-bar",7),o.TgZ(8,"table",8,9),o.ynx(10,10),o.YNc(11,ka,2,0,"th",11),o.YNc(12,Ja,7,7,"td",12),o.BQk(),o.ynx(13,13),o.YNc(14,Da,2,0,"th",14),o.YNc(15,Ya,4,3,"td",12),o.BQk(),o.ynx(16,15),o.YNc(17,Qa,2,0,"th",14),o.YNc(18,Ha,3,2,"td",12),o.BQk(),o.ynx(19,16),o.YNc(20,za,2,0,"th",14),o.YNc(21,Ga,4,3,"td",12),o.BQk(),o.ynx(22,17),o.YNc(23,Va,6,0,"th",18),o.YNc(24,Xa,3,0,"td",19),o.BQk(),o.ynx(25,20),o.YNc(26,ja,4,3,"td",21),o.BQk(),o.YNc(27,es,1,3,"tr",22),o.YNc(28,ns,1,0,"tr",23),o.YNc(29,as,1,0,"tr",24),o.qZA(),o._UZ(30,"mat-paginator",25),o.qZA(),o.qZA(),o.qZA(),o.YNc(31,ss,1,0,"ng-template",null,26,o.W1O)),2&t&&(o.xp6(7),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchUTXOs.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.listUTXOs)("ngClass",o.VKq(10,is,""!==e.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(12,os)),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,M.KE,xt.Nt,D.$V,a.O5,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,a.PC,b.Zl,E.gM,_.Hw,At.gD,At.$L,Ct.ey,q.lW,mt.yh,mt.Q2,mt.XQ,mt.Gk],pipes:[a.rS,a.JJ],styles:[".mat-column-txid[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-txid[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var rs=n(1050);function cs(t,e){if(1&t&&(o.TgZ(0,"span",5),o._uU(1,"UTXOs"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.numUtxos)}}function us(t,e){if(1&t&&(o.TgZ(0,"span",5),o._uU(1,"Dust UTXOs"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.numDustUtxos)}}let ds=(()=>{class t{constructor(t,e){this.logger=t,this.store=e,this.selectedTableIndex=0,this.selectedTableIndexChange=new o.vpe,this.utxos=[],this.numUtxos=0,this.dustUtxos=[],this.numDustUtxos=0,this.unSubs=[new d.x]}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{t.utxos&&t.utxos.length>0&&(this.utxos=t.utxos,this.numUtxos=this.utxos.length,this.dustUtxos=t.utxos.filter(t=>+t.value<1e3),this.numDustUtxos=this.dustUtxos.length),t.utxos&&t.utxos.length>0&&(this.utxos=t.utxos,this.numUtxos=this.utxos.length),this.logger.info(t)})}onSelectedIndexChanged(t){this.selectedTableIndexChange.emit(t)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-utxo-tables"]],inputs:{selectedTableIndex:"selectedTableIndex"},outputs:{selectedTableIndexChange:"selectedTableIndexChange"},decls:8,vars:7,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"bordered-box"],[3,"selectedIndex","selectedIndexChange"],["mat-tab-label",""],["xLayout","row","fxFlex","100",3,"utxos","numDustUTXOs","isDustUTXO"],["fxLayout","row","fxFlex","100",3,"utxos","numDustUTXOs","isDustUTXO"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"mat-tab-group",1),o.NdJ("selectedIndexChange",function(t){return e.onSelectedIndexChanged(t)}),o.TgZ(2,"mat-tab"),o.YNc(3,cs,2,1,"ng-template",2),o._UZ(4,"rtl-cl-on-chain-utxos",3),o.qZA(),o.TgZ(5,"mat-tab"),o.YNc(6,us,2,1,"ng-template",2),o._UZ(7,"rtl-cl-on-chain-utxos",4),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("selectedIndex",e.selectedTableIndex),o.xp6(3),o.Q6J("utxos",e.utxos)("numDustUTXOs",e.numDustUtxos)("isDustUTXO",!1),o.xp6(3),o.Q6J("utxos",e.dustUtxos)("numDustUTXOs",e.numDustUtxos)("isDustUTXO",!0))},directives:[l.xw,l.yH,l.Wh,dt.SP,dt.uX,dt.uD,ls,rs.k],styles:[""]}),t})();const ps=function(t,e){return[t,e]};function hs(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=null==e?null:e.link}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.Q6J("active",n.activeLink===(null==t?null:t.link))("routerLink",o.WLB(3,ps,null==t?null:t.link,null==n.selectedTable?null:n.selectedTable.name)),o.xp6(1),o.Oqu(null==t?null:t.name)}}let ms=(()=>{class t{constructor(t,e,n){this.store=t,this.router=e,this.activatedRoute=n,this.selNode={},this.faExchangeAlt=g.Ssp,this.faChartPie=g.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"},{link:"sweep",name:"Sweep All"}],this.activeLink=this.links[0].link,this.tables=[{id:0,name:"utxos"},{id:1,name:"dustUtxos"}],this.selectedTable=this.tables[0],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.selectedTable=this.tables.find(t=>t.name===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.Av)).subscribe(t=>{const e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.selectedTable=this.tables.find(e=>e.name===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.selNode=t.nodeSettings,this.balances=[{title:"Total Balance",dataValue:t.balance.totalBalance||0},{title:"Confirmed",dataValue:t.balance.confBalance},{title:"Unconfirmed",dataValue:t.balance.unconfBalance}]})}openSendFundsModal(t){this.store.dispatch(new Ft.wu({data:{sweepAll:t,component:La}}))}onSelectedTableIndexChanged(t){this.selectedTable=this.tables.find(e=>e.id===t),this.router.navigate(["./",this.activeLink,this.selectedTable.name],{relativeTo:this.activatedRoute})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.yh),o.Y36(s.F0),o.Y36(s.gz))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-on-chain"]],decls:21,vars:5,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,"mat-tab-body-wrapper"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100",3,"selectedTableIndex","selectedTableIndexChange"],["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,hs,2,6,"div",8),o.qZA(),o.TgZ(17,"div",9),o._UZ(18,"router-outlet"),o.qZA(),o.TgZ(19,"div",10),o.TgZ(20,"rtl-cl-utxo-tables",11),o.NdJ("selectedTableIndexChange",function(t){return e.onSelectedTableIndexChanged(t)}),o.qZA(),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),o.xp6(4),o.Q6J("selectedTableIndex",null==e.selectedTable?null:e.selectedTable.id))},directives:[l.xw,l.Wh,C.BN,v.a8,v.dn,Ua.D,dt.BU,a.sg,l.yH,s.lC,ds,dt.Nj,s.rH],styles:[""]}),t})();function gs(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 fs(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 xs=(()=>{class t{constructor(t,e,n){this.store=t,this.logger=e,this.router=n,this.activePeers=0,this.activeChannels=0,this.faUsers=g.FVb,this.faChartPie=g.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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.activePeers=t.peers&&t.peers.length?t.peers.length:0,this.activeChannels=t.information.num_active_channels,this.balances=[{title:"Total Balance",dataValue:t.balance.totalBalance||0},{title:"Confirmed",dataValue:t.balance.confBalance},{title:"Unconfirmed",dataValue:t.balance.unconfBalance}],this.logger.info(t)})}onSelectedTabChange(t){this.router.navigateByUrl("/cl/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(y.yh),o.Y36(Z.mQ),o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,gs,2,1,"ng-template",8),o.qZA(),o.TgZ(18,"mat-tab"),o.YNc(19,fs,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,C.BN,v.a8,v.dn,Ua.D,dt.SP,dt.uX,dt.uD,l.yH,s.lC,rs.k],styles:[""]}),t})();function Zs(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 ys=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.router=n,this.faExchangeAlt=g.Ssp,this.faChartPie=g.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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.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("cl").pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.currencyUnits=t.nodeSettings.currencyUnits,this.balances=t.nodeSettings.userPersona===f.ol.OPERATOR?[{title:"Local Capacity",dataValue:t.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:t.localRemoteBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:t.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:t.localRemoteBalance.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(Z.mQ),o.Y36(y.yh),o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,Zs,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,C.BN,v.a8,v.dn,Ua.D,dt.BU,a.sg,l.yH,s.lC,dt.Nj,s.rH],styles:[""]}),t})();function As(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 Ts=(()=>{class t{constructor(t){this.router=t,this.faMapSigns=g.SuH,this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"routingpeers",name:"Routing Peers"},{link:"failedtransactions",name:"Failed Transactions"}],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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.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(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-routing"]],decls:13,vars:2,consts:[["fxLayout","column",1,"mb-2"],["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,As,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,C.BN,l.yH,v.a8,v.dn,dt.BU,a.sg,s.lC,dt.Nj,s.rH],styles:[""]}),t})();var Cs=n(2609);function ws(t,e){1&t&&(o.TgZ(0,"th",26),o._uU(1,"Type"),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.hij(" ",null==t?null:t.type," ")}}function Ss(t,e){1&t&&(o.TgZ(0,"th",26),o._uU(1,"Address"),o.qZA())}function bs(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.hij(" ",null==t?null:t.address," ")}}function qs(t,e){1&t&&(o.TgZ(0,"th",26),o._uU(1,"Port"),o.qZA())}function _s(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.hij(" ",null==t?null:t.port," ")}}function Fs(t,e){1&t&&(o.TgZ(0,"th",28),o.TgZ(1,"span",29),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Ls(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",30),o.TgZ(1,"span",29),o.TgZ(2,"button",31),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.address+":"+t.port)}}function Us(t,e){1&t&&o._UZ(0,"tr",32)}function Rs(t,e){1&t&&o._UZ(0,"tr",33)}const ks=function(t){return{"background-color":t}};function Ns(t,e){if(1&t&&(o.TgZ(0,"div",1),o._UZ(1,"mat-divider",2),o.TgZ(2,"div",3),o.TgZ(3,"h4",4),o._uU(4,"Pub Key"),o.qZA(),o.TgZ(5,"span",5),o._uU(6),o.qZA(),o.qZA(),o._UZ(7,"mat-divider",6),o.TgZ(8,"div",7),o.TgZ(9,"div",3),o.TgZ(10,"h4",4),o._uU(11,"Alias"),o.qZA(),o.TgZ(12,"span",8),o._uU(13),o.TgZ(14,"span",9),o._uU(15),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o._UZ(16,"mat-divider",6),o.TgZ(17,"div",7),o.TgZ(18,"div",10),o.TgZ(19,"h4",4),o._uU(20,"Last Update"),o.qZA(),o.TgZ(21,"span",8),o._uU(22),o.ALo(23,"date"),o.qZA(),o.qZA(),o.TgZ(24,"div",10),o.TgZ(25,"h4",4),o._uU(26,"Features"),o.qZA(),o.TgZ(27,"span",8),o._uU(28),o.qZA(),o.qZA(),o.qZA(),o._UZ(29,"mat-divider",6),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,ws,2,0,"th",17),o.YNc(38,vs,2,1,"td",18),o.BQk(),o.ynx(39,19),o.YNc(40,Ss,2,0,"th",17),o.YNc(41,bs,2,1,"td",18),o.BQk(),o.ynx(42,20),o.YNc(43,qs,2,0,"th",17),o.YNc(44,_s,2,1,"td",18),o.BQk(),o.ynx(45,21),o.YNc(46,Fs,3,0,"th",22),o.YNc(47,Ls,4,1,"td",23),o.BQk(),o.YNc(48,Us,1,0,"tr",24),o.YNc(49,Rs,1,0,"tr",25),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(5),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.alias),o.xp6(1),o.Q6J("ngStyle",o.VKq(16,ks,"#"+(null==t.lookupResult?null:t.lookupResult.color))),o.xp6(1),o.Oqu(null!=t.lookupResult&&t.lookupResult.color?"#"+(null==t.lookupResult?null:t.lookupResult.color):""),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.xi3(23,13,1e3*(null==t.lookupResult?null:t.lookupResult.last_timestamp),"dd/MMM/YYYY HH:mm")),o.xp6(6),o.Oqu(null==t.lookupResult?null:t.lookupResult.features),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Q6J("dataSource",t.addresses),o.xp6(14),o.Q6J("matHeaderRowDef",t.displayedColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)}}let Is=(()=>{class t{constructor(t,e){this.logger=t,this.snackBar=e,this.displayedColumns=["type","address","port","actions"]}ngOnInit(){this.addresses=new mt.by(this.lookupResult&&this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult&&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(Z.mQ),o.Y36(ta.ux))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-node-lookup"]],viewQuery:function(t,e){if(1&t&&o.Gf(ht.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","column","fxFlex","100","fxLayoutAlign","end start",1,"my-1"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text","w-100"],[1,"my-1",3,"inset"],["fxLayout","row"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxLayout","column","fxFlex","50","fxLayoutAlign","end start",1,"my-1"],["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","type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","port"],["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,Ns,50,18,"div",0),2&t&&o.Q6J("ngIf",e.lookupResult)},directives:[a.O5,l.xw,J.d,l.yH,l.Wh,a.PC,b.Zl,D.$V,mt.BZ,ht.YE,mt.w1,mt.fO,mt.Dz,mt.as,mt.nj,mt.ge,ht.nU,mt.ev,q.lW,Cs.y,mt.XQ,mt.Gk],pipes:[a.uU],styles:[""]}),t})();function Os(t,e){1&t&&(o.TgZ(0,"h3",11),o._uU(1,"Node 1"),o.qZA())}function Ms(t,e){1&t&&(o.TgZ(0,"h3",11),o._uU(1,"Node 1 (Your Node)"),o.qZA())}function Es(t,e){1&t&&(o.TgZ(0,"h3",11),o._uU(1,"Node 2"),o.qZA())}function Js(t,e){1&t&&(o.TgZ(0,"h3",11),o._uU(1,"Node 2 (Your Node)"),o.qZA())}function Ds(t,e){if(1&t&&(o.TgZ(0,"div",1),o._UZ(1,"mat-divider"),o.TgZ(2,"div",2),o.TgZ(3,"div",3),o.TgZ(4,"div",4),o.YNc(5,Os,2,0,"h3",5),o.YNc(6,Ms,2,0,"h3",5),o.qZA(),o._UZ(7,"mat-divider",6),o.TgZ(8,"div",7),o.TgZ(9,"h4",8),o._uU(10,"Short Channel Id"),o.qZA(),o.TgZ(11,"span",9),o._uU(12),o.qZA(),o.qZA(),o._UZ(13,"mat-divider",6),o.TgZ(14,"div",10),o.TgZ(15,"h4",8),o._uU(16,"Active"),o.qZA(),o.TgZ(17,"span",9),o._uU(18),o.qZA(),o.qZA(),o._UZ(19,"mat-divider",6),o.TgZ(20,"div",10),o.TgZ(21,"h4",8),o._uU(22,"Last Update"),o.qZA(),o.TgZ(23,"span",9),o._uU(24),o.qZA(),o.qZA(),o._UZ(25,"mat-divider",6),o.TgZ(26,"div",10),o.TgZ(27,"h4",8),o._uU(28,"Amount (mSats)"),o.qZA(),o.TgZ(29,"span",9),o._uU(30),o.qZA(),o.qZA(),o._UZ(31,"mat-divider",6),o.TgZ(32,"div",10),o.TgZ(33,"h4",8),o._uU(34,"Base Fee (mSats)"),o.qZA(),o.TgZ(35,"span",9),o._uU(36),o.ALo(37,"number"),o.qZA(),o.qZA(),o._UZ(38,"mat-divider",6),o.TgZ(39,"div",10),o.TgZ(40,"h4",8),o._uU(41,"Channel Flags"),o.qZA(),o.TgZ(42,"span",9),o._uU(43),o.ALo(44,"number"),o.qZA(),o.qZA(),o._UZ(45,"mat-divider",6),o.TgZ(46,"div",10),o.TgZ(47,"h4",8),o._uU(48,"Delay"),o.qZA(),o.TgZ(49,"span",9),o._uU(50),o.ALo(51,"number"),o.qZA(),o.qZA(),o._UZ(52,"mat-divider",6),o.TgZ(53,"div",10),o.TgZ(54,"h4",8),o._uU(55,"Destination"),o.qZA(),o.TgZ(56,"span",9),o._uU(57),o.qZA(),o.qZA(),o._UZ(58,"mat-divider",6),o.TgZ(59,"div",10),o.TgZ(60,"h4",8),o._uU(61,"Fee/Millionth"),o.qZA(),o.TgZ(62,"span",9),o._uU(63),o.ALo(64,"number"),o.qZA(),o.qZA(),o._UZ(65,"mat-divider",6),o.TgZ(66,"div",10),o.TgZ(67,"h4",8),o._uU(68,"Max Htlc (mSat)"),o.qZA(),o.TgZ(69,"span",9),o._uU(70),o.qZA(),o.qZA(),o._UZ(71,"mat-divider",6),o.TgZ(72,"div",10),o.TgZ(73,"h4",8),o._uU(74,"Min Htlc (mSat)"),o.qZA(),o.TgZ(75,"span",9),o._uU(76),o.qZA(),o.qZA(),o._UZ(77,"mat-divider",6),o.TgZ(78,"div",10),o.TgZ(79,"h4",8),o._uU(80,"Message Flags"),o.qZA(),o.TgZ(81,"span",9),o._uU(82),o.ALo(83,"number"),o.qZA(),o.qZA(),o._UZ(84,"mat-divider",6),o.TgZ(85,"div",10),o.TgZ(86,"h4",8),o._uU(87,"Public"),o.qZA(),o.TgZ(88,"span",9),o._uU(89),o.qZA(),o.qZA(),o._UZ(90,"mat-divider",6),o.TgZ(91,"div",10),o.TgZ(92,"h4",8),o._uU(93,"Satoshis"),o.qZA(),o.TgZ(94,"span",9),o._uU(95),o.ALo(96,"number"),o.qZA(),o.qZA(),o._UZ(97,"mat-divider",6),o.TgZ(98,"div",10),o.TgZ(99,"h4",8),o._uU(100,"Source"),o.qZA(),o.TgZ(101,"span",9),o._uU(102),o.qZA(),o.qZA(),o.qZA(),o.TgZ(103,"div",3),o.TgZ(104,"div"),o.YNc(105,Es,2,0,"h3",5),o.YNc(106,Js,2,0,"h3",5),o.qZA(),o._UZ(107,"mat-divider",6),o.TgZ(108,"div",7),o.TgZ(109,"h4",8),o._uU(110,"Short Channel Id"),o.qZA(),o.TgZ(111,"span",9),o._uU(112),o.qZA(),o.qZA(),o._UZ(113,"mat-divider",6),o.TgZ(114,"div",10),o.TgZ(115,"h4",8),o._uU(116,"Active"),o.qZA(),o.TgZ(117,"span",9),o._uU(118),o.qZA(),o.qZA(),o._UZ(119,"mat-divider",6),o.TgZ(120,"div",10),o.TgZ(121,"h4",8),o._uU(122,"Last Update"),o.qZA(),o.TgZ(123,"span",9),o._uU(124),o.ALo(125,"date"),o.qZA(),o.qZA(),o._UZ(126,"mat-divider",6),o.TgZ(127,"div",10),o.TgZ(128,"h4",8),o._uU(129,"Amount (mSats)"),o.qZA(),o.TgZ(130,"span",9),o._uU(131),o.qZA(),o.qZA(),o._UZ(132,"mat-divider",6),o.TgZ(133,"div",10),o.TgZ(134,"h4",8),o._uU(135,"Base Fee (mSats)"),o.qZA(),o.TgZ(136,"span",9),o._uU(137),o.ALo(138,"number"),o.qZA(),o.qZA(),o._UZ(139,"mat-divider",6),o.TgZ(140,"div",10),o.TgZ(141,"h4",8),o._uU(142,"Channel Flags"),o.qZA(),o.TgZ(143,"span",9),o._uU(144),o.ALo(145,"number"),o.qZA(),o.qZA(),o._UZ(146,"mat-divider",6),o.TgZ(147,"div",10),o.TgZ(148,"h4",8),o._uU(149,"Delay"),o.qZA(),o.TgZ(150,"span",9),o._uU(151),o.ALo(152,"number"),o.qZA(),o.qZA(),o._UZ(153,"mat-divider",6),o.TgZ(154,"div",10),o.TgZ(155,"h4",8),o._uU(156,"Destination"),o.qZA(),o.TgZ(157,"span",9),o._uU(158),o.qZA(),o.qZA(),o._UZ(159,"mat-divider",6),o.TgZ(160,"div",10),o.TgZ(161,"h4",8),o._uU(162,"Fee/Millionth"),o.qZA(),o.TgZ(163,"span",9),o._uU(164),o.ALo(165,"number"),o.qZA(),o.qZA(),o._UZ(166,"mat-divider",6),o.TgZ(167,"div",10),o.TgZ(168,"h4",8),o._uU(169,"Max Htlc (mSat)"),o.qZA(),o.TgZ(170,"span",9),o._uU(171),o.qZA(),o.qZA(),o._UZ(172,"mat-divider",6),o.TgZ(173,"div",10),o.TgZ(174,"h4",8),o._uU(175,"Min Htlc (mSat)"),o.qZA(),o.TgZ(176,"span",9),o._uU(177),o.qZA(),o.qZA(),o._UZ(178,"mat-divider",6),o.TgZ(179,"div",10),o.TgZ(180,"h4",8),o._uU(181,"Message Flags"),o.qZA(),o.TgZ(182,"span",9),o._uU(183),o.ALo(184,"number"),o.qZA(),o.qZA(),o._UZ(185,"mat-divider",6),o.TgZ(186,"div",10),o.TgZ(187,"h4",8),o._uU(188,"Public"),o.qZA(),o.TgZ(189,"span",9),o._uU(190),o.qZA(),o.qZA(),o._UZ(191,"mat-divider",6),o.TgZ(192,"div",10),o.TgZ(193,"h4",8),o._uU(194,"Satoshis"),o.qZA(),o.TgZ(195,"span",9),o._uU(196),o.ALo(197,"number"),o.qZA(),o.qZA(),o._UZ(198,"mat-divider",6),o.TgZ(199,"div",10),o.TgZ(200,"h4",8),o._uU(201,"Source"),o.qZA(),o.TgZ(202,"span",9),o._uU(203),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(5),o.Q6J("ngIf",!t.node1_match),o.xp6(1),o.Q6J("ngIf",t.node1_match),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].short_channel_id),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null!=t.lookupResult[0]&&t.lookupResult[0].active?"True":"False"),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].last_update),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].amount_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(37,64,null==t.lookupResult[0]?null:t.lookupResult[0].base_fee_millisatoshi)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(44,66,null==t.lookupResult[0]?null:t.lookupResult[0].channel_flags)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(51,68,null==t.lookupResult[0]?null:t.lookupResult[0].delay)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].destination),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(64,70,null==t.lookupResult[0]?null:t.lookupResult[0].fee_per_millionth)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].htlc_maximum_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].htlc_minimum_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(83,72,null==t.lookupResult[0]?null:t.lookupResult[0].message_flags)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null!=t.lookupResult[0]&&t.lookupResult[0].public?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(96,74,null==t.lookupResult[0]?null:t.lookupResult[0].satoshis)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[0]?null:t.lookupResult[0].source),o.xp6(3),o.Q6J("ngIf",!t.node2_match),o.xp6(1),o.Q6J("ngIf",t.node2_match),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].short_channel_id),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null!=t.lookupResult[1]&&t.lookupResult[1].active?"True":"False"),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.xi3(125,76,1e3*(null==t.lookupResult[1]?null:t.lookupResult[1].last_update),"dd/MMM/YYYY HH:mm")),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].amount_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(138,79,null==t.lookupResult[1]?null:t.lookupResult[1].base_fee_millisatoshi)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(145,81,null==t.lookupResult[1]?null:t.lookupResult[1].channel_flags)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(152,83,null==t.lookupResult[1]?null:t.lookupResult[1].delay)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].destination),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(165,85,null==t.lookupResult[1]?null:t.lookupResult[1].fee_per_millionth)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].htlc_maximum_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].htlc_minimum_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(184,87,null==t.lookupResult[1]?null:t.lookupResult[1].message_flags)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null!=t.lookupResult[1]&&t.lookupResult[1].public?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(o.lcZ(197,89,null==t.lookupResult[1]?null:t.lookupResult[1].satoshis)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==t.lookupResult[1]?null:t.lookupResult[1].source)}}let Ys=(()=>{class t{constructor(t){this.store=t,this.lookupResult=[],this.node1_match=!1,this.node2_match=!1,this.unSubs=[new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.lookupResult.length>0&&this.lookupResult[0].source===t.information.id&&(this.node1_match=!0),this.lookupResult.length>1&&this.lookupResult[1].source===t.information.id&&(this.node2_match=!0)})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-channel-lookup"]],inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start start",1,"mt-1","bordered-box","padding-gap-large"],["fxLayout","column"],["class","page-title font-bold-500",4,"ngIf"],[3,"inset"],["fxLayout","column","fxFlex","20",1,"my-1"],[1,"font-bold-500"],[1,"foreground-secondary-text"],["fxLayout","column","fxFlex","10",1,"my-1"],[1,"page-title","font-bold-500"]],template:function(t,e){1&t&&o.YNc(0,Ds,204,91,"div",0),2&t&&o.Q6J("ngIf",e.lookupResult)},directives:[a.O5,l.xw,J.d,l.Wh,l.yH],pipes:[a.JJ,a.uU],styles:[".mat-list-base[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%], .mat-list-base[_ngcontent-%COMP%] .mat-list-option[_ngcontent-%COMP%]{height:38px!important}"]}),t})();const Qs=["form"];function Ps(t,e){if(1&t&&(o.TgZ(0,"mat-radio-button",21),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("value",t.id)("checked",n.selectedFieldId===t.id),o.xp6(1),o.hij(" ",t.name," ")}}function Bs(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 Hs(t,e){if(1&t&&(o.TgZ(0,"div"),o._UZ(1,"rtl-cl-node-lookup",30),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Q6J("lookupResult",t.nodeLookupValue)}}function zs(t,e){if(1&t&&(o.TgZ(0,"span",28),o.YNc(1,Hs,2,1,"div",29),o.qZA()),2&t){const t=o.oxw(2),e=o.MAs(24);o.xp6(1),o.Q6J("ngIf",""!==t.nodeLookupValue.nodeid)("ngIfElse",e)}}function Gs(t,e){if(1&t&&(o.TgZ(0,"div"),o._UZ(1,"rtl-cl-channel-lookup",30),o.qZA()),2&t){const t=o.oxw(3);o.xp6(1),o.Q6J("lookupResult",t.channelLookupValue)}}function Vs(t,e){if(1&t&&(o.TgZ(0,"span",28),o.YNc(1,Gs,2,1,"div",29),o.qZA()),2&t){const t=o.oxw(2),e=o.MAs(24);o.xp6(1),o.Q6J("ngIf",t.channelLookupValue.length>0)("ngIfElse",e)}}function Xs(t,e){1&t&&(o.TgZ(0,"span",28),o.TgZ(1,"h3"),o._uU(2,"Error! Unable to find details!"),o.qZA(),o.qZA())}function Ws(t,e){if(1&t&&(o.TgZ(0,"div",22),o.TgZ(1,"div",23),o.TgZ(2,"span",24),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"div",25),o.YNc(5,zs,2,2,"span",26),o.YNc(6,Vs,2,2,"span",26),o.YNc(7,Xs,3,0,"span",27),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),o.xp6(1),o.Q6J("ngSwitchCase",1)}}function $s(t,e){1&t&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find details!"),o.qZA())}const Ks=function(t){return{"mt-2":t}};let js=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.actions=a,this.lookupKey="",this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Pubkey"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=g.wn1,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new d.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,p.R)(this.unSubs[0]),(0,h.h)(t=>t.type===x.CR||t.type===x.qe)).subscribe(t=>{if(t.type===x.CR){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===x.qe&&t.payload.status===f.Bn.ERROR&&"Lookup"===t.payload.action&&(this.flgLoading[0]="error")})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.selectedFieldId){case 0:this.store.dispatch(new x.x$(this.lookupKey.trim()));break;case 1:this.store.dispatch(new x.IG({uiMessage:f.m6.SEARCHING_CHANNEL,shortChannelID:this.lookupKey.trim(),showError:!1}))}}onSelectChange(t){this.resetData(),this.selectedFieldId=t.value}resetData(){this.flgSetLookupValue=!1,this.selectedFieldId=0,this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={nodeid:""},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(Z.mQ),o.Y36(T.v),o.Y36(y.yh),o.Y36(A.eX))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-lookups"]],viewQuery:function(t,e){if(1&t&&o.Gf(Qs,7),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first)}},decls:25,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","35","fxFlex.gt-md","25","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField",3,"ngModel","ngModelChange","change"],["class","mr-4",3,"value","checked",4,"ngFor","ngForOf"],["fxFlex","65","fxFlex.gt-md","75","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"placeholder","ngModel","change","ngModelChange"],["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",""],[1,"mr-4",3,"value","checked"],["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.NdJ("ngModelChange",function(t){return e.selectedFieldId=t})("change",function(t){return e.onSelectChange(t)}),o.YNc(12,Ps,2,3,"mat-radio-button",11),o.qZA(),o.qZA(),o.TgZ(13,"mat-form-field",12),o.TgZ(14,"input",13,14),o.NdJ("change",function(){return e.clearLookupValue()})("ngModelChange",function(t){return e.lookupKey=t}),o.qZA(),o.YNc(16,Bs,2,1,"mat-error",15),o.qZA(),o.TgZ(17,"div",16),o.TgZ(18,"button",17),o.NdJ("click",function(){return e.resetData()}),o._uU(19,"Clear"),o.qZA(),o.TgZ(20,"button",18),o.NdJ("click",function(){return e.onLookup()}),o._uU(21,"Lookup"),o.qZA(),o.qZA(),o.qZA(),o.YNc(22,Ws,8,4,"div",19),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(23,$s,2,0,"ng-template",null,20,o.W1O)),2&t&&(o.xp6(2),o.Q6J("icon",e.faSearch),o.xp6(9),o.Q6J("ngModel",e.selectedFieldId),o.xp6(1),o.Q6J("ngForOf",e.lookupFields),o.xp6(1),o.Q6J("ngClass",o.VKq(8,Ks,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM)),o.xp6(1),o.Q6J("placeholder",(null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder)||"Lookup Key")("ngModel",e.lookupKey),o.xp6(2),o.Q6J("ngIf",!e.lookupKey),o.xp6(6),o.Q6J("ngIf",e.flgSetLookupValue))},directives:[l.xw,l.Wh,C.BN,l.yH,v.a8,v.dn,ft._Y,ft.JL,ft.F,de.VQ,ft.JJ,ft.On,a.sg,M.KE,a.mk,b.oO,xt.Nt,ft.Fj,ft.Q7,a.O5,q.lW,de.U0,M.TO,a.RF,a.n9,a.ED,Is,Ys],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 ti=function(t){return t.KB="KB",t.KW="KW",t}({});function ei(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div",4),o.TgZ(3,"h4",5),o._uU(4,"Opening"),o.qZA(),o.TgZ(5,"div",6),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"h4",5),o._uU(10,"Mutual Close"),o.qZA(),o.TgZ(11,"div",6),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.TgZ(14,"div",8),o.TgZ(15,"h4",5),o._uU(16,"Unilateral Close"),o.qZA(),o.TgZ(17,"div",6),o._uU(18),o.ALo(19,"number"),o.qZA(),o.qZA(),o.TgZ(20,"div",9),o.TgZ(21,"h4",5),o._uU(22,"Delayed To Us"),o.qZA(),o.TgZ(23,"div",6),o._uU(24),o.ALo(25,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(26,"div",3),o.TgZ(27,"div",10),o.TgZ(28,"h4",5),o._uU(29,"Minimum Acceptable"),o.qZA(),o.TgZ(30,"div",6),o._uU(31),o.ALo(32,"number"),o.qZA(),o.qZA(),o.TgZ(33,"div",11),o.TgZ(34,"h4",5),o._uU(35,"Maximum Acceptable"),o.qZA(),o.TgZ(36,"div",6),o._uU(37),o.ALo(38,"number"),o.qZA(),o.qZA(),o.TgZ(39,"div",12),o.TgZ(40,"h4",5),o._uU(41,"HTLC Resolution"),o.qZA(),o.TgZ(42,"div",6),o._uU(43),o.ALo(44,"number"),o.qZA(),o.qZA(),o.TgZ(45,"div",13),o.TgZ(46,"h4",5),o._uU(47,"Penalty"),o.qZA(),o.TgZ(48,"div",6),o._uU(49),o.ALo(50,"number"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.Oqu(o.lcZ(7,8,null==t.perkbw?null:t.perkbw.opening)),o.xp6(6),o.Oqu(o.lcZ(13,10,null==t.perkbw?null:t.perkbw.mutual_close)),o.xp6(6),o.Oqu(o.lcZ(19,12,null==t.perkbw?null:t.perkbw.unilateral_close)),o.xp6(6),o.Oqu(o.lcZ(25,14,null==t.perkbw?null:t.perkbw.delayed_to_us)),o.xp6(7),o.Oqu(o.lcZ(32,16,null==t.perkbw?null:t.perkbw.min_acceptable)),o.xp6(6),o.Oqu(o.lcZ(38,18,null==t.perkbw?null:t.perkbw.max_acceptable)),o.xp6(6),o.Oqu(o.lcZ(44,20,null==t.perkbw?null:t.perkbw.htlc_resolution)),o.xp6(6),o.Oqu(o.lcZ(50,22,null==t.perkbw?null:t.perkbw.penalty))}}function ni(t,e){if(1&t&&(o.TgZ(0,"div",14),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 ai=(()=>{class t{constructor(){this.perkbw={}}ngAfterContentChecked(){this.feeRateStyle===ti.KB?this.perkbw=this.feeRates.perkb:this.feeRateStyle===ti.KW&&(this.perkbw=this.feeRates.perkw)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-fee-rates"]],inputs:{feeRateStyle:"feeRateStyle",feeRates:"feeRates",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","stretch","class","h-100",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","stretch",1,"h-100"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["matTooltip","Default feerate for fundchannel and withdraw","matTooltipPosition","below"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["matTooltip","Feerate to aim for in cooperative shutdown. Note that since mutual close is a negotiation, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer","matTooltipPosition","below"],["matTooltip","Feerate for commitment_transaction in a live channel which we originally funded","matTooltipPosition","below"],["matTooltip","Feerate for returning unilateral close funds to our wallet","matTooltipPosition","below"],["matTooltip","The smallest feerate that you can use, usually the minimum relayed feerate of the backend","matTooltipPosition","below"],["matTooltip","The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)","matTooltipPosition","below"],["matTooltip","Feerate for returning unilateral close HTLC outputs to our wallet","matTooltipPosition","below"],["matTooltip","Feerate to start at when penalizing a cheat attempt","matTooltipPosition","below"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,e){if(1&t&&(o.YNc(0,ei,51,24,"div",0),o.YNc(1,ni,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,E.gM],pipes:[a.JJ],styles:[".fee-rate-list[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%]{height:44px}"]}),t})();function si(t,e){if(1&t&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div",4),o.TgZ(3,"h4",5),o._uU(4,"Opening Channel"),o.qZA(),o.TgZ(5,"div",6),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"h4",5),o._uU(10,"Mutual Close"),o.qZA(),o.TgZ(11,"div",6),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.TgZ(14,"div",8),o.TgZ(15,"h4",5),o._uU(16,"Unilateral Close"),o.qZA(),o.TgZ(17,"div",6),o._uU(18),o.ALo(19,"number"),o.qZA(),o.qZA(),o.TgZ(20,"div",9),o._UZ(21,"h4",5),o._UZ(22,"div",6),o.qZA(),o.qZA(),o.TgZ(23,"div",3),o.TgZ(24,"div",10),o.TgZ(25,"h4",5),o._uU(26,"HTLC Timeout"),o.qZA(),o.TgZ(27,"div",6),o._uU(28),o.ALo(29,"number"),o.qZA(),o.qZA(),o.TgZ(30,"div",11),o.TgZ(31,"h4",5),o._uU(32,"HTLC Success"),o.qZA(),o.TgZ(33,"div",6),o._uU(34),o.ALo(35,"number"),o.qZA(),o.qZA(),o.TgZ(36,"div",9),o._UZ(37,"h4",5),o._UZ(38,"div",6),o.qZA(),o.TgZ(39,"div",9),o._UZ(40,"h4",5),o._UZ(41,"div",6),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.Oqu(o.lcZ(7,5,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.opening_channel_satoshis)),o.xp6(6),o.Oqu(o.lcZ(13,7,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.mutual_close_satoshis)),o.xp6(6),o.Oqu(o.lcZ(19,9,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.unilateral_close_satoshis)),o.xp6(10),o.Oqu(o.lcZ(29,11,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.htlc_timeout_satoshis)),o.xp6(6),o.Oqu(o.lcZ(35,13,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.htlc_success_satoshis))}}function ii(t,e){if(1&t&&(o.TgZ(0,"div",12),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 oi=(()=>{class t{constructor(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-onchain-fee-estimates"]],inputs:{feeRates:"feeRates",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","stretch","class","h-100",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","stretch",1,"h-100"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["matTooltip","Estimated cost of typical channel open","matTooltipPosition","below"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["matTooltip","Estimated cost of typical channel close","matTooltipPosition","below"],["matTooltip","Estimated cost of typical unilateral close (without HTLCs)","matTooltipPosition","below"],["fxFlex","12"],["matTooltip","Estimated cost of typical HTLC timeout transaction","matTooltipPosition","below"],["matTooltip","Estimated cost of typical HTLC fulfillment transaction","matTooltipPosition","below"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,e){if(1&t&&(o.YNc(0,si,42,15,"div",0),o.YNc(1,ii,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,E.gM],pipes:[a.JJ],styles:[".fee-rate-list[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%]{height:44px}"]}),t})();function li(t,e){1&t&&o._UZ(0,"mat-progress-bar",19)}function ri(t,e){if(1&t&&o._UZ(0,"rtl-cl-node-info",20),2&t){const t=o.oxw(3);o.Q6J("information",t.information)("showColorFieldSeparately",!1)}}function ci(t,e){if(1&t&&o._UZ(0,"rtl-cl-channel-status-info",21),2&t){const t=o.oxw(3);o.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[0]+" "+t.errorMessages[2])}}function ui(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-info",22),2&t){const t=o.oxw(3);o.Q6J("fees",t.fees)("errorMessage",t.errorMessages[1]+" "+t.errorMessages[3]+" "+t.errorMessages[4])}}function di(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-rates",23),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKB)("feeRateStyle","KB")("errorMessage",t.errorMessages[5])}}function pi(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-rates",23),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKW)("feeRateStyle","KW")("errorMessage",t.errorMessages[6])}}function hi(t,e){if(1&t&&o._UZ(0,"rtl-cl-onchain-fee-estimates",24),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKW)("errorMessage",t.errorMessages[5])}}const mi=function(t){return{"dashboard-card-content":!0,"error-border":t}};function gi(t,e){if(1&t&&(o.TgZ(0,"mat-grid-tile",4),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",7),o._UZ(4,"fa-icon",8),o.TgZ(5,"span"),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"mat-card",10),o.TgZ(9,"mat-card-content",11),o.YNc(10,li,1,0,"mat-progress-bar",12),o.TgZ(11,"div",13),o.YNc(12,ri,1,2,"rtl-cl-node-info",14),o.YNc(13,ci,1,2,"rtl-cl-channel-status-info",15),o.YNc(14,ui,1,2,"rtl-cl-fee-info",16),o.YNc(15,di,1,3,"rtl-cl-fee-rates",17),o.YNc(16,pi,1,3,"rtl-cl-fee-rates",17),o.YNc(17,hi,1,2,"rtl-cl-onchain-fee-estimates",18),o.qZA(),o.qZA(),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(4),o.Q6J("icon",t.icon),o.xp6(2),o.Oqu(t.title),o.xp6(3),o.Q6J("ngClass",o.VKq(13,mi,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.ERROR)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.ERROR)||"feeRatesKB"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkb.status)===n.apiCallStatusEnum.ERROR||"feeRatesKW"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.ERROR||"onChainFeeEstimates"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.INITIATED)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.INITIATED)||"feeRatesKB"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkb.status)===n.apiCallStatusEnum.INITIATED||"feeRatesKW"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.INITIATED||"onChainFeeEstimates"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.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","status"),o.xp6(1),o.Q6J("ngSwitchCase","fee"),o.xp6(1),o.Q6J("ngSwitchCase","feeRatesKB"),o.xp6(1),o.Q6J("ngSwitchCase","feeRatesKW"),o.xp6(1),o.Q6J("ngSwitchCase","onChainFeeEstimates")}}function fi(t,e){if(1&t&&(o.TgZ(0,"mat-grid-list",2),o.YNc(1,gi,18,15,"mat-grid-tile",3),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngForOf",t.nodeCardsOperator)}}function xi(t,e){1&t&&o._UZ(0,"mat-progress-bar",19)}function Zi(t,e){if(1&t&&o._UZ(0,"rtl-cl-node-info",20),2&t){const t=o.oxw(3);o.Q6J("information",t.information)("showColorFieldSeparately",!1)}}function yi(t,e){if(1&t&&o._UZ(0,"rtl-cl-channel-status-info",21),2&t){const t=o.oxw(3);o.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[0]+" "+t.errorMessages[2])}}function Ai(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-info",22),2&t){const t=o.oxw(3);o.Q6J("fees",t.fees)("errorMessage",t.errorMessages[1]+" "+t.errorMessages[3]+" "+t.errorMessages[4])}}function Ti(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-rates",23),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKB)("feeRateStyle","KB")("errorMessage",t.errorMessages[5])}}function Ci(t,e){if(1&t&&o._UZ(0,"rtl-cl-fee-rates",23),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKW)("feeRateStyle","KW")("errorMessage",t.errorMessages[5])}}function wi(t,e){if(1&t&&o._UZ(0,"rtl-cl-onchain-fee-estimates",24),2&t){const t=o.oxw(3);o.Q6J("feeRates",t.feeRatesPerKW)("errorMessage",t.errorMessages[5])}}function vi(t,e){if(1&t&&(o.TgZ(0,"mat-grid-tile",4),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",25),o._UZ(4,"fa-icon",8),o.TgZ(5,"span"),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"mat-card",10),o.TgZ(9,"mat-card-content",11),o.YNc(10,xi,1,0,"mat-progress-bar",12),o.TgZ(11,"div",13),o.YNc(12,Zi,1,2,"rtl-cl-node-info",14),o.YNc(13,yi,1,2,"rtl-cl-channel-status-info",15),o.YNc(14,Ai,1,2,"rtl-cl-fee-info",16),o.YNc(15,Ti,1,3,"rtl-cl-fee-rates",17),o.YNc(16,Ci,1,3,"rtl-cl-fee-rates",17),o.YNc(17,wi,1,2,"rtl-cl-onchain-fee-estimates",18),o.qZA(),o.qZA(),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(4),o.Q6J("icon",t.icon),o.xp6(2),o.Oqu(t.title),o.xp6(3),o.Q6J("ngClass",o.VKq(13,mi,"node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.ERROR)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.ERROR)||"feeRatesKB"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkb.status)===n.apiCallStatusEnum.ERROR||"feeRatesKW"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.ERROR||"onChainFeeEstimates"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"status"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchLocalRemoteBalance.status)===n.apiCallStatusEnum.INITIATED)||"fee"===t.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.GetForwardingHistory.status)===n.apiCallStatusEnum.INITIATED)||"feeRatesKB"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkb.status)===n.apiCallStatusEnum.INITIATED||"feeRatesKW"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.status)===n.apiCallStatusEnum.INITIATED||"onChainFeeEstimates"===t.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFeeRatesperkw.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","status"),o.xp6(1),o.Q6J("ngSwitchCase","fee"),o.xp6(1),o.Q6J("ngSwitchCase","feeRatesKB"),o.xp6(1),o.Q6J("ngSwitchCase","feeRatesKW"),o.xp6(1),o.Q6J("ngSwitchCase","onChainFeeEstimates")}}function Si(t,e){if(1&t&&(o.TgZ(0,"mat-grid-list",2),o.YNc(1,vi,18,15,"mat-grid-tile",3),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngForOf",t.nodeCardsMerchant)}}let bi=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.faBolt=g.BDt,this.faServer=g.xf3,this.faNetworkWired=g.kXW,this.faLink=g.nNP,this.selNode={},this.information={},this.channelsStatus={},this.feeRatesPerKB={},this.feeRatesPerKW={},this.nodeCardsOperator=[],this.nodeCardsMerchant=[],this.screenSize="",this.screenSizeEnum=f.cu,this.userPersonaEnum=f.ol,this.errorMessages=["","","","","","",""],this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.nodeCardsMerchant=[{id:"node",icon:this.faServer,title:"Node Information",cols:6,rows:3},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:6,rows:3},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:6,rows:1},{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:4,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:4,rows:4},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:4,rows:4}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:4,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:4,rows:4},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:4,rows:4}]):(this.nodeCardsMerchant=[{id:"node",icon:this.faServer,title:"Node Information",cols:2,rows:3},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:2,rows:3},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:2,rows:3},{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:2,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:2,rows:4},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:2,rows:4}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:2,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:2,rows:4},{id:"onChainFeeEstimates",icon:this.faLink,title:"Onchain Fee Estimates (Sats)",cols:2,rows:4}])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessages=["","","","","","",""],this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchInfo.status===f.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===f.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apisCallStatus.FetchFees.message?JSON.stringify(this.apisCallStatus.FetchFees.message):this.apisCallStatus.FetchFees.message),t.apisCallStatus.FetchLocalRemoteBalance.status===f.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apisCallStatus.FetchLocalRemoteBalance.message?JSON.stringify(this.apisCallStatus.FetchLocalRemoteBalance.message):this.apisCallStatus.FetchLocalRemoteBalance.message),t.apisCallStatus.FetchChannels.status===f.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apisCallStatus.FetchChannels.message?JSON.stringify(this.apisCallStatus.FetchChannels.message):this.apisCallStatus.FetchChannels.message),t.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),t.apisCallStatus.FetchFeeRatesperkb.status===f.Bn.ERROR&&(this.errorMessages[5]="object"==typeof this.apisCallStatus.FetchFeeRatesperkb.message?JSON.stringify(this.apisCallStatus.FetchFeeRatesperkb.message):this.apisCallStatus.FetchFeeRatesperkb.message),t.apisCallStatus.FetchFeeRatesperkw.status===f.Bn.ERROR&&(this.errorMessages[6]="object"==typeof this.apisCallStatus.FetchFeeRatesperkw.message?JSON.stringify(this.apisCallStatus.FetchFeeRatesperkw.message):this.apisCallStatus.FetchFeeRatesperkw.message),this.selNode=t.nodeSettings,this.information=t.information,this.fees=t.fees,this.fees.totalTxCount=0,t.forwardingHistory&&t.forwardingHistory.length&&(this.fees.totalTxCount=t.forwardingHistory.length),this.channelsStatus={active:{channels:t.information.num_active_channels,capacity:0},inactive:{channels:t.information.num_inactive_channels,capacity:0},pending:{channels:t.information.num_pending_channels,capacity:0}},this.feeRatesPerKB=t.feeRatesPerKB,this.feeRatesPerKW=t.feeRatesPerKW,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(Z.mQ),o.Y36(T.v),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-network-info"]],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch",1,"mb-4"],["cols","6","rowHeight","100px",4,"ngIf"],["cols","6","rowHeight","100px"],["class","node-grid-tile",3,"colspan","rowspan",4,"ngFor","ngForOf"],[1,"node-grid-tile",3,"colspan","rowspan"],["fxLayout","column","fxLayoutAlign","stretch start","fxFlex","100",1,"h-100"],["fxLayout","row","fxLayoutAlign","start start",1,"w-100"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","pl-2"],[1,"mr-1",3,"icon"],["fxLayout","column","fxLayoutAlign","stretch center","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","center stretch",1,"w-100","h-93"],["fxLayout","row","fxFlex","95","fxLayoutAlign","start stretch",1,"dashboard-card","w-96","h-93"],["fxLayout","column","fxFlex","100",3,"ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["class","h-100",3,"feeRates","feeRateStyle","errorMessage",4,"ngSwitchCase"],["class","h-100",3,"feeRates","errorMessage",4,"ngSwitchCase"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],[1,"h-100",3,"feeRates","feeRateStyle","errorMessage"],[1,"h-100",3,"feeRates","errorMessage"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","pl-15px"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,fi,2,1,"mat-grid-list",1),o.YNc(2,Si,2,1,"mat-grid-list",1),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngIf",e.selNode.userPersona===e.userPersonaEnum.OPERATOR),o.xp6(1),o.Q6J("ngIf",e.selNode.userPersona===e.userPersonaEnum.MERCHANT))},directives:[l.xw,l.Wh,a.O5,w.Il,a.sg,w.DX,l.yH,C.BN,v.a8,v.dn,a.mk,b.oO,a.RF,a.n9,r.pW,k,K,X,ai,oi],styles:[""]}),t})();function qi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",8),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 _i=(()=>{class t{constructor(t){this.router=t,this.faUserCheck=g.hkK,this.links=[{link:"sign",name:"Sign"},{link:"verify",name:"Verify"}],this.activeLink=this.links[0].link,this.unSubs=[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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.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(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-sign-verify-message"]],decls:11,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"],["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,"Sign/Verify Message"),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,qi,2,3,"div",6),o.qZA(),o.TgZ(9,"div",7),o._UZ(10,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Q6J("icon",e.faUserCheck),o.xp6(7),o.Q6J("ngForOf",e.links))},directives:[l.xw,l.Wh,C.BN,v.a8,v.dn,dt.BU,a.sg,l.yH,s.lC,dt.Nj,s.rH],styles:[""]}),t})();var Fi=n(7969);function Li(t,e){if(1&t&&(o.TgZ(0,"mat-option",7),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.hij(" ",t.addressTp," ")}}let Ui=(()=>{class t{constructor(t,e){this.store=t,this.clEffects=e,this.addressTypes=f._t,this.selectedAddressType=f._t[0],this.newAddress=""}onGenerateAddress(){this.store.dispatch(new x.ER(this.selectedAddressType)),this.clEffects.setNewAddressCL.pipe((0,ce.q)(1)).subscribe(t=>{this.newAddress=t,this.store.dispatch(new Ft.wu({width:"58%",data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:Fi.n}}))})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.yh),o.Y36(ue.s))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-on-chain-receive"]],decls:8,vars:2,consts:[["fxLayout","column",1,"padding-gap-x"],["fxLayout","row","fxLayoutAlign","space-between end","fxLayoutAlign.gt-sm","start end"],["fxFlex","48","fxFlex.gt-md","25","fxLayoutAlign","start end",1,"mr-2"],["placeholder","Address Type","name","address_type","tabindex","1",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"mt-2"],["mat-flat-button","","color","primary","tabindex","2",1,"top-minus-15px",3,"click"],[3,"value"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-form-field",2),o.TgZ(3,"mat-select",3),o.NdJ("ngModelChange",function(t){return e.selectedAddressType=t}),o.YNc(4,Li,2,2,"mat-option",4),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"button",6),o.NdJ("click",function(){return e.onGenerateAddress()}),o._uU(7,"Generate Address"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.selectedAddressType),o.xp6(1),o.Q6J("ngForOf",e.addressTypes))},directives:[l.xw,l.Wh,M.KE,l.yH,At.gD,ft.JJ,ft.On,a.sg,q.lW,Ct.ey],styles:[""]}),t})(),Ri=(()=>{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,p.R)(this.unSubs[0])).subscribe(t=>{this.sweepAll=t.sweepAll})}openSendFundsModal(){this.store.dispatch(new Ft.wu({data:{sweepAll:this.sweepAll,component:La}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.yh),o.Y36(s.gz))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["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,q.lW],styles:[""]}),t})();var ki=n(1258),Ni=n(1681),Ii=n(3474),Oi=n(84);const Mi=["form"];function Ei(t,e){if(1&t&&(o.TgZ(0,"mat-option",42),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.id?t.id:"")}}function Ji(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer alias is required."),o.qZA())}function Di(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",39),o.NdJ("change",function(){return o.CHM(t),o.oxw().onSelectedPeerChanged()}),o.qZA(),o.TgZ(2,"mat-autocomplete",40,41),o.NdJ("optionSelected",function(){return o.CHM(t),o.oxw().onSelectedPeerChanged()}),o.YNc(4,Ei,2,2,"mat-option",26),o.ALo(5,"async"),o.qZA(),o.YNc(6,Ji,2,0,"mat-error",17),o.YNc(7,Di,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 Qi(t,e){1&t&&o.GkF(0)}function Pi(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Bi(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 Hi(t,e){if(1&t&&(o.TgZ(0,"mat-option",42),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.feeRateId),o.xp6(1),o.hij(" ",t.feeRateType," ")}}function zi(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Fee Rate is required."),o.qZA())}function Gi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-form-field",43),o.TgZ(1,"input",44,45),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().customFeeRate=e}),o.qZA(),o.YNc(3,zi,2,0,"mat-error",17),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngModel",t.customFeeRate)("step",.1)("min",0)("required","customperkb"===t.selFeeRate&&!t.flgMinConf),o.xp6(2),o.Q6J("ngIf","customperkb"===t.selFeeRate&&!t.flgMinConf&&!t.customFeeRate)}}function Vi(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Min Confirmation Blocks is required."),o.qZA())}function Xi(t,e){if(1&t&&(o.TgZ(0,"mat-option",42),o._uU(1),o.ALo(2,"number"),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.hij("",o.lcZ(2,2,t.value)," Sats")}}function Wi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",22),o.TgZ(1,"mat-form-field",46),o.TgZ(2,"mat-select",47),o.NdJ("selectionChange",function(e){return o.CHM(t),o.oxw().onUTXOSelectionChange(e)})("valueChange",function(e){return o.CHM(t),o.oxw().selUTXOs=e}),o.TgZ(3,"mat-select-trigger"),o._uU(4),o.ALo(5,"number"),o.qZA(),o.YNc(6,Xi,3,4,"mat-option",26),o.qZA(),o.qZA(),o.TgZ(7,"mat-slide-toggle",48),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().flgUseAllBalance=e})("change",function(){return o.CHM(t),o.oxw().onUTXOAllBalanceChange()}),o._uU(8," Use selected UTXOs balance "),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(2),o.Q6J("value",t.selUTXOs),o.xp6(2),o.AsE("",o.lcZ(5,6,t.totalSelectedUTXOAmount)," Sats (",t.selUTXOs.length>1?t.selUTXOs.length+" UTXOs":"1 UTXO",")"),o.xp6(2),o.Q6J("ngForOf",t.utxos),o.xp6(1),o.Q6J("ngModel",t.flgUseAllBalance)("disabled",t.selUTXOs.length<1)}}function $i(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 Ki(t,e){if(1&t&&(o.TgZ(0,"div",49),o._UZ(1,"fa-icon",50),o.YNc(2,$i,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 ji(t,e){if(1&t&&(o.TgZ(0,"mat-expansion-panel",52),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",53),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",54),o._uU(11,"Pubkey"),o.qZA(),o.TgZ(12,"span",55),o._uU(13),o.qZA(),o.qZA(),o.qZA(),o._UZ(14,"mat-divider",56),o.TgZ(15,"div",0),o.TgZ(16,"div",57),o.TgZ(17,"h4",54),o._uU(18,"Address"),o.qZA(),o.TgZ(19,"span",58),o._uU(20),o.qZA(),o.qZA(),o.TgZ(21,"div",57),o.TgZ(22,"h4",54),o._uU(23,"Connected"),o.qZA(),o.TgZ(24,"span",58),o._uU(25),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.id)),o.xp6(7),o.Oqu(t.peer.id),o.xp6(7),o.Oqu(null==t.peer?null:t.peer.netaddr),o.xp6(5),o.Oqu(t.peer.connected?"True":"False")}}function to(t,e){if(1&t&&o.YNc(0,ji,26,4,"mat-expansion-panel",51),2&t){const t=o.oxw();o.Q6J("ngIf",t.peer)}}const eo=function(t,e){return{"mr-6":t,"mr-2":e}};let no=(()=>{class t{constructor(t,e,n,a,s,i){this.dialogRef=t,this.data=e,this.store=n,this.actions=a,this.decimalPipe=s,this.commonService=i,this.selectedPeer=new ft.NI,this.faExclamationTriangle=g.eHv,this.isCompatibleVersion=!1,this.utxos=[],this.selUTXOs=[],this.flgUseAllBalance=!1,this.totalSelectedUTXOAmount=0,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.fundingAmount=null,this.selectedPubkey="",this.isPrivate=!1,this.feeRateTypes=f.vn,this.selFeeRate="",this.customFeeRate=null,this.flgMinConf=!1,this.minConfValue=null,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.isCompatibleVersion=this.data.message.isCompatibleVersion,this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.utxos=this.data.message.utxos,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,p.R)(this.unSubs[0]),(0,h.h)(t=>t.type===x.qe||t.type===x.GL)).subscribe(t=>{t.type===x.qe&&t.payload.status===f.Bn.ERROR&&"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message),t.type===x.GL&&this.dialogRef.close()});let t="",e="";this.sortedPeers=this.peers.sort((n,a)=>(t=n.alias?n.alias.toLowerCase():n.id?n.id.toLowerCase():"",e=a.alias?a.alias.toLowerCase():n.id.toLowerCase(),t<e?-1:t>e?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,p.R)(this.unSubs[1]),(0,ki.O)(""),(0,Ni.U)(t=>"string"==typeof t?t:t.alias?t.alias:t.id),(0,Ni.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.id?t.id:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.id?this.selectedPeer.value.id: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].id&&(this.selectedPubkey=t[0].id)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.flgMinConf=!1,this.selFeeRate="",this.minConfValue=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!1,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(t){t&&(this.flgMinConf||this.selFeeRate||this.selUTXOs.length&&0!==this.selUTXOs.length)?(this.advancedTitle="Advanced Options",this.flgMinConf&&(this.advancedTitle=this.advancedTitle+" | Min Confirmation Blocks: "+this.minConfValue),this.selFeeRate&&(this.advancedTitle=this.advancedTitle+" | Fee Rate: "+(this.customFeeRate?this.customFeeRate+" (Sats/vB)":this.feeRateTypes.find(t=>t.feeRateId===this.selFeeRate).feeRateType)),this.selUTXOs.length&&this.selUTXOs.length>0&&(this.advancedTitle=this.advancedTitle+" | Total Selected: "+this.selUTXOs.length+" | Selected UTXOs: "+this.decimalPipe.transform(this.totalSelectedUTXOAmount)+" Sats")):this.advancedTitle="Advanced Options"}onUTXOSelectionChange(t){const e={value:0};this.selUTXOs.length&&this.selUTXOs.length>0?(this.totalSelectedUTXOAmount=this.selUTXOs.reduce((t,n)=>(e.value=t.value+n.value,e)).value,this.flgUseAllBalance&&this.onUTXOAllBalanceChange()):(this.totalSelectedUTXOAmount=0,this.fundingAmount=null,this.flgUseAllBalance=!1)}onUTXOAllBalanceChange(){this.fundingAmount=this.flgUseAllBalance?this.totalSelectedUTXOAmount:null}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0||this.flgMinConf&&!this.minConfValue||"customperkb"===this.selFeeRate&&!this.flgMinConf&&!this.customFeeRate)return!0;const t={peerId:this.peer&&this.peer.id?this.peer.id:this.selectedPubkey,satoshis:this.flgUseAllBalance?"all":this.fundingAmount.toString(),announce:!this.isPrivate,minconf:this.flgMinConf?this.minConfValue:null};t.feeRate="customperkb"===this.selFeeRate&&!this.flgMinConf&&this.customFeeRate?1e3*this.customFeeRate+"perkb":this.selFeeRate,this.selUTXOs.length&&this.selUTXOs.length>0&&(t.utxos=[],this.selUTXOs.forEach(e=>t.utxos.push(e.txid+":"+e.output))),this.store.dispatch(new x.nb(t))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(gt.so),o.Y36(gt.WI),o.Y36(y.yh),o.Y36(A.eX),o.Y36(a.JJ),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-open-channel"]],viewQuery:function(t,e){if(1&t&&o.Gf(Mi,7),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first)}},decls:56,vars:34,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","disabled","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"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayoutAlign.gt-sm","space-between center","fxLayout.gt-sm","row wrap"],["fxFlex","48","fxLayoutAlign","space-between end"],["fxLayoutAlign","start center",3,"fxFlex"],["tabindex","4","placeholder","Fee Rate",3,"value","disabled","valueChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48","fxLayoutAlign","end center",4,"ngIf"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","5","color","primary","name","flgMinConf","fxLayoutAlign","stretch start",3,"ngModel","ngClass","ngModelChange","change"],["fxFlex","98"],["matInput","","placeholder","Min Confirmation Blocks","type","number","name","blocks","tabindex","8",3,"ngModel","step","min","required","disabled","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayoutAlign.gt-sm","space-between center","fxLayout.gt-sm","row wrap",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","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"],["fxFlex","48","fxLayoutAlign","end center"],["matInput","","placeholder","Fee Rate (Sats/vB)","type","number","name","custFeeRate","tabindex","4",3,"ngModel","step","min","required","ngModelChange"],["custFeeRate","ngModel"],["fxFlex","48","fxLayoutAlign","start end"],["tabindex","6","placeholder","Coin Selection","multiple","",3,"value","selectionChange","valueChange"],["fxFlex","48","tabindex","7","color","primary","name","flgUseAllBalance","matTooltip","Use selected UTXOs balance as the amount to be sent. Final amount sent will be less the mining fee.","matTooltipPosition","above",3,"ngModel","disabled","ngModelChange","change"],["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,Qi,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,Pi,2,0,"mat-error",17),o.YNc(25,Bi,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",22),o.TgZ(36,"div",23),o.TgZ(37,"mat-form-field",24),o.TgZ(38,"mat-select",25),o.NdJ("valueChange",function(t){return e.selFeeRate=t})("selectionChange",function(){return e.customFeeRate=null}),o.YNc(39,Hi,2,2,"mat-option",26),o.qZA(),o.qZA(),o.YNc(40,Gi,4,5,"mat-form-field",27),o.qZA(),o.TgZ(41,"div",28),o.TgZ(42,"mat-checkbox",29),o.NdJ("ngModelChange",function(t){return e.flgMinConf=t})("change",function(){return e.flgMinConf?e.selFeeRate=null:e.minConfValue=null}),o.qZA(),o.TgZ(43,"mat-form-field",30),o.TgZ(44,"input",31,32),o.NdJ("ngModelChange",function(t){return e.minConfValue=t}),o.qZA(),o.YNc(46,Vi,2,0,"mat-error",17),o.qZA(),o.qZA(),o.qZA(),o.YNc(47,Wi,9,8,"div",33),o.qZA(),o.qZA(),o.qZA(),o.YNc(48,Ki,3,2,"div",34),o.TgZ(49,"div",35),o.TgZ(50,"button",36),o._uU(51,"Clear Fields"),o.qZA(),o.TgZ(52,"button",37),o._uU(53,"Open Channel"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(54,to,1,1,"ng-template",null,38,o.W1O)),2&t){const t=o.MAs(18),n=o.MAs(55);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)("disabled",e.flgUseAllBalance),o.xp6(3),o.AsE("Remaining Bal: ",o.lcZ(21,29,e.totalBalance-(e.fundingAmount?e.fundingAmount:0)),"",e.flgUseAllBalance?". Amount replaced by UTXO balance":"",""),o.xp6(4),o.Q6J("ngIf",(null==t.errors?null:t.errors.required)||!e.fundingAmount),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(4),o.Q6J("fxFlex","customperkb"!==e.selFeeRate||e.flgMinConf?"100":"48"),o.xp6(1),o.Q6J("value",e.selFeeRate)("disabled",e.flgMinConf),o.xp6(1),o.Q6J("ngForOf",e.feeRateTypes),o.xp6(1),o.Q6J("ngIf","customperkb"===e.selFeeRate&&!e.flgMinConf),o.xp6(2),o.Q6J("ngModel",e.flgMinConf)("ngClass",o.WLB(31,eo,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD||e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),o.xp6(2),o.Q6J("ngModel",e.minConfValue)("step",1)("min",0)("required",e.flgMinConf)("disabled",!e.flgMinConf),o.xp6(2),o.Q6J("ngIf",e.flgMinConf&&!e.minConfValue),o.xp6(1),o.Q6J("ngIf",e.isCompatibleVersion),o.xp6(1),o.Q6J("ngIf",""!==e.channelConnectionError)}},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,v.dn,ft._Y,ft.JL,ft.F,a.O5,a.tP,M.KE,xt.Nt,ft.wV,ft.qQ,ft.Fd,ft.Fj,yt.q,Ii.F,ft.Q7,ft.JJ,ft.On,M.bx,M.R9,Tt.Rr,na.ib,na.yz,na.yK,At.gD,a.sg,ea.oG,a.mk,b.oO,Zt.h,Oi.ZL,ft.oH,Oi.XC,Ct.ey,M.TO,At.$L,E.gM,C.BN,J.d],pipes:[a.JJ,a.Ov],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),t})();function ao(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.openChannels)}}function so(t,e){if(1&t&&(o.TgZ(0,"span",7),o._uU(1,"Pending/Inactive"),o.qZA()),2&t){const t=o.oxw();o.s9C("matBadge",t.pendingChannels)}}let io=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.store=e,this.commonService=n,this.router=a,this.openChannels=0,this.pendingChannels=0,this.selNode={},this.information={},this.peers=[],this.utxos=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending/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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{t.allChannels&&t.allChannels.length?(this.openChannels=0,this.pendingChannels=0,t.allChannels.forEach(t=>{"CHANNELD_NORMAL"===t.state&&t.connected?this.openChannels++:this.pendingChannels++})):(this.openChannels=0,this.pendingChannels=0),this.selNode=t.nodeSettings,this.information=t.information,this.peers=t.peers,this.utxos=this.commonService.sortAscByKey(t.utxos.filter(t=>"confirmed"===t.status),"value"),this.totalBalance=t.balance.totalBalance,this.logger.info(t)})}onOpenChannel(){const t={peers:this.peers,information:this.information,balance:this.totalBalance,utxos:this.utxos,isCompatibleVersion:this.commonService.isVersionCompatible(this.information.version,"0.9.0")&&this.commonService.isVersionCompatible(this.information.api_version,"0.4.0")};this.store.dispatch(new Ft.wu({data:{alertTitle:"Open Channel",message:t,component:no}}))}onSelectedTabChange(t){this.router.navigateByUrl("/cl/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(Z.mQ),o.Y36(y.yh),o.Y36(T.v),o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-channels-tables"]],decls:12,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,ao,2,1,"ng-template",5),o.qZA(),o.TgZ(8,"mat-tab"),o.YNc(9,so,2,1,"ng-template",5),o.qZA(),o.qZA(),o.TgZ(10,"div",6),o._UZ(11,"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,q.lW,dt.SP,dt.uX,dt.uD,s.lC,rs.k],styles:[""]}),t})();function oo(t,e){if(1&t&&(o.TgZ(0,"div"),o.TgZ(1,"div",9),o.TgZ(2,"div",1),o.TgZ(3,"h4",11),o._uU(4,"Funding Transaction Id"),o.qZA(),o.TgZ(5,"span",12),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o._UZ(7,"mat-divider",13),o.qZA()),2&t){const t=o.oxw();o.xp6(6),o.Oqu(t.channel.funding_txid),o.xp6(1),o.Q6J("inset",!0)}}function lo(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Show Advanced"),o.qZA())}function ro(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Hide Advanced"),o.qZA())}function co(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",23),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.short_channel_id)}}function uo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",24),o.NdJ("click",function(){return o.CHM(t),o.oxw().onClose()}),o._uU(1,"OK"),o.qZA()}}const po=function(t){return{"xs-scroll-y":t}},ho=function(t,e){return{"mt-2":t,"mt-1":e}};let mo=(()=>{class t{constructor(t,e,n,a,s){this.dialogRef=t,this.data=e,this.logger=n,this.commonService=a,this.snackBar=s,this.faReceipt=g.dLy,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=f.cu}ngOnInit(){this.channel=this.data.channel,this.showCopy=this.data.showCopy,this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(t){this.snackBar.open("Short channel ID "+t+" copied."),this.logger.info("Copied Text: "+t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(gt.so),o.Y36(gt.WI),o.Y36(Z.mQ),o.Y36(T.v),o.Y36(ta.ux))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-channel-information"]],decls:94,vars:40,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"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],["fxFlex","25"],[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",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","button",3,"click",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","button",3,"click"]],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._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.TgZ(12,"div",10),o.TgZ(13,"h4",11),o._uU(14,"Short Channel ID"),o.qZA(),o.TgZ(15,"span",12),o._uU(16),o.qZA(),o.qZA(),o.TgZ(17,"div",10),o.TgZ(18,"h4",11),o._uU(19,"Peer Alias"),o.qZA(),o.TgZ(20,"span",12),o._uU(21),o.qZA(),o.qZA(),o.qZA(),o._UZ(22,"mat-divider",13),o.TgZ(23,"div",9),o.TgZ(24,"div",1),o.TgZ(25,"h4",11),o._uU(26,"Channel ID"),o.qZA(),o.TgZ(27,"span",12),o._uU(28),o.qZA(),o.qZA(),o.qZA(),o._UZ(29,"mat-divider",13),o.TgZ(30,"div",9),o.TgZ(31,"div",1),o.TgZ(32,"h4",11),o._uU(33,"Peer Public Key"),o.qZA(),o.TgZ(34,"span",12),o._uU(35),o.qZA(),o.qZA(),o.qZA(),o._UZ(36,"mat-divider",13),o.TgZ(37,"div",9),o.TgZ(38,"div",14),o.TgZ(39,"h4",11),o._uU(40,"mSatoshi to Us"),o.qZA(),o.TgZ(41,"span",15),o._uU(42),o.ALo(43,"number"),o.qZA(),o.qZA(),o.TgZ(44,"div",14),o.TgZ(45,"h4",11),o._uU(46,"Spendable (mSats)"),o.qZA(),o.TgZ(47,"span",15),o._uU(48),o.ALo(49,"number"),o.qZA(),o.qZA(),o.TgZ(50,"div",14),o.TgZ(51,"h4",11),o._uU(52,"Total (mSats)"),o.qZA(),o.TgZ(53,"span",15),o._uU(54),o.ALo(55,"number"),o.qZA(),o.qZA(),o.TgZ(56,"div",14),o.TgZ(57,"h4",11),o._uU(58,"State"),o.qZA(),o.TgZ(59,"span",15),o._uU(60),o.qZA(),o.qZA(),o.qZA(),o._UZ(61,"mat-divider",13),o.TgZ(62,"div",9),o.TgZ(63,"div",14),o.TgZ(64,"h4",11),o._uU(65,"Our Reserve (Sats)"),o.qZA(),o.TgZ(66,"span",15),o._uU(67),o.ALo(68,"number"),o.qZA(),o.qZA(),o.TgZ(69,"div",14),o.TgZ(70,"h4",11),o._uU(71,"Their Reserve (Sats)"),o.qZA(),o.TgZ(72,"span",15),o._uU(73),o.ALo(74,"number"),o.qZA(),o.qZA(),o.TgZ(75,"div",14),o.TgZ(76,"h4",11),o._uU(77,"Connected"),o.qZA(),o.TgZ(78,"span",15),o._uU(79),o.qZA(),o.qZA(),o.TgZ(80,"div",14),o.TgZ(81,"h4",11),o._uU(82,"Private"),o.qZA(),o.TgZ(83,"span",15),o._uU(84),o.qZA(),o.qZA(),o.qZA(),o._UZ(85,"mat-divider",13),o.YNc(86,oo,8,2,"div",16),o.TgZ(87,"div",17),o.TgZ(88,"button",18),o.NdJ("click",function(){return e.onShowAdvanced()}),o.YNc(89,lo,2,0,"p",19),o.YNc(90,ro,2,0,"ng-template",null,20,o.W1O),o.qZA(),o.YNc(92,co,2,1,"button",21),o.YNc(93,uo,2,0,"button",22),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.MAs(91);o.xp6(4),o.Q6J("icon",e.faReceipt),o.xp6(5),o.Q6J("ngClass",o.VKq(35,po,e.screenSize===e.screenSizeEnum.XS)),o.xp6(7),o.Oqu(e.channel.short_channel_id),o.xp6(5),o.Oqu(e.channel.alias),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(e.channel.channel_id),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(e.channel.id),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(43,25,e.channel.msatoshi_to_us)),o.xp6(6),o.Oqu(o.lcZ(49,27,e.channel.spendable_msatoshi)),o.xp6(6),o.Oqu(o.lcZ(55,29,e.channel.msatoshi_total)),o.xp6(6),o.Oqu(e.channel.state),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(68,31,e.channel.our_channel_reserve_satoshis)),o.xp6(6),o.Oqu(o.lcZ(74,33,e.channel.their_channel_reserve_satoshis)),o.xp6(6),o.Oqu(e.channel.connected?"Yes":"No"),o.xp6(5),o.Oqu(e.channel.private?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(1),o.Q6J("ngIf",e.showAdvanced),o.xp6(1),o.Q6J("ngClass",o.WLB(37,ho,!e.showAdvanced,e.showAdvanced)),o.xp6(2),o.Q6J("ngIf",!e.showAdvanced)("ngIfElse",t),o.xp6(3),o.Q6J("ngIf",e.showCopy),o.xp6(1),o.Q6J("ngIf",!e.showCopy)}},directives:[l.xw,l.Wh,l.yH,v.dk,C.BN,q.lW,v.dn,a.mk,b.oO,J.d,a.O5,Zt.h,Cs.y],pipes:[a.JJ],styles:[""]}),t})();function go(t,e){1&t&&o._UZ(0,"mat-progress-bar",33)}function fo(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Short Channel ID "),o.qZA())}function xo(t,e){if(1&t&&(o.TgZ(0,"span",40),o._UZ(1,"fa-icon",41),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEyeSlash)}}function Zo(t,e){if(1&t&&(o.TgZ(0,"span",42),o._UZ(1,"fa-icon",41),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("icon",t.faEye)}}const yo=function(t){return{"max-width":t}};function Ao(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"div",36),o.YNc(2,xo,2,1,"span",37),o.YNc(3,Zo,2,1,"span",38),o.TgZ(4,"span",39),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,yo,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),o.xp6(1),o.Q6J("ngIf",t.private),o.xp6(1),o.Q6J("ngIf",!t.private),o.xp6(2),o.Oqu(null==t?null:t.short_channel_id)}}function To(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Alias "),o.qZA())}function Co(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"div",36),o.TgZ(2,"span",39),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,yo,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),o.xp6(2),o.Oqu(null==t?null:t.alias)}}function wo(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Connected "),o.qZA())}function vo(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null!=t&&t.connected?"Connected":"Disconnected"," ")}}function So(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Private "),o.qZA())}function bo(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null!=t&&t.private?"Private":"Public"," ")}}function qo(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," State "),o.qZA())}function _o(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.state,"")}}function Fo(t,e){1&t&&(o.TgZ(0,"th",43),o._uU(1," Local Balance (Sats) "),o.qZA())}function Lo(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"span",44),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.msatoshi_to_us)/1e3,(null==t?null:t.msatoshi_to_us)<1e3?"1.0-4":"1.0-0")," ")}}function Uo(t,e){1&t&&(o.TgZ(0,"th",43),o._uU(1," Remote Balance (Sats) "),o.qZA())}function Ro(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"span",44),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.msatoshi_to_them)/1e3,(null==t?null:t.msatoshi_to_them)<1e3?"1.0-4":"1.0-0")," ")}}function ko(t,e){1&t&&(o.TgZ(0,"th",43),o._uU(1," Total mSatoshis "),o.qZA())}function No(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"span",44),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.msatoshi_total)," ")}}function Io(t,e){1&t&&(o.TgZ(0,"th",43),o._uU(1," Spendable Satoshi "),o.qZA())}function Oo(t,e){if(1&t&&(o.TgZ(0,"td",35),o.TgZ(1,"span",44),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.spendable_msatoshi)," ")}}function Mo(t,e){1&t&&(o.TgZ(0,"th",45),o._uU(1,"Balance Score "),o.qZA())}function Eo(t,e){if(1&t&&(o.TgZ(0,"td",46),o.TgZ(1,"div",47),o.TgZ(2,"mat-hint",48),o._uU(3),o.ALo(4,"number"),o.qZA(),o.qZA(),o._UZ(5,"mat-progress-bar",49),o.qZA()),2&t){const t=e.$implicit;o.xp6(3),o.Oqu(o.lcZ(4,2,t.balancedness||0)),o.xp6(2),o.s9C("value",t.msatoshi_to_us&&t.msatoshi_to_us>0?+t.msatoshi_to_us/(+t.msatoshi_to_us+ +t.msatoshi_to_them)*100:0)}}function Jo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",50),o.TgZ(1,"div",51),o.TgZ(2,"mat-select",52),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",53),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",53),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 Do(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",54),o.TgZ(1,"div",55),o.TgZ(2,"mat-select",56),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",53),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",53),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onViewRemotePolicy(e)}),o._uU(7,"View Remote Fee"),o.qZA(),o.TgZ(8,"mat-option",53),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelUpdate(e)}),o._uU(9,"Update Fee Policy"),o.qZA(),o.TgZ(10,"mat-option",53),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().onChannelClose(e)}),o._uU(11,"Close Channel"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Yo(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 Qo(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No channel available."),o.qZA())}function Po(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting channels..."),o.qZA())}function Bo(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 Ho(t,e){if(1&t&&(o.TgZ(0,"td",57),o.YNc(1,Yo,2,0,"p",58),o.YNc(2,Qo,2,0,"p",58),o.YNc(3,Po,2,0,"p",58),o.YNc(4,Bo,2,1,"p",58),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 zo=function(t){return{"display-none":t}};function Go(t,e){if(1&t&&o._UZ(0,"tr",59),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,zo,t.numPeers>0&&(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Vo(t,e){1&t&&o._UZ(0,"tr",60)}function Xo(t,e){1&t&&o._UZ(0,"tr",61)}const Wo=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},$o=function(){return["no_peer"]};let Ko=(()=>{class t{constructor(t,e,n,a,s){this.logger=t,this.store=e,this.rtlEffects=n,this.clEffects=a,this.commonService=s,this.faEye=g.Mdf,this.faEyeSlash=g.Aq,this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=f.vn,this.selFilter="",this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","msatoshi_to_us","msatoshi_to_them","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["short_channel_id","alias","msatoshi_to_us","msatoshi_to_them","actions"]):(this.flgSticky=!0,this.displayedColumns=["short_channel_id","alias","msatoshi_to_us","msatoshi_to_them","balancedness","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchChannels.status===f.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.balance.totalBalance,this.channelsData=t.allChannels.filter(t=>"CHANNELD_NORMAL"===t.state&&t.connected),this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(t)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onViewRemotePolicy(t){this.store.dispatch(new x.IG({uiMessage:f.m6.GET_REMOTE_POLICY,shortChannelID:t.short_channel_id,showError:!0})),this.clEffects.setLookupCL.pipe((0,ce.q)(1)).subscribe(t=>{if(0===t.length)return!1;let e={};e=t[0].source!==this.information.id?t[0]:t[1],this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Remote Channel Policy",message:[[{key:"base_fee_millisatoshi",value:e.base_fee_millisatoshi,title:"Base Fees (mSats)",width:34,type:f.Gi.NUMBER},{key:"fee_per_millionth",value:e.fee_per_millionth,title:"Fee/Millionth",width:33,type:f.Gi.NUMBER},{key:"delay",value:e.delay,title:"Delay",width:33,type:f.Gi.NUMBER}]]}}))})}onChannelUpdate(t){"all"!==t&&"ONCHAIN"===t.state||("all"===t?(this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update All",message:[],titleMessage:"Update fee policy for all channels",flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:1e3,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:1,min:1,width:48,hintFunction:this.percentHintFunction}]}})),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{t&&this.store.dispatch(new x.k({baseFeeMsat:t[0].inputValue,feeRate:t[1].inputValue,channelId:"all"}))})):(this.myChanPolicy={fee_base_msat:0,fee_rate_milli_msat:0},this.store.dispatch(new x.IG({uiMessage:f.m6.GET_CHAN_POLICY,shortChannelID:t.short_channel_id,showError:!1})),this.clEffects.setLookupCL.pipe((0,ce.q)(1)).subscribe(e=>{this.myChanPolicy=e.length>0&&e[0].source===this.information.id?{fee_base_msat:e[0].base_fee_millisatoshi,fee_rate_milli_msat:e[0].fee_per_millionth}:e.length>1&&e[1].source===this.information.id?{fee_base_msat:e[1].base_fee_millisatoshi,fee_rate_milli_msat:e[1].fee_per_millionth}:{fee_base_msat:0,fee_rate_milli_msat:0},this.logger.info(this.myChanPolicy),this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"Update fee policy for Channel: "+t.channel_id,flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:""===this.myChanPolicy.fee_base_msat?0:this.myChanPolicy.fee_base_msat,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:this.myChanPolicy.fee_rate_milli_msat,min:1,width:48,hintFunction:this.percentHintFunction}]}}))}),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[2])).subscribe(e=>{e&&this.store.dispatch(new x.k({baseFeeMsat:e[0].inputValue,feeRate:e[1].inputValue,channelId:t.channel_id}))})),this.applyFilter())}percentHintFunction(t){return(t/1e4).toString()+"%"}onChannelClose(t){this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Close Channel",titleMessage:"Closing channel: "+t.channel_id,noBtnText:"Cancel",yesBtnText:"Close Channel"}})),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[3])).subscribe(e=>{e&&this.store.dispatch(new x.e8({channelId:t.channel_id,force:!1}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,e){this.store.dispatch(new Ft.wu({data:{channel:t,showCopy:!0,component:mo}}))}loadChannelsTable(t){t.sort((t,e)=>t.active===e.active?0:e.active?1:-1),this.channels=new mt.by([...t]),this.channels.filterPredicate=(t,e)=>((t.connected?"connected":"disconnected")+(t.channel_id?t.channel_id.toLowerCase():"")+(t.short_channel_id?t.short_channel_id.toLowerCase():"")+(t.id?t.id.toLowerCase():"")+(t.alias?t.alias.toLowerCase():"")+(t.private?"private":"public")+(t.state?t.state.toLowerCase():"")+(t.funding_txid?t.funding_txid.toLowerCase():"")+(t.msatoshi_to_us?t.msatoshi_to_us:"")+(t.msatoshi_total?t.msatoshi_total:"")+(t.their_channel_reserve_satoshis?t.their_channel_reserve_satoshis:"")+(t.our_channel_reserve_satoshis?t.our_channel_reserve_satoshis:"")+(t.spendable_msatoshi?t.spendable_msatoshi:"")).includes(e),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.paginator=this.paginator,this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"Open-channels")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(Lt.V),o.Y36(ue.s),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-channel-open-table"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Channels")}])],decls:48,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"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","short_channel_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","connected"],["matColumnDef","private"],["matColumnDef","state"],["matColumnDef","msatoshi_to_us"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi_to_them"],["matColumnDef","msatoshi_total"],["matColumnDef","spendable_msatoshi"],["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.YNc(5,go,1,0,"mat-progress-bar",5),o.TgZ(6,"div",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,fo,2,0,"th",10),o.YNc(11,Ao,6,6,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,To,2,0,"th",10),o.YNc(14,Co,4,4,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,wo,2,0,"th",10),o.YNc(17,vo,2,1,"td",11),o.BQk(),o.ynx(18,14),o.YNc(19,So,2,0,"th",10),o.YNc(20,bo,2,1,"td",11),o.BQk(),o.ynx(21,15),o.YNc(22,qo,2,0,"th",10),o.YNc(23,_o,2,1,"td",11),o.BQk(),o.ynx(24,16),o.YNc(25,Fo,2,0,"th",17),o.YNc(26,Lo,4,4,"td",11),o.BQk(),o.ynx(27,18),o.YNc(28,Uo,2,0,"th",17),o.YNc(29,Ro,4,4,"td",11),o.BQk(),o.ynx(30,19),o.YNc(31,ko,2,0,"th",17),o.YNc(32,No,4,3,"td",11),o.BQk(),o.ynx(33,20),o.YNc(34,Io,2,0,"th",17),o.YNc(35,Oo,4,3,"td",11),o.BQk(),o.ynx(36,21),o.YNc(37,Mo,2,0,"th",22),o.YNc(38,Eo,6,4,"td",23),o.BQk(),o.ynx(39,24),o.YNc(40,Jo,8,0,"th",25),o.YNc(41,Do,12,0,"td",26),o.BQk(),o.ynx(42,27),o.YNc(43,Ho,5,4,"td",28),o.BQk(),o.YNc(44,Go,1,3,"tr",29),o.YNc(45,Vo,1,0,"tr",30),o.YNc(46,Xo,1,0,"tr",31),o.qZA(),o.qZA(),o._UZ(47,"mat-paginator",32),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.selFilter),o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(2),o.Q6J("dataSource",e.channels)("ngClass",o.VKq(11,Wo,""!==e.errorMessage)),o.xp6(37),o.Q6J("matFooterRowDef",o.DdM(13,$o)),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,M.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,a.O5,D.$V,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,a.PC,b.Zl,E.gM,C.BN,M.bx,At.gD,At.$L,Ct.ey,mt.yh,mt.Q2,mt.XQ,mt.Gk],pipes:[a.JJ],styles:[".mat-column-short_channel_id[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-short_channel_id[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{flex:0 0 20%;width:20%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;flex:0 0 22%;width:22%}.mat-column-msatoshi_to_them[_ngcontent-%COMP%], .mat-column-msatoshi_to_us[_ngcontent-%COMP%], .mat-column-state[_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-msatoshi_to_them[_ngcontent-%COMP%], .mat-column-msatoshi_to_us[_ngcontent-%COMP%], .mat-column-state[_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})();const jo=["outputIdx"];function tl(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Output Index required."),o.qZA())}function el(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Invalid index value."),o.qZA())}function nl(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees is required."),o.qZA())}function al(t,e){if(1&t&&(o.TgZ(0,"div",27),o._UZ(1,"fa-icon",13),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.bumpFeeError)}}let sl=(()=>{class t{constructor(t,e,n,a,s,i){this.actions=t,this.dialogRef=e,this.data=n,this.store=a,this.logger=s,this.snackBar=i,this.newAddress="",this.fees=null,this.outputIndex=null,this.faCopy=g.kZ_,this.faInfoCircle=g.sqG,this.faExclamationTriangle=g.eHv,this.bumpFeeError="",this.unSubs=[new d.x,new d.x]}set payReq(t){t&&(this.outputIdx=t)}ngOnInit(){this.bumpFeeChannel=this.data.channel}onBumpFee(){if(!this.outputIndex&&0!==this.outputIndex||!this.fees)return!0;this.bumpFeeError="",this.store.dispatch(new x.ER(f._t[0])),this.actions.pipe((0,h.h)(t=>t.type===x.Un),(0,ce.q)(1)).subscribe(t=>{this.store.dispatch(new x.uj({address:t.payload,satoshis:"all",feeRate:this.fees,utxos:[this.bumpFeeChannel.funding_txid+":"+this.outputIndex.toString()]}))}),this.actions.pipe((0,h.h)(t=>t.type===x.ob),(0,ce.q)(1)).subscribe(t=>{this.store.dispatch(new Ft.Lw("Successfully bumped the fee. Use the block explorer to verify transaction.")),this.dialogRef.close()}),this.actions.pipe((0,h.h)(t=>t.type===x.qe),(0,p.R)(this.unSubs[0])).subscribe(t=>{t.payload.status!==f.Bn.ERROR||"SetChannelTransaction"!==t.payload.action&&"GenerateNewAddress"!==t.payload.action||(this.logger.error(t.payload.message),this.bumpFeeError=t.payload.message)})}onCopyID(t){this.snackBar.open("Transaction ID copied.")}resetData(){this.bumpFeeError="",this.fees=null,this.outputIndex=null,this.outputIdx.control.setErrors(null)}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(A.eX),o.Y36(gt.so),o.Y36(gt.WI),o.Y36(y.yh),o.Y36(Z.mQ),o.Y36(ta.ux))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-bump-fee"]],viewQuery:function(t,e){if(1&t&&o.Gf(jo,5),2&t){let t;o.iGM(t=o.CRH())&&(e.payReq=t.first)}},decls:47,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","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],["fxLayout","column",1,"bordered-box","mb-1","p-2"],["fxLayoutAlign","start center",1,"pb-1","word-break"],["matSuffix","","rtlClipboard","","matTooltip","Copy transaction ID",1,"ml-1",3,"icon","payload","copied"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","100"],[1,"pl-1"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","49"],["autoFocus","","matInput","","placeholder","Output Index","type","number","tabindex","1","required","","name","outputIdx",3,"ngModel","step","min","ngModelChange"],["outputIdx","ngModel"],[4,"ngIf"],["matInput","","placeholder","Fees (Sats/vByte)","type","number","name","fees","required","","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","reset","tabindex","5","default","",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","6",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"]],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,"Bump Fee"),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),o.TgZ(10,"div",8),o.TgZ(11,"p",9),o._uU(12),o.TgZ(13,"fa-icon",10),o.NdJ("copied",function(t){return e.onCopyID(t)}),o.qZA(),o.qZA(),o.TgZ(14,"div",11),o.TgZ(15,"div",12),o._UZ(16,"fa-icon",13),o.TgZ(17,"span",14),o._uU(18,"Bumping fee on pending open channels is an advanced feature, attempt it only if you are familiar with the functionality of Bitcoin transactions. "),o.TgZ(19,"div"),o._uU(20,"Before attempting fee bump ensure the following:"),o.qZA(),o.TgZ(21,"div",15),o._uU(22,"1: Use a Bitcoin block explorer to ensure that channel opening transaction is not confirmed."),o.qZA(),o.TgZ(23,"div",15),o._uU(24,"2: The channel opening transaction must have a sizable change output, which can be spent further. The fee cannot be bumped without the change output."),o.qZA(),o.TgZ(25,"div",15),o._uU(26,"3: Find the index value of the change output via a block explorer."),o.qZA(),o.TgZ(27,"div",15),o._uU(28,"4: Enter the index value of the change output in the form below and the desired fee rate."),o.qZA(),o.TgZ(29,"div",15),o._uU(30,"5: Upon successful fee bump, use your block explorer to track the child transaction in the mempool, which should be linked with the change output transaction."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(31,"div",16),o.TgZ(32,"mat-form-field",17),o.TgZ(33,"input",18,19),o.NdJ("ngModelChange",function(t){return e.outputIndex=t}),o.qZA(),o.YNc(35,tl,2,0,"mat-error",20),o.YNc(36,el,2,0,"mat-error",20),o.qZA(),o.TgZ(37,"mat-form-field",17),o.TgZ(38,"input",21,22),o.NdJ("ngModelChange",function(t){return e.fees=t}),o.qZA(),o.YNc(40,nl,2,0,"mat-error",20),o.qZA(),o.qZA(),o.YNc(41,al,4,2,"div",23),o.qZA(),o.qZA(),o.TgZ(42,"div",24),o.TgZ(43,"button",25),o.NdJ("click",function(){return e.resetData()}),o._uU(44,"Clear"),o.qZA(),o.TgZ(45,"button",26),o.NdJ("click",function(){return e.onBumpFee()}),o._uU(46),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.MAs(34);o.xp6(12),o.hij("Bump fee for transaction id: ",null==e.bumpFeeChannel?null:e.bumpFeeChannel.funding_txid," "),o.xp6(1),o.Q6J("icon",e.faCopy)("payload",null==e.bumpFeeChannel?null:e.bumpFeeChannel.funding_txid),o.xp6(3),o.Q6J("icon",e.faInfoCircle),o.xp6(17),o.Q6J("ngModel",e.outputIndex)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",null==t.errors?null:t.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.errors?null:t.errors.pendingChannelOutputIndex),o.xp6(2),o.Q6J("ngModel",e.fees)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.fees),o.xp6(1),o.Q6J("ngIf",""!==e.bumpFeeError),o.xp6(5),o.Oqu(""!==e.bumpFeeError?"Retry Bump Fee":"Bump Fee")}},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,v.dn,ft._Y,ft.JL,ft.F,C.BN,M.R9,Cs.y,E.gM,M.KE,xt.Nt,ft.wV,ft.qQ,ft.Fj,yt.q,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,M.TO],styles:[""]}),t})();function il(t,e){1&t&&o._UZ(0,"mat-progress-bar",30)}function ol(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Short Channel ID "),o.qZA())}function ll(t,e){if(1&t&&(o.TgZ(0,"td",32),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.short_channel_id,"")}}function rl(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Alias "),o.qZA())}function cl(t,e){if(1&t&&(o.TgZ(0,"td",32),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.alias)}}function ul(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Connected "),o.qZA())}function dl(t,e){if(1&t&&(o.TgZ(0,"td",32),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null!=t&&t.connected?"Connected":"Disconnected"," ")}}function pl(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," Private "),o.qZA())}function hl(t,e){if(1&t&&(o.TgZ(0,"td",32),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null!=t&&t.private?"Private":"Public"," ")}}function ml(t,e){1&t&&(o.TgZ(0,"th",31),o._uU(1," State "),o.qZA())}const gl=function(t){return{"max-width":t}};function fl(t,e){if(1&t&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,gl,n.screenSize===n.screenSizeEnum.XS?"10rem":"")),o.xp6(1),o.hij(" ",n.CLChannelPendingState[null==t?null:t.state]," ")}}function xl(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," mSatoshi To Us "),o.qZA())}function Zl(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",35),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.msatoshi_to_us)," ")}}function yl(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Total (Sats) "),o.qZA())}function Al(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",35),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.msatoshi_total)/1e3)," ")}}function Tl(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1," Spendable Satoshi "),o.qZA())}function Cl(t,e){if(1&t&&(o.TgZ(0,"td",32),o.TgZ(1,"span",35),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.spendable_msatoshi)," ")}}function wl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",36),o.TgZ(1,"div",37),o.TgZ(2,"mat-select",38),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",39),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 vl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",39),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onChannelClose(e)}),o._uU(1,"Close Channel"),o.qZA()}}function Sl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",39),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onBumpFee(e)}),o._uU(1,"Bump Fee"),o.qZA()}}function bl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",40),o.TgZ(1,"div",37),o.TgZ(2,"mat-select",41),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",39),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.YNc(6,vl,2,0,"mat-option",42),o.YNc(7,Sl,2,0,"mat-option",42),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.xp6(6),o.Q6J("ngIf",n.isCompatibleVersion&&!t.connected&&"CHANNELD_NORMAL"===t.state),o.xp6(1),o.Q6J("ngIf","CHANNELD_AWAITING_LOCKIN"===t.state)}}function ql(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 _l(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No pending/inactive channel available."),o.qZA())}function Fl(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting pending/inactive channels..."),o.qZA())}function Ll(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 Ul(t,e){if(1&t&&(o.TgZ(0,"td",43),o.YNc(1,ql,2,0,"p",44),o.YNc(2,_l,2,0,"p",44),o.YNc(3,Fl,2,0,"p",44),o.YNc(4,Ll,2,1,"p",44),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 Rl=function(t){return{"display-none":t}};function kl(t,e){if(1&t&&o._UZ(0,"tr",45),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,Rl,t.numPeers>0&&(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Nl(t,e){1&t&&o._UZ(0,"tr",46)}function Il(t,e){1&t&&o._UZ(0,"tr",47)}const Ol=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Ml=function(){return["no_peer"]};let El=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.store=e,this.rtlEffects=n,this.commonService=a,this.isCompatibleVersion=!1,this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=f.vn,this.selFilter="",this.flgSticky=!1,this.CLChannelPendingState=f.uX,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","state","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","connected","state","actions"]):this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","connected","state","msatoshi_total","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","connected","state","msatoshi_total","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchChannels.status===f.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.information.api_version&&(this.isCompatibleVersion=this.commonService.isVersionCompatible(this.information.api_version,"0.4.2")),this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.balance.totalBalance,this.channelsData=t.allChannels.filter(t=>!("CHANNELD_NORMAL"===t.state&&t.connected)),this.channelsData=this.channelsData.sort((t,e)=>this.CLChannelPendingState[t.state]>=this.CLChannelPendingState[e.state]?1:-1),this.channelsData&&this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(t)})}ngAfterViewInit(){this.channelsData&&this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onBumpFee(t){this.store.dispatch(new Ft.wu({data:{channel:t,component:sl}}))}onChannelClick(t,e){this.store.dispatch(new Ft.wu({data:{channel:t,showCopy:!0,component:mo}}))}onChannelClose(t){this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Force Close Channel",titleMessage:"Force closing channel: "+t.channel_id,noBtnText:"Cancel",yesBtnText:"Force Close"}})),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[3])).subscribe(e=>{e&&this.store.dispatch(new x.e8({channelId:t.channel_id,force:!0}))})}loadChannelsTable(t){t.sort((t,e)=>t.active===e.active?0:e.active?1:-1),this.channels=new mt.by([...t]),this.channels.filterPredicate=(t,e)=>((t.connected?"connected":"disconnected")+(t.channel_id?t.channel_id.toLowerCase():"")+(t.short_channel_id?t.short_channel_id.toLowerCase():"")+(t.id?t.id.toLowerCase():"")+(t.alias?t.alias.toLowerCase():"")+(t.private?"private":"public")+(t.state&&this.CLChannelPendingState[t.state]?this.CLChannelPendingState[t.state].toLowerCase():"")+(t.funding_txid?t.funding_txid.toLowerCase():"")+(t.msatoshi_to_us?t.msatoshi_to_us:"")+(t.msatoshi_total?t.msatoshi_total:"")+(t.their_channel_reserve_satoshis?t.their_channel_reserve_satoshis:"")+(t.our_channel_reserve_satoshis?t.our_channel_reserve_satoshis:"")+(t.spendable_msatoshi?t.spendable_msatoshi:"")).includes(e),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>{switch(e){case"state":return this.CLChannelPendingState[t.state];default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},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,"Pending-inactive-channels")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(Lt.V),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-channel-pending-table"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Channels")}])],decls:42,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"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","short_channel_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","connected"],["matColumnDef","private"],["matColumnDef","state"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","msatoshi_to_us"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi_total"],["matColumnDef","spendable_msatoshi"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pr-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",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pr-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pr-3"],["placeholder","Actions","tabindex","4",1,"mr-0"],[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,"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.YNc(5,il,1,0,"mat-progress-bar",5),o.TgZ(6,"div",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,ol,2,0,"th",10),o.YNc(11,ll,2,1,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,rl,2,0,"th",10),o.YNc(14,cl,2,1,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,ul,2,0,"th",10),o.YNc(17,dl,2,1,"td",11),o.BQk(),o.ynx(18,14),o.YNc(19,pl,2,0,"th",10),o.YNc(20,hl,2,1,"td",11),o.BQk(),o.ynx(21,15),o.YNc(22,ml,2,0,"th",10),o.YNc(23,fl,2,4,"td",16),o.BQk(),o.ynx(24,17),o.YNc(25,xl,2,0,"th",18),o.YNc(26,Zl,4,3,"td",11),o.BQk(),o.ynx(27,19),o.YNc(28,yl,2,0,"th",18),o.YNc(29,Al,4,3,"td",11),o.BQk(),o.ynx(30,20),o.YNc(31,Tl,2,0,"th",18),o.YNc(32,Cl,4,3,"td",11),o.BQk(),o.ynx(33,21),o.YNc(34,wl,6,0,"th",22),o.YNc(35,bl,8,2,"td",23),o.BQk(),o.ynx(36,24),o.YNc(37,Ul,5,4,"td",25),o.BQk(),o.YNc(38,kl,1,3,"tr",26),o.YNc(39,Nl,1,0,"tr",27),o.YNc(40,Il,1,0,"tr",28),o.qZA(),o.qZA(),o._UZ(41,"mat-paginator",29),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.selFilter),o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(2),o.Q6J("dataSource",e.channels)("ngClass",o.VKq(11,Ol,""!==e.errorMessage)),o.xp6(31),o.Q6J("matFooterRowDef",o.DdM(13,Ml)),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,M.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,a.O5,D.$V,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,a.PC,b.Zl,At.gD,At.$L,Ct.ey,mt.yh,mt.Q2,mt.XQ,mt.Gk],pipes:[a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-state[_ngcontent-%COMP%]{flex:1 1 15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();const Jl=["peersForm"],Dl=["stepper"];function Yl(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw();o.Oqu(t.peerFormLabel)}}function Ql(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Address is required."),o.qZA())}function Pl(t,e){if(1&t&&(o.TgZ(0,"div",40),o._UZ(1,"fa-icon",41),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 Bl(t,e){if(1&t&&o._uU(0),2&t){const t=o.oxw();o.Oqu(t.channelFormLabel)}}function Hl(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function zl(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount must be a positive number."),o.qZA())}function Gl(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 Vl(t,e){if(1&t&&(o.TgZ(0,"mat-option",42),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.feeRateId),o.xp6(1),o.hij(" ",t.feeRateType," ")}}function Xl(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Fee Rate is required."),o.qZA())}function Wl(t,e){if(1&t&&(o.TgZ(0,"mat-form-field",43),o._UZ(1,"input",44),o.YNc(2,Xl,2,0,"mat-error",14),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("step",.1)("min",0),o.xp6(1),o.Q6J("ngIf","customperkb"===t.channelFormGroup.controls.selFeeRate.value&&!t.channelFormGroup.controls.flgMinConf.value&&!t.channelFormGroup.controls.customFeeRate.value)}}function $l(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Min Confirmation Blocks is required."),o.qZA())}function Kl(t,e){if(1&t&&(o.TgZ(0,"div",40),o._UZ(1,"fa-icon",41),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)}}const jl=function(t,e){return{"mr-6":t,"mr-2":e}};let tr=(()=>{class t{constructor(t,e,n,a,s,i,o){this.dialogRef=t,this.data=e,this.store=n,this.formBuilder=a,this.actions=s,this.logger=i,this.commonService=o,this.faExclamationTriangle=g.eHv,this.peerAddress="",this.totalBalance=0,this.feeRateTypes=f.vn,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.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.id&&this.data.message.peer.netaddr?this.data.message.peer.id+"@"+this.data.message.peer.netaddr:this.data.message.peer&&this.data.message.peer.id&&!this.data.message.peer.netaddr?this.data.message.peer.id:"",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],selFeeRate:[null],customFeeRate:[null],flgMinConf:[!1],minConfValue:[{value:null,disabled:!0}],hiddenAmount:["",[ft.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.channelFormGroup.controls.flgMinConf.valueChanges.pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{t?(this.channelFormGroup.controls.selFeeRate.setValue(null),this.channelFormGroup.controls.selFeeRate.disable(),this.channelFormGroup.controls.customFeeRate.setValue(null),this.channelFormGroup.controls.minConfValue.reset(),this.channelFormGroup.controls.minConfValue.enable(),this.channelFormGroup.controls.minConfValue.setValidators([ft.kI.required])):(this.channelFormGroup.controls.selFeeRate.enable(),this.channelFormGroup.controls.minConfValue.setValue(null),this.channelFormGroup.controls.minConfValue.disable(),this.channelFormGroup.controls.minConfValue.setValidators(null))}),this.channelFormGroup.controls.selFeeRate.valueChanges.pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.channelFormGroup.controls.customFeeRate.setValue(null),this.channelFormGroup.controls.customFeeRate.reset(),this.channelFormGroup.controls.customFeeRate.setValidators("customperkb"!==t||this.channelFormGroup.controls.flgMinConf.value?null:[ft.kI.required])}),this.actions.pipe((0,p.R)(this.unSubs[2]),(0,h.h)(t=>t.type===x.ab||t.type===x.GL||t.type===x.qe)).subscribe(t=>{t.type===x.ab&&(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===x.GL&&this.dialogRef.close(),t.type===x.qe&&t.payload.status===f.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 x.rF({id:this.peerFormGroup.controls.peerAddress.value}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0||this.channelFormGroup.controls.flgMinConf.value&&!this.channelFormGroup.controls.minConfValue.value)return!0;this.channelConnectionError="",this.store.dispatch(new x.nb({peerId:this.newlyAddedPeer.id,satoshis:this.channelFormGroup.controls.fundingAmount.value,announce:!this.channelFormGroup.controls.isPrivate.value,feeRate:"customperkb"===this.channelFormGroup.controls.selFeeRate.value&&!this.channelFormGroup.controls.flgMinConf.value&&this.channelFormGroup.controls.customFeeRate.value?1e3*this.channelFormGroup.controls.customFeeRate.value+"perkb":this.channelFormGroup.controls.selFeeRate.value,minconf:this.channelFormGroup.controls.flgMinConf.value?this.channelFormGroup.controls.minConfValue.value:null}))}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.id):"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.id):"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(gt.so),o.Y36(gt.WI),o.Y36(y.yh),o.Y36(ft.qu),o.Y36(A.eX),o.Y36(Z.mQ),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-connect-peer"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Jl,5),o.Gf(Dl,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.form=t.first),o.iGM(t=o.CRH())&&(e.stepper=t.first)}},decls:57,vars:30,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","ngSubmit"],["matStepLabel","","disabled","true"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row","fxFlex","100","fxLayoutAlign.gt-sm","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","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign.gt-sm","space-between center"],["fxFlex","48","fxLayoutAlign","space-between end"],["fxLayoutAlign","start center",3,"fxFlex"],["tabindex","4","placeholder","Fee Rate","formControlName","selFeeRate"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48","fxLayoutAlign","end center",4,"ngIf"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","5","color","primary","formControlName","flgMinConf","fxLayoutAlign","stretch start",3,"ngClass"],["fxFlex","98"],["matInput","","formControlName","minConfValue","placeholder","Min Confirmation Blocks","type","number","name","blocks","tabindex","8",3,"step","min","required"],["mat-stroked-button","","color","primary","tabindex","8","type","submit"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[3,"value"],["fxFlex","48","fxLayoutAlign","end center"],["matInput","","formControlName","customFeeRate","placeholder","Fee Rate (Sats/vB)","type","number","name","custFeeRate","tabindex","4",3,"step","min"]],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,Yl,1,1,"ng-template",12),o.TgZ(15,"mat-form-field",1),o._UZ(16,"input",13),o.YNc(17,Ql,2,0,"mat-error",14),o.qZA(),o.YNc(18,Pl,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.NdJ("ngSubmit",function(){return e.onOpenChannel()}),o.YNc(24,Bl,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,Hl,2,0,"mat-error",14),o.YNc(34,zl,2,0,"mat-error",14),o.YNc(35,Gl,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",29),o.TgZ(42,"mat-select",30),o.YNc(43,Vl,2,2,"mat-option",31),o.qZA(),o.qZA(),o.YNc(44,Wl,3,3,"mat-form-field",32),o.qZA(),o.TgZ(45,"div",33),o._UZ(46,"mat-checkbox",34),o.TgZ(47,"mat-form-field",35),o._UZ(48,"input",36),o.YNc(49,$l,2,0,"mat-error",14),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(50,Kl,4,2,"div",15),o.TgZ(51,"div",16),o.TgZ(52,"button",37),o._uU(53),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(54,"div",38),o.TgZ(55,"button",39),o._uU(56),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(6),o.Q6J("fxFlex","customperkb"!==e.channelFormGroup.controls.selFeeRate.value||e.channelFormGroup.controls.flgMinConf.value?"100":"48"),o.xp6(2),o.Q6J("ngForOf",e.feeRateTypes),o.xp6(1),o.Q6J("ngIf","customperkb"===e.channelFormGroup.controls.selFeeRate.value&&!e.channelFormGroup.controls.flgMinConf.value),o.xp6(2),o.Q6J("ngClass",o.WLB(27,jl,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD||e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),o.xp6(2),o.Q6J("step",1)("min",0)("required",e.channelFormGroup.controls.flgMinConf.value),o.xp6(1),o.Q6J("ngIf",e.channelFormGroup.controls.flgMinConf.value&&!e.channelFormGroup.controls.minConfValue.value),o.xp6(1),o.Q6J("ngIf",""!==e.channelConnectionError),o.xp6(3),o.Oqu(""!==e.channelConnectionError?"Retry":"Open Channel"),o.xp6(2),o.Q6J("mat-dialog-close",!1),o.xp6(1),o.Oqu(null!=e.newlyAddedPeer&&e.newlyAddedPeer.id?"Do It Later":"Close"))},directives:[l.xw,l.yH,v.dk,l.Wh,q.lW,v.dn,aa.Vq,aa.C0,ft._Y,ft.JL,ft.sg,aa.VY,M.KE,xt.Nt,ft.Fj,Zt.h,ft.JJ,ft.u,ft.Q7,a.O5,ft.wV,M.bx,M.R9,Tt.Rr,At.gD,a.sg,ea.oG,a.mk,b.oO,ft.qQ,yt.q,gt.ZT,M.TO,C.BN,Ct.ey],styles:[""]}),t})();function er(t,e){1&t&&o._UZ(0,"mat-progress-bar",32)}function nr(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1," Alias "),o.qZA())}const ar=function(t){return{"mr-0":t}};function sr(t,e){if(1&t&&o._UZ(0,"span",37),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,ar,t.screenSize===t.screenSizeEnum.XS))}}function ir(t,e){if(1&t&&o._UZ(0,"span",38),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,ar,t.screenSize===t.screenSizeEnum.XS))}}const or=function(t){return{"max-width":t}};function lr(t,e){if(1&t&&(o.TgZ(0,"td",34),o.YNc(1,sr,1,3,"span",35),o.YNc(2,ir,1,3,"span",36),o._uU(3),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(4,or,n.screenSize===n.screenSizeEnum.XS?"10rem":"40rem")),o.xp6(1),o.Q6J("ngIf",null==t?null:t.connected),o.xp6(1),o.Q6J("ngIf",!(null!=t&&t.connected)),o.xp6(1),o.hij(" ",null==t?null:t.alias," ")}}function rr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," ID "),o.qZA())}function cr(t,e){if(1&t&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,or,n.screenSize===n.screenSizeEnum.XS?"10rem":"40rem")),o.xp6(1),o.hij(" ",null==t?null:t.id," ")}}function ur(t,e){1&t&&(o.TgZ(0,"th",33),o._uU(1," Network Address "),o.qZA())}function dr(t,e){1&t&&(o.TgZ(0,"span"),o._uU(1,","),o._UZ(2,"br"),o.qZA())}function pr(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.YNc(2,dr,3,0,"span",42),o.qZA()),2&t){const t=e.$implicit,n=e.last;o.xp6(1),o.Oqu(t),o.xp6(1),o.Q6J("ngIf",!n)}}function hr(t,e){if(1&t&&(o.TgZ(0,"td",34),o.YNc(1,pr,3,2,"span",41),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,or,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(1),o.Q6J("ngForOf",null==t?null:t.netaddr)}}function mr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",43),o.TgZ(1,"div",44),o.TgZ(2,"mat-select",45),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",46),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 gr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",46),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onPeerDetach(e)}),o._uU(1,"Disconnect"),o.qZA()}}function fr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-option",46),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().onConnectPeer(e)}),o._uU(1,"Reconnect"),o.qZA()}}function xr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",47),o.TgZ(1,"div",48),o.TgZ(2,"mat-select",45),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",46),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",46),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,gr,2,0,"mat-option",49),o.YNc(9,fr,2,0,"mat-option",49),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.xp6(8),o.Q6J("ngIf",t.connected),o.xp6(1),o.Q6J("ngIf",!t.connected)}}function Zr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No connected peer."),o.qZA())}function yr(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting peers..."),o.qZA())}function Ar(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 Tr(t,e){if(1&t&&(o.TgZ(0,"td",50),o.YNc(1,Zr,2,0,"p",42),o.YNc(2,yr,2,0,"p",42),o.YNc(3,Ar,2,1,"p",42),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 Cr=function(t){return{"display-none":t}};function wr(t,e){if(1&t&&o._UZ(0,"tr",51),2&t){const t=o.oxw();o.Q6J("ngClass",o.VKq(1,Cr,(null==t.peers?null:t.peers.data)&&(null==t.peers||null==t.peers.data?null:t.peers.data.length)>0))}}function vr(t,e){1&t&&o._UZ(0,"tr",52)}function Sr(t,e){if(1&t&&o._UZ(0,"tr",53),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("@newlyAddedRowAnimation",t.pub_key===n.newlyAddedPeer&&n.flgAnimate?"added":"notAdded")}}const br=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},qr=function(){return["no_peer"]};let _r=(()=>{class t{constructor(t,e,n,a,s){this.logger=t,this.store=e,this.rtlEffects=n,this.actions=a,this.commonService=s,this.faUsers=g.FVb,this.newlyAddedPeer="",this.flgAnimate=!0,this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.information={},this.availableBalance=0,this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","id","netaddr","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","id","netaddr","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.FetchPeers.status===f.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.balance.totalBalance||0,this.peersData=t.peers?t.peers:[],this.peersData.length>0&&this.loadPeersTable(this.peersData),this.logger.info(t)}),this.actions.pipe((0,p.R)(this.unSubs[1]),(0,h.h)(t=>t.type===x.sX)).subscribe(t=>{this.peerAddress=null,this.flgAnimate=!0})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(t,e){this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:t.id,message:[[{key:"id",value:t.id,title:"Public Key",width:100}],[{key:"netaddr",value:t.netaddr,title:"Address",width:100}],[{key:"alias",value:t.alias,title:"Alias",width:50},{key:"connected",value:t.connected?"True":"False",title:"Connected",width:50}]]}}))}onConnectPeer(t){this.store.dispatch(new Ft.wu({data:{message:{peer:t.id?t:null,information:this.information,balance:this.availableBalance},component:tr}}))}onOpenChannel(t){this.store.dispatch(new Ft.wu({data:{alertTitle:"Open Channel",message:{peer:t,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:no}}))}onPeerDetach(t){this.store.dispatch(new Ft.b_({data:{type:f.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(t.alias?t.alias:t.id),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe((0,p.R)(this.unSubs[3])).subscribe(e=>{e&&this.store.dispatch(new x.yw({id:t.id,force:!1}))})}applyFilter(t){this.peers.filter=t.value.trim().toLowerCase()}loadPeersTable(t){this.peers=new mt.by([...t]),this.peers.sortingDataAccessor=(t,e)=>{switch(e){case"netaddr":if(t.netaddr&&t.netaddr[0]){const e=t.netaddr[0].toString().split(".");return e[0]?+e[0]:t.netaddr[0]}return"";default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},this.peers.sort=this.sort,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(Z.mQ),o.Y36(y.yh),o.Y36(Lt.V),o.Y36(A.eX),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-peers"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Peers")}])],decls:36,vars:14,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["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","30","fxFlex.gt-xs","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","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","id"],["mat-header-cell","","class","px-3","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","class","px-3",3,"ngStyle",4,"matCellDef"],["matColumnDef","netaddr"],["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"],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header","",1,"px-3"],["mat-cell","",1,"px-3",3,"ngStyle"],[4,"ngFor","ngForOf"],[4,"ngIf"],["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"],["fxFlex","100","fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],[3,"click",4,"ngIf"],["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.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,"Connected 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,er,1,0,"mat-progress-bar",13),o.TgZ(16,"table",14,15),o.ynx(18,16),o.YNc(19,nr,2,0,"th",17),o.YNc(20,lr,4,6,"td",18),o.BQk(),o.ynx(21,19),o.YNc(22,rr,2,0,"th",20),o.YNc(23,cr,2,4,"td",21),o.BQk(),o.ynx(24,22),o.YNc(25,ur,2,0,"th",17),o.YNc(26,hr,2,4,"td",18),o.BQk(),o.ynx(27,23),o.YNc(28,mr,6,0,"th",24),o.YNc(29,xr,10,2,"td",25),o.BQk(),o.ynx(30,26),o.YNc(31,Tr,4,3,"td",27),o.BQk(),o.YNc(32,wr,1,3,"tr",28),o.YNc(33,vr,1,0,"tr",29),o.YNc(34,Sr,1,1,"tr",30),o.qZA(),o.qZA(),o._UZ(35,"mat-paginator",31),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,br,""!==e.errorMessage)),o.xp6(16),o.Q6J("matFooterRowDef",o.DdM(13,qr)),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,q.lW,C.BN,M.KE,xt.Nt,D.$V,a.O5,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,a.PC,b.Zl,E.gM,a.sg,At.gD,At.$L,Ct.ey,mt.yh,mt.Q2,mt.XQ,mt.Gk],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-id[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-id[_ngcontent-%COMP%]{padding-left:2rem}.mat-column-netaddr[_ngcontent-%COMP%]{flex:1 1 25%;width:25%}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[_t.Q]}}),t})();const Fr=["queryRoutesForm"];function Lr(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Destination pubkey is required."),o.qZA())}function Ur(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Rr(t,e){1&t&&o._UZ(0,"mat-progress-bar",38)}function kr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," ID "),o.qZA())}function Nr(t,e){if(1&t&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.id," ")}}function Ir(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Alias "),o.qZA())}function Or(t,e){if(1&t&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.alias," ")}}function Mr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Channel "),o.qZA())}function Er(t,e){if(1&t&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.channel," ")}}function Jr(t,e){1&t&&(o.TgZ(0,"th",39),o._uU(1," Direction "),o.qZA())}function Dr(t,e){if(1&t&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.hij(" ",null==t?null:t.direction," ")}}function Yr(t,e){1&t&&(o.TgZ(0,"th",41),o._uU(1," Delay "),o.qZA())}function Qr(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",42),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.delay)," ")}}function Pr(t,e){1&t&&(o.TgZ(0,"th",41),o._uU(1," Amount (Sats) "),o.qZA())}function Br(t,e){if(1&t&&(o.TgZ(0,"td",40),o.TgZ(1,"span",42),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.msatoshi)/1e3)," ")}}function Hr(t,e){1&t&&(o.TgZ(0,"th",43),o._uU(1," Amount mSat "),o.qZA())}function zr(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.amount_msat," ")}}function Gr(t,e){1&t&&(o.TgZ(0,"th",45),o.TgZ(1,"span",42),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Vr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",44),o.TgZ(1,"button",46),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 Xr(t,e){1&t&&o._UZ(0,"tr",47)}function Wr(t,e){1&t&&o._UZ(0,"tr",48)}const $r=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}};let Kr=(()=>{class t{constructor(t,e,n){this.store=t,this.clEffects=e,this.commonService=n,this.destinationPubkey="",this.amount=null,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=g.FpQ,this.faExclamationTriangle=g.eHv,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","msatoshi","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","direction","msatoshi","actions"]):this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","direction","delay","msatoshi","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","channel","direction","delay","msatoshi","actions"])}ngOnInit(){this.clEffects.setQueryRoutesCL.pipe((0,p.R)(this.unSubs[1])).subscribe(t=>{this.qrHops=new mt.by([]),this.qrHops.data=[],t.routes?(this.flgLoading[0]=!1,this.qrHops=new mt.by([...t.routes]),this.qrHops.data=t.routes):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.destinationPubkey||!this.amount)return!0;this.flgLoading[0]=!0,this.store.dispatch(new x.bm({destPubkey:this.destinationPubkey,amount:1e3*this.amount}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(t,e){this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"id",value:t.id,title:"ID",width:100,type:f.Gi.STRING}],[{key:"channel",value:t.channel,title:"Channel",width:50,type:f.Gi.STRING},{key:"alias",value:t.alias,title:"Peer Alias",width:50,type:f.Gi.STRING}],[{key:"msatoshi",value:t.msatoshi,title:"mSatoshi",width:50,type:f.Gi.NUMBER},{key:"amount_msat",value:t.amount_msat,title:"Amount mSat",width:50,type:f.Gi.STRING}],[{key:"direction",value:t.direction,title:"Direction",width:50,type:f.Gi.STRING},{key:"delay",value:t.delay,title:"Delay",width:50,type:f.Gi.NUMBER}]]}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(y.yh),o.Y36(ue.s),o.Y36(T.v))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-query-routes"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(Fr,7)),2&t){let t;o.iGM(t=o.CRH())&&(e.sort=t.first),o.iGM(t=o.CRH())&&(e.form=t.first)}},decls:54,vars:16,consts:[["fxLayout","column","fxFlex","100",1,"padding-gap"],["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 Pubkey","name","destinationPubkey","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","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","channel"],["matColumnDef","direction"],["matColumnDef","delay"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","msatoshi"],["matColumnDef","amount_msat"],["mat-header-cell","","class","pl-4","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-4"],["mat-cell","",1,"pl-4"],["mat-header-cell","",1,"pl-4","pr-3"],["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.destinationPubkey=t}),o.qZA(),o.YNc(10,Lr,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,Ur,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,Rr,1,0,"mat-progress-bar",19),o.TgZ(26,"table",20,21),o.ynx(28,22),o.YNc(29,kr,2,0,"th",23),o.YNc(30,Nr,2,1,"td",24),o.BQk(),o.ynx(31,25),o.YNc(32,Ir,2,0,"th",23),o.YNc(33,Or,2,1,"td",24),o.BQk(),o.ynx(34,26),o.YNc(35,Mr,2,0,"th",23),o.YNc(36,Er,2,1,"td",24),o.BQk(),o.ynx(37,27),o.YNc(38,Jr,2,0,"th",23),o.YNc(39,Dr,2,1,"td",24),o.BQk(),o.ynx(40,28),o.YNc(41,Yr,2,0,"th",29),o.YNc(42,Qr,4,3,"td",24),o.BQk(),o.ynx(43,30),o.YNc(44,Pr,2,0,"th",29),o.YNc(45,Br,4,3,"td",24),o.BQk(),o.ynx(46,31),o.YNc(47,Hr,2,0,"th",32),o.YNc(48,zr,2,1,"td",33),o.BQk(),o.ynx(49,34),o.YNc(50,Gr,3,0,"th",35),o.YNc(51,Vr,3,0,"td",33),o.BQk(),o.YNc(52,Xr,1,0,"tr",36),o.YNc(53,Wr,1,0,"tr",37),o.qZA(),o.qZA(),o.qZA()}2&t&&(o.xp6(4),o.Q6J("icon",e.faExclamationTriangle),o.xp6(4),o.Q6J("ngModel",e.destinationPubkey),o.xp6(2),o.Q6J("ngIf",!e.destinationPubkey),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,$r,"error"===e.flgLoading[0])),o.xp6(26),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,C.BN,M.KE,xt.Nt,ft.Fj,ft.Q7,ft.JJ,ft.On,a.O5,ft.wV,ft.qQ,yt.q,q.lW,D.$V,mt.BZ,ht.YE,a.mk,b.oO,mt.w1,mt.fO,mt.Dz,mt.as,mt.nj,M.TO,r.pW,mt.ge,ht.nU,mt.ev,mt.XQ,mt.Gk],pipes:[a.JJ],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})();var jr=n(3556);function tc(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Message is required."),o.qZA())}let ec=(()=>{class t{constructor(t,e,n){this.dataService=t,this.snackBar=e,this.logger=n,this.message="",this.signedMessage="",this.signature="",this.unSubs=[new d.x,new d.x]}onSign(){if(!this.message||""===this.message)return!0;this.dataService.signMessage(this.message).pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.signedMessage=this.message,this.signature=t.zbase})}onMessageChange(){this.signedMessage!==this.message&&(this.signature="")}onCopyField(t){this.snackBar.open("Signature copied."),this.logger.info("Copied Text: "+t)}resetData(){this.message="",this.signature="",this.signedMessage=""}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(jr.D),o.Y36(ta.ux),o.Y36(Z.mQ))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-sign"]],decls:20,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["form","ngForm"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","placeholder","Message to sign","required","","tabindex","1","name","message",3,"ngModel","ngModelChange","keyup"],[4,"ngIf"],["fxLayout","row",1,"my-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3","type","submit",3,"click"],[1,"my-2",3,"inset"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",1,"bordered-box","read-only","h-4","padding-gap"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","4","rtlClipboard","","type","button",3,"payload","copied"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"textarea",4),o.NdJ("ngModelChange",function(t){return e.message=t})("keyup",function(){return e.onMessageChange()}),o.qZA(),o.YNc(5,tc,2,0,"mat-error",5),o.qZA(),o.TgZ(6,"div",6),o.TgZ(7,"button",7),o.NdJ("click",function(){return e.resetData()}),o._uU(8,"Clear Field"),o.qZA(),o.TgZ(9,"button",8),o.NdJ("click",function(){return e.onSign()}),o._uU(10,"Sign"),o.qZA(),o.qZA(),o._UZ(11,"mat-divider",9),o.TgZ(12,"div",10),o.TgZ(13,"p"),o._uU(14,"Generated Signature"),o.qZA(),o.qZA(),o.TgZ(15,"div",11),o._uU(16),o.qZA(),o.TgZ(17,"div",12),o.TgZ(18,"button",13),o.NdJ("copied",function(t){return e.onCopyField(t)}),o._uU(19,"Copy Signature"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.message),o.xp6(1),o.Q6J("ngIf",!e.message),o.xp6(6),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.signature),o.xp6(2),o.Q6J("payload",e.signature))},directives:[l.xw,l.yH,l.Wh,ft._Y,ft.JL,ft.F,M.KE,xt.Nt,ft.Fj,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,q.lW,J.d,Cs.y,M.TO],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function nc(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Message is required."),o.qZA())}function ac(t,e){1&t&&(o.TgZ(0,"mat-error"),o._uU(1,"Signature is required."),o.qZA())}function sc(t,e){1&t&&(o.TgZ(0,"p",13),o.TgZ(1,"mat-icon",14),o._uU(2,"close"),o.qZA(),o._uU(3,"Verification failed, please double check message and signature"),o.qZA())}function ic(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Pubkey Used"),o.qZA())}function oc(t,e){if(1&t&&(o.TgZ(0,"div",20),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw(2);o.xp6(2),o.Oqu(null==t.verifyRes?null:t.verifyRes.pubkey)}}function lc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",21),o.TgZ(1,"button",22),o.NdJ("copied",function(e){return o.CHM(t),o.oxw(2).onCopyField(e)}),o._uU(2,"Copy Pubkey"),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("payload",null==t.verifyRes?null:t.verifyRes.pubkey)}}function rc(t,e){if(1&t&&(o.TgZ(0,"div",15),o._UZ(1,"mat-divider",16),o.TgZ(2,"div",17),o.YNc(3,ic,2,0,"p",5),o.qZA(),o.YNc(4,oc,3,1,"div",18),o.YNc(5,lc,3,1,"div",19),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(2),o.Q6J("ngIf",t.verifyRes.verified),o.xp6(1),o.Q6J("ngIf",t.verifyRes.verified),o.xp6(1),o.Q6J("ngIf",t.verifyRes.verified)}}let cc=(()=>{class t{constructor(t,e,n){this.dataService=t,this.snackBar=e,this.logger=n,this.message="",this.verifiedMessage="",this.signature="",this.verifiedSignature="",this.showVerifyStatus=!1,this.verifyRes={pubkey:"",verified:null},this.unSubs=[new d.x,new d.x]}onVerify(){if(!this.message||""===this.message||!this.signature||""===this.signature)return!0;this.dataService.verifyMessage(this.message,this.signature).pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.verifyRes=t,this.showVerifyStatus=!0,this.verifiedMessage=this.message,this.verifiedSignature=this.signature})}onChange(){this.verifiedMessage===this.message&&this.verifiedSignature===this.signature||(this.showVerifyStatus=!1,this.verifyRes={pubkey:"",verified:null})}resetData(){this.message="",this.signature="",this.verifyRes=null,this.showVerifyStatus=!1}onCopyField(t){this.snackBar.open("Pubkey copied."),this.logger.info("Copied Text: "+t)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(jr.D),o.Y36(ta.ux),o.Y36(Z.mQ))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-verify"]],decls:17,vars:6,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","placeholder","Message to verify","required","","tabindex","1","name","message",3,"ngModel","ngModelChange","keyup"],[4,"ngIf"],["matInput","","placeholder","Signature provided","name","signature","tabindex","2","required","",3,"ngModel","ngModelChange","keyup"],["sign","ngModel"],["fxFlex","100","class","color-warn","fxLayoutAlign","start center",4,"ngIf"],["fxLayout","row",1,"my-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"color-warn"],[1,"mr-1","icon-small"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],[1,"my-2",3,"inset"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start","class","bordered-box read-only h-4 padding-gap",4,"ngIf"],["fxLayout","row","class","mt-2",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",1,"bordered-box","read-only","h-4","padding-gap"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","5","rtlClipboard","","type","button",3,"payload","copied"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"textarea",4),o.NdJ("ngModelChange",function(t){return e.message=t})("keyup",function(){return e.onChange()}),o.qZA(),o.YNc(5,nc,2,0,"mat-error",5),o.qZA(),o.TgZ(6,"mat-form-field",3),o.TgZ(7,"input",6,7),o.NdJ("ngModelChange",function(t){return e.signature=t})("keyup",function(){return e.onChange()}),o.qZA(),o.YNc(9,ac,2,0,"mat-error",5),o.qZA(),o.YNc(10,sc,4,0,"p",8),o.TgZ(11,"div",9),o.TgZ(12,"button",10),o.NdJ("click",function(){return e.resetData()}),o._uU(13,"Clear Fields"),o.qZA(),o.TgZ(14,"button",11),o.NdJ("click",function(){return e.onVerify()}),o._uU(15,"Verify"),o.qZA(),o.qZA(),o.YNc(16,rc,6,4,"div",12),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("ngModel",e.message),o.xp6(1),o.Q6J("ngIf",!e.message),o.xp6(2),o.Q6J("ngModel",e.signature),o.xp6(2),o.Q6J("ngIf",!e.signature),o.xp6(1),o.Q6J("ngIf",e.showVerifyStatus&&!e.verifyRes.verified),o.xp6(6),o.Q6J("ngIf",e.showVerifyStatus&&e.verifyRes.verified))},directives:[l.xw,l.yH,l.Wh,ft._Y,ft.JL,ft.F,M.KE,xt.Nt,ft.Fj,Zt.h,ft.Q7,ft.JJ,ft.On,a.O5,q.lW,M.TO,_.Hw,J.d,Cs.y],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function uc(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 dc(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 pc(t,e){1&t&&o._UZ(0,"mat-progress-bar",33)}function hc(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1,"Status"),o.qZA())}function mc(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.status)}}function gc(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1,"Received Time"),o.qZA())}function fc(t,e){if(1&t&&(o.TgZ(0,"td",35),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*(null==t?null:t.received_time),"dd/MMM/YYYY HH:mm"))}}function xc(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1,"Resolved Time"),o.qZA())}function Zc(t,e){if(1&t&&(o.TgZ(0,"td",35),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*(null==t?null:t.resolved_time),"dd/MMM/YYYY HH:mm"))}}function yc(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1,"In Channel"),o.qZA())}function Ac(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.in_channel_alias)}}function Tc(t,e){1&t&&(o.TgZ(0,"th",34),o._uU(1,"Out Channel"),o.qZA())}function Cc(t,e){if(1&t&&(o.TgZ(0,"td",35),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(null==t?null:t.out_channel_alias)}}function wc(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Amount In (Sats)"),o.qZA())}function vc(t,e){if(1&t&&(o.TgZ(0,"td",35),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.xi3(3,1,(null==t?null:t.in_msatoshi)/1e3,(null==t?null:t.in_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function Sc(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Amount Out (Sats)"),o.qZA())}function bc(t,e){if(1&t&&(o.TgZ(0,"td",35),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.xi3(3,1,(null==t?null:t.out_msatoshi)/1e3,(null==t?null:t.out_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function qc(t,e){1&t&&(o.TgZ(0,"th",36),o._uU(1,"Fee (mSat)"),o.qZA())}function _c(t,e){if(1&t&&(o.TgZ(0,"td",35),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.fee))}}function Fc(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 Lc(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 Uc(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No forwarding history available."),o.qZA())}function Rc(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting forwarding history..."),o.qZA())}function kc(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 Nc(t,e){if(1&t&&(o.TgZ(0,"td",44),o.YNc(1,Uc,2,0,"p",45),o.YNc(2,Rc,2,0,"p",45),o.YNc(3,kc,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.GetForwardingHistory.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.GetForwardingHistory.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.GetForwardingHistory.status)===t.apiCallStatusEnum.ERROR)}}const Ic=function(t){return{"display-none":t}};function Oc(t,e){if(1&t&&o._UZ(0,"tr",46),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Ic,(null==t.forwardingHistoryEvents?null:t.forwardingHistoryEvents.data)&&(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)>0))}}function Mc(t,e){1&t&&o._UZ(0,"tr",47)}function Ec(t,e){1&t&&o._UZ(0,"tr",48)}const Jc=function(){return["no_event"]};function Dc(t,e){if(1&t&&(o.TgZ(0,"div",10),o.YNc(1,pc,1,0,"mat-progress-bar",11),o.TgZ(2,"table",12,13),o.ynx(4,14),o.YNc(5,hc,2,0,"th",15),o.YNc(6,mc,2,1,"td",16),o.BQk(),o.ynx(7,17),o.YNc(8,gc,2,0,"th",15),o.YNc(9,fc,3,4,"td",16),o.BQk(),o.ynx(10,18),o.YNc(11,xc,2,0,"th",15),o.YNc(12,Zc,3,4,"td",16),o.BQk(),o.ynx(13,19),o.YNc(14,yc,2,0,"th",15),o.YNc(15,Ac,2,1,"td",16),o.BQk(),o.ynx(16,20),o.YNc(17,Tc,2,0,"th",15),o.YNc(18,Cc,2,1,"td",16),o.BQk(),o.ynx(19,21),o.YNc(20,wc,2,0,"th",22),o.YNc(21,vc,4,4,"td",16),o.BQk(),o.ynx(22,23),o.YNc(23,Sc,2,0,"th",22),o.YNc(24,bc,4,4,"td",16),o.BQk(),o.ynx(25,24),o.YNc(26,qc,2,0,"th",22),o.YNc(27,_c,4,3,"td",16),o.BQk(),o.ynx(28,25),o.YNc(29,Fc,6,0,"th",26),o.YNc(30,Lc,3,0,"td",27),o.BQk(),o.ynx(31,28),o.YNc(32,Nc,4,3,"td",29),o.BQk(),o.YNc(33,Oc,1,3,"tr",30),o.YNc(34,Mc,1,0,"tr",31),o.YNc(35,Ec,1,0,"tr",32),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.GetForwardingHistory.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.forwardingHistoryEvents),o.xp6(31),o.Q6J("matFooterRowDef",o.DdM(6,Jc)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)}}function Yc(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 Qc=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.datePipe=a,this.eventsData=[],this.filterValue="",this.successfulEvents=[],this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["in_msatoshi","out_msatoshi","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["received_time","in_msatoshi","out_msatoshi","fee","actions"]):(this.flgSticky=!0,this.displayedColumns=["received_time","resolved_time","in_channel","out_channel","in_msatoshi","out_msatoshi","fee","actions"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.eventsData.length<=0&&(this.errorMessage="",this.apisCallStatus=t.apisCallStatus,this.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),this.successfulEvents=t.forwardingHistory?t.forwardingHistory:[],this.successfulEvents.length>0&&this.sort&&this.paginator&&this.loadForwardingEventsTable(this.successfulEvents),this.logger.info(t))})}ngAfterViewInit(){this.successfulEvents.length>0&&this.loadForwardingEventsTable(this.successfulEvents)}ngOnChanges(t){t.eventsData&&(this.eventsData=t.eventsData.currentValue,this.successfulEvents=this.eventsData,t.eventsData.firstChange||this.loadForwardingEventsTable(this.successfulEvents)),t.filterValue&&!t.filterValue.firstChange&&this.applyFilter()}onForwardingEventClick(t,e){this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Event Information",message:[[{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:f.Gi.STRING}],[{key:"status",value:"Settled",title:"Status",width:50,type:f.Gi.STRING},{key:"fee",value:t.fee,title:"Fee (mSats)",width:50,type:f.Gi.NUMBER}],[{key:"received_time",value:t.received_time,title:"Received Time",width:50,type:f.Gi.DATE_TIME},{key:"resolved_time",value:t.resolved_time,title:"Resolved Time",width:50,type:f.Gi.DATE_TIME}],[{key:"in_channel",value:t.in_channel_alias,title:"Inbound Channel",width:50,type:f.Gi.STRING},{key:"out_channel",value:t.out_channel_alias,title:"Outbound Channel",width:50,type:f.Gi.STRING}],[{key:"in_msatoshi",value:t.in_msatoshi,title:"In (mSats)",width:50,type:f.Gi.NUMBER},{key:"out_msatoshi",value:t.out_msatoshi,title:"Out (mSats)",width:50,type:f.Gi.NUMBER}]]}}))}loadForwardingEventsTable(t){this.forwardingHistoryEvents=new mt.by([...t]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.forwardingHistoryEvents.paginator=this.paginator,this.forwardingHistoryEvents.filterPredicate=(t,e)=>((t.received_time?this.datePipe.transform(new Date(1e3*t.received_time),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(t.resolved_time?this.datePipe.transform(new Date(1e3*t.resolved_time),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(t.in_channel?t.in_channel.toLowerCase():"")+(t.out_channel?t.out_channel.toLowerCase():"")+(t.in_msatoshi?t.in_msatoshi/1e3:"")+(t.out_msatoshi?t.out_msatoshi/1e3:"")+(t.fee?t.fee:"")).includes(e),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(Z.mQ),o.Y36(T.v),o.Y36(y.yh),o.Y36(a.uU))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-forwarding-history"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.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","status"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","received_time"],["matColumnDef","resolved_time"],["matColumnDef","in_channel"],["matColumnDef","out_channel"],["matColumnDef","in_msatoshi"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","out_msatoshi"],["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-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,uc,2,1,"div",1),o.YNc(2,dc,4,1,"div",2),o.YNc(3,Dc,36,7,"div",3),o.YNc(4,Yc,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,M.KE,xt.Nt,ft.Fj,ft.JJ,ft.On,D.$V,mt.BZ,ht.YE,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,r.pW,mt.ge,ht.nU,mt.ev,At.gD,At.$L,Ct.ey,q.lW,mt.yh,mt.Q2,a.mk,b.oO,mt.XQ,mt.Gk,pt.NW],pipes:[a.uU,a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();function Pc(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 Bc(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("keyup",function(e){return o.CHM(t),o.oxw().applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA()}}function Hc(t,e){1&t&&o._UZ(0,"mat-progress-bar",29)}function zc(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1,"Status"),o.qZA())}function Gc(t,e){if(1&t&&(o.TgZ(0,"td",31),o._uU(1),o.ALo(2,"titlecase"),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,"local_failed"===(null==t?null:t.status)?"local failed":null==t?null:t.status))}}function Vc(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1,"Received Time"),o.qZA())}function Xc(t,e){if(1&t&&(o.TgZ(0,"td",31),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*(null==t?null:t.received_time),"dd/MMM/YYYY HH:mm"))}}function Wc(t,e){1&t&&(o.TgZ(0,"th",30),o._uU(1,"In Channel"),o.qZA())}function $c(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.in_channel_alias)}}function Kc(t,e){1&t&&(o.TgZ(0,"th",32),o._uU(1,"Amount In (Sats)"),o.qZA())}function jc(t,e){if(1&t&&(o.TgZ(0,"td",31),o.TgZ(1,"span",33),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(2),o.Oqu(o.xi3(3,1,(null==t?null:t.in_msatoshi)/1e3,(null==t?null:t.in_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function tu(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"th",34),o.TgZ(1,"div",35),o.TgZ(2,"mat-select",36),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",37),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 eu(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",38),o.TgZ(1,"button",39),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).onFailedEventClick(e)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function nu(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No failed transaction available."),o.qZA())}function au(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting failed transactions..."),o.qZA())}function su(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 iu(t,e){if(1&t&&(o.TgZ(0,"td",40),o.YNc(1,nu,2,0,"p",41),o.YNc(2,au,2,0,"p",41),o.YNc(3,su,2,1,"p",41),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=t.failedForwardingEvents&&t.failedForwardingEvents.data)||(null==t.failedForwardingEvents||null==t.failedForwardingEvents.data?null:t.failedForwardingEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.GetFailedForwardingHistory.status)===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.failedForwardingEvents&&t.failedForwardingEvents.data)||(null==t.failedForwardingEvents||null==t.failedForwardingEvents.data?null:t.failedForwardingEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.GetFailedForwardingHistory.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=t.failedForwardingEvents&&t.failedForwardingEvents.data)||(null==t.failedForwardingEvents||null==t.failedForwardingEvents.data?null:t.failedForwardingEvents.data.length)<1)&&(null==t.apisCallStatus?null:t.apisCallStatus.GetFailedForwardingHistory.status)===t.apiCallStatusEnum.ERROR)}}const ou=function(t){return{"display-none":t}};function lu(t,e){if(1&t&&o._UZ(0,"tr",42),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,ou,(null==t.failedForwardingEvents?null:t.failedForwardingEvents.data)&&(null==t.failedForwardingEvents||null==t.failedForwardingEvents.data?null:t.failedForwardingEvents.data.length)>0))}}function ru(t,e){1&t&&o._UZ(0,"tr",43)}function cu(t,e){1&t&&o._UZ(0,"tr",44)}const uu=function(){return["no_event"]};function du(t,e){if(1&t&&(o.TgZ(0,"div",10),o.YNc(1,Hc,1,0,"mat-progress-bar",11),o.TgZ(2,"table",12,13),o.ynx(4,14),o.YNc(5,zc,2,0,"th",15),o.YNc(6,Gc,3,3,"td",16),o.BQk(),o.ynx(7,17),o.YNc(8,Vc,2,0,"th",15),o.YNc(9,Xc,3,4,"td",16),o.BQk(),o.ynx(10,18),o.YNc(11,Wc,2,0,"th",15),o.YNc(12,$c,2,1,"td",16),o.BQk(),o.ynx(13,19),o.YNc(14,Kc,2,0,"th",20),o.YNc(15,jc,4,4,"td",16),o.BQk(),o.ynx(16,21),o.YNc(17,tu,6,0,"th",22),o.YNc(18,eu,3,0,"td",23),o.BQk(),o.ynx(19,24),o.YNc(20,iu,4,3,"td",25),o.BQk(),o.YNc(21,lu,1,3,"tr",26),o.YNc(22,ru,1,0,"tr",27),o.YNc(23,cu,1,0,"tr",28),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.GetFailedForwardingHistory.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.failedForwardingEvents),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(6,uu)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns)}}function pu(t,e){if(1&t&&o._UZ(0,"mat-paginator",45),2&t){const t=o.oxw();o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let hu=(()=>{class t{constructor(t,e,n,a,s){this.logger=t,this.commonService=e,this.store=n,this.datePipe=a,this.router=s,this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS||this.screenSize===f.cu.SM||this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["status","received_time","in_msatoshi","actions"]):(this.flgSticky=!0,this.displayedColumns=["status","received_time","in_channel","in_msatoshi","actions"])}ngOnInit(){this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.store.dispatch(new x.Is),this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,this.apisCallStatus.GetFailedForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.GetFailedForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetFailedForwardingHistory.message):this.apisCallStatus.GetFailedForwardingHistory.message),this.failedEvents=t.failedForwardingHistory?t.failedForwardingHistory:[],this.failedEvents.length>0&&this.sort&&this.paginator&&this.loadFailedEventsTable(this.failedEvents),this.logger.info(t)})}ngAfterViewInit(){this.failedEvents.length>0&&this.loadFailedEventsTable(this.failedEvents)}onFailedEventClick(t){const e=[[{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:f.Gi.STRING}],[{key:"status",value:"local_failed"===t.status?"Local Failed":this.commonService.titleCase(t.status),title:"Status",width:50,type:f.Gi.STRING},{key:"received_time",value:t.received_time,title:"Received Time",width:50,type:f.Gi.DATE_TIME}],[{key:"in_channel",value:t.in_channel_alias,title:"Inbound Channel",width:50,type:f.Gi.STRING},{key:"in_msatoshi",value:t.in_msatoshi,title:"In (mSats)",width:50,type:f.Gi.NUMBER}]];this.store.dispatch(new Ft.wu({data:{type:f.n_.INFORMATION,alertTitle:"Event Information",message:e}}))}loadFailedEventsTable(t){this.failedForwardingEvents=new mt.by([...t]),this.failedForwardingEvents.sort=this.sort,this.failedForwardingEvents.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.failedForwardingEvents.paginator=this.paginator,this.failedForwardingEvents.filterPredicate=(t,e)=>((t.status?"local_failed"===t.status?"local failed":t.status.toLowerCase():"")+(t.received_time?this.datePipe.transform(new Date(1e3*t.received_time),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(t.resolved_time?this.datePipe.transform(new Date(1e3*t.resolved_time),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(t.in_channel?t.in_channel.toLowerCase():"")+(t.out_channel?t.out_channel.toLowerCase():"")+(t.in_msatoshi?t.in_msatoshi/1e3:"")+(t.out_msatoshi?t.out_msatoshi/1e3:"")+(t.fee?t.fee:"")).includes(e),this.logger.info(this.failedForwardingEvents)}onDownloadCSV(){this.failedForwardingEvents&&this.failedForwardingEvents.data&&this.failedForwardingEvents.data.length>0&&this.commonService.downloadFile(this.failedForwardingEvents.data,"Failed-transactions")}applyFilter(t){this.failedForwardingEvents.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(Z.mQ),o.Y36(T.v),o.Y36(y.yh),o.Y36(a.uU),o.Y36(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-failed-history"]],viewQuery:function(t,e){if(1&t&&(o.Gf(ht.YE,5),o.Gf(pt.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:pt.ye,useValue:(0,f.pt)("Events")}])],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","","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","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","received_time"],["matColumnDef","in_channel"],["matColumnDef","in_msatoshi"],["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_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-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,Pc,2,1,"div",1),o.YNc(2,Bc,4,0,"div",2),o.YNc(3,du,24,7,"div",3),o.YNc(4,pu,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,M.KE,xt.Nt,D.$V,mt.BZ,ht.YE,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,r.pW,mt.ge,ht.nU,mt.ev,At.gD,At.$L,Ct.ey,q.lW,mt.yh,mt.Q2,a.mk,b.oO,mt.XQ,mt.Gk,pt.NW],pipes:[a.rS,a.uU,a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();const mu=["tableIn"],gu=["tableOut"],fu=["paginatorIn"],xu=["paginatorOut"];function Zu(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 yu(t,e){1&t&&o._UZ(0,"mat-progress-bar",37)}function Au(t,e){1&t&&(o.TgZ(0,"th",38),o._uU(1,"Channel ID"),o.qZA())}const Tu=function(t){return{"max-width":t}};function Cu(t,e){if(1&t&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,Tu,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.channel_id)}}function wu(t,e){1&t&&(o.TgZ(0,"th",38),o._uU(1,"Peer Alias"),o.qZA())}function vu(t,e){if(1&t&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,Tu,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.alias)}}function Su(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Events"),o.qZA())}function bu(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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 qu(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Amount (Sats)"),o.qZA())}function _u(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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.total_amount))}}function Fu(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Fee (Sats)"),o.qZA())}function Lu(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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.total_fee))}}function Uu(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No incoming routing peer available."),o.qZA())}function Ru(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting incoming routing peers..."),o.qZA())}function ku(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 Nu(t,e){if(1&t&&(o.TgZ(0,"td",43),o.YNc(1,Uu,2,0,"p",44),o.YNc(2,Ru,2,0,"p",44),o.YNc(3,ku,2,1,"p",44),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.GetForwardingHistory.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.GetForwardingHistory.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.GetForwardingHistory.status)===t.apiCallStatusEnum.ERROR)}}const Iu=function(t){return{"display-none":t}};function Ou(t,e){if(1&t&&o._UZ(0,"tr",45),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Iu,(null==t.RoutingPeersIncoming?null:t.RoutingPeersIncoming.data)&&(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)>0))}}function Mu(t,e){1&t&&o._UZ(0,"tr",46)}function Eu(t,e){1&t&&o._UZ(0,"tr",47)}function Ju(t,e){1&t&&o._UZ(0,"mat-progress-bar",37)}function Du(t,e){1&t&&(o.TgZ(0,"th",38),o._uU(1,"Channel ID"),o.qZA())}function Yu(t,e){if(1&t&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,Tu,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.channel_id)}}function Qu(t,e){1&t&&(o.TgZ(0,"th",38),o._uU(1,"Peer Alias"),o.qZA())}function Pu(t,e){if(1&t&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,Tu,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),o.xp6(1),o.Oqu(t.alias)}}function Bu(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Events"),o.qZA())}function Hu(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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 zu(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Amount (Sats)"),o.qZA())}function Gu(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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.total_amount))}}function Vu(t,e){1&t&&(o.TgZ(0,"th",40),o._uU(1,"Fee (Sats)"),o.qZA())}function Xu(t,e){if(1&t&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),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.total_fee))}}function Wu(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"No outgoing routing peer available."),o.qZA())}function $u(t,e){1&t&&(o.TgZ(0,"p"),o._uU(1,"Getting outgoing routing peers..."),o.qZA())}function Ku(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 ju(t,e){if(1&t&&(o.TgZ(0,"td",43),o.YNc(1,Wu,2,0,"p",44),o.YNc(2,$u,2,0,"p",44),o.YNc(3,Ku,2,1,"p",44),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.GetForwardingHistory.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.GetForwardingHistory.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.GetForwardingHistory.status)===t.apiCallStatusEnum.ERROR)}}function td(t,e){if(1&t&&o._UZ(0,"tr",45),2&t){const t=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Iu,(null==t.RoutingPeersOutgoing?null:t.RoutingPeersOutgoing.data)&&(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)>0))}}function ed(t,e){1&t&&o._UZ(0,"tr",46)}function nd(t,e){1&t&&o._UZ(0,"tr",47)}const ad=function(t,e){return{"mt-2":t,"mt-1":e}},sd=function(){return["no_incoming_event"]},id=function(t){return{"mt-2":t}},od=function(){return["no_outgoing_event"]};function ld(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,yu,1,0,"mat-progress-bar",11),o.TgZ(9,"table",12,13),o.ynx(11,14),o.YNc(12,Au,2,0,"th",15),o.YNc(13,Cu,2,4,"td",16),o.BQk(),o.ynx(14,17),o.YNc(15,wu,2,0,"th",15),o.YNc(16,vu,2,4,"td",16),o.BQk(),o.ynx(17,18),o.YNc(18,Su,2,0,"th",19),o.YNc(19,bu,4,3,"td",20),o.BQk(),o.ynx(20,21),o.YNc(21,qu,2,0,"th",19),o.YNc(22,_u,4,3,"td",20),o.BQk(),o.ynx(23,22),o.YNc(24,Fu,2,0,"th",19),o.YNc(25,Lu,4,3,"td",20),o.BQk(),o.ynx(26,23),o.YNc(27,Nu,4,3,"td",24),o.BQk(),o.YNc(28,Ou,1,3,"tr",25),o.YNc(29,Mu,1,0,"tr",26),o.YNc(30,Eu,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,31),o.NdJ("keyup",function(e){return o.CHM(t),o.oxw().applyOutgoingFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(40,"div",32),o.YNc(41,Ju,1,0,"mat-progress-bar",11),o.TgZ(42,"table",33,34),o.ynx(44,14),o.YNc(45,Du,2,0,"th",15),o.YNc(46,Yu,2,4,"td",16),o.BQk(),o.ynx(47,17),o.YNc(48,Qu,2,0,"th",15),o.YNc(49,Pu,2,4,"td",16),o.BQk(),o.ynx(50,18),o.YNc(51,Bu,2,0,"th",19),o.YNc(52,Hu,4,3,"td",20),o.BQk(),o.ynx(53,21),o.YNc(54,zu,2,0,"th",19),o.YNc(55,Gu,4,3,"td",20),o.BQk(),o.ynx(56,22),o.YNc(57,Vu,2,0,"th",19),o.YNc(58,Xu,4,3,"td",20),o.BQk(),o.ynx(59,35),o.YNc(60,ju,4,3,"td",24),o.BQk(),o.YNc(61,td,1,3,"tr",25),o.YNc(62,ed,1,0,"tr",26),o.YNc(63,nd,1,0,"tr",27),o.qZA(),o._UZ(64,"mat-paginator",28,36),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(2),o.Q6J("ngClass",o.WLB(20,ad,t.screenSize===t.screenSizeEnum.XS,t.screenSize===t.screenSizeEnum.SM)),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.GetForwardingHistory.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.RoutingPeersIncoming),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(23,sd)),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,id,t.screenSize!==t.screenSizeEnum.LG)),o.xp6(7),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.GetForwardingHistory.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.RoutingPeersOutgoing),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(26,od)),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 rd=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.eventsData=[],this.filterValue="",this.successfulEvents=[],this.displayedColumns=[],this.RoutingPeersIncoming=[],this.RoutingPeersOutgoing=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","total_fee"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","events","total_fee"]):this.screenSize===f.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","events","total_amount","total_fee"]):(this.flgSticky=!0,this.displayedColumns=["channel_id","alias","events","total_amount","total_fee"])}ngOnInit(){this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.eventsData.length<=0&&(this.errorMessage="",this.apisCallStatus=t.apisCallStatus,this.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),this.successfulEvents=t.forwardingHistory?t.forwardingHistory:[],this.successfulEvents.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.successfulEvents),this.logger.info(t))})}ngAfterViewInit(){this.successfulEvents.length>0&&this.loadRoutingPeersTable(this.successfulEvents)}ngOnChanges(t){t.eventsData&&(this.eventsData=t.eventsData.currentValue,this.successfulEvents=this.eventsData,t.eventsData.firstChange||this.loadRoutingPeersTable(this.successfulEvents))}loadRoutingPeersTable(t){if(t.length>0){const e=this.groupRoutingPeers(t);this.RoutingPeersIncoming=new mt.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 mt.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 mt.by([]),this.RoutingPeersOutgoing=new mt.by([]);this.logger.info(this.RoutingPeersIncoming),this.logger.info(this.RoutingPeersOutgoing)}groupRoutingPeers(t){const e=[],n=[];return t.forEach(t=>{const a=e.find(e=>e.channel_id===t.in_channel),s=n.find(e=>e.channel_id===t.out_channel);a?(a.events++,a.total_amount=+a.total_amount+ +t.in_msatoshi,a.total_fee=t.in_msatoshi-t.out_msatoshi+ +a.total_fee):e.push({channel_id:t.in_channel,alias:t.in_channel_alias,events:1,total_amount:t.in_msatoshi,total_fee:t.in_msatoshi-t.out_msatoshi}),s?(s.events++,s.total_amount=+s.total_amount+ +t.out_msatoshi,s.total_fee=t.in_msatoshi-t.out_msatoshi+ +s.total_fee):n.push({channel_id:t.out_channel,alias:t.out_channel_alias,events:1,total_amount:t.out_msatoshi,total_fee:t.in_msatoshi-t.out_msatoshi})}),[this.commonService.sortDescByKey(e,"total_fee"),this.commonService.sortDescByKey(n,"total_fee")]}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(Z.mQ),o.Y36(T.v),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-routing-peers"]],viewQuery:function(t,e){if(1&t&&(o.Gf(mu,5,ht.YE),o.Gf(gu,5,ht.YE),o.Gf(fu,5),o.Gf(xu,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)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[o._Bn([{provide:pt.ye,useValue:(0,f.pt)("Peers")}]),o.TTD],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["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"],["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 stretch","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channel_id"],["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","total_amount"],["matColumnDef","total_fee"],["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"],["filterOut",""],["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,Zu,2,1,"div",1),o.YNc(2,ld,66,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,b.oO,M.KE,xt.Nt,D.$V,mt.BZ,ht.YE,mt.w1,mt.fO,mt.Dz,mt.mD,mt.Ke,mt.as,mt.nj,pt.NW,r.pW,mt.ge,ht.nU,mt.ev,a.PC,b.Zl,mt.yh,mt.Q2,mt.XQ,mt.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 cd(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 ud=(()=>{class t{constructor(t){this.router=t,this.faChartBar=g.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,p.R)(this.unSubs[0]),(0,h.h)(t=>t instanceof s.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(s.F0))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,cd,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,C.BN,v.a8,v.dn,dt.BU,a.sg,s.lC,dt.Nj,s.rH],styles:[""]}),t})();var dd=n(4833),pd=n(4018),hd=n(1905);function md(t,e){1&t&&(o.TgZ(0,"div",9),o._UZ(1,"mat-progress-bar",10),o.TgZ(2,"p"),o._uU(3,"Getting fee report..."),o.qZA(),o.qZA())}function gd(t,e){if(1&t&&(o.TgZ(0,"div",11),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errorMessage)}}function fd(t,e){if(1&t&&(o.TgZ(0,"div",12),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&t){const t=o.oxw();o.Q6J("@fadeIn",t.totalFeeMsat),o.xp6(1),o.AsE("",o.xi3(2,3,t.totalFeeMsat/1e3||0,"1.0-2")," Sats/",o.lcZ(3,6,t.filteredEventsBySelectedPeriod.length||0)," Events")}}function xd(t,e){1&t&&(o.TgZ(0,"div",9),o._uU(1,"No fee report for the selected period"),o.qZA())}function Zd(t,e){if(1&t&&(o.TgZ(0,"span"),o.TgZ(1,"span",15),o._uU(2),o.ALo(3,"number"),o.qZA(),o.TgZ(4,"span",15),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 yd(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"ngx-charts-bar-vertical",13),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,Zd,7,7,"ng-template",null,14,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 Ad(t,e){if(1&t&&o._UZ(0,"rtl-cl-forwarding-history",16),2&t){const t=o.oxw();o.Q6J("eventsData",t.filteredEventsBySelectedPeriod)("filterValue",t.eventFilterValue)}}let Td=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.reportPeriod=f.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.totalFeeMsat=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=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.cu.XS||this.screenSize===f.cu.SM),this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apisCallStatus=t.apisCallStatus,t.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof t.apisCallStatus.GetForwardingHistory.message?JSON.stringify(t.apisCallStatus.GetForwardingHistory.message):t.apisCallStatus.GetForwardingHistory.message),this.events=t.forwardingHistory?t.forwardingHistory:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(t)})}ngAfterContentInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case f.cu.MD:this.screenPaddingX=t.width/10;break;case f.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.filteredEventsBySelectedPeriod=[],this.feeReportData=[],this.totalFeeMsat=null,this.events&&this.events.length>0&&(this.events.forEach(t=>{t.received_time>=n&&t.received_time<a&&this.filteredEventsBySelectedPeriod.push(t)}),this.feeReportData=this.prepareFeeReport(t))}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===f.op[1]?t.name+"/"+this.startDate.getFullYear():t.name.toString().padStart(2,"0")+"/"+f.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(t){const e=Math.round(t.getTime()/1e3),n=[];if(this.reportPeriod===f.op[1]){for(let t=0;t<12;t++)n.push({name:f.gg[t].name,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(t=>{const e=new Date(1e3*+t.received_time).getMonth();return n[e].value=n[e].value+ +t.fee/1e3,n[e].extra.totalEvents=n[e].extra.totalEvents+1,this.totalFeeMsat=(this.totalFeeMsat?this.totalFeeMsat:0)+ +t.fee,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((+t.received_time-e)/this.secondsInADay);return n[a].value=n[a].value+ +t.fee/1e3,n[a].extra.totalEvents=n[a].extra.totalEvents+1,this.totalFeeMsat=(this.totalFeeMsat?this.totalFeeMsat:0)+ +t.fee,this.filteredEventsBySelectedPeriod})}return n}onSelectionChange(t){const e=t.selDate.getMonth(),n=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===f.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?f.gg[t].days+1:f.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Z.mQ),o.Y36(T.v),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-fee-report"]],hostBindings:function(t,e){1&t&&o.NdJ("mouseup",function(t){return e.onChartMouseUp(t)})},decls:11,vars:6,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 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1 error-border",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 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","mt-1"],["mode","indeterminate"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1","error-border"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","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,md,4,0,"div",3),o.YNc(4,gd,2,1,"div",4),o.YNc(5,fd,4,8,"div",5),o.YNc(6,xd,2,0,"div",3),o.TgZ(7,"div",6),o.YNc(8,yd,3,11,"ngx-charts-bar-vertical",7),o.qZA(),o.TgZ(9,"div",6),o.YNc(10,Ad,1,2,"rtl-cl-forwarding-history",8),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.ERROR),o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.COMPLETED&&e.feeReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.COMPLETED&&(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&&e.filteredEventsBySelectedPeriod.length>0))},directives:[l.xw,l.Wh,l.yH,pd.D,a.O5,r.pW,hd.K$,Qc],pipes:[a.JJ],styles:[""],data:{animation:[dd.J]}}),t})();var Cd=n(6590);function wd(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/1e3||0,"1.0-2")," Sats/",o.lcZ(3,5,t.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function vd(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/1e3||0,"1.0-2")," Sats/",o.lcZ(3,5,t.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Sd(t,e){if(1&t&&(o.TgZ(0,"div",8),o.YNc(1,wd,4,7,"div",9),o.YNc(2,vd,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 bd(t,e){1&t&&(o.TgZ(0,"div",11),o._uU(1,"No transactions report for the selected period"),o.qZA())}function qd(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 _d(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,qd,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:4)}}function Fd(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 Ld=(()=>{class t{constructor(t,e){this.commonService=t,this.store=e,this.scrollRanges=f.op,this.reportPeriod=f.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=f.cu,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.cu.XS||this.screenSize===f.cu.SM),this.store.select("cl").pipe((0,p.R)(this.unSubs[0])).subscribe(t=>{this.payments=t.payments,this.invoices=t.invoices.invoices,this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData()})}ngAfterContentInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case f.cu.MD:this.screenPaddingX=t.width/10;break;case f.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===f.op[1]?t.series+"/"+this.startDate.getFullYear():t.series.toString().padStart(2,"0")+"/"+f.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(t,e){const n=Math.round(t.getTime()/1e3),a=Math.round(e.getTime()/1e3),s=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const i=this.payments.filter(t=>"complete"===t.status&&t.created_at>=n&&t.created_at<a),o=this.invoices.filter(t=>"paid"===t.status&&t.paid_at>=n&&t.paid_at<a);if(this.transactionsReportSummary.paymentsSelectedPeriod=i.length,this.transactionsReportSummary.invoicesSelectedPeriod=o.length,this.reportPeriod===f.op[1]){for(let e=0;e<12;e++)s.push({name:f.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}}]});i.map(t=>{const e=new Date(1e3*t.created_at).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.msatoshi_sent,s[e].series[0].value=s[e].series[0].value+t.msatoshi_sent/1e3,s[e].series[0].extra.total=s[e].series[0].extra.total+1,this.transactionsReportSummary}),o.map(t=>{const e=new Date(1e3*+t.paid_at).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.msatoshi_received,s[e].series[1].value=s[e].series[1].value+t.msatoshi_received/1e3,s[e].series[1].extra.total=s[e].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let e=0;e<this.getMonthDays(t.getMonth(),t.getFullYear());e++)s.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}}]});i.map(t=>{const e=Math.floor((+t.created_at-n)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.msatoshi_sent,s[e].series[0].value=s[e].series[0].value+t.msatoshi_sent/1e3,s[e].series[0].extra.total=s[e].series[0].extra.total+1,this.transactionsReportSummary}),o.map(t=>{const e=Math.floor((+t.paid_at-n)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.msatoshi_received,s[e].series[1].value=s[e].series[1].value+t.msatoshi_received/1e3,s[e].series[1].extra.total=s[e].series[1].extra.total+1,this.transactionsReportSummary})}return s}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===f.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?f.gg[t].days+1:f.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(T.v),o.Y36(y.yh))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rtl-cl-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,Sd,3,3,"div",3),o.YNc(4,bd,2,0,"div",4),o.TgZ(5,"div",5),o.YNc(6,_d,3,13,"ngx-charts-bar-vertical-2d",6),o.qZA(),o.TgZ(7,"div",5),o.YNc(8,Fd,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,pd.D,a.O5,hd.H5,Cd.g],pipes:[a.JJ],styles:[""],data:{animation:[dd.J]}}),t})();var Ud=n(6013),Rd=n(8016);const kd=s.Bz.forChild([{path:"",component:u,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:$n,canActivate:[Ud.lB]},{path:"onchain",component:ms,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:Ui,canActivate:[Ud.lB]},{path:"send/:selTab",component:Ri,data:{sweepAll:!1},canActivate:[Ud.lB]},{path:"sweep/:selTab",component:Ri,data:{sweepAll:!0},canActivate:[Ud.lB]}]},{path:"connections",component:xs,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:io,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Ko,canActivate:[Ud.lB]},{path:"pending",component:El,canActivate:[Ud.lB]}]},{path:"peers",component:_r,data:{sweepAll:!1},canActivate:[Ud.lB]}]},{path:"transactions",component:ys,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:vn,canActivate:[Ud.lB]},{path:"invoices",component:re,canActivate:[Ud.lB]},{path:"queryroutes",component:Kr,canActivate:[Ud.lB]}]},{path:"messages",component:_i,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:ec,canActivate:[Ud.lB]},{path:"verify",component:cc,canActivate:[Ud.lB]}]},{path:"routing",component:Ts,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Qc,canActivate:[Ud.lB]},{path:"failedtransactions",component:hu,canActivate:[Ud.lB]},{path:"routingpeers",component:rd,canActivate:[Ud.lB]}]},{path:"reports",component:ud,canActivate:[Ud.lB],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:Td,canActivate:[Ud.lB]},{path:"transactions",component:Ld,canActivate:[Ud.lB]}]},{path:"lookups",component:js,canActivate:[Ud.lB]},{path:"rates",component:bi,canActivate:[Ud.lB]},{path:"**",component:Rd.w},{path:"network",redirectTo:"rates"},{path:"wallet",redirectTo:"home"},{path:"backup",redirectTo:"home"}]}]);var Nd=n(253);let Id=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t,bootstrap:[u]}),t.\u0275inj=o.cJS({providers:[Ud.lB],imports:[[a.ez,Nd.m,kd]]}),t})()}}]);