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/5.3cc9f14aefc4012c6f28.js

1 line
313 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{Ssnv:function(e,t,n){"use strict";n.r(t),n.d(t,"CLModule",function(){return Jr});var i=n("SVse"),a=n("iInd"),o=n("JTFm"),s=n("8Y7J"),c=n("VDRc"),l=n("BTe0");function r(e,t){1&e&&s.Qb(0,"mat-progress-bar",3)}let b=(()=>{class e{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(e=>{switch(!0){case e instanceof a.e:this.loading=!0;break;case e instanceof a.c:case e instanceof a.b:case e instanceof a.d:this.loading=!1}})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-root"]],decls:4,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,t){if(1&e&&(s.Vb(0,"div",0),s.Ic(1,r,1,0,"mat-progress-bar",1),s.Qb(2,"router-outlet",null,2),s.Ub()),2&e){const e=s.wc(3);s.oc("@routeAnimation",e&&e.activatedRouteData),s.Db(1),s.oc("ngIf",t.loading)}},directives:[c.c,c.a,c.b,i.o,a.l,l.a],styles:[""],data:{animation:[o.a]}}),e})();var d=n("XNiG"),u=n("1G5W"),h=n("pLZG"),m=n("twK/"),f=n("wHSu"),p=n("7nzP"),g=n("LvnZ"),y=n("cpEJ"),x=n("tqRt"),v=n("7bNT"),U=n("7o2P"),w=n("Nv++"),V=n("40+f"),D=n("PDjf"),C=n("rJgo"),S=n("Dxy4"),L=n("Tj54"),I=n("ura0");const F=function(e){return{backgroundColor:e}};function k(e,t){if(1&e&&s.Qb(0,"span",6),2&e){const e=s.hc();s.oc("ngStyle",s.sc(1,F,"#"+e.information.color))}}function A(e,t){if(1&e&&(s.Vb(0,"div"),s.Vb(1,"h4",1),s.Kc(2,"Color"),s.Ub(),s.Vb(3,"div",2),s.Qb(4,"span",7),s.Kc(5),s.ic(6,"uppercase"),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(4),s.oc("ngStyle",s.sc(4,F,"#"+e.information.color)),s.Db(1),s.Mc(" ",s.jc(6,2,e.information.color)," ")}}function P(e,t){if(1&e&&(s.Vb(0,"span",2),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(e)}}let _=(()=>{class e{constructor(e){this.commonService=e,this.chains=[""]}ngOnChanges(){this.information&&this.information.chains&&this.information.chains.length>0&&(this.chains=[""],this.information.chains.forEach(e=>{this.chains.push(this.commonService.titleCase(e.chain)+" "+this.commonService.titleCase(e.network))}))}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[s.Bb],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Alias"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.Ic(6,k,1,3,"span",3),s.Ub(),s.Ub(),s.Ic(7,A,7,6,"div",4),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"Implementation"),s.Ub(),s.Vb(11,"div",2),s.Kc(12),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",1),s.Kc(15,"Chain"),s.Ub(),s.Ic(16,P,2,1,"span",5),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.Mc(" ",t.information.alias," "),s.Db(1),s.oc("ngIf",!t.showColorFieldSeparately),s.Db(1),s.oc("ngIf",t.showColorFieldSeparately),s.Db(5),s.Lc(t.information.lnImplementation||t.information.version?t.information.lnImplementation+" "+t.information.version:""),s.Db(4),s.oc("ngForOf",t.chains))},directives:[c.c,c.a,c.b,i.o,i.n,i.p,I.b],pipes:[i.y],styles:[""]}),e})(),T=(()=>{class e{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-balances-info"]],inputs:{balances:"balances"},decls:21,vars:11,consts:[["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"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Lightning"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Qb(7,"mat-progress-bar",3),s.Ub(),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"On-chain"),s.Ub(),s.Vb(11,"div",2),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Qb(14,"mat-progress-bar",3),s.Ub(),s.Vb(15,"div"),s.Vb(16,"h4",1),s.Kc(17,"Total"),s.Ub(),s.Vb(18,"div",2),s.Kc(19),s.ic(20,"number"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.Mc("",s.jc(6,5,t.balances.lightning)," Sats"),s.Db(2),s.pc("value",t.balances.lightning/t.balances.total*100),s.Db(5),s.Mc("",s.jc(13,7,t.balances.onchain)," Sats"),s.Db(2),s.pc("value",t.balances.onchain/t.balances.total*100),s.Db(5),s.Mc("",s.jc(20,9,t.balances.total)," Sats"))},directives:[c.c,c.a,c.b,l.a],pipes:[i.f],styles:[""]}),e})();var O=n("Q2Ze"),R=n("ZFy/"),K=n("BSbQ"),M=n("aLe/");function E(e,t){if(1&e&&(s.Vb(0,"div",17),s.Vb(1,"span",18),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-hint",19),s.Vb(6,"strong",5),s.Kc(7,"Local:"),s.Ub(),s.Kc(8),s.ic(9,"number"),s.Ub(),s.Vb(10,"mat-hint",20),s.Qb(11,"fa-icon",21),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Vb(14,"mat-hint",22),s.Vb(15,"strong",5),s.Kc(16,"Remote:"),s.Ub(),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Qb(19,"mat-progress-bar",23),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.Db(1),s.pc("matTooltip",e.alias||e.id),s.pc("matTooltipDisabled",(e.alias||e.id).length<26),s.Db(1),s.Nc("",s.lc(3,9,e.alias||e.id,0,24),"",(e.alias||e.id).length>25?"...":"",""),s.Db(6),s.Mc("",s.kc(9,13,e.msatoshi_to_us/1e3||0,"1.0-0")," Sats"),s.Db(3),s.oc("icon",n.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,16,e.balancedness||0),") "),s.Db(5),s.Mc("",s.kc(18,18,e.msatoshi_to_them/1e3||0,"1.0-0")," Sats"),s.Db(2),s.pc("value",e.msatoshi_to_us&&e.msatoshi_to_us>0?+e.msatoshi_to_us/(+e.msatoshi_to_us+ +e.msatoshi_to_them)*100:0)}}function z(e,t){if(1&e&&(s.Vb(0,"div",15),s.Ic(1,E,20,21,"div",16),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.allChannels)}}function B(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",24),s.Kc(1," No channels available. "),s.Vb(2,"button",25),s.dc("click",function(){return s.zc(e),s.hc().goToChannels()}),s.Kc(3,"Open Channel"),s.Ub(),s.Ub()}}let N=(()=>{class e{constructor(e){this.router=e,this.faBalanceScale=f.d,this.faDumbbell=f.l,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/cl/connections")}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy"},decls:26,vars:15,consts:[["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"],["noChannelBlock",""],["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"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"]],template:function(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"span",2),s.Kc(3,"Total Capacity"),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-hint",4),s.Vb(6,"strong",5),s.Kc(7,"Local:"),s.Ub(),s.Kc(8),s.ic(9,"number"),s.Ub(),s.Vb(10,"mat-hint",6),s.Qb(11,"fa-icon",7),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Vb(14,"mat-hint",8),s.Vb(15,"strong",5),s.Kc(16,"Remote:"),s.Ub(),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Qb(19,"mat-progress-bar",9),s.Ub(),s.Vb(20,"div",10),s.Qb(21,"mat-divider",11),s.Ub(),s.Vb(22,"div",12),s.Ic(23,z,2,1,"div",13),s.Ub(),s.Ub(),s.Ic(24,B,4,0,"ng-template",null,14,s.Jc)),2&e){const e=s.wc(25);s.Db(8),s.Mc("",s.kc(9,7,t.channelBalances.localBalance||0,"1.0-0")," Sats"),s.Db(3),s.oc("icon",t.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,10,(null==t.channelBalances?null:t.channelBalances.balancedness)||0),") "),s.Db(5),s.Mc("",s.kc(18,12,t.channelBalances.remoteBalance||0,"1.0-0")," Sats"),s.Db(2),s.pc("value",t.channelBalances.localBalance&&t.channelBalances.localBalance>0?+t.channelBalances.localBalance/(+t.channelBalances.localBalance+ +t.channelBalances.remoteBalance)*100:0),s.Db(4),s.oc("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",e)}},directives:[c.c,c.b,c.a,O.f,w.a,R.a,l.a,K.a,M.b,i.o,i.n,S.a],pipes:[i.f,i.w],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),e})(),Q=(()=>{class e{constructor(){this.totalFees=[{name:"Total",value:0}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-fee-info"]],inputs:{fees:"fees"},decls:14,vars:6,consts:[["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Total"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",0),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"Transactions"),s.Ub(),s.Vb(11,"div",2),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.Mc("",s.jc(6,2,(null==t.fees?null:t.fees.feeCollected)/1e3)," Sats"),s.Db(7),s.Lc(s.jc(13,4,null==t.fees?null:t.fees.totalTxCount)))},directives:[c.c,c.a,c.b],pipes:[i.f],styles:[""]}),e})(),H=(()=>{class e{constructor(){this.channelsStatus={}}ngOnChanges(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus"},features:[s.Bb],decls:41,vars:18,consts:[["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"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Active"),s.Ub(),s.Vb(4,"div",2),s.Qb(5,"span",3),s.Kc(6),s.ic(7,"number"),s.Ub(),s.Ub(),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"Pending"),s.Ub(),s.Vb(11,"div",2),s.Qb(12,"span",4),s.Kc(13),s.ic(14,"number"),s.Ub(),s.Ub(),s.Vb(15,"div"),s.Vb(16,"h4",1),s.Kc(17,"Inactive"),s.Ub(),s.Vb(18,"div",2),s.Qb(19,"span",5),s.Kc(20),s.ic(21,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(22,"div",0),s.Vb(23,"div"),s.Vb(24,"h4",1),s.Kc(25,"Capacity"),s.Ub(),s.Vb(26,"div",2),s.Kc(27),s.ic(28,"number"),s.Ub(),s.Ub(),s.Vb(29,"div"),s.Vb(30,"h4",1),s.Kc(31,"Capacity"),s.Ub(),s.Vb(32,"div",2),s.Kc(33),s.ic(34,"number"),s.Ub(),s.Ub(),s.Vb(35,"div"),s.Vb(36,"h4",1),s.Kc(37,"Capacity"),s.Ub(),s.Vb(38,"div",2),s.Kc(39),s.ic(40,"number"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(6),s.Lc(s.jc(7,6,t.channelsStatus.active.channels||0)),s.Db(7),s.Lc(s.jc(14,8,t.channelsStatus.pending.channels||0)),s.Db(7),s.Lc(s.jc(21,10,t.channelsStatus.inactive.channels||0)),s.Db(7),s.Mc("",s.jc(28,12,t.channelsStatus.active.capacity||0)," Sats"),s.Db(6),s.Mc("",s.jc(34,14,t.channelsStatus.pending.capacity||0)," Sats"),s.Db(6),s.Mc("",s.jc(40,16,t.channelsStatus.inactive.capacity||0)," Sats"))},directives:[c.c,c.a,c.b],pipes:[i.f],styles:[""]}),e})();function q(e,t){if(1&e&&(s.Vb(0,"mat-hint",17),s.Vb(1,"strong",18),s.Kc(2,"Capacity: "),s.Ub(),s.Kc(3),s.ic(4,"number"),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(3),s.Mc("",s.kc(4,1,e.msatoshi_to_them/1e3||0,"1.0-0")," Sats")}}function X(e,t){if(1&e&&(s.Vb(0,"mat-hint",17),s.Vb(1,"strong",18),s.Kc(2,"Capacity: "),s.Ub(),s.Kc(3),s.ic(4,"number"),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(3),s.Mc("",s.kc(4,1,e.msatoshi_to_us/1e3||0,"1.0-0")," Sats")}}function j(e,t){if(1&e&&s.Qb(0,"mat-progress-bar",19),2&e){const e=s.hc().$implicit,t=s.hc(2);s.pc("value",t.totalLiquidity>0?(+e.msatoshi_to_them/1e3||0)/t.totalLiquidity*100:0)}}function G(e,t){if(1&e&&s.Qb(0,"mat-progress-bar",19),2&e){const e=s.hc().$implicit,t=s.hc(2);s.pc("value",t.totalLiquidity>0?(+e.msatoshi_to_us/1e3||0)/t.totalLiquidity*100:0)}}function $(e,t){if(1&e&&(s.Vb(0,"div",12),s.Vb(1,"span",13),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Vb(4,"div",14),s.Ic(5,q,5,4,"mat-hint",15),s.Ic(6,X,5,4,"mat-hint",15),s.Ub(),s.Ic(7,j,1,1,"mat-progress-bar",16),s.Ic(8,G,1,1,"mat-progress-bar",16),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.Db(1),s.pc("matTooltip",e.alias||e.id),s.pc("matTooltipDisabled",(e.alias||e.id).length<26),s.Db(1),s.Nc("",s.lc(3,8,e.alias||e.id,0,24),"",(e.alias||e.id).length>25?"...":"",""),s.Db(3),s.oc("ngIf","In"===n.direction),s.Db(1),s.oc("ngIf","Out"===n.direction),s.Db(1),s.oc("ngIf","In"===n.direction),s.Db(1),s.oc("ngIf","Out"===n.direction)}}function W(e,t){if(1&e&&(s.Vb(0,"div",10),s.Ic(1,$,9,12,"div",11),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.allChannels)}}function J(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",22),s.dc("click",function(){return s.zc(e),s.hc(2).goToChannels()}),s.Kc(1,"Open Channel"),s.Ub()}}function Y(e,t){if(1&e&&(s.Vb(0,"div",20),s.Kc(1," No channels available. "),s.Ic(2,J,2,0,"button",21),s.Ub()),2&e){const e=s.hc();s.Db(2),s.oc("ngIf","Out"===e.direction)}}const Z=function(e,t,n){return{"mb-4":e,"mb-2":t,"mb-1":n}};let ee=(()=>{class e{constructor(e,t){this.router=e,this.commonService=t,this.screenSize="",this.screenSizeEnum=p.s}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/cl/connections")}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(a.g),s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels"},decls:14,vars:11,consts:[["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"],["noChannelBlock",""],["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"]],template:function(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"span",2),s.Kc(3,"Total Capacity"),s.Ub(),s.Vb(4,"mat-hint",3),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Qb(7,"mat-progress-bar",4),s.Ub(),s.Vb(8,"div",5),s.Qb(9,"mat-divider",6),s.Ub(),s.Vb(10,"div",7),s.Ic(11,W,2,1,"div",8),s.Ub(),s.Ub(),s.Ic(12,Y,3,1,"ng-template",null,9,s.Jc)),2&e){const e=s.wc(13);s.oc("ngClass",s.uc(7,Z,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)),s.Db(5),s.Mc("",s.kc(6,4,t.totalLiquidity,"1.0-0")," Sats"),s.Db(6),s.oc("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",e)}},directives:[c.c,c.b,c.a,i.m,I.a,O.f,l.a,K.a,M.b,i.o,i.n,R.a,S.a],pipes:[i.f,i.w],styles:[""]}),e})();var te=n("M9ds"),ne=n("5QHs"),ie=n("LUZP"),ae=n("OaSA"),oe=n("iELJ"),se=n("/uX3"),ce=n("s7LF"),le=n("e6WT"),re=n("O4ig"),be=n("B0X+"),de=n("ZTz/"),ue=n("jMqV"),he=n("UhP/");function me(e,t){if(1&e&&(s.Vb(0,"mat-option",26),s.Kc(1),s.ic(2,"titlecase"),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Lc(s.jc(2,2,e))}}function fe(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.invoiceError)}}function pe(e,t){if(1&e&&(s.Vb(0,"div",27),s.Qb(1,"fa-icon",28),s.Ic(2,fe,2,1,"span",29),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.invoiceError)}}let ge=(()=>{class e{constructor(e,t,n,i,a,o){this.dialogRef=e,this.data=t,this.store=n,this.decimalPipe=i,this.commonService=a,this.actions$=o,this.faExclamationTriangle=f.o,this.selNode={},this.description="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=p.p,this.timeUnitEnum=p.y,this.timeUnits=p.w,this.selTimeUnit=p.y.SECS,this.invoiceError="",this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.information=e.information}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.o||e.type===g.v)).subscribe(e=>{e.type===g.v&&this.dialogRef.close(),e.type===g.o&&"SaveNewInvoice"===e.payload.action&&(this.invoiceError=e.payload.message)})}onAddInvoice(e){this.invoiceError="",this.invoiceValue||(this.invoiceValue=0);let t=this.expiry?this.expiry:3600;this.selTimeUnit!==p.y.SECS&&(t=this.commonService.convertTime(this.expiry,this.selTimeUnit,p.y.SECS)),this.store.dispatch(new se.G("Adding Invoice...")),this.store.dispatch(new g.xb({label:"ulbl"+Math.random().toString(36).slice(2)+Date.now(),amount:1e3*this.invoiceValue,description:this.description,expiry:t,private:this.private}))}resetData(){this.description="",this.invoiceValue=void 0,this.private=!1,this.expiry=void 0,this.invoiceValueHint="",this.selTimeUnit=p.y.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,p.f.OTHER)+" "+e.unit}))}onTimeUnitChange(e){this.expiry&&this.selTimeUnit!==e.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,e.value)),this.selTimeUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(oe.a),s.Pb(x.h),s.Pb(i.f),s.Pb(U.a),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-create-invoices"]],decls:37,vars:18,consts:[["fxLayout","row"],["fxFlex","100",1,"padding-gap-large"],["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,"mt-5px"],["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-2"],["mat-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"]],template:function(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Create Invoice"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10),s.dc("ngModelChange",function(e){return t.description=e}),s.Ub(),s.Ub(),s.Vb(13,"div",11),s.Vb(14,"mat-form-field",12),s.Vb(15,"input",13),s.dc("ngModelChange",function(e){return t.invoiceValue=e})("keyup",function(){return t.onInvoiceValueChange()}),s.Ub(),s.Vb(16,"span",14),s.Kc(17),s.Ub(),s.Vb(18,"mat-hint"),s.Kc(19),s.Ub(),s.Ub(),s.Vb(20,"mat-form-field",15),s.Vb(21,"input",16),s.dc("ngModelChange",function(e){return t.expiry=e}),s.Ub(),s.Vb(22,"span",14),s.Kc(23),s.ic(24,"titlecase"),s.Ub(),s.Ub(),s.Vb(25,"mat-form-field",17),s.Vb(26,"mat-select",18),s.dc("selectionChange",function(e){return t.onTimeUnitChange(e)}),s.Ic(27,me,3,4,"mat-option",19),s.Ub(),s.Ub(),s.Ub(),s.Vb(28,"div",20),s.Vb(29,"mat-slide-toggle",21),s.dc("ngModelChange",function(e){return t.private=e}),s.Kc(30,"Private Routing Hints"),s.Ub(),s.Ub(),s.Ic(31,pe,3,2,"div",22),s.Vb(32,"div",23),s.Vb(33,"button",24),s.dc("click",function(){return t.resetData()}),s.Kc(34,"Clear Field"),s.Ub(),s.Vb(35,"button",25),s.dc("click",function(){s.zc(e);const n=s.wc(10);return t.onAddInvoice(n)}),s.Kc(36,"Create Invoice"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}2&e&&(s.Db(6),s.oc("mat-dialog-close",!1),s.Db(6),s.oc("ngModel",t.description),s.Db(3),s.oc("ngModel",t.invoiceValue)("step",100)("min",1),s.Db(2),s.Mc(" ",null==t.information?null:t.information.smaller_currency_unit," "),s.Db(2),s.Lc(t.invoiceValueHint),s.Db(2),s.oc("ngModel",t.expiry)("step",t.selTimeUnit===t.timeUnitEnum.SECS?300:t.selTimeUnit===t.timeUnitEnum.MINS?10:t.selTimeUnit===t.timeUnitEnum.HOURS?2:1)("min",1),s.Db(2),s.Mc(" ",s.jc(24,16,t.selTimeUnit)," "),s.Db(3),s.oc("value",t.selTimeUnit),s.Db(1),s.oc("ngForOf",t.timeUnits),s.Db(2),s.oc("ngModel",t.private)("matTooltipPosition","above"),s.Db(2),s.oc("ngIf",""!==t.invoiceError))},directives:[c.c,c.a,D.c,c.b,S.a,oe.d,D.b,ce.u,ce.n,ce.o,O.c,le.b,ce.c,re.a,ce.m,ce.p,ce.q,be.a,O.g,O.f,de.a,i.n,ue.a,R.a,i.o,he.m,w.a],pipes:[i.x],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();var ye=n("4r19"),xe=n("mNcL"),ve=n("X9mX");function Ue(e,t){if(1&e){const e=s.Wb();s.Vb(0,"form",4,5),s.Vb(2,"mat-form-field",6),s.Vb(3,"input",7),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().description=t}),s.Ub(),s.Ub(),s.Vb(4,"mat-form-field",8),s.Vb(5,"input",9),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().invoiceValue=t})("keyup",function(){return s.zc(e),s.hc().onInvoiceValueChange()}),s.Ub(),s.Vb(6,"span",10),s.Kc(7),s.Ub(),s.Vb(8,"mat-hint"),s.Kc(9),s.Ub(),s.Ub(),s.Vb(10,"div",11),s.Vb(11,"button",12),s.dc("click",function(){return s.zc(e),s.hc().resetData()}),s.Kc(12,"Clear Field"),s.Ub(),s.Vb(13,"button",13),s.dc("click",function(){s.zc(e);const t=s.wc(1);return s.hc().onAddInvoice(t)}),s.Kc(14,"Create Invoice"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("ngModel",e.description),s.Db(2),s.oc("ngModel",e.invoiceValue)("step",100)("min",1),s.Db(2),s.Mc(" ",null==e.information?null:e.information.smaller_currency_unit," "),s.Db(2),s.Lc(e.invoiceValueHint)}}function we(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",14),s.Vb(1,"button",15),s.dc("click",function(){return s.zc(e),s.hc().onDeleteExpiredInvoices()}),s.Kc(2,"Delete Expired"),s.Ub(),s.Vb(3,"button",16),s.dc("click",function(){return s.zc(e),s.hc().openCreateInvoiceModal()}),s.Kc(4,"Create Invoice"),s.Ub(),s.Ub()}}function Ve(e,t){1&e&&s.Qb(0,"mat-progress-bar",45)}function De(e,t){1&e&&(s.Vb(0,"th",46),s.Kc(1," Expiry Date "),s.Ub())}const Ce=function(e){return{"mr-0":e}};function Se(e,t){if(1&e&&s.Qb(0,"span",50),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Ce,e.screenSize===e.screenSizeEnum.XS))}}function Le(e,t){if(1&e&&s.Qb(0,"span",51),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Ce,e.screenSize===e.screenSizeEnum.XS))}}function Ie(e,t){if(1&e&&(s.Vb(0,"td",47),s.Ic(1,Se,1,3,"span",48),s.Ic(2,Le,1,3,"span",49),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf","paid"===e.status),s.Db(1),s.oc("ngIf","paid"!==e.status),s.Db(1),s.Mc(" ",e.expires_at_str," ")}}function Fe(e,t){1&e&&(s.Vb(0,"th",46),s.Kc(1," Date Settled "),s.Ub())}function ke(e,t){if(1&e&&(s.Vb(0,"td",47),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(e.paid_at_str||"-")}}function Ae(e,t){1&e&&(s.Vb(0,"th",46),s.Kc(1," Description "),s.Ub())}const Pe=function(e){return{"max-width":e}};function _e(e,t){if(1&e&&(s.Vb(0,"td",47),s.Vb(1,"div",52),s.Vb(2,"span",53),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(2,Pe,n.screenSize===n.screenSizeEnum.XS?"10rem":"32rem")),s.Db(2),s.Lc(e.description)}}function Te(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1," Amount (Sats) "),s.Ub())}function Oe(e,t){if(1&e&&(s.Vb(0,"td",47),s.Vb(1,"span",55),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,e.msatoshi/1e3,e.msatoshi<1e3?"1.0-4":"1.0-0"),"")}}function Re(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1," Amount Settled (Sats) "),s.Ub())}function Ke(e,t){if(1&e&&(s.Vb(0,"td",47),s.Vb(1,"span",55),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,e.msatoshi_received/1e3,e.msatoshi_received<1e3?"1.0-4":"1.0-0"),"")}}function Me(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",56),s.Vb(1,"div",57),s.Vb(2,"mat-select",58),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",59),s.dc("click",function(){return s.zc(e),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}const Ee=function(e){return{"px-3":e}};function ze(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",60),s.Vb(1,"button",61),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc(2).onInvoiceClick(i,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}if(2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,Ee,e.screenSize!==e.screenSizeEnum.XS))}}function Be(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No invoices available."),s.Ub())}function Ne(e,t){if(1&e&&(s.Vb(0,"td",62),s.Ic(1,Be,2,0,"p",63),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)}}const Qe=function(e){return{"display-none":e}};function He(e,t){if(1&e&&s.Qb(0,"tr",64),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,Qe,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function qe(e,t){1&e&&s.Qb(0,"tr",65)}function Xe(e,t){if(1&e&&s.Qb(0,"tr",66),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.label==n.newlyAddedInvoiceMemo&&e.value==n.newlyAddedInvoiceValue&&n.flgAnimate?"added":"notAdded")}}const je=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Ge=function(){return["no_invoice"]};function $e(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",17),s.Vb(1,"div",18),s.Vb(2,"div",19),s.Qb(3,"fa-icon",20),s.Vb(4,"span",21),s.Kc(5,"Invoices History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",22),s.Vb(7,"input",23),s.dc("keyup",function(t){return s.zc(e),s.hc().applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",24),s.Ic(9,Ve,1,0,"mat-progress-bar",25),s.Vb(10,"table",26,27),s.Tb(12,28),s.Ic(13,De,2,0,"th",29),s.Ic(14,Ie,4,3,"td",30),s.Sb(),s.Tb(15,31),s.Ic(16,Fe,2,0,"th",29),s.Ic(17,ke,2,1,"td",30),s.Sb(),s.Tb(18,32),s.Ic(19,Ae,2,0,"th",29),s.Ic(20,_e,4,4,"td",30),s.Sb(),s.Tb(21,33),s.Ic(22,Te,2,0,"th",34),s.Ic(23,Oe,4,4,"td",30),s.Sb(),s.Tb(24,35),s.Ic(25,Re,2,0,"th",34),s.Ic(26,Ke,4,4,"td",30),s.Sb(),s.Tb(27,36),s.Ic(28,Me,6,0,"th",37),s.Ic(29,ze,3,3,"td",38),s.Sb(),s.Tb(30,39),s.Ic(31,Ne,2,1,"td",40),s.Sb(),s.Ic(32,He,1,3,"tr",41),s.Ic(33,qe,1,0,"tr",42),s.Ic(34,Xe,1,1,"tr",43),s.Ub(),s.Ub(),s.Qb(35,"mat-paginator",44),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("icon",e.faHistory),s.Db(6),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.invoices)("ngClass",s.sc(11,je,"error"===e.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,Ge)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let We=(()=>{class e{constructor(e,t,n,i,a){this.logger=e,this.store=t,this.decimalPipe=n,this.commonService=i,this.rtlEffects=a,this.calledFrom="transactions",this.faHistory=f.r,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.flgLoading=[!0],this.flgSticky=!1,this.private=!1,this.expiryStep=100,this.totalInvoices=100,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["expires_at","msatoshi","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["expires_at","description","msatoshi","actions"]):this.screenSize===p.s.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.dispatch(new g.F({num_max_invoices:100,index_offset:0,reversed:!1})),this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchInvoices"===e.action&&(this.flgLoading[0]="error")}),this.selNode=e.nodeSettings,this.information=e.information,this.totalInvoices=e.totalInvoices,this.logger.info(e),this.invoiceJSONArr=e.invoices.invoices&&e.invoices.invoices.length>0?e.invoices.invoices:[],this.invoices=new ae.o(this.invoiceJSONArr?[...this.invoiceJSONArr]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.invoices.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.invoices.paginator=this.paginator,setTimeout(()=>{this.flgAnimate=!1},5e3),this.logger.info(this.invoices),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.invoices)})}openCreateInvoiceModal(){this.store.dispatch(new se.D({data:{pageSize:this.pageSize,component:ge}}))}onAddInvoice(e){this.invoiceValue||(this.invoiceValue=0);let t=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 se.G("Adding Invoice...")),this.store.dispatch(new g.xb({label:this.newlyAddedInvoiceMemo,amount:1e3*this.invoiceValue,description:this.description,expiry:t,private:this.private})),this.resetData()}onDeleteExpiredInvoices(){this.store.dispatch(new se.E({data:{type:"CONFIRM",titleMessage:"Delete Expired Invoices",noBtnText:"Cancel",yesBtnText:"Delete Invoices"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{e&&(this.store.dispatch(new se.G("Deleting Invoices...")),this.store.dispatch(new g.m))})}onInvoiceClick(e,t){this.store.dispatch(new se.D({data:{invoice:{msatoshi:e.msatoshi,label:e.label,expires_at_str:e.expires_at_str,paid_at_str:e.paid_at_str,bolt11:e.bolt11,payment_hash:e.payment_hash,description:e.description,status:e.status,msatoshi_received:e.msatoshi_received},newlyAdded:!1,component:ye.a}}))}resetData(){this.description="",this.invoiceValue=void 0,this.private=!1,this.expiry=void 0,this.invoiceValueHint=""}applyFilter(e){this.invoices.filter=e.value.trim().toLowerCase()}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,p.f.OTHER)+" "+e.unit}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(i.f),s.Pb(U.a),s.Pb(ve.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-lightning-invoices"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},inputs:{calledFrom:"calledFrom"},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("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","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",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-4",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"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,Ue,15,6,"form",1),s.Ic(2,we,5,0,"div",2),s.Ic(3,$e,36,14,"div",3),s.Ub()),2&e&&(s.Db(1),s.oc("ngIf","home"===t.calledFrom),s.Db(1),s.oc("ngIf","transactions"===t.calledFrom),s.Db(1),s.oc("ngIf","transactions"===t.calledFrom))},directives:[c.c,c.a,c.b,i.o,ce.u,ce.n,ce.o,O.c,le.b,ce.c,ce.m,ce.p,ce.q,be.a,O.g,O.f,S.a,w.a,M.b,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ne.a,l.a,ae.h,ie.b,ae.a,R.a,i.p,I.b,de.a,de.c,he.m,ae.d,ae.f,ae.j,ae.l],pipes:[i.f],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:[xe.a]}}),e})();var Je=n("IzEk"),Ye=n("W7oF"),Ze=n("zQhy");const et=["paymentReq"];function tt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-radio-group",17),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().paymentType=t})("change",function(){return s.zc(e),s.hc().onPaymentTypeChange()}),s.Vb(1,"mat-radio-button",18),s.Kc(2,"Invoice Payment"),s.Ub(),s.Vb(3,"mat-radio-button",19),s.Kc(4,"Keysend Payment"),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.oc("ngModel",e.paymentType)}}function nt(e,t){1&e&&s.Rb(0)}function it(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.paymentError)}}function at(e,t){if(1&e&&(s.Vb(0,"div",20),s.Qb(1,"fa-icon",21),s.Ic(2,it,2,1,"span",22),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.paymentError)}}function ot(e,t){if(1&e&&(s.Vb(0,"mat-hint"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.paymentDecodedHint)}}function st(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function ct(e,t){if(1&e&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.paymentDecodedHint)}}function lt(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment amount is required."),s.Ub())}function rt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",23),s.Vb(1,"input",27,28),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).paymentAmount=t})("change",function(t){return s.zc(e),s.hc(2).onAmountChange(t)}),s.Ub(),s.Vb(3,"mat-hint"),s.Kc(4,"It is a zero amount invoice, enter amount to be paid."),s.Ub(),s.Ic(5,lt,2,0,"mat-error",22),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.oc("ngModel",e.paymentAmount),s.Db(4),s.oc("ngIf",!e.paymentAmount)}}function bt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",23),s.Vb(1,"textarea",24,25),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().onPaymentRequestEntry(t)})("matTextareaAutosize",function(){return!0}),s.Ub(),s.Ic(3,ot,2,1,"mat-hint",22),s.Ic(4,st,2,0,"mat-error",22),s.Ic(5,ct,2,1,"mat-error",22),s.Ub(),s.Ic(6,rt,6,2,"mat-form-field",26)}if(2&e){const e=s.wc(2),t=s.hc();s.Db(1),s.oc("ngModel",t.paymentRequest),s.Db(2),s.oc("ngIf",t.paymentRequest&&""!==t.paymentDecodedHint),s.Db(1),s.oc("ngIf",!t.paymentRequest),s.Db(1),s.oc("ngIf",null==e.errors?null:e.errors.decodeError),s.Db(1),s.oc("ngIf",t.zeroAmtInvoice)}}function dt(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Pubkey is required."),s.Ub())}function ut(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Keysend amount is required."),s.Ub())}function ht(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",23),s.Vb(1,"input",29),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().pubkey=t}),s.Ub(),s.Ic(2,dt,2,0,"mat-error",22),s.Ub(),s.Vb(3,"mat-form-field",23),s.Vb(4,"input",30,31),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().keysendAmount=t}),s.Ub(),s.Ic(6,ut,2,0,"mat-error",22),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("ngModel",e.pubkey),s.Db(1),s.oc("ngIf",!e.pubkey),s.Db(2),s.oc("ngModel",e.keysendAmount),s.Db(2),s.oc("ngIf",!e.keysendAmount)}}let mt=(()=>{class e{constructor(e,t,n,i,a,o,s,c){this.dialogRef=e,this.store=t,this.clEffects=n,this.logger=i,this.commonService=a,this.decimalPipe=o,this.actions$=s,this.rtlEffects=c,this.faExclamationTriangle=f.o,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=p.i[0],this.feeLimitTypes=p.i,this.paymentError="",this.isCompatibleVersion=!1,this.unSubs=[new d.a,new d.a,new d.a,new d.a]}set payReq(e){e&&(this.paymentReq=e)}ngOnInit(){this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.activeChannels=e.allChannels.filter(e=>"CHANNELD_NORMAL"===e.state&&e.connected),this.isCompatibleVersion=this.commonService.isVersionCompatible(e.information.version,"0.9.0")&&this.commonService.isVersionCompatible(e.information.api_version,"0.4.0"),this.logger.info(e)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.o||e.type===g.cb)).subscribe(e=>{e.type===g.cb&&this.dialogRef.close(),e.type===g.o&&("SendPayment"===e.payload.action&&(delete this.paymentDecoded.msatoshi,this.paymentError=e.payload.message),"DecodePayment"===e.payload.action&&(this.paymentDecodedHint="ERROR: "+e.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_str?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.store.dispatch(new se.G("Decoding Payment...")),this.store.dispatch(new g.l({routeParam:this.paymentRequest,fromDialog:!0})),this.clEffects.setDecodedPaymentCL.pipe(Object(Je.a)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.created_at_str&&!this.paymentDecoded.msatoshi?(this.paymentDecoded.msatoshi=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(e=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description}))}))}keysendPayment(){this.store.dispatch(new se.G("Sending Keysend Payment...")),this.store.dispatch(new g.zb({pubkey:this.pubkey,amount:1e3*this.keysendAmount,fromDialog:!0}))}sendPayment(){this.store.dispatch(new se.G("Sending Payment...")),this.store.dispatch(new g.zb(this.zeroAmtInvoice?{invoice:this.paymentRequest,amount:1e3*this.paymentAmount,fromDialog:!0}:{invoice:this.paymentRequest,fromDialog:!0}))}onPaymentRequestEntry(e){this.paymentRequest=e,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 se.G("Decoding Payment...")),this.store.dispatch(new g.l({routeParam:this.paymentRequest,fromDialog:!0})),this.clEffects.setDecodedPaymentCL.subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.created_at_str&&!this.paymentDecoded.msatoshi?(this.paymentDecoded.msatoshi=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[3])).subscribe(e=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description}))}))}onAmountChange(e){delete this.paymentDecoded.msatoshi,this.paymentDecoded.msatoshi=e}onPaymentTypeChange(){this.paymentError=""}resetData(){"keysend"===this.paymentType?(this.pubkey="",this.keysendAmount=null):(this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=p.i[0],this.paymentReq.control.setErrors(null),this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentAmount=null),this.paymentError=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(x.h),s.Pb(Ye.a),s.Pb(y.b),s.Pb(U.a),s.Pb(i.f),s.Pb(v.a),s.Pb(ve.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-lightning-send-payments"]],viewQuery:function(e,t){if(1&e&&s.Pc(et,!0),2&e){let e;s.vc(e=s.ec())&&(t.payReq=e.first)}},decls:23,vars:4,consts:[["fxLayout","row"],["fxFlex","100",1,"padding-gap-large"],["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,"mt-5px"],["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"],["fxFlex","100"],["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(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Send Payment"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Ic(9,tt,5,1,"mat-radio-group",7),s.Vb(10,"form",8,9),s.Ic(12,nt,1,0,"ng-container",10),s.Ic(13,at,3,2,"div",11),s.Vb(14,"div",12),s.Vb(15,"button",13),s.dc("click",function(){return t.resetData()}),s.Kc(16,"Clear Fields"),s.Ub(),s.Vb(17,"button",14),s.dc("click",function(){return t.onSendPayment()}),s.Kc(18,"Send Payment"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(19,bt,7,5,"ng-template",null,15,s.Jc),s.Ic(21,ht,7,4,"ng-template",null,16,s.Jc)),2&e){const e=s.wc(20),n=s.wc(22);s.Db(6),s.oc("mat-dialog-close",!1),s.Db(3),s.oc("ngIf",t.isCompatibleVersion),s.Db(3),s.oc("ngTemplateOutlet","keysend"===t.paymentType?n:e),s.Db(1),s.oc("ngIf",""!==t.paymentError)}},directives:[c.c,c.a,D.c,c.b,S.a,oe.d,D.b,i.o,ce.u,ce.n,ce.o,i.t,Ze.b,ce.m,ce.p,Ze.a,w.a,O.c,le.b,ce.c,le.d,re.a,ce.s,O.f,O.b],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}"]}),e})();const ft=["sendPaymentForm"];function pt(e,t){if(1&e&&(s.Vb(0,"mat-hint"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.paymentDecodedHint)}}function gt(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function yt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"form",4,5),s.Vb(2,"mat-form-field",6),s.Vb(3,"textarea",7,8),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().onPaymentRequestEntry(t)})("matTextareaAutosize",function(){return!0}),s.Ub(),s.Ic(5,pt,2,1,"mat-hint",9),s.Ic(6,gt,2,0,"mat-error",9),s.Ub(),s.Vb(7,"div",10),s.Vb(8,"button",11),s.dc("click",function(){return s.zc(e),s.hc().resetData()}),s.Kc(9,"Clear Field"),s.Ub(),s.Vb(10,"button",12),s.dc("click",function(){return s.zc(e),s.hc().onSendPayment()}),s.Kc(11,"Send Payment"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("ngModel",e.paymentRequest),s.Db(2),s.oc("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),s.Db(1),s.oc("ngIf",!e.paymentRequest)}}function xt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",13),s.Vb(1,"button",12),s.dc("click",function(){return s.zc(e),s.hc().openSendPaymentModal()}),s.Kc(2,"Send Payment"),s.Ub(),s.Ub()}}function vt(e,t){1&e&&s.Qb(0,"mat-progress-bar",47)}function Ut(e,t){1&e&&(s.Vb(0,"th",48),s.Kc(1,"Created At"),s.Ub())}const wt=function(e){return{"mr-0":e}};function Vt(e,t){if(1&e&&s.Qb(0,"span",52),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Dt(e,t){if(1&e&&s.Qb(0,"span",53),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Ct(e,t){if(1&e&&(s.Vb(0,"td",49),s.Ic(1,Vt,1,3,"span",50),s.Ic(2,Dt,1,3,"span",51),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf","complete"===e.status),s.Db(1),s.oc("ngIf","complete"!==e.status),s.Db(1),s.Mc(" ",null==e?null:e.created_at_str," ")}}function St(e,t){1&e&&(s.Vb(0,"th",48),s.Kc(1,"Payment Hash"),s.Ub())}function Lt(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"div"),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(null==e?null:e.payment_hash)}}function It(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1,"Sats Sent"),s.Ub())}function Ft(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",55),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.msatoshi_sent)/1e3,(null==e?null:e.msatoshi_sent)<1e3?"1.0-4":"1.0-0"))}}function kt(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1,"Sats Received"),s.Ub())}function At(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",55),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.msatoshi)/1e3,(null==e?null:e.msatoshi)<1e3?"1.0-4":"1.0-0"))}}function Pt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",56),s.Vb(1,"div",57),s.Vb(2,"mat-select",58),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",59),s.dc("click",function(){return s.zc(e),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function _t(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",60),s.Vb(1,"button",61),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc(2).onPaymentClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Tt(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No payments available."),s.Ub())}function Ot(e,t){if(1&e&&(s.Vb(0,"td",62),s.Ic(1,Tt,2,0,"p",9),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)}}function Rt(e,t){if(1&e&&s.Qb(0,"span",66),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Kt(e,t){if(1&e&&s.Qb(0,"span",67),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Mt(e,t){if(1&e&&s.Qb(0,"span",66),2&e){const e=s.hc(5);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Et(e,t){if(1&e&&s.Qb(0,"span",67),2&e){const e=s.hc(5);s.oc("ngClass",s.sc(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function zt(e,t){if(1&e&&(s.Vb(0,"span",69),s.Ic(1,Mt,1,3,"span",64),s.Ic(2,Et,1,3,"span",65),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf","complete"===e.status),s.Db(1),s.oc("ngIf","complete"!==e.status),s.Db(1),s.Mc(" ",e.created_at_str," ")}}function Bt(e,t){if(1&e&&(s.Tb(0),s.Ic(1,zt,4,3,"span",68),s.Sb()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.mpps)}}function Nt(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",63),s.Ic(2,Rt,1,3,"span",64),s.Ic(3,Kt,1,3,"span",65),s.Kc(4),s.Ub(),s.Ic(5,Bt,2,1,"ng-container",9),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.oc("ngIf","complete"===e.status),s.Db(1),s.oc("ngIf","complete"!==e.status),s.Db(1),s.Mc(" Total Attempts: ",null==e?null:e.total_parts," "),s.Db(1),s.oc("ngIf",e.is_expanded)}}function Qt(e,t){if(1&e&&(s.Vb(0,"span",63),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" Part ID ",e.partid?e.partid:0," ")}}function Ht(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Qt,2,1,"span",70),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.mpps)}}function qt(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",63),s.Kc(2),s.Ub(),s.Ic(3,Ht,2,1,"span",9),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(null==e?null:e.payment_hash),s.Db(1),s.oc("ngIf",e.is_expanded)}}function Xt(e,t){if(1&e&&(s.Vb(0,"span",71),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,e.msatoshi_sent/1e3,e.msatoshi_sent<1e3?"1.0-4":"1.0-0")," ")}}function jt(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Xt,3,4,"span",72),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.mpps)}}function Gt(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",71),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ic(4,jt,2,1,"span",9),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,2,(null==e?null:e.msatoshi_sent)/1e3,(null==e?null:e.msatoshi_sent)<1e3?"1.0-4":"1.0-0")),s.Db(2),s.oc("ngIf",e.is_expanded)}}function $t(e,t){if(1&e&&(s.Vb(0,"span",71),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,e.msatoshi/1e3,e.msatoshi<1e3?"1.0-4":"1.0-0")," ")}}function Wt(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,$t,3,4,"span",72),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.mpps)}}function Jt(e,t){if(1&e&&(s.Vb(0,"td",49),s.Vb(1,"span",71),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ic(4,Wt,2,1,"span",9),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,2,(null==e?null:e.msatoshi)/1e3,(null==e?null:e.msatoshi)<1e3?"1.0-4":"1.0-0")),s.Db(2),s.oc("ngIf",e.is_expanded)}}function Yt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",55),s.Vb(1,"button",76),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc(4).onPaymentClick(n)}),s.Kc(2),s.Ub(),s.Ub()}if(2&e){const e=t.$implicit;s.Db(2),s.Mc("View ",e.partid?e.partid:0,"")}}function Zt(e,t){if(1&e&&(s.Vb(0,"div"),s.Ic(1,Yt,3,1,"div",75),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.mpps)}}function en(e,t){if(1&e&&(s.Vb(0,"td",73),s.Vb(1,"span",55),s.Vb(2,"button",74),s.dc("click",function(){const e=t.$implicit;return e.is_expanded=!e.is_expanded}),s.Kc(3),s.Ub(),s.Ub(),s.Ic(4,Zt,2,1,"div",9),s.Ub()),2&e){const e=t.$implicit;s.Db(3),s.Lc(e.is_expanded?"Hide":"Show"),s.Db(1),s.oc("ngIf",e.is_expanded)}}function tn(e,t){if(1&e&&s.Qb(0,"tr",77),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const nn=function(e){return{"display-none":e}};function an(e,t){if(1&e&&s.Qb(0,"tr",78),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,nn,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function on(e,t){1&e&&s.Qb(0,"tr",79)}function sn(e,t){if(1&e&&s.Qb(0,"tr",77),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const cn=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},ln=function(){return["no_payment"]};function rn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",14),s.Vb(1,"div",15),s.Vb(2,"div",16),s.Qb(3,"fa-icon",17),s.Vb(4,"span",18),s.Kc(5,"Payments History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",19),s.Vb(7,"input",20),s.dc("keyup",function(t){return s.zc(e),s.hc().applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",21),s.Ic(9,vt,1,0,"mat-progress-bar",22),s.Vb(10,"table",23,24),s.Tb(12,25),s.Ic(13,Ut,2,0,"th",26),s.Ic(14,Ct,4,3,"td",27),s.Sb(),s.Tb(15,28),s.Ic(16,St,2,0,"th",26),s.Ic(17,Lt,3,1,"td",27),s.Sb(),s.Tb(18,29),s.Ic(19,It,2,0,"th",30),s.Ic(20,Ft,4,4,"td",27),s.Sb(),s.Tb(21,31),s.Ic(22,kt,2,0,"th",30),s.Ic(23,At,4,4,"td",27),s.Sb(),s.Tb(24,32),s.Ic(25,Pt,6,0,"th",33),s.Ic(26,_t,3,0,"td",34),s.Sb(),s.Tb(27,35),s.Ic(28,Ot,2,1,"td",36),s.Sb(),s.Tb(29,37),s.Ic(30,Nt,6,4,"td",27),s.Sb(),s.Tb(31,38),s.Ic(32,qt,4,2,"td",27),s.Sb(),s.Tb(33,39),s.Ic(34,Gt,5,5,"td",27),s.Sb(),s.Tb(35,40),s.Ic(36,Jt,5,5,"td",27),s.Sb(),s.Tb(37,41),s.Ic(38,en,5,2,"td",42),s.Sb(),s.Ic(39,tn,1,1,"tr",43),s.Ic(40,an,1,3,"tr",44),s.Ic(41,on,1,0,"tr",45),s.Ic(42,sn,1,1,"tr",43),s.Ub(),s.Ub(),s.Qb(43,"mat-paginator",46),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("icon",e.faHistory),s.Db(6),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.payments)("ngClass",s.sc(14,cn,"error"===e.flgLoading[0])),s.Db(29),s.oc("matRowDefColumns",e.mppColumns)("matRowDefWhen",e.is_group),s.Db(1),s.oc("matFooterRowDef",s.rc(16,ln)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)("matRowDefWhen",!e.is_group),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let bn=(()=>{class e{constructor(e,t,n,i,a,o,s){this.logger=e,this.commonService=t,this.store=n,this.rtlEffects=i,this.clEffects=a,this.decimalPipe=o,this.titleCasePipe=s,this.calledFrom="transactions",this.faHistory=f.r,this.newlyAddedPayment="",this.flgAnimate=!0,this.selNode={},this.flgLoading=[!0],this.information={},this.paymentJSONArr=[],this.displayedColumns=[],this.mppColumns=[],this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["created_at","actions"],this.mppColumns=["groupTotal","groupAction"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["created_at","msatoshi","actions"],this.mppColumns=["groupTotal","groupAmtRecv","groupAction"]):this.screenSize===p.s.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(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchPayments"===e.action&&(this.flgLoading[0]="error")}),this.information=e.information,this.selNode=e.nodeSettings,this.paymentJSONArr=e.payments&&e.payments.length>0?e.payments:[],this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr),setTimeout(()=>{this.flgAnimate=!1},3e3),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.paymentJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}is_group(e,t){return t.is_group}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.created_at_str?this.sendPayment():(this.store.dispatch(new se.G("Decoding Payment...")),this.store.dispatch(new g.l({routeParam:this.paymentRequest,fromDialog:!1})),this.clEffects.setDecodedPaymentCL.pipe(Object(Je.a)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.created_at_str?(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 se.E({data:{type:p.b.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_str",value:this.paymentDecoded.created_at_str,title:"Creation Date",width:50},{key:"num_satoshis",value:this.paymentDecoded.msatoshi/1e3,title:"Amount (Sats)",width:50,type:p.h.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:p.h.NUMBER},{key:"min_finaltv_expiry",value:this.paymentDecoded.min_final_cltv_expiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe(Object(Je.a)(1)).subscribe(e=>{e&&(this.store.dispatch(new se.G("Sending Payment...")),this.store.dispatch(new g.zb({invoice:this.paymentRequest,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new se.E({data:{type:p.b.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_str",value:this.paymentDecoded.created_at_str,title:"Creation Date",width:40},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:p.h.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:p.h.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe(Object(Je.a)(1)).subscribe(e=>{e&&(this.paymentDecoded.msatoshi=e[0].inputValue,this.store.dispatch(new se.G("Sending Payment...")),this.store.dispatch(new g.zb({invoice:this.paymentRequest,amount:1e3*e[0].inputValue,fromDialog:!1})),this.resetData())}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&(this.store.dispatch(new se.G("Decoding Payment...")),this.store.dispatch(new g.l({routeParam:this.paymentRequest,fromDialog:!1})),this.clEffects.setDecodedPaymentCL.subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.msatoshi?this.commonService.convertCurrency(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.msatoshi?this.paymentDecoded.msatoshi/1e3:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"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 se.D({data:{component:mt}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}onPaymentClick(e){const t=[[{key:"bolt11",value:e.bolt11,title:"Bolt 11",width:100,type:p.h.STRING}],[{key:"payment_preimage",value:e.payment_preimage,title:"Payment Preimage",width:100,type:p.h.STRING}],[{key:"id",value:e.id,title:"ID",width:20,type:p.h.STRING},{key:"destination",value:e.destination,title:"Destination",width:80,type:p.h.STRING}],[{key:"created_at_str",value:e.created_at_str,title:"Creation Date",width:50,type:p.h.DATE_TIME},{key:"status",value:this.titleCasePipe.transform(e.status),title:"Status",width:50,type:p.h.STRING}],[{key:"msatoshi",value:e.msatoshi,title:"Amount (mSats)",width:50,type:p.h.NUMBER},{key:"msatoshi_sent",value:e.msatoshi_sent,title:"Amount Sent (mSats)",width:50,type:p.h.NUMBER}]];e.memo&&""!==e.memo&&t.splice(2,0,[{key:"memo",value:e.memo,title:"Memo",width:100,type:p.h.STRING}]),e.hasOwnProperty("partid")?t.unshift([{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:80,type:p.h.STRING},{key:"partid",value:e.partid,title:"Part ID",width:20,type:p.h.STRING}]):t.unshift([{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:100,type:p.h.STRING}]),this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Payment Information",message:t}}))}applyFilter(e){this.payments.filter=e.value.trim().toLowerCase()}loadPaymentsTable(e){this.payments=new ae.o(e?[...e]:[]),this.payments.data=this.paymentJSONArr,this.payments.sort=this.sort,this.payments.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.payments.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.payments.paginator=this.paginator}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){let e=JSON.parse(JSON.stringify(this.payments.data)).reduce((e,t)=>t.mpps?e.concat(t.mpps):(delete t.is_group,delete t.is_expanded,delete t.total_parts,e.concat(t)),[]);this.commonService.downloadFile(e,"Payments")}}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h),s.Pb(ve.a),s.Pb(Ye.a),s.Pb(i.f),s.Pb(i.x))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-lightning-payments"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ft,!0),s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first),s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},inputs:{calledFrom:"calledFrom"},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("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","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",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-4",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(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,yt,12,3,"form",1),s.Ic(2,xt,3,0,"div",2),s.Ic(3,rn,44,17,"div",3),s.Ub()),2&e&&(s.Db(1),s.oc("ngIf","home"===t.calledFrom),s.Db(1),s.oc("ngIf","transactions"===t.calledFrom),s.Db(1),s.oc("ngIf","transactions"===t.calledFrom))},directives:[c.c,c.a,c.b,i.o,ce.u,ce.n,ce.o,O.c,le.b,ce.c,le.d,ce.s,M.b,ce.m,ce.p,S.a,O.f,O.b,w.a,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.m,ae.g,ae.k,ne.a,l.a,ae.h,ie.b,ae.a,R.a,de.a,de.c,he.m,ae.d,i.n,ae.l,ae.f,ae.j],pipes:[i.f],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:[xe.a]}}),e})();function dn(e,t){if(1&e&&(s.Vb(0,"button",25),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub()),2&e){s.hc();const e=s.wc(11);s.oc("matMenuTriggerFor",e)}}function un(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",15),s.dc("click",function(){return s.zc(e),s.hc(3).onNavigateTo("/cl/reports")}),s.Kc(1,"Fees Summary"),s.Ub()}}function hn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",15),s.dc("click",function(){return s.zc(e),s.hc(3).onsortChannelsBy()}),s.Kc(1),s.Ub()}if(2&e){const e=s.hc(3);s.Db(1),s.Mc("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}const mn=function(e){return{"error-border":e}};function fn(e,t){if(1&e&&s.Qb(0,"rtl-cl-node-info",26),2&e){const e=s.hc(3);s.oc("information",e.information)("showColorFieldSeparately",!1)("ngClass",s.sc(3,mn,"error"===e.flgLoading[0]))}}function pn(e,t){if(1&e&&s.Qb(0,"rtl-cl-balances-info",27),2&e){const e=s.hc(3);s.oc("balances",e.balances)("ngClass",s.sc(2,mn,"error"===e.flgLoading[2]))}}function gn(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-capacity-info",28),2&e){const e=s.hc(3);s.oc("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("ngClass",s.sc(4,mn,"error"===e.flgLoading[5]))}}function yn(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-info",29),2&e){const e=s.hc(3);s.oc("fees",e.fees)("ngClass",s.sc(2,mn,"error"===e.flgLoading[1]))}}function xn(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-status-info",30),2&e){const e=s.hc(3);s.oc("channelsStatus",e.channelsStatus)("ngClass",s.sc(2,mn,"error"===e.flgLoading[0]))}}function vn(e,t){1&e&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}function Un(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-grid-tile",8),s.Vb(1,"mat-card",9),s.Vb(2,"mat-card-header"),s.Vb(3,"mat-card-title",10),s.Vb(4,"div"),s.Qb(5,"fa-icon",11),s.Vb(6,"span"),s.Kc(7),s.Ub(),s.Ub(),s.Vb(8,"div"),s.Ic(9,dn,3,1,"button",12),s.Vb(10,"mat-menu",13,14),s.Vb(12,"button",15),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc(2).onNavigateTo(n.link)}),s.Kc(13),s.Ub(),s.Ic(14,un,2,0,"button",16),s.Ic(15,hn,2,1,"button",16),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(16,"mat-card-content",17),s.Vb(17,"div",18),s.Ic(18,fn,1,5,"rtl-cl-node-info",19),s.Ic(19,pn,1,4,"rtl-cl-balances-info",20),s.Ic(20,gn,1,6,"rtl-cl-channel-capacity-info",21),s.Ic(21,yn,1,4,"rtl-cl-fee-info",22),s.Ic(22,xn,1,4,"rtl-cl-channel-status-info",23),s.Ic(23,vn,2,0,"h3",24),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=t.$implicit;s.oc("colspan",e.cols)("rowspan",e.rows),s.Db(5),s.oc("icon",e.icon),s.Db(2),s.Lc(e.title),s.Db(2),s.oc("ngIf",e.link),s.Db(4),s.Mc("Go To ",e.goTo,""),s.Db(1),s.oc("ngIf","fee"===e.id),s.Db(1),s.oc("ngIf","capacity"===e.id),s.Db(1),s.pc("fxFlex","capacity"===e.id?90:70),s.Db(1),s.oc("ngSwitch",e.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","balance"),s.Db(1),s.oc("ngSwitchCase","capacity"),s.Db(1),s.oc("ngSwitchCase","fee"),s.Db(1),s.oc("ngSwitchCase","status")}}function wn(e,t){if(1&e&&(s.Vb(0,"div",2),s.Vb(1,"div",3),s.Qb(2,"fa-icon",4),s.Vb(3,"span",5),s.Kc(4),s.Ub(),s.Ub(),s.Vb(5,"mat-grid-list",6),s.Ic(6,Un,24,15,"mat-grid-tile",7),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(2),s.oc("icon",e.flgLoading[0]?e.faFrown:e.faSmile),s.Db(2),s.Lc(e.flgLoading[0]?"Error! Please check the server connection.":"Welcome "+e.information.alias+"! Your node is up and running."),s.Db(1),s.oc("rowHeight",e.operatorCardHeight),s.Db(1),s.oc("ngForOf",e.operatorCards)}}function Vn(e,t){if(1&e&&(s.Vb(0,"button",25),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub()),2&e){s.hc();const e=s.wc(9);s.oc("matMenuTriggerFor",e)}}function Dn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-card-header"),s.Vb(1,"mat-card-title",10),s.Vb(2,"div"),s.Qb(3,"fa-icon",11),s.Vb(4,"span"),s.Kc(5),s.Ub(),s.Ub(),s.Vb(6,"div"),s.Ic(7,Vn,3,1,"button",12),s.Vb(8,"mat-menu",13,39),s.Vb(10,"button",15),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc(2).onNavigateTo(t.link)}),s.Kc(11),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc().$implicit;s.Db(3),s.oc("icon",e.icon),s.Db(2),s.Lc(e.title),s.Db(2),s.oc("ngIf",e.link),s.Db(4),s.Mc("Go To ",e.goTo,"")}}function Cn(e,t){if(1&e&&s.Qb(0,"rtl-cl-node-info",40),2&e){const e=s.hc(3);s.oc("information",e.information)("ngClass",s.sc(2,mn,"error"===e.flgLoading[0]))}}function Sn(e,t){if(1&e&&s.Qb(0,"rtl-cl-balances-info",27),2&e){const e=s.hc(3);s.oc("balances",e.balances)("ngClass",s.sc(2,mn,"error"===e.flgLoading[2]))}}function Ln(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-liquidity-info",41),2&e){const e=s.hc(3);s.oc("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("ngClass",s.sc(4,mn,"error"===e.flgLoading[5]))}}function In(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-liquidity-info",41),2&e){const e=s.hc(3);s.oc("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("ngClass",s.sc(4,mn,"error"===e.flgLoading[5]))}}function Fn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",50),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub(),s.Vb(3,"mat-menu",13,51),s.Vb(5,"button",15),s.dc("click",function(){s.zc(e);const t=s.hc(2).$implicit;return s.hc(2).onNavigateTo(t.link)}),s.Kc(6),s.Ub(),s.Vb(7,"button",15),s.dc("click",function(){return s.zc(e),s.hc(4).onNavigateTo("/cl/reports/transactions")}),s.Kc(8,"Transactions Summary"),s.Ub(),s.Ub()}if(2&e){const e=s.wc(4),t=s.hc(2).$implicit;s.oc("matMenuTriggerFor",e),s.Db(6),s.Mc("Go To ",t.goTo,"")}}function kn(e,t){1&e&&(s.Vb(0,"span",42),s.Vb(1,"mat-tab-group",43),s.Vb(2,"mat-tab",44),s.Qb(3,"rtl-cl-lightning-invoices",45),s.Ub(),s.Vb(4,"mat-tab",46),s.Qb(5,"rtl-cl-lightning-payments",47),s.Ub(),s.Vb(6,"mat-tab",48),s.Ic(7,Fn,9,2,"ng-template",49),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("calledFrom","home"),s.Db(2),s.oc("calledFrom","home"),s.Db(1),s.oc("disabled",!0))}function An(e,t){1&e&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}const Pn=function(e){return{"p-0":e}};function _n(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",8),s.Vb(1,"mat-card",33),s.Ic(2,Dn,12,4,"mat-card-header",34),s.Vb(3,"mat-card-content",35),s.Vb(4,"div",18),s.Ic(5,Cn,1,4,"rtl-cl-node-info",36),s.Ic(6,Sn,1,4,"rtl-cl-balances-info",20),s.Ic(7,Ln,1,6,"rtl-cl-channel-liquidity-info",37),s.Ic(8,In,1,6,"rtl-cl-channel-liquidity-info",37),s.Ic(9,kn,8,3,"span",38),s.Ic(10,An,2,0,"h3",24),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.oc("colspan",e.cols)("rowspan",e.rows),s.Db(1),s.oc("ngClass",s.sc(11,Pn,"transactions"===e.id)),s.Db(1),s.oc("ngIf","transactions"!==e.id),s.Db(1),s.pc("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),s.Db(1),s.oc("ngSwitch",e.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","balance"),s.Db(1),s.oc("ngSwitchCase","inboundLiq"),s.Db(1),s.oc("ngSwitchCase","outboundLiq"),s.Db(1),s.oc("ngSwitchCase","transactions")}}function Tn(e,t){if(1&e&&(s.Vb(0,"div",31),s.Qb(1,"fa-icon",4),s.Vb(2,"span",5),s.Kc(3),s.Ub(),s.Ub(),s.Vb(4,"mat-grid-list",32),s.Ic(5,_n,11,13,"mat-grid-tile",7),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faSmile),s.Db(2),s.Mc("Welcome ",e.information.alias,"! Your node is up and running."),s.Db(1),s.oc("rowHeight",e.merchantCardHeight),s.Db(1),s.oc("ngForOf",e.merchantCards)}}let On=(()=>{class e{constructor(e,t,n,i,a){this.logger=e,this.store=t,this.actions$=n,this.commonService=i,this.router=a,this.faSmile=m.b,this.faFrown=m.a,this.faAngleDoubleDown=f.a,this.faAngleDoubleUp=f.b,this.faChartPie=f.g,this.faBolt=f.e,this.faServer=f.K,this.faNetworkWired=f.B,this.flgChildInfoUpdated=!1,this.userPersonaEnum=p.z,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.feeRatesPerKB={},this.feeRatesPerKW={},this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.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===p.s.SM||this.screenSize===p.s.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(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],e.effectErrors.forEach(e=>{"FetchInfo"===e.action&&(this.flgLoading[0]="error"),"FetchFees"===e.action&&(this.flgLoading[1]="error"),"FetchBalance"===e.action&&(this.flgLoading[2]="error"),"FetchLocalRemoteBalance"===e.action&&(this.flgLoading[3]="error"),"FetchFeeRates"===e.action&&(this.flgLoading[4]="error"),"FetchChannels"===e.action&&(this.flgLoading[5]="error")}),this.selNode=e.nodeSettings,this.information=e.information,"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.information.id),this.fees=e.fees,"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!this.fees.feeCollected),this.totalBalance=e.balance,this.balances.onchain=e.balance.totalBalance,this.balances.lightning=e.localRemoteBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances),"error"!==this.flgLoading[2]&&(this.flgLoading[2]=""===this.totalBalance);let t=e.localRemoteBalance.localBalance?+e.localRemoteBalance.localBalance:0,n=e.localRemoteBalance.remoteBalance?+e.localRemoteBalance.remoteBalance:0;this.channelBalances={localBalance:t,remoteBalance:n,balancedness:+(1-Math.abs((t-n)/(t+n))).toFixed(3)},"error"!==this.flgLoading[3]&&(this.flgLoading[3]=!e.localRemoteBalance.localBalance),this.feeRatesPerKB=e.feeRatesPerKB,this.feeRatesPerKW=e.feeRatesPerKW,"error"!==this.flgLoading[4]&&(this.flgLoading[4]=!this.feeRatesPerKB||!this.feeRatesPerKW),this.channelsStatus={active:{channels:e.information.num_active_channels,capacity:e.localRemoteBalance.localBalance},pending:{channels:e.information.num_pending_channels,capacity:0|e.localRemoteBalance.pendingBalance},inactive:{channels:e.information.num_inactive_channels,capacity:0|e.localRemoteBalance.inactiveBalance}},this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannels=e.allChannels.filter(e=>"CHANNELD_NORMAL"===e.state&&e.connected),this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(e=>e.msatoshi_to_them>0),"msatoshi_to_them"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(e=>e.msatoshi_to_us>0),"msatoshi_to_us"))),this.allChannels.forEach(e=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(e.msatoshi_to_them/1e3),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(e.msatoshi_to_us/1e3)}),"error"!==this.flgLoading[5]&&(this.flgLoading[5]=!this.allChannels||!this.allChannels.length),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.feeCollected>=0,this.logger.info(e)}),this.actions$.pipe(Object(u.a)(this.unSubs[2]),Object(h.a)(e=>e.type===g.s||e.type===g.jb)).subscribe(e=>{e.type===g.s&&(this.flgChildInfoUpdated=!1),e.type===g.jb&&(this.flgChildInfoUpdated=!0)})}onNavigateTo(e){this.router.navigateByUrl(e)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.allChannels.sort(function(e,t){const n=+e.msatoshi_to_us+ +e.msatoshi_to_them,i=+t.msatoshi_to_them+ +t.msatoshi_to_them;return n>i?-1:n<i?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(v.a),s.Pb(U.a),s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,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",1,"dashboard-card-content",3,"fxFlex"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"balances","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"fees","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass"],["fxFlex","100",3,"balances","ngClass"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","ngClass"],["fxFlex","100",3,"fees","ngClass"],["fxFlex","100",3,"channelsStatus","ngClass"],["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",1,"dashboard-card-content",3,"fxFlex"],["fxFlex","100",3,"information","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information","ngClass"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass"],["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(e,t){if(1&e&&(s.Ic(0,wn,7,4,"div",0),s.Ic(1,Tn,6,4,"ng-template",null,1,s.Jc)),2&e){const e=s.wc(2);s.oc("ngIf",t.selNode.userPersona===t.userPersonaEnum.OPERATOR)("ngIfElse",e)}},directives:[i.o,c.c,c.b,w.a,V.a,i.n,V.c,D.a,c.a,D.c,D.f,C.a,C.b,D.b,i.q,i.r,i.s,S.a,C.d,L.a,_,i.m,I.a,T,N,Q,H,ee,te.b,te.a,We,bn,te.c],styles:[""]}),e})();var Rn=n("itXk"),Kn=n("Cyaj"),Mn=n("zHaW"),En=n("pMoy"),zn=n("o4Yh"),Bn=n("hzfI");const Nn=["form"],Qn=["formSweepAll"],Hn=["stepper"];function qn(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Bitcoin address is required."),s.Ub())}function Xn(e,t){1&e&&(s.Vb(0,"mat-hint"),s.Kc(1,"Amount replaced by UTXO balance"),s.Ub())}function jn(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Gn(e,t){if(1&e&&(s.Vb(0,"mat-option",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Lc(e)}}function $n(e,t){if(1&e&&(s.Vb(0,"mat-option",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.feeRateId),s.Db(1),s.Mc(" ",e.feeRateType," ")}}function Wn(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Min Confirmation Blocks is required."),s.Ub())}function Jn(e,t){if(1&e&&(s.Vb(0,"mat-option",36),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc("",s.jc(2,2,e.value)," Sats")}}function Yn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",37),s.Vb(1,"mat-expansion-panel",38),s.dc("closed",function(){return s.zc(e),s.hc(2).onAdvancedPanelToggle(!0)})("opened",function(){return s.zc(e),s.hc(2).onAdvancedPanelToggle(!1)}),s.Vb(2,"mat-expansion-panel-header"),s.Vb(3,"mat-panel-title"),s.Vb(4,"span"),s.Kc(5),s.Ub(),s.Ub(),s.Ub(),s.Vb(6,"div",31),s.Vb(7,"div",39),s.Vb(8,"mat-form-field",40),s.Vb(9,"mat-select",41),s.dc("selectionChange",function(t){return s.zc(e),s.hc(2).onUTXOSelectionChange(t)})("valueChange",function(t){return s.zc(e),s.hc(2).selUTXOs=t}),s.Vb(10,"mat-select-trigger"),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ic(13,Jn,3,4,"mat-option",21),s.Ub(),s.Ub(),s.Vb(14,"mat-slide-toggle",42),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).flgUseAllBalance=t})("change",function(){return s.zc(e),s.hc(2).onUTXOAllBalanceChange()}),s.Kc(15," Use selected UTXOs balance "),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc(2);s.Db(5),s.Lc(e.advancedTitle),s.Db(4),s.oc("value",e.selUTXOs),s.Db(2),s.Nc("",s.jc(12,7,e.totalSelectedUTXOAmount)," Sats (",e.selUTXOs.length>1?e.selUTXOs.length+" UTXOs":"1 UTXO",")"),s.Db(2),s.oc("ngForOf",e.utxos),s.Db(1),s.oc("ngModel",e.flgUseAllBalance)("disabled",e.selUTXOs.length<1)}}function Zn(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&e){const e=s.hc(3);s.Db(1),s.Lc(e.sendFundError)}}function ei(e,t){if(1&e&&(s.Vb(0,"div",43),s.Qb(1,"fa-icon",44),s.Ic(2,Zn,2,1,"span",14),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.sendFundError)}}function ti(e,t){if(1&e){const e=s.Wb();s.Vb(0,"form",9,10),s.dc("submit",function(){return s.zc(e),s.hc().onSendFunds()})("reset",function(){return s.zc(e),s.hc().resetData()}),s.Vb(2,"mat-form-field",11),s.Vb(3,"input",12,13),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().transaction.address=t}),s.Ub(),s.Ic(5,qn,2,0,"mat-error",14),s.Ub(),s.Vb(6,"mat-form-field",15),s.Vb(7,"input",16,17),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().transaction.satoshis=t}),s.Ub(),s.Ic(9,Xn,2,0,"mat-hint",14),s.Vb(10,"span",18),s.Kc(11),s.Ub(),s.Ic(12,jn,2,0,"mat-error",14),s.Ub(),s.Vb(13,"mat-form-field",19),s.Vb(14,"mat-select",20),s.dc("selectionChange",function(t){return s.zc(e),s.hc().onAmountUnitChange(t)}),s.Ic(15,Gn,2,2,"mat-option",21),s.Ub(),s.Ub(),s.Vb(16,"div",22),s.Vb(17,"mat-form-field",23),s.Vb(18,"mat-select",24),s.dc("valueChange",function(t){return s.zc(e),s.hc().transaction.feeRate=t}),s.Ic(19,$n,2,2,"mat-option",21),s.Ub(),s.Ub(),s.Vb(20,"div",25),s.Vb(21,"mat-checkbox",26),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().flgMinConf=t})("change",function(){s.zc(e);const t=s.hc();return t.flgMinConf?t.transaction.feeRate=null:t.transaction.minconf=null}),s.Ub(),s.Vb(22,"mat-form-field",27),s.Vb(23,"input",28,29),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().transaction.minconf=t}),s.Ub(),s.Ic(25,Wn,2,0,"mat-error",14),s.Ub(),s.Ub(),s.Ub(),s.Ic(26,Yn,16,9,"div",30),s.Qb(27,"div",31),s.Ic(28,ei,3,2,"div",32),s.Vb(29,"div",33),s.Vb(30,"button",34),s.Kc(31,"Clear Fields"),s.Ub(),s.Vb(32,"button",35),s.Kc(33,"Send Funds"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("ngModel",e.transaction.address),s.Db(2),s.oc("ngIf",!e.transaction.address),s.Db(2),s.oc("ngModel",e.transaction.satoshis)("type",e.flgUseAllBalance?"text":"number")("step",100)("min",0)("disabled",e.flgUseAllBalance),s.Db(2),s.oc("ngIf",e.flgUseAllBalance),s.Db(2),s.Mc(" ",e.selAmountUnit," "),s.Db(1),s.oc("ngIf",!e.transaction.satoshis),s.Db(2),s.oc("value",e.selAmountUnit)("disabled",e.flgUseAllBalance),s.Db(1),s.oc("ngForOf",e.amountUnits),s.Db(3),s.oc("value",e.transaction.feeRate)("disabled",e.flgMinConf),s.Db(1),s.oc("ngForOf",e.feeRateTypes),s.Db(2),s.oc("ngModel",e.flgMinConf),s.Db(2),s.oc("ngModel",e.transaction.minconf)("step",1)("min",0)("required",e.flgMinConf)("disabled",!e.flgMinConf),s.Db(2),s.oc("ngIf",e.flgMinConf&&!e.transaction.minconf),s.Db(1),s.oc("ngIf",e.isCompatibleVersion),s.Db(2),s.oc("ngIf",""!==e.sendFundError)}}function ni(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(3);s.Lc(e.passwordFormLabel)}}function ii(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Password is required."),s.Ub())}function ai(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-step",49),s.Vb(1,"form",70),s.Ic(2,ni,1,1,"ng-template",64),s.Vb(3,"div",0),s.Vb(4,"mat-form-field",52),s.Qb(5,"input",71),s.Ic(6,ii,2,0,"mat-error",14),s.Ub(),s.Ub(),s.Vb(7,"div",72),s.Vb(8,"button",73),s.dc("click",function(){return s.zc(e),s.hc(2).onAuthenticate()}),s.Kc(9,"Confirm"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc(2);s.oc("stepControl",e.passwordFormGroup)("editable",e.flgEditable),s.Db(1),s.oc("formGroup",e.passwordFormGroup),s.Db(5),s.oc("ngIf",null==e.passwordFormGroup.controls.password.errors?null:e.passwordFormGroup.controls.password.errors.required)}}function oi(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(2);s.Lc(e.sendFundFormLabel)}}function si(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Bitcoin address is required."),s.Ub())}function ci(e,t){if(1&e&&(s.Vb(0,"mat-option",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.feeRateId),s.Db(1),s.Mc(" ",e.feeRateType," ")}}function li(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Fees Rate is required."),s.Ub())}function ri(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Min confirmation blocks is required."),s.Ub())}function bi(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(2);s.Lc(e.confirmFormLabel)}}function di(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&e){const e=s.hc(3);s.Db(1),s.Lc(e.sendFundError)}}function ui(e,t){if(1&e&&(s.Vb(0,"div",43),s.Qb(1,"fa-icon",44),s.Ic(2,di,2,1,"span",14),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.sendFundError)}}function hi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",45),s.Vb(1,"mat-vertical-stepper",46,47),s.dc("selectionChange",function(t){return s.zc(e),s.hc().stepSelectionChanged(t)}),s.Ic(3,ai,10,4,"mat-step",48),s.Vb(4,"mat-step",49),s.Vb(5,"form",50),s.Ic(6,oi,1,1,"ng-template",51),s.Vb(7,"div",31),s.Vb(8,"mat-form-field",52),s.Qb(9,"input",53),s.Ic(10,si,2,0,"mat-error",14),s.Ub(),s.Vb(11,"div",54),s.Vb(12,"mat-form-field",55),s.Vb(13,"mat-select",56),s.Ic(14,ci,2,2,"mat-option",21),s.Ub(),s.Ic(15,li,2,0,"mat-error",14),s.Ub(),s.Vb(16,"div",57),s.Qb(17,"mat-checkbox",58),s.Vb(18,"mat-form-field",27),s.Qb(19,"input",59),s.Ic(20,ri,2,0,"mat-error",14),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(21,"div",60),s.Vb(22,"button",61),s.Kc(23,"Next"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(24,"mat-step",62),s.Vb(25,"form",63),s.Ic(26,bi,1,1,"ng-template",64),s.Vb(27,"div",45),s.Vb(28,"div",65),s.Qb(29,"fa-icon",66),s.Vb(30,"span"),s.Kc(31,"You are about to sweep all funds from RTL. Are you sure?"),s.Ub(),s.Ub(),s.Ic(32,ui,3,2,"div",32),s.Vb(33,"div",60),s.Vb(34,"button",67),s.dc("click",function(){return s.zc(e),s.hc().onSendFunds()}),s.Kc(35,"Sweep All Funds"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(36,"div",68),s.Vb(37,"button",69),s.Kc(38),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("linear",!0),s.Db(2),s.oc("ngIf",!e.appConfig.sso.rtlSSO),s.Db(1),s.oc("stepControl",e.sendFundFormGroup)("editable",e.flgEditable),s.Db(1),s.oc("formGroup",e.sendFundFormGroup),s.Db(5),s.oc("ngIf",null==e.sendFundFormGroup.controls.transactionAddress.errors?null:e.sendFundFormGroup.controls.transactionAddress.errors.required),s.Db(4),s.oc("ngForOf",e.feeRateTypes),s.Db(1),s.oc("ngIf",null==e.sendFundFormGroup.controls.transactionFeeRate.errors?null:e.sendFundFormGroup.controls.transactionFeeRate.errors.required),s.Db(4),s.oc("step",1)("min",0),s.Db(1),s.oc("ngIf",null==e.sendFundFormGroup.controls.transactionBlocks.errors?null:e.sendFundFormGroup.controls.transactionBlocks.errors.required),s.Db(4),s.oc("stepControl",e.confirmFormGroup),s.Db(1),s.oc("formGroup",e.confirmFormGroup),s.Db(4),s.oc("icon",e.faExclamationTriangle),s.Db(3),s.oc("ngIf",""!==e.sendFundError),s.Db(5),s.oc("mat-dialog-close",!1),s.Db(1),s.Lc(e.flgValidated?"Close":"Cancel")}}let mi=(()=>{class e{constructor(e,t,n,i,a,o,s,c,l,r){this.dialogRef=e,this.data=t,this.logger=n,this.store=i,this.commonService=a,this.decimalPipe=o,this.actions$=s,this.formBuilder=c,this.rtlEffects=l,this.snackBar=r,this.faExclamationTriangle=f.o,this.sweepAll=!1,this.selNode={},this.addressTypes=[],this.utxos=[],this.selUTXOs=[],this.flgUseAllBalance=!1,this.totalSelectedUTXOAmount=null,this.flgLoadingWallet=!0,this.selectedAddress=p.a[1],this.blockchainBalance={},this.information={},this.isCompatibleVersion=!1,this.newAddress="",this.transaction={},this.feeRateTypes=p.j,this.flgMinConf=!1,this.sendFundError="",this.fiatConversion=!1,this.amountUnits=p.e,this.selAmountUnit=p.e[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=p.f,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.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[ce.t.required]],password:["",[ce.t.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",ce.t.required],transactionFeeRate:[null],flgMinConf:[!1],transactionBlocks:[{value:null,disabled:!0}]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.flgMinConf.valueChanges.pipe(Object(u.a)(this.unSubs[4])).subscribe(e=>{e?(this.sendFundFormGroup.controls.transactionBlocks.enable(),this.sendFundFormGroup.controls.transactionBlocks.setValidators([ce.t.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))}),Object(Rn.b)(this.store.select("root"),this.store.select("cl")).pipe(Object(u.a)(this.unSubs[0])).subscribe(([e,t])=>{this.fiatConversion=e.selNode.settings.fiatConversion,this.amountUnits=e.selNode.settings.currencyUnits,this.appConfig=e.appConfig,this.nodeData=e.nodeData,this.information=t.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(t.utxos.filter(e=>"confirmed"===e.status),"value"),this.logger.info(e),this.logger.info(t)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.o||e.type===g.gb)).subscribe(e=>{e.type===g.gb&&(this.store.dispatch(new se.F("Fund Sent Successfully!")),this.dialogRef.close()),e.type===g.o&&"SetChannelTransaction"===e.payload.action&&(this.sendFundError=e.payload.message)})}onAuthenticate(){if(!this.passwordFormGroup.controls.password.value)return!0;this.flgValidated=!1,this.store.dispatch(new se.u(Kn(this.passwordFormGroup.controls.password.value))),this.rtlEffects.isAuthorizedRes.pipe(Object(Je.a)(1)).subscribe(e=>{"ERROR"!==e?(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(e=>this.transaction.utxos.push(e.txid+":"+e.output))),this.store.dispatch(new se.G("Sending Funds...")),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 g.Ab(this.transaction))):this.transaction.satoshis&&"all"!==this.transaction.satoshis&&this.selAmountUnit!==p.g.SATS?this.commonService.convertCurrency(+this.transaction.satoshis,this.selAmountUnit===this.amountUnits[2]?p.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(e=>{this.transaction.satoshis=e[p.g.SATS],this.selAmountUnit=p.g.SATS,this.store.dispatch(new g.Ab(this.transaction))}):this.store.dispatch(new g.Ab(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=p.e[0]}stepSelectionChanged(e){switch(this.sendFundError="",e.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(e=>e.feeRateId===this.sendFundFormGroup.controls.transactionFeeRate.value).feeRateType:"");break;default:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds"}e.selectedIndex<e.previouslySelectedIndex&&0===e.selectedIndex&&this.passwordFormGroup.controls.hiddenPassword.setValue("")}onUTXOSelectionChange(e){let t={value:0};this.selUTXOs.length&&this.selUTXOs.length>0?(this.totalSelectedUTXOAmount=this.selUTXOs.reduce((e,n)=>(t.value=e.value+n.value,t)).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=p.e[0]):this.transaction.satoshis=null}onAmountUnitChange(e){let t=this,n=e.value===this.amountUnits[2]?p.g.OTHER:e.value;this.transaction.satoshis&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(+this.transaction.satoshis,this.selAmountUnit===this.amountUnits[2]?p.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(u.a)(this.unSubs[3])).subscribe(e=>{t.transaction.satoshis=t.decimalPipe.transform(e[n],t.currencyUnitFormats[n]).replace(/,/g,"")}),this.selAmountUnit=e.value}onAdvancedPanelToggle(e){this.advancedTitle=e&&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(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(oe.a),s.Pb(y.b),s.Pb(x.h),s.Pb(U.a),s.Pb(i.f),s.Pb(v.a),s.Pb(ce.d),s.Pb(ve.a),s.Pb(Mn.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-on-chain-send-modal"]],viewQuery:function(e,t){if(1&e&&(s.Ec(Nn,!0),s.Pc(Qn,!0),s.Pc(Hn,!0)),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first),s.vc(e=s.ec())&&(t.formSweepAll=e.first),s.vc(e=s.ec())&&(t.stepper=e.first)}},decls:12,vars:4,consts:[["fxLayout","row"],["fxFlex","100",1,"padding-gap-large"],["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,"mt-5px"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100","class","padding-gap overflow-x-hidden",3,"submit","reset",4,"ngIf","ngIfElse"],["sweepAllBlock",""],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100",1,"padding-gap","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"],["fxFlex","100"],["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(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Ic(9,ti,34,25,"form",7),s.Ub(),s.Ub(),s.Ub(),s.Ic(10,hi,39,17,"ng-template",null,8,s.Jc)),2&e){const e=s.wc(11);s.Db(5),s.Lc(t.sweepAll?"Sweep All Funds":"Send Funds"),s.Db(1),s.oc("mat-dialog-close",!1),s.Db(3),s.oc("ngIf",!t.sweepAll)("ngIfElse",e)}},directives:[c.c,c.a,D.c,c.b,S.a,oe.d,D.b,i.o,ce.u,ce.n,ce.o,O.c,le.b,ce.c,re.a,ce.s,ce.m,ce.p,be.a,O.g,de.a,i.n,En.a,ce.q,O.b,O.f,he.m,zn.c,zn.e,zn.f,de.c,ue.a,R.a,w.a,Bn.h,Bn.a,ce.h,Bn.b,ce.g,Bn.f],pipes:[i.f],styles:[""]}),e})();var fi=n("qmev");function pi(e,t){1&e&&s.Qb(0,"mat-progress-bar",27)}function gi(e,t){1&e&&(s.Vb(0,"th",28),s.Kc(1," Transaction ID "),s.Ub())}function yi(e,t){1&e&&(s.Vb(0,"span",36),s.Vb(1,"mat-icon",37),s.Kc(2,"warning"),s.Ub(),s.Ub())}function xi(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,yi,3,0,"span",35),s.Ub()),2&e){const e=s.hc().$implicit;s.hc();const t=s.wc(32);s.Db(1),s.oc("ngIf",e.value<1e3)("ngIfElse",t)}}function vi(e,t){1&e&&s.Qb(0,"span",38)}function Ui(e,t){if(1&e&&(s.Qb(0,"span",39),s.ic(1,"titlecase")),2&e){const e=s.hc().$implicit;s.pc("matTooltip",s.jc(1,1,e.status))}}const wi=function(e){return{"max-width":e}};function Vi(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",30),s.Ic(2,xi,2,2,"span",31),s.Ic(3,vi,1,0,"span",32),s.Ic(4,Ui,2,3,"span",33),s.Vb(5,"span",34),s.Kc(6),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(5,wi,n.screenSize===n.screenSizeEnum.XS?"10rem":"50rem")),s.Db(1),s.oc("ngIf",n.numDustUTXOs>0&&!n.isDustUTXO),s.Db(1),s.oc("ngIf","confirmed"===e.status),s.Db(1),s.oc("ngIf","confirmed"!==e.status),s.Db(2),s.Lc(e.txid)}}function Di(e,t){1&e&&(s.Vb(0,"th",40),s.Kc(1," Output "),s.Ub())}function Ci(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",41),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.output)," ")}}function Si(e,t){1&e&&(s.Vb(0,"th",40),s.Kc(1," Value (Sats) "),s.Ub())}function Li(e,t){if(1&e&&(s.Vb(0,"span",41),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.Lc(s.jc(2,1,e.value))}}function Ii(e,t){if(1&e&&(s.Vb(0,"span",44),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.Mc("(",s.jc(2,1,-1*e.value),")")}}function Fi(e,t){if(1&e&&(s.Vb(0,"td",29),s.Ic(1,Li,3,3,"span",42),s.Ic(2,Ii,3,3,"span",43),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf",e.value>0||0===e.value),s.Db(1),s.oc("ngIf",e.value<0)}}function ki(e,t){1&e&&(s.Vb(0,"th",40),s.Kc(1," Blockheight "),s.Ub())}function Ai(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",41),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.blockheight)," ")}}function Pi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",45),s.Vb(1,"div",46),s.Vb(2,"mat-select",47),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",48),s.dc("click",function(){return s.zc(e),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function _i(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",49),s.Vb(1,"button",50),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc().onUTXOClick(i,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Ti(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No utxos available."),s.Ub())}function Oi(e,t){if(1&e&&(s.Vb(0,"td",51),s.Ic(1,Ti,2,0,"p",31),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)}}const Ri=function(e){return{"display-none":e}};function Ki(e,t){if(1&e&&s.Qb(0,"tr",52),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Ri,(null==e.listUTXOs?null:e.listUTXOs.data)&&(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)>0))}}function Mi(e,t){1&e&&s.Qb(0,"tr",53)}function Ei(e,t){1&e&&s.Qb(0,"tr",54)}function zi(e,t){1&e&&s.Qb(0,"mat-icon",37)}const Bi=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Ni=function(){return["no_utxo"]};let Qi=(()=>{class e{constructor(e,t,n,i){this.logger=e,this.commonService=t,this.store=n,this.actions$=i,this.numDustUTXOs=0,this.isDustUTXO=!1,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["txid","value","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["txid","output","value","blockheight","actions"]):(this.flgSticky=!0,this.displayedColumns=["txid","output","value","blockheight","actions"])}ngOnChanges(){this.utxos&&this.utxos.length>0&&this.loadUTXOsTable(this.utxos)}applyFilter(e){this.listUTXOs.filter=e.value.trim().toLowerCase()}onUTXOClick(e,t){const n=[[{key:"txid",value:e.txid,title:"Transaction ID",width:100}],[{key:"output",value:e.output,title:"Output",width:50,type:p.h.NUMBER},{key:"value",value:e.value,title:"Value (Sats)",width:50,type:p.h.NUMBER}],[{key:"status",value:this.commonService.titleCase(e.status),title:"Status",width:50,type:p.h.STRING},{key:"blockheight",value:e.blockheight,title:"Blockheight",width:50,type:p.h.NUMBER}],[{key:"address",value:e.address,title:"Address",width:100}]];this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"UTXO Information",message:n}}))}loadUTXOsTable(e){this.listUTXOs=new ae.o([...e]),this.listUTXOs.sort=this.sort,this.listUTXOs.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.listUTXOs.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),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")}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-on-chain-utxos"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},inputs:{numDustUTXOs:"numDustUTXOs",isDustUTXO:"isDustUTXO",utxos:"utxos",errorLoading:"errorLoading"},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("UTXOs")}]),s.Bb],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-4",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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Vb(6,"div",6),s.Ic(7,pi,1,0,"mat-progress-bar",7),s.Vb(8,"table",8,9),s.Tb(10,10),s.Ic(11,gi,2,0,"th",11),s.Ic(12,Vi,7,7,"td",12),s.Sb(),s.Tb(13,13),s.Ic(14,Di,2,0,"th",14),s.Ic(15,Ci,4,3,"td",12),s.Sb(),s.Tb(16,15),s.Ic(17,Si,2,0,"th",14),s.Ic(18,Fi,3,2,"td",12),s.Sb(),s.Tb(19,16),s.Ic(20,ki,2,0,"th",14),s.Ic(21,Ai,4,3,"td",12),s.Sb(),s.Tb(22,17),s.Ic(23,Pi,6,0,"th",18),s.Ic(24,_i,3,0,"td",19),s.Sb(),s.Tb(25,20),s.Ic(26,Oi,2,1,"td",21),s.Sb(),s.Ic(27,Ki,1,3,"tr",22),s.Ic(28,Mi,1,0,"tr",23),s.Ic(29,Ei,1,0,"tr",24),s.Ub(),s.Qb(30,"mat-paginator",25),s.Ub(),s.Ub(),s.Ub(),s.Ic(31,zi,1,0,"ng-template",null,26,s.Jc)),2&e&&(s.Db(7),s.oc("ngIf",!0===t.errorLoading),s.Db(1),s.oc("dataSource",t.listUTXOs)("ngClass",s.sc(10,Bi,"error"===t.errorLoading)),s.Db(19),s.oc("matFooterRowDef",s.rc(12,Ni)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,O.c,le.b,M.b,i.o,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ne.a,l.a,ae.h,ie.b,ae.a,i.p,I.b,R.a,L.a,de.a,de.c,he.m,S.a,ae.d,ae.f,ae.j,ae.l],pipes:[i.x,i.f],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}"]}),e})();var Hi=n("8Qe2");function qi(e,t){if(1&e&&(s.Vb(0,"span",5),s.Kc(1,"UTXOs"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numUtxos)}}function Xi(e,t){if(1&e&&(s.Vb(0,"span",5),s.Kc(1,"Dust UTXOs"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numDustUtxos)}}let ji=(()=>{class e{constructor(e,t){this.logger=e,this.store=t,this.selectedTableIndex=0,this.selectedTableIndexChange=new s.o,this.utxos=[],this.numUtxos=0,this.dustUtxos=[],this.numDustUtxos=0,this.flgLoading=[!0,!0],this.unSubs=[new d.a]}ngOnInit(){this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchUTXOs"===e.action&&(this.flgLoading[1]="error")}),e.utxos&&e.utxos.length>0&&(this.utxos=e.utxos,this.numUtxos=this.utxos.length,this.dustUtxos=e.utxos.filter(e=>+e.value<1e3),this.numDustUtxos=this.dustUtxos.length),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.utxos),e.utxos&&e.utxos.length>0&&(this.utxos=e.utxos,this.numUtxos=this.utxos.length),"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!e.utxos),this.logger.info(e)})}onSelectedIndexChanged(e){this.selectedTableIndexChange.emit(e)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-utxo-tables"]],inputs:{selectedTableIndex:"selectedTableIndex"},outputs:{selectedTableIndexChange:"selectedTableIndexChange"},decls:8,vars:9,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"bordered-box"],[3,"selectedIndex","selectedIndexChange"],["mat-tab-label",""],["xLayout","row","fxFlex","100",3,"utxos","errorLoading","numDustUTXOs","isDustUTXO"],["fxLayout","row","fxFlex","100",3,"utxos","errorLoading","numDustUTXOs","isDustUTXO"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"mat-tab-group",1),s.dc("selectedIndexChange",function(e){return t.onSelectedIndexChanged(e)}),s.Vb(2,"mat-tab"),s.Ic(3,qi,2,1,"ng-template",2),s.Qb(4,"rtl-cl-on-chain-utxos",3),s.Ub(),s.Vb(5,"mat-tab"),s.Ic(6,Xi,2,1,"ng-template",2),s.Qb(7,"rtl-cl-on-chain-utxos",4),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("selectedIndex",t.selectedTableIndex),s.Db(3),s.oc("utxos",t.utxos)("errorLoading",t.flgLoading[0])("numDustUTXOs",t.numDustUtxos)("isDustUTXO",!1),s.Db(3),s.oc("utxos",t.dustUtxos)("errorLoading",t.flgLoading[0])("numDustUTXOs",t.numDustUtxos)("isDustUTXO",!0))},directives:[c.c,c.a,c.b,te.b,te.a,te.c,Qi,Hi.a],styles:[""]}),e})();const Gi=function(e,t){return[e,t]};function $i(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",12),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.oc("active",n.activeLink===e.link)("routerLink",s.tc(3,Gi,e.link,n.selectedTable.name)),s.Db(1),s.Lc(e.name)}}let Wi=(()=>{class e{constructor(e,t,n){this.store=e,this.router=t,this.activatedRoute=n,this.selNode={},this.faExchangeAlt=f.n,this.faChartPie=f.g,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.a,new d.a,new d.a,new d.a]}ngOnInit(){let e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.selectedTable=this.tables.find(e=>e.name===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.selectedTable=this.tables.find(t=>t.name===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.selNode=e.nodeSettings,this.balances=[{title:"Total Balance",dataValue:e.balance.totalBalance||0},{title:"Confirmed",dataValue:e.balance.confBalance},{title:"Unconfirmed",dataValue:e.balance.unconfBalance}]})}openSendFundsModal(e){this.store.dispatch(new se.D({data:{sweepAll:e,component:mi}}))}onSelectedTableIndexChanged(e){this.selectedTable=this.tables.find(t=>t.id===e),this.router.navigate(["./",this.activeLink,this.selectedTable.name],{relativeTo:this.activatedRoute})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(a.g),s.Pb(a.a))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"On-chain Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",0),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"On-chain Transactions"),s.Ub(),s.Ub(),s.Vb(12,"div",6),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"nav",7),s.Ic(16,$i,2,6,"div",8),s.Ub(),s.Vb(17,"div",9),s.Qb(18,"router-outlet"),s.Ub(),s.Vb(19,"div",10),s.Vb(20,"rtl-cl-utxo-tables",11),s.dc("selectedTableIndexChange",function(e){return t.onSelectedTableIndexChanged(e)}),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faChartPie),s.Db(6),s.oc("values",t.balances),s.Db(2),s.oc("icon",t.faExchangeAlt),s.Db(7),s.oc("ngForOf",t.links),s.Db(4),s.oc("selectedTableIndex",t.selectedTable.id))},directives:[c.c,c.b,w.a,D.a,D.b,fi.a,te.e,i.n,c.a,a.l,ji,te.d,a.h],styles:[""]}),e})();function Ji(e,t){if(1&e&&(s.Vb(0,"span",10),s.Kc(1,"Channels"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.activeChannels)}}function Yi(e,t){if(1&e&&(s.Vb(0,"span",10),s.Kc(1,"Peers"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.activePeers)}}let Zi=(()=>{class e{constructor(e,t,n,i){this.store=e,this.logger=t,this.commonService=n,this.router=i,this.activePeers=0,this.activeChannels=0,this.faUsers=f.T,this.faChartPie=f.g,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.a,new d.a,new d.a,new d.a]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0,this.activeChannels=e.information.num_active_channels,this.balances=[{title:"Total Balance",dataValue:e.balance.totalBalance||0},{title:"Confirmed",dataValue:e.balance.confBalance},{title:"Unconfirmed",dataValue:e.balance.unconfBalance}],this.logger.info(e)})}onSelectedTabChange(e){this.router.navigateByUrl("/cl/connections/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(y.b),s.Pb(U.a),s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"On-chain Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",0),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"Connections"),s.Ub(),s.Ub(),s.Vb(12,"div",6),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"mat-tab-group",7),s.dc("selectedIndexChange",function(e){return t.activeLink=e})("selectedTabChange",function(e){return t.onSelectedTabChange(e)}),s.Vb(16,"mat-tab"),s.Ic(17,Ji,2,1,"ng-template",8),s.Ub(),s.Vb(18,"mat-tab"),s.Ic(19,Yi,2,1,"ng-template",8),s.Ub(),s.Ub(),s.Vb(20,"div",9),s.Qb(21,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faChartPie),s.Db(6),s.oc("values",t.balances),s.Db(2),s.oc("icon",t.faUsers),s.Db(6),s.oc("selectedIndex",t.activeLink))},directives:[c.c,c.b,w.a,D.a,D.b,fi.a,te.b,te.a,te.c,c.a,a.l,Hi.a],styles:[""]}),e})();function ea(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",11),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.pc("routerLink",e.link),s.oc("active",n.activeLink===e.link),s.Db(1),s.Lc(e.name)}}let ta=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.router=n,this.faExchangeAlt=f.n,this.faChartPie=f.g,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.a,new d.a,new d.a,new d.a]}ngOnInit(){let e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link}),this.store.select("cl").pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.currencyUnits=e.nodeSettings.currencyUnits,this.balances=e.nodeSettings.userPersona===p.z.OPERATOR?[{title:"Local Capacity",dataValue:e.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:e.localRemoteBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:e.localRemoteBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:e.localRemoteBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(e)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"Lightning Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",6),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"Lightning Transactions"),s.Ub(),s.Ub(),s.Vb(12,"div",7),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"nav",8),s.Ic(16,ea,2,3,"div",9),s.Ub(),s.Vb(17,"div",10),s.Qb(18,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faChartPie),s.Db(6),s.oc("values",t.balances),s.Db(2),s.oc("icon",t.faExchangeAlt),s.Db(7),s.oc("ngForOf",t.links))},directives:[c.c,c.b,w.a,D.a,D.b,fi.a,te.e,i.n,c.a,a.l,te.d,a.h],styles:[""]}),e})();function na(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",11),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.pc("routerLink",e.link),s.oc("active",n.activeLink===e.link),s.Db(1),s.Lc(e.name)}}let ia=(()=>{class e{constructor(e,t){this.store=e,this.router=t,this.faMapSigns=f.y,this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"failedtransactions",name:"Failed Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new d.a,new d.a,new d.a]}ngOnInit(){let e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.store.dispatch(new g.Db({})),this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-routing"]],decls:13,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100"],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"fa-icon",2),s.Vb(3,"span",3),s.Kc(4,"Routing"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"mat-card",5),s.Vb(7,"mat-card-content",6),s.Vb(8,"div",7),s.Vb(9,"nav",8),s.Ic(10,na,2,3,"div",9),s.Ub(),s.Ub(),s.Vb(11,"div",10),s.Qb(12,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(2),s.oc("icon",t.faMapSigns),s.Db(8),s.oc("ngForOf",t.links))},directives:[c.c,c.b,w.a,c.a,D.a,D.b,te.e,i.n,a.l,te.d,a.h],styles:[""]}),e})();var aa=n("dEYt");function oa(e,t){1&e&&(s.Vb(0,"th",26),s.Kc(1,"Type"),s.Ub())}function sa(e,t){if(1&e&&(s.Vb(0,"td",27),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.type," ")}}function ca(e,t){1&e&&(s.Vb(0,"th",26),s.Kc(1,"Address"),s.Ub())}function la(e,t){if(1&e&&(s.Vb(0,"td",27),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.address," ")}}function ra(e,t){1&e&&(s.Vb(0,"th",26),s.Kc(1,"Port"),s.Ub())}function ba(e,t){if(1&e&&(s.Vb(0,"td",27),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.port," ")}}function da(e,t){1&e&&(s.Vb(0,"th",28),s.Vb(1,"span",29),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function ua(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",30),s.Vb(1,"span",29),s.Vb(2,"button",31),s.dc("copied",function(t){return s.zc(e),s.hc(2).onCopyNodeURI(t)}),s.Kc(3,"Copy Node URI"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc(2);s.Db(2),s.oc("payload",n.lookupResult.nodeid+"@"+e.address+":"+e.port)}}function ha(e,t){1&e&&s.Qb(0,"tr",32)}function ma(e,t){1&e&&s.Qb(0,"tr",33)}const fa=function(e){return{"background-color":e}};function pa(e,t){if(1&e&&(s.Vb(0,"div",1),s.Qb(1,"mat-divider",2),s.Vb(2,"div",3),s.Vb(3,"h4",4),s.Kc(4,"Pub Key"),s.Ub(),s.Vb(5,"span",5),s.Kc(6),s.Ub(),s.Ub(),s.Qb(7,"mat-divider",6),s.Vb(8,"div",7),s.Vb(9,"div",3),s.Vb(10,"h4",4),s.Kc(11,"Alias"),s.Ub(),s.Vb(12,"span",8),s.Kc(13),s.Vb(14,"span",9),s.Kc(15),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Qb(16,"mat-divider",6),s.Vb(17,"div",7),s.Vb(18,"div",10),s.Vb(19,"h4",4),s.Kc(20,"Last Update"),s.Ub(),s.Vb(21,"span",8),s.Kc(22),s.Ub(),s.Ub(),s.Vb(23,"div",10),s.Vb(24,"h4",4),s.Kc(25,"Features"),s.Ub(),s.Vb(26,"span",8),s.Kc(27),s.Ub(),s.Ub(),s.Ub(),s.Qb(28,"mat-divider",6),s.Vb(29,"div",11),s.Vb(30,"h4",12),s.Kc(31,"Addresses"),s.Ub(),s.Vb(32,"div",13),s.Vb(33,"table",14,15),s.Tb(35,16),s.Ic(36,oa,2,0,"th",17),s.Ic(37,sa,2,1,"td",18),s.Sb(),s.Tb(38,19),s.Ic(39,ca,2,0,"th",17),s.Ic(40,la,2,1,"td",18),s.Sb(),s.Tb(41,20),s.Ic(42,ra,2,0,"th",17),s.Ic(43,ba,2,1,"td",18),s.Sb(),s.Tb(44,21),s.Ic(45,da,3,0,"th",22),s.Ic(46,ua,4,1,"td",23),s.Sb(),s.Ic(47,ha,1,0,"tr",24),s.Ic(48,ma,1,0,"tr",25),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult.nodeid),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.lookupResult.alias),s.Db(1),s.oc("ngStyle",s.sc(13,fa,"#"+e.lookupResult.color)),s.Db(1),s.Lc(e.lookupResult.color?"#"+e.lookupResult.color:""),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.lookupResult.last_timestamp_str),s.Db(5),s.Lc(e.lookupResult.features),s.Db(1),s.oc("inset",!0),s.Db(5),s.oc("dataSource",e.addresses),s.Db(14),s.oc("matHeaderRowDef",e.displayedColumns),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}let ga=(()=>{class e{constructor(e,t){this.logger=e,this.snackBar=t,this.displayedColumns=["type","address","port","actions"]}ngOnInit(){this.addresses=new ae.o(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses?this.lookupResult.addresses:[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(Mn.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-node-lookup"]],viewQuery:function(e,t){if(1&e&&s.Pc(ie.a,!0),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.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(e,t){1&e&&s.Ic(0,pa,49,15,"div",0),2&e&&s.oc("ngIf",t.lookupResult)},directives:[i.o,c.c,K.a,c.a,c.b,i.p,I.b,M.b,ae.n,ie.a,ae.c,ae.i,ae.b,ae.k,ae.m,ae.h,ie.b,ae.a,S.a,aa.a,ae.j,ae.l],styles:[""]}),e})();function ya(e,t){1&e&&(s.Vb(0,"h3",11),s.Kc(1,"Node 1"),s.Ub())}function xa(e,t){1&e&&(s.Vb(0,"h3",11),s.Kc(1,"Node 1 (Your Node)"),s.Ub())}function va(e,t){1&e&&(s.Vb(0,"h3",11),s.Kc(1,"Node 2"),s.Ub())}function Ua(e,t){1&e&&(s.Vb(0,"h3",11),s.Kc(1,"Node 2 (Your Node)"),s.Ub())}function wa(e,t){if(1&e&&(s.Vb(0,"div",1),s.Qb(1,"mat-divider"),s.Vb(2,"div",2),s.Vb(3,"div",3),s.Vb(4,"div",4),s.Ic(5,ya,2,0,"h3",5),s.Ic(6,xa,2,0,"h3",5),s.Ub(),s.Qb(7,"mat-divider",6),s.Vb(8,"div",7),s.Vb(9,"h4",8),s.Kc(10,"Short Channel Id"),s.Ub(),s.Vb(11,"span",9),s.Kc(12),s.Ub(),s.Ub(),s.Qb(13,"mat-divider",6),s.Vb(14,"div",10),s.Vb(15,"h4",8),s.Kc(16,"Active"),s.Ub(),s.Vb(17,"span",9),s.Kc(18),s.Ub(),s.Ub(),s.Qb(19,"mat-divider",6),s.Vb(20,"div",10),s.Vb(21,"h4",8),s.Kc(22,"Last Update"),s.Ub(),s.Vb(23,"span",9),s.Kc(24),s.Ub(),s.Ub(),s.Qb(25,"mat-divider",6),s.Vb(26,"div",10),s.Vb(27,"h4",8),s.Kc(28,"Amount (mSats)"),s.Ub(),s.Vb(29,"span",9),s.Kc(30),s.Ub(),s.Ub(),s.Qb(31,"mat-divider",6),s.Vb(32,"div",10),s.Vb(33,"h4",8),s.Kc(34,"Base Fee (mSats)"),s.Ub(),s.Vb(35,"span",9),s.Kc(36),s.ic(37,"number"),s.Ub(),s.Ub(),s.Qb(38,"mat-divider",6),s.Vb(39,"div",10),s.Vb(40,"h4",8),s.Kc(41,"Channel Flags"),s.Ub(),s.Vb(42,"span",9),s.Kc(43),s.ic(44,"number"),s.Ub(),s.Ub(),s.Qb(45,"mat-divider",6),s.Vb(46,"div",10),s.Vb(47,"h4",8),s.Kc(48,"Delay"),s.Ub(),s.Vb(49,"span",9),s.Kc(50),s.ic(51,"number"),s.Ub(),s.Ub(),s.Qb(52,"mat-divider",6),s.Vb(53,"div",10),s.Vb(54,"h4",8),s.Kc(55,"Destination"),s.Ub(),s.Vb(56,"span",9),s.Kc(57),s.Ub(),s.Ub(),s.Qb(58,"mat-divider",6),s.Vb(59,"div",10),s.Vb(60,"h4",8),s.Kc(61,"Fee/Millionth"),s.Ub(),s.Vb(62,"span",9),s.Kc(63),s.ic(64,"number"),s.Ub(),s.Ub(),s.Qb(65,"mat-divider",6),s.Vb(66,"div",10),s.Vb(67,"h4",8),s.Kc(68,"Max Htlc (mSat)"),s.Ub(),s.Vb(69,"span",9),s.Kc(70),s.Ub(),s.Ub(),s.Qb(71,"mat-divider",6),s.Vb(72,"div",10),s.Vb(73,"h4",8),s.Kc(74,"Min Htlc (mSat)"),s.Ub(),s.Vb(75,"span",9),s.Kc(76),s.Ub(),s.Ub(),s.Qb(77,"mat-divider",6),s.Vb(78,"div",10),s.Vb(79,"h4",8),s.Kc(80,"Message Flags"),s.Ub(),s.Vb(81,"span",9),s.Kc(82),s.ic(83,"number"),s.Ub(),s.Ub(),s.Qb(84,"mat-divider",6),s.Vb(85,"div",10),s.Vb(86,"h4",8),s.Kc(87,"Public"),s.Ub(),s.Vb(88,"span",9),s.Kc(89),s.Ub(),s.Ub(),s.Qb(90,"mat-divider",6),s.Vb(91,"div",10),s.Vb(92,"h4",8),s.Kc(93,"Satoshis"),s.Ub(),s.Vb(94,"span",9),s.Kc(95),s.ic(96,"number"),s.Ub(),s.Ub(),s.Qb(97,"mat-divider",6),s.Vb(98,"div",10),s.Vb(99,"h4",8),s.Kc(100,"Source"),s.Ub(),s.Vb(101,"span",9),s.Kc(102),s.Ub(),s.Ub(),s.Ub(),s.Vb(103,"div",3),s.Vb(104,"div"),s.Ic(105,va,2,0,"h3",5),s.Ic(106,Ua,2,0,"h3",5),s.Ub(),s.Qb(107,"mat-divider",6),s.Vb(108,"div",7),s.Vb(109,"h4",8),s.Kc(110,"Short Channel Id"),s.Ub(),s.Vb(111,"span",9),s.Kc(112),s.Ub(),s.Ub(),s.Qb(113,"mat-divider",6),s.Vb(114,"div",10),s.Vb(115,"h4",8),s.Kc(116,"Active"),s.Ub(),s.Vb(117,"span",9),s.Kc(118),s.Ub(),s.Ub(),s.Qb(119,"mat-divider",6),s.Vb(120,"div",10),s.Vb(121,"h4",8),s.Kc(122,"Last Update"),s.Ub(),s.Vb(123,"span",9),s.Kc(124),s.Ub(),s.Ub(),s.Qb(125,"mat-divider",6),s.Vb(126,"div",10),s.Vb(127,"h4",8),s.Kc(128,"Amount (mSats)"),s.Ub(),s.Vb(129,"span",9),s.Kc(130),s.Ub(),s.Ub(),s.Qb(131,"mat-divider",6),s.Vb(132,"div",10),s.Vb(133,"h4",8),s.Kc(134,"Base Fee (mSats)"),s.Ub(),s.Vb(135,"span",9),s.Kc(136),s.ic(137,"number"),s.Ub(),s.Ub(),s.Qb(138,"mat-divider",6),s.Vb(139,"div",10),s.Vb(140,"h4",8),s.Kc(141,"Channel Flags"),s.Ub(),s.Vb(142,"span",9),s.Kc(143),s.ic(144,"number"),s.Ub(),s.Ub(),s.Qb(145,"mat-divider",6),s.Vb(146,"div",10),s.Vb(147,"h4",8),s.Kc(148,"Delay"),s.Ub(),s.Vb(149,"span",9),s.Kc(150),s.ic(151,"number"),s.Ub(),s.Ub(),s.Qb(152,"mat-divider",6),s.Vb(153,"div",10),s.Vb(154,"h4",8),s.Kc(155,"Destination"),s.Ub(),s.Vb(156,"span",9),s.Kc(157),s.Ub(),s.Ub(),s.Qb(158,"mat-divider",6),s.Vb(159,"div",10),s.Vb(160,"h4",8),s.Kc(161,"Fee/Millionth"),s.Ub(),s.Vb(162,"span",9),s.Kc(163),s.ic(164,"number"),s.Ub(),s.Ub(),s.Qb(165,"mat-divider",6),s.Vb(166,"div",10),s.Vb(167,"h4",8),s.Kc(168,"Max Htlc (mSat)"),s.Ub(),s.Vb(169,"span",9),s.Kc(170),s.Ub(),s.Ub(),s.Qb(171,"mat-divider",6),s.Vb(172,"div",10),s.Vb(173,"h4",8),s.Kc(174,"Min Htlc (mSat)"),s.Ub(),s.Vb(175,"span",9),s.Kc(176),s.Ub(),s.Ub(),s.Qb(177,"mat-divider",6),s.Vb(178,"div",10),s.Vb(179,"h4",8),s.Kc(180,"Message Flags"),s.Ub(),s.Vb(181,"span",9),s.Kc(182),s.ic(183,"number"),s.Ub(),s.Ub(),s.Qb(184,"mat-divider",6),s.Vb(185,"div",10),s.Vb(186,"h4",8),s.Kc(187,"Public"),s.Ub(),s.Vb(188,"span",9),s.Kc(189),s.Ub(),s.Ub(),s.Qb(190,"mat-divider",6),s.Vb(191,"div",10),s.Vb(192,"h4",8),s.Kc(193,"Satoshis"),s.Ub(),s.Vb(194,"span",9),s.Kc(195),s.ic(196,"number"),s.Ub(),s.Ub(),s.Qb(197,"mat-divider",6),s.Vb(198,"div",10),s.Vb(199,"h4",8),s.Kc(200,"Source"),s.Ub(),s.Vb(201,"span",9),s.Kc(202),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(5),s.oc("ngIf",!e.node1_match),s.Db(1),s.oc("ngIf",e.node1_match),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].short_channel_id),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].active?"True":"False"),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].last_update_str),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].amount_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(37,64,e.lookupResult[0].base_fee_millisatoshi)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(44,66,e.lookupResult[0].channel_flags)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(51,68,e.lookupResult[0].delay)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].destination),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(64,70,e.lookupResult[0].fee_per_millionth)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].htlc_maximum_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].htlc_minimum_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(83,72,e.lookupResult[0].message_flags)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].public?"Yes":"No"),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(96,74,e.lookupResult[0].satoshis)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[0].source),s.Db(3),s.oc("ngIf",!e.node2_match),s.Db(1),s.oc("ngIf",e.node2_match),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].short_channel_id),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].active?"True":"False"),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].last_update_str),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].amount_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(137,76,e.lookupResult[1].base_fee_millisatoshi)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(144,78,e.lookupResult[1].channel_flags)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(151,80,e.lookupResult[1].delay)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].destination),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(164,82,e.lookupResult[1].fee_per_millionth)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].htlc_maximum_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].htlc_minimum_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(183,84,e.lookupResult[1].message_flags)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].public?"Yes":"No"),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(s.jc(196,86,e.lookupResult[1].satoshis)),s.Db(2),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult[1].source)}}let Va=(()=>{class e{constructor(e){this.store=e,this.node1_match=!1,this.node2_match=!1,this.unSubs=[new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.lookupResult.length>0&&this.lookupResult[0].source===e.information.id&&(this.node1_match=!0),this.lookupResult.length>1&&this.lookupResult[1].source===e.information.id&&(this.node2_match=!0)})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&s.Ic(0,wa,203,88,"div",0),2&e&&s.oc("ngIf",t.lookupResult)},directives:[i.o,c.c,K.a,c.b,c.a],pipes:[i.f],styles:[".mat-list-base[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%], .mat-list-base[_ngcontent-%COMP%] .mat-list-option[_ngcontent-%COMP%]{height:38px!important}"]}),e})();const Da=["form"];function Ca(e,t){if(1&e&&(s.Vb(0,"mat-radio-button",21),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("value",e.id)("checked",n.selectedFieldId===e.id),s.Db(1),s.Mc(" ",e.name," ")}}function Sa(e,t){if(1&e&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Mc("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function La(e,t){if(1&e&&(s.Vb(0,"div"),s.Qb(1,"rtl-cl-node-lookup",30),s.Ub()),2&e){const e=s.hc(3);s.Db(1),s.oc("lookupResult",e.nodeLookupValue)}}function Ia(e,t){if(1&e&&(s.Vb(0,"span",28),s.Ic(1,La,2,1,"div",29),s.Ub()),2&e){const e=s.hc(2),t=s.wc(24);s.Db(1),s.oc("ngIf",""!==e.nodeLookupValue.nodeid)("ngIfElse",t)}}function Fa(e,t){if(1&e&&(s.Vb(0,"div"),s.Qb(1,"rtl-cl-channel-lookup",30),s.Ub()),2&e){const e=s.hc(3);s.Db(1),s.oc("lookupResult",e.channelLookupValue)}}function ka(e,t){if(1&e&&(s.Vb(0,"span",28),s.Ic(1,Fa,2,1,"div",29),s.Ub()),2&e){const e=s.hc(2),t=s.wc(24);s.Db(1),s.oc("ngIf",e.channelLookupValue.length>0)("ngIfElse",t)}}function Aa(e,t){1&e&&(s.Vb(0,"span",28),s.Vb(1,"h3"),s.Kc(2,"Error! Unable to find details!"),s.Ub(),s.Ub())}function Pa(e,t){if(1&e&&(s.Vb(0,"div",22),s.Vb(1,"div",23),s.Vb(2,"span",24),s.Kc(3),s.Ub(),s.Ub(),s.Vb(4,"div",25),s.Ic(5,Ia,2,2,"span",26),s.Ic(6,ka,2,2,"span",26),s.Ic(7,Aa,3,0,"span",27),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(3),s.Mc("",e.lookupFields[e.selectedFieldId].name," Details"),s.Db(1),s.oc("ngSwitch",e.selectedFieldId),s.Db(1),s.oc("ngSwitchCase",0),s.Db(1),s.oc("ngSwitchCase",1)}}function _a(e,t){1&e&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find details!"),s.Ub())}const Ta=function(e){return{"mt-2":e}};let Oa=(()=>{class e{constructor(e,t,n,i){this.logger=e,this.commonService=t,this.store=n,this.actions$=i,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=f.J,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions$.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e.type===g.pb||e.type===g.o)).subscribe(e=>{if(e.type===g.pb){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=e.payload[0]?JSON.parse(JSON.stringify(e.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=e.payload?JSON.parse(JSON.stringify(e.payload)):[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}e.type===g.o&&"Lookup"===e.payload.action&&(this.flgLoading[0]="error")})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.nodeLookupValue={nodeid:""},this.channelLookupValue=[],this.store.dispatch(new se.G("Searching "+this.lookupFields[this.selectedFieldId].name+"...")),this.selectedFieldId){case 0:this.store.dispatch(new g.T(this.lookupKey.trim()));break;case 1:this.store.dispatch(new g.f({shortChannelID:this.lookupKey.trim(),showError:!1}))}}onSelectChange(e){this.resetData(),this.selectedFieldId=e.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(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-lookups"]],viewQuery:function(e,t){if(1&e&&s.Ec(Da,!0),2&e){let e;s.vc(e=s.ec())&&(t.form=e.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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"fa-icon",2),s.Vb(3,"span",3),s.Kc(4,"Graph Lookups"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"mat-card",5),s.Vb(7,"mat-card-content",6),s.Vb(8,"form",7,8),s.Vb(10,"div",9),s.Vb(11,"mat-radio-group",10),s.dc("ngModelChange",function(e){return t.selectedFieldId=e})("change",function(e){return t.onSelectChange(e)}),s.Ic(12,Ca,2,3,"mat-radio-button",11),s.Ub(),s.Ub(),s.Vb(13,"mat-form-field",12),s.Vb(14,"input",13,14),s.dc("change",function(){return t.clearLookupValue()})("ngModelChange",function(e){return t.lookupKey=e}),s.Ub(),s.Ic(16,Sa,2,1,"mat-error",15),s.Ub(),s.Vb(17,"div",16),s.Vb(18,"button",17),s.dc("click",function(){return t.resetData()}),s.Kc(19,"Clear"),s.Ub(),s.Vb(20,"button",18),s.dc("click",function(){return t.onLookup()}),s.Kc(21,"Lookup"),s.Ub(),s.Ub(),s.Ub(),s.Ic(22,Pa,8,4,"div",19),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(23,_a,2,0,"ng-template",null,20,s.Jc)),2&e&&(s.Db(2),s.oc("icon",t.faSearch),s.Db(9),s.oc("ngModel",t.selectedFieldId),s.Db(1),s.oc("ngForOf",t.lookupFields),s.Db(1),s.oc("ngClass",s.sc(8,Ta,t.screenSize===t.screenSizeEnum.XS||t.screenSize===t.screenSizeEnum.SM)),s.Db(1),s.oc("placeholder",(null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder)||"Lookup Key")("ngModel",t.lookupKey),s.Db(2),s.oc("ngIf",!t.lookupKey),s.Db(6),s.oc("ngIf",t.flgSetLookupValue))},directives:[c.c,c.b,w.a,c.a,D.a,D.b,ce.u,ce.n,ce.o,Ze.b,ce.m,ce.p,i.n,O.c,i.m,I.a,le.b,ce.c,ce.s,i.o,S.a,Ze.a,O.b,i.q,i.r,i.s,ga,Va],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}"]}),e})();var Ra=function(e){return e.KB="KB",e.KW="KW",e}({});let Ka=(()=>{class e{constructor(){this.perkbw={}}ngOnInit(){}ngAfterContentChecked(){this.feeRateStyle===Ra.KB?this.perkbw=this.feeRates.perkb:this.feeRateStyle===Ra.KW&&(this.perkbw=this.feeRates.perkw)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-fee-rates"]],inputs:{feeRateStyle:"feeRateStyle",feeRates:"feeRates",flgLoading:"flgLoading"},decls:51,vars:24,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","stretch",1,"h-100"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"div"),s.Vb(3,"h4",2),s.Kc(4,"Urgent"),s.Ub(),s.Vb(5,"div",3),s.Kc(6),s.ic(7,"number"),s.Ub(),s.Ub(),s.Vb(8,"div"),s.Vb(9,"h4",2),s.Kc(10,"Normal"),s.Ub(),s.Vb(11,"div",3),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Ub(),s.Vb(14,"div"),s.Vb(15,"h4",2),s.Kc(16,"Slow"),s.Ub(),s.Vb(17,"div",3),s.Kc(18),s.ic(19,"number"),s.Ub(),s.Ub(),s.Vb(20,"div"),s.Vb(21,"h4",2),s.Kc(22,"Opening Channel"),s.Ub(),s.Vb(23,"div",3),s.Kc(24),s.ic(25,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(26,"div",1),s.Vb(27,"div"),s.Vb(28,"h4",2),s.Kc(29,"Min Acceptable"),s.Ub(),s.Vb(30,"div",3),s.Kc(31),s.ic(32,"number"),s.Ub(),s.Ub(),s.Vb(33,"div"),s.Vb(34,"h4",2),s.Kc(35,"Max Acceptable"),s.Ub(),s.Vb(36,"div",3),s.Kc(37),s.ic(38,"number"),s.Ub(),s.Ub(),s.Vb(39,"div"),s.Vb(40,"h4",2),s.Kc(41,"Mutual Close"),s.Ub(),s.Vb(42,"div",3),s.Kc(43),s.ic(44,"number"),s.Ub(),s.Ub(),s.Vb(45,"div"),s.Vb(46,"h4",2),s.Kc(47,"Unilateral Close"),s.Ub(),s.Vb(48,"div",3),s.Kc(49),s.ic(50,"number"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(6),s.Lc(s.jc(7,8,null==t.perkbw?null:t.perkbw.urgent)),s.Db(6),s.Lc(s.jc(13,10,null==t.perkbw?null:t.perkbw.normal)),s.Db(6),s.Lc(s.jc(19,12,null==t.perkbw?null:t.perkbw.slow)),s.Db(6),s.Lc(s.jc(25,14,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.opening_channel_satoshis)),s.Db(7),s.Lc(s.jc(32,16,null==t.perkbw?null:t.perkbw.min_acceptable)),s.Db(6),s.Lc(s.jc(38,18,null==t.perkbw?null:t.perkbw.max_acceptable)),s.Db(6),s.Lc(s.jc(44,20,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.mutual_close_satoshis)),s.Db(6),s.Lc(s.jc(50,22,null==t.feeRates||null==t.feeRates.onchain_fee_estimates?null:t.feeRates.onchain_fee_estimates.unilateral_close_satoshis)))},directives:[c.c,c.a,c.b],pipes:[i.f],styles:[".fee-rate-list[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%]{height:44px}"]}),e})();const Ma=function(e){return{"error-border":e}};function Ea(e,t){if(1&e&&s.Qb(0,"rtl-cl-node-info",17),2&e){const e=s.hc(3);s.oc("information",e.information)("showColorFieldSeparately",!1)("ngClass",s.sc(3,Ma,"error"===e.flgLoading[0]))}}function za(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-status-info",18),2&e){const e=s.hc(3);s.oc("channelsStatus",e.channelsStatus)("ngClass",s.sc(2,Ma,"error"===e.flgLoading[0]))}}function Ba(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-info",19),2&e){const e=s.hc(3);s.oc("fees",e.fees)("ngClass",s.sc(2,Ma,"error"===e.flgLoading[1]))}}function Na(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-rates",20),2&e){const e=s.hc(3);s.oc("flgLoading",e.flgLoading[2])("feeRates",e.feeRatesPerKB)("feeRateStyle","KB")}}function Qa(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-rates",20),2&e){const e=s.hc(3);s.oc("flgLoading",e.flgLoading[2])("feeRates",e.feeRatesPerKW)("feeRateStyle","KW")}}function Ha(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",4),s.Vb(1,"div",5),s.Vb(2,"div",6),s.Vb(3,"div",7),s.Qb(4,"fa-icon",8),s.Vb(5,"span"),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",9),s.Vb(8,"mat-card",10),s.Vb(9,"mat-card-content",11),s.Vb(10,"div",12),s.Ic(11,Ea,1,5,"rtl-cl-node-info",13),s.Ic(12,za,1,4,"rtl-cl-channel-status-info",14),s.Ic(13,Ba,1,4,"rtl-cl-fee-info",15),s.Ic(14,Na,1,3,"rtl-cl-fee-rates",16),s.Ic(15,Qa,1,3,"rtl-cl-fee-rates",16),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.oc("colspan",e.cols)("rowspan",e.rows),s.Db(4),s.oc("icon",e.icon),s.Db(2),s.Lc(e.title),s.Db(4),s.oc("ngSwitch",e.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","status"),s.Db(1),s.oc("ngSwitchCase","fee"),s.Db(1),s.oc("ngSwitchCase","feeRatesKB"),s.Db(1),s.oc("ngSwitchCase","feeRatesKW")}}function qa(e,t){if(1&e&&(s.Vb(0,"mat-grid-list",2),s.Ic(1,Ha,16,10,"mat-grid-tile",3),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.nodeCardsOperator)}}function Xa(e,t){if(1&e&&s.Qb(0,"rtl-cl-node-info",17),2&e){const e=s.hc(3);s.oc("information",e.information)("showColorFieldSeparately",!1)("ngClass",s.sc(3,Ma,"error"===e.flgLoading[0]))}}function ja(e,t){if(1&e&&s.Qb(0,"rtl-cl-channel-status-info",18),2&e){const e=s.hc(3);s.oc("channelsStatus",e.channelsStatus)("ngClass",s.sc(2,Ma,"error"===e.flgLoading[0]))}}function Ga(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-info",19),2&e){const e=s.hc(3);s.oc("fees",e.fees)("ngClass",s.sc(2,Ma,"error"===e.flgLoading[1]))}}function $a(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-rates",20),2&e){const e=s.hc(3);s.oc("flgLoading",e.flgLoading[2])("feeRates",e.feeRatesPerKB)("feeRateStyle","KB")}}function Wa(e,t){if(1&e&&s.Qb(0,"rtl-cl-fee-rates",20),2&e){const e=s.hc(3);s.oc("flgLoading",e.flgLoading[2])("feeRates",e.feeRatesPerKW)("feeRateStyle","KW")}}function Ja(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",4),s.Vb(1,"div",5),s.Vb(2,"div",6),s.Vb(3,"div",21),s.Qb(4,"fa-icon",8),s.Vb(5,"span"),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",9),s.Vb(8,"mat-card",10),s.Vb(9,"mat-card-content",11),s.Vb(10,"div",12),s.Ic(11,Xa,1,5,"rtl-cl-node-info",13),s.Ic(12,ja,1,4,"rtl-cl-channel-status-info",14),s.Ic(13,Ga,1,4,"rtl-cl-fee-info",15),s.Ic(14,$a,1,3,"rtl-cl-fee-rates",16),s.Ic(15,Wa,1,3,"rtl-cl-fee-rates",16),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.oc("colspan",e.cols)("rowspan",e.rows),s.Db(4),s.oc("icon",e.icon),s.Db(2),s.Lc(e.title),s.Db(4),s.oc("ngSwitch",e.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","status"),s.Db(1),s.oc("ngSwitchCase","fee"),s.Db(1),s.oc("ngSwitchCase","feeRatesKB"),s.Db(1),s.oc("ngSwitchCase","feeRatesKW")}}function Ya(e,t){if(1&e&&(s.Vb(0,"mat-grid-list",2),s.Ic(1,Ja,16,10,"mat-grid-tile",3),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.nodeCardsMerchant)}}let Za=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.faBolt=f.e,this.faServer=f.K,this.faNetworkWired=f.B,this.selNode={},this.information={},this.channelsStatus={},this.feeRatesPerKB={},this.feeRatesPerKW={},this.nodeCardsOperator=[],this.nodeCardsMerchant=[],this.screenSize="",this.screenSizeEnum=p.s,this.userPersonaEnum=p.z,this.flgLoading=[!0,!0,!0],this.unSubs=[new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.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:6,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:6,rows:4}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:6,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:6,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:3,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:3,rows:4}],this.nodeCardsOperator=[{id:"feeRatesKB",icon:this.faServer,title:"Fee Rate Per KB",cols:3,rows:4},{id:"feeRatesKW",icon:this.faNetworkWired,title:"Fee Rate Per KW",cols:3,rows:4}])}ngOnInit(){this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchInfo"===e.action&&(this.flgLoading[0]="error"),"FetchFees"===e.action&&(this.flgLoading[1]="error"),"FetchFeeRates"===e.action&&(this.flgLoading[2]="error")}),this.selNode=e.nodeSettings,this.information=e.information,"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.information.id),this.fees=e.fees,this.fees.totalTxCount=0,e.forwardingHistory&&e.forwardingHistory.forwarding_events&&e.forwardingHistory.forwarding_events.length&&(this.fees.totalTxCount=e.forwardingHistory.forwarding_events.filter(e=>"settled"===e.status).length),"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!this.fees.feeCollected),this.channelsStatus={active:{channels:e.information.num_active_channels,capacity:0},inactive:{channels:e.information.num_inactive_channels,capacity:0},pending:{channels:e.information.num_pending_channels,capacity:0}},this.feeRatesPerKB=e.feeRatesPerKB,this.feeRatesPerKW=e.feeRatesPerKW,"error"!==this.flgLoading[2]&&(this.flgLoading[2]=!this.feeRatesPerKB||!this.feeRatesPerKW),this.logger.info(e)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-network-info"]],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch",1,"mb-4"],["cols","6","rowHeight","110px",4,"ngIf"],["cols","6","rowHeight","110px"],["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"],["fxFlex","100",1,"dashboard-card-content"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"fees","ngClass",4,"ngSwitchCase"],["class","h-100",3,"flgLoading","feeRates","feeRateStyle",4,"ngSwitchCase"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass"],["fxFlex","100",3,"channelsStatus","ngClass"],["fxFlex","100",3,"fees","ngClass"],[1,"h-100",3,"flgLoading","feeRates","feeRateStyle"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","pl-15px"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,qa,2,1,"mat-grid-list",1),s.Ic(2,Ya,2,1,"mat-grid-list",1),s.Ub()),2&e&&(s.Db(1),s.oc("ngIf",t.selNode.userPersona===t.userPersonaEnum.OPERATOR),s.Db(1),s.oc("ngIf",t.selNode.userPersona===t.userPersonaEnum.MERCHANT))},directives:[c.c,c.b,i.o,V.a,i.n,V.c,c.a,w.a,D.a,D.b,i.q,i.r,_,i.m,I.a,H,Q,Ka],styles:[""]}),e})();function eo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",8),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.pc("routerLink",e.link),s.oc("active",n.activeLink===e.link),s.Db(1),s.Lc(e.name)}}let to=(()=>{class e{constructor(e){this.router=e,this.faUserCheck=f.P,this.links=[{link:"sign",name:"Sign"},{link:"verify",name:"Verify"}],this.activeLink=this.links[0].link,this.unSubs=[new d.a,new d.a]}ngOnInit(){let e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"Sign/Verify Message"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Vb(7,"nav",5),s.Ic(8,eo,2,3,"div",6),s.Ub(),s.Vb(9,"div",7),s.Qb(10,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faUserCheck),s.Db(7),s.oc("ngForOf",t.links))},directives:[c.c,c.b,w.a,D.a,D.b,te.e,i.n,c.a,a.l,te.d,a.h],styles:[""]}),e})();var no=n("Ysfc");function io(e,t){if(1&e&&(s.Vb(0,"mat-option",7),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc(" ",e.addressTp," ")}}let ao=(()=>{class e{constructor(e,t){this.store=e,this.clEffects=t,this.addressTypes=p.a,this.selectedAddressType=p.a[0],this.newAddress=""}ngOnInit(){}onGenerateAddress(){this.store.dispatch(new se.G("Getting New Address...")),this.store.dispatch(new g.O(this.selectedAddressType)),this.clEffects.setNewAddressCL.pipe(Object(Je.a)(1)).subscribe(e=>{this.newAddress=e,this.store.dispatch(new se.D({width:"58%",data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:no.a}}))})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(Ye.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-on-chain-receive"]],decls:8,vars:2,consts:[["fxLayout","column",1,"padding-gap-x-large"],["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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-form-field",2),s.Vb(3,"mat-select",3),s.dc("ngModelChange",function(e){return t.selectedAddressType=e}),s.Ic(4,io,2,2,"mat-option",4),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Vb(6,"button",6),s.dc("click",function(){return t.onGenerateAddress()}),s.Kc(7,"Generate Address"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("ngModel",t.selectedAddressType),s.Db(1),s.oc("ngForOf",t.addressTypes))},directives:[c.c,c.b,O.c,c.a,de.a,ce.m,ce.p,i.n,S.a,he.m],styles:[""]}),e})(),oo=(()=>{class e{constructor(e,t){this.store=e,this.activatedRoute=t,this.sweepAll=!1,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.activatedRoute.data.pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>this.sweepAll=e.sweepAll)}openSendFundsModal(){this.store.dispatch(new se.D({data:{sweepAll:this.sweepAll,component:mi}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(a.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"button",2),s.dc("click",function(){return t.openSendFundsModal()}),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.Lc(t.sweepAll?"Sweep All":"Send Funds"))},directives:[c.c,c.a,c.b,S.a],styles:[""]}),e})();var so=n("JX91"),co=n("lJxs"),lo=n("hNFU"),ro=n("vrAh");const bo=["form"];function uo(e,t){if(1&e&&(s.Vb(0,"mat-option",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Lc(e.alias?e.alias:e.id?e.id:"")}}function ho(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer alias is required."),s.Ub())}function mo(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer not found in the list."),s.Ub())}function fo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",36),s.Vb(1,"input",37),s.dc("change",function(){return s.zc(e),s.hc().onSelectedPeerChanged()}),s.Ub(),s.Vb(2,"mat-autocomplete",38,39),s.dc("optionSelected",function(){return s.zc(e),s.hc().onSelectedPeerChanged()}),s.Ic(4,uo,2,2,"mat-option",24),s.ic(5,"async"),s.Ub(),s.Ic(6,ho,2,0,"mat-error",17),s.Ic(7,mo,2,0,"mat-error",17),s.Ub()}if(2&e){const e=s.wc(3),t=s.hc();s.Db(1),s.oc("formControl",t.selectedPeer)("matAutocomplete",e),s.Db(1),s.oc("displayWith",t.displayFn),s.Db(2),s.oc("ngForOf",s.jc(5,6,t.filteredPeers)),s.Db(2),s.oc("ngIf",null==t.selectedPeer.errors?null:t.selectedPeer.errors.required),s.Db(1),s.oc("ngIf",null==t.selectedPeer.errors?null:t.selectedPeer.errors.notfound)}}function po(e,t){1&e&&s.Rb(0)}function go(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function yo(e,t){if(1&e&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Mc("Amount must be less than or equal to ",e.totalBalance,".")}}function xo(e,t){if(1&e&&(s.Vb(0,"mat-option",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.feeRateId),s.Db(1),s.Mc(" ",e.feeRateType," ")}}function vo(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Min Confirmation Blocks is required."),s.Ub())}function Uo(e,t){if(1&e&&(s.Vb(0,"mat-option",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc("",s.jc(2,2,e.value)," Sats")}}function wo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",12),s.Vb(1,"mat-form-field",22),s.Vb(2,"mat-select",41),s.dc("selectionChange",function(t){return s.zc(e),s.hc().onUTXOSelectionChange(t)})("valueChange",function(t){return s.zc(e),s.hc().selUTXOs=t}),s.Vb(3,"mat-select-trigger"),s.Kc(4),s.ic(5,"number"),s.Ub(),s.Ic(6,Uo,3,4,"mat-option",24),s.Ub(),s.Ub(),s.Vb(7,"mat-slide-toggle",42),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().flgUseAllBalance=t})("change",function(){return s.zc(e),s.hc().onUTXOAllBalanceChange()}),s.Kc(8," Use selected UTXOs balance "),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(2),s.oc("value",e.selUTXOs),s.Db(2),s.Nc("",s.jc(5,6,e.totalSelectedUTXOAmount)," Sats (",e.selUTXOs.length>1?e.selUTXOs.length+" UTXOs":"1 UTXO",")"),s.Db(2),s.oc("ngForOf",e.utxos),s.Db(1),s.oc("ngModel",e.flgUseAllBalance)("disabled",e.selUTXOs.length<1)}}function Vo(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Lc(e.channelConnectionError)}}function Do(e,t){if(1&e&&(s.Vb(0,"div",43),s.Qb(1,"fa-icon",44),s.Ic(2,Vo,2,1,"span",17),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.channelConnectionError)}}function Co(e,t){if(1&e&&(s.Vb(0,"mat-expansion-panel",46),s.Vb(1,"mat-expansion-panel-header"),s.Vb(2,"mat-panel-title"),s.Vb(3,"span"),s.Kc(4,"Peer: \xa0"),s.Ub(),s.Vb(5,"strong",47),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",9),s.Vb(8,"div",0),s.Vb(9,"div",36),s.Vb(10,"h4",48),s.Kc(11,"Pubkey"),s.Ub(),s.Vb(12,"span",49),s.Kc(13),s.Ub(),s.Ub(),s.Ub(),s.Qb(14,"mat-divider",50),s.Vb(15,"div",0),s.Vb(16,"div",51),s.Vb(17,"h4",48),s.Kc(18,"Address"),s.Ub(),s.Vb(19,"span",52),s.Kc(20),s.Ub(),s.Ub(),s.Vb(21,"div",51),s.Vb(22,"h4",48),s.Kc(23,"Connected"),s.Ub(),s.Vb(24,"span",52),s.Kc(25),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc(2);s.Db(6),s.Lc((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.id)),s.Db(7),s.Lc(e.peer.id),s.Db(7),s.Lc(null==e.peer?null:e.peer.netaddr),s.Db(5),s.Lc(e.peer.connected?"True":"False")}}function So(e,t){if(1&e&&s.Ic(0,Co,26,4,"mat-expansion-panel",45),2&e){const e=s.hc();s.oc("ngIf",e.peer)}}let Lo=(()=>{class e{constructor(e,t,n,i,a){this.dialogRef=e,this.data=t,this.store=n,this.actions$=i,this.decimalPipe=a,this.selectedPeer=new ce.e,this.faExclamationTriangle=f.o,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=p.j,this.selFeeRate="",this.flgMinConf=!1,this.minConfValue=null,this.unSubs=[new d.a,new d.a]}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(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e.type===g.o||e.type===g.r)).subscribe(e=>{e.type===g.o&&"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message),e.type===g.r&&this.dialogRef.close()});let e="",t="";this.sortedPeers=this.peers.sort((n,i)=>(e=n.alias?n.alias.toLowerCase():n.id?n.id.toLowerCase():"",t=i.alias?i.alias.toLowerCase():n.id.toLowerCase(),e<t?-1:e>t?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe(Object(u.a)(this.unSubs[1]),Object(so.a)(""),Object(co.a)(e=>"string"==typeof e?e:e.alias?e.alias:e.id),Object(co.a)(e=>e?this.filterPeers(e):this.sortedPeers.slice()))}filterPeers(e){return this.sortedPeers.filter(t=>0===t.alias.toLowerCase().indexOf(e?e.toLowerCase():""))}displayFn(e){return e&&e.alias?e.alias:e&&e.id?e.id:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.id?this.selectedPeer.value.id:void 0,"string"==typeof this.selectedPeer.value){let e=this.peers.filter(e=>e.alias.length===this.selectedPeer.value.length&&0===e.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===e.length&&e[0].id&&(this.selectedPubkey=e[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(e){e&&(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.feeRateTypes.find(e=>e.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(e){let t={value:0};this.selUTXOs.length&&this.selUTXOs.length>0?(this.totalSelectedUTXOAmount=this.selUTXOs.reduce((e,n)=>(t.value=e.value+n.value,t)).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)return!0;let e={peerId:this.peer&&this.peer.id?this.peer.id:this.selectedPubkey,satoshis:this.flgUseAllBalance?"all":this.fundingAmount.toString(),announce:!this.isPrivate,feeRate:this.selFeeRate,minconf:this.flgMinConf?this.minConfValue:null};this.selUTXOs.length&&this.selUTXOs.length>0&&(e.utxos=[],this.selUTXOs.forEach(t=>e.utxos.push(t.txid+":"+t.output))),this.store.dispatch(new se.G("Opening Channel...")),this.store.dispatch(new g.wb(e))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(oe.a),s.Pb(x.h),s.Pb(v.a),s.Pb(i.f))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-open-channel"]],viewQuery:function(e,t){if(1&e&&s.Ec(bo,!0),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first)}},decls:54,vars:29,consts:[["fxLayout","row"],["fxFlex","100",1,"padding-gap-large"],["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,"mt-5px"],["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"],["fxFlex","48","fxLayoutAlign","start end"],["tabindex","4","placeholder","Fee Rate",3,"value","disabled","valueChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","5","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 center",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",""],["fxFlex","100"],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value"],["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(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.dc("click",function(){return t.onClose()}),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.dc("submit",function(){return t.onOpenChannel()})("reset",function(){return t.resetData()}),s.Vb(11,"div",9),s.Ic(12,fo,8,8,"mat-form-field",10),s.Ub(),s.Ic(13,po,1,0,"ng-container",11),s.Vb(14,"div",9),s.Vb(15,"div",12),s.Vb(16,"mat-form-field",13),s.Vb(17,"input",14,15),s.dc("ngModelChange",function(e){return t.fundingAmount=e}),s.Ub(),s.Vb(19,"mat-hint"),s.Kc(20),s.ic(21,"number"),s.Ub(),s.Vb(22,"span",16),s.Kc(23),s.Ub(),s.Ic(24,go,2,0,"mat-error",17),s.Ic(25,yo,2,1,"mat-error",17),s.Ub(),s.Vb(26,"div",18),s.Vb(27,"mat-slide-toggle",19),s.dc("ngModelChange",function(e){return t.isPrivate=e}),s.Kc(28,"Private Channel"),s.Ub(),s.Ub(),s.Ub(),s.Vb(29,"mat-expansion-panel",20),s.dc("closed",function(){return t.onAdvancedPanelToggle(!0)})("opened",function(){return t.onAdvancedPanelToggle(!1)}),s.Vb(30,"mat-expansion-panel-header"),s.Vb(31,"mat-panel-title"),s.Vb(32,"span"),s.Kc(33),s.Ub(),s.Ub(),s.Ub(),s.Vb(34,"div",21),s.Vb(35,"div",12),s.Vb(36,"mat-form-field",22),s.Vb(37,"mat-select",23),s.dc("valueChange",function(e){return t.selFeeRate=e}),s.Ic(38,xo,2,2,"mat-option",24),s.Ub(),s.Ub(),s.Vb(39,"div",25),s.Vb(40,"mat-checkbox",26),s.dc("ngModelChange",function(e){return t.flgMinConf=e})("change",function(){return t.flgMinConf?t.selFeeRate=null:t.minConfValue=null}),s.Ub(),s.Vb(41,"mat-form-field",27),s.Vb(42,"input",28,29),s.dc("ngModelChange",function(e){return t.minConfValue=e}),s.Ub(),s.Ic(44,vo,2,0,"mat-error",17),s.Ub(),s.Ub(),s.Ub(),s.Ic(45,wo,9,8,"div",30),s.Ub(),s.Ub(),s.Ub(),s.Ic(46,Do,3,2,"div",31),s.Vb(47,"div",32),s.Vb(48,"button",33),s.Kc(49,"Clear Fields"),s.Ub(),s.Vb(50,"button",34),s.Kc(51,"Open Channel"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(52,So,1,1,"ng-template",null,35,s.Jc)),2&e){const e=s.wc(18),n=s.wc(53);s.Db(5),s.Lc(t.alertTitle),s.Db(7),s.oc("ngIf",!t.peer&&t.peers&&t.peers.length>0),s.Db(1),s.oc("ngTemplateOutlet",n),s.Db(4),s.oc("ngModel",t.fundingAmount)("step",1e3)("min",1)("max",t.totalBalance)("disabled",t.flgUseAllBalance),s.Db(3),s.Nc("Remaining Bal: ",s.jc(21,27,t.totalBalance-(t.fundingAmount?t.fundingAmount:0)),"",t.flgUseAllBalance?". Amount replaced by UTXO balance":"",""),s.Db(3),s.Mc(" ",null==t.information?null:t.information.smaller_currency_unit," "),s.Db(1),s.oc("ngIf",(null==e.errors?null:e.errors.required)||!t.fundingAmount),s.Db(1),s.oc("ngIf",null==e.errors?null:e.errors.max),s.Db(2),s.oc("ngModel",t.isPrivate),s.Db(6),s.Lc(t.advancedTitle),s.Db(4),s.oc("value",t.selFeeRate)("disabled",t.flgMinConf),s.Db(1),s.oc("ngForOf",t.feeRateTypes),s.Db(2),s.oc("ngModel",t.flgMinConf),s.Db(2),s.oc("ngModel",t.minConfValue)("step",1)("min",0)("required",t.flgMinConf)("disabled",!t.flgMinConf),s.Db(2),s.oc("ngIf",t.flgMinConf&&!t.minConfValue),s.Db(1),s.oc("ngIf",t.isCompatibleVersion),s.Db(1),s.oc("ngIf",""!==t.channelConnectionError)}},directives:[c.c,c.a,D.c,c.b,S.a,D.b,ce.u,ce.n,ce.o,i.o,i.t,O.c,le.b,ce.q,ce.c,be.a,lo.a,ce.s,ce.m,ce.p,O.f,O.g,ue.a,zn.c,zn.e,zn.f,de.a,i.n,En.a,re.a,ro.c,ce.f,ro.a,he.m,O.b,de.c,R.a,w.a,K.a],pipes:[i.f,i.b],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),e})();function Io(e,t){if(1&e&&(s.Vb(0,"span",7),s.Kc(1,"Open"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.openChannels)}}function Fo(e,t){if(1&e&&(s.Vb(0,"span",7),s.Kc(1,"Pending/Inactive"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.pendingChannels)}}let ko=(()=>{class e{constructor(e,t,n,i){this.logger=e,this.store=t,this.commonService=n,this.router=i,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.a,new d.a]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("cl").pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{e.allChannels&&e.allChannels.length?(this.openChannels=0,this.pendingChannels=0,e.allChannels.forEach(e=>{"CHANNELD_NORMAL"===e.state&&e.connected?this.openChannels++:this.pendingChannels++})):(this.openChannels=0,this.pendingChannels=0),this.selNode=e.nodeSettings,this.information=e.information,this.peers=e.peers,this.utxos=this.commonService.sortAscByKey(e.utxos.filter(e=>"confirmed"===e.status),"value"),this.totalBalance=e.balance.totalBalance,this.logger.info(e)})}onOpenChannel(){const e={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 se.D({data:{alertTitle:"Open Channel",message:e,component:Lo}}))}onSelectedTabChange(e){this.router.navigateByUrl("/cl/connections/channels/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(U.a),s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channels-tables"]],decls:12,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"mt-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"button",2),s.dc("click",function(){return t.onOpenChannel()}),s.Kc(3,"Open Channel"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-tab-group",4),s.dc("selectedIndexChange",function(e){return t.activeLink=e})("selectedTabChange",function(e){return t.onSelectedTabChange(e)}),s.Vb(6,"mat-tab"),s.Ic(7,Io,2,1,"ng-template",5),s.Ub(),s.Vb(8,"mat-tab"),s.Ic(9,Fo,2,1,"ng-template",5),s.Ub(),s.Ub(),s.Vb(10,"div",6),s.Qb(11,"router-outlet"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.oc("selectedIndex",t.activeLink))},directives:[c.c,c.a,c.b,S.a,te.b,te.a,te.c,a.l,Hi.a],styles:[""]}),e})();function Ao(e,t){if(1&e&&(s.Vb(0,"div"),s.Qb(1,"mat-divider",13),s.Vb(2,"div",9),s.Vb(3,"div",14),s.Vb(4,"h4",11),s.Kc(5,"Funding Transaction Id"),s.Ub(),s.Vb(6,"span",12),s.Kc(7),s.Ub(),s.Ub(),s.Ub(),s.Qb(8,"mat-divider",13),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.channel.funding_txid),s.Db(1),s.oc("inset",!0)}}function Po(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Show Advanced"),s.Ub())}function _o(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Hide Advanced"),s.Ub())}function To(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",24),s.dc("copied",function(t){return s.zc(e),s.hc().onCopyChanID(t)}),s.Kc(1,"Copy Short Channel ID"),s.Ub()}if(2&e){const e=s.hc();s.oc("payload",e.channel.short_channel_id)}}function Oo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",25),s.dc("click",function(){return s.zc(e),s.hc().onClose()}),s.Kc(1,"OK"),s.Ub()}}const Ro=function(e){return{"xs-scroll-y":e}},Ko=function(e,t){return{"mt-2":e,"mt-1":t}};let Mo=(()=>{class e{constructor(e,t,n,i,a){this.dialogRef=e,this.data=t,this.logger=n,this.commonService=i,this.snackBar=a,this.faReceipt=f.H,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=p.s}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(e){this.snackBar.open("Short channel ID "+e+" copied."),this.logger.info("Copied Text: "+e)}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(oe.a),s.Pb(y.b),s.Pb(U.a),s.Pb(Mn.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-information"]],decls:93,vars:39,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"padding-gap-large","pl-3"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header","mb-1"],["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"],[3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],["fxFlex","100"],["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(e,t){if(1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Qb(4,"fa-icon",4),s.Vb(5,"span",5),s.Kc(6,"Channel Information"),s.Ub(),s.Ub(),s.Vb(7,"button",6),s.dc("click",function(){return t.onClose()}),s.Kc(8,"X"),s.Ub(),s.Ub(),s.Vb(9,"mat-card-content",7),s.Vb(10,"div",8),s.Vb(11,"div",9),s.Vb(12,"div",10),s.Vb(13,"h4",11),s.Kc(14,"Short Channel ID"),s.Ub(),s.Vb(15,"span",12),s.Kc(16),s.Ub(),s.Ub(),s.Vb(17,"div",10),s.Vb(18,"h4",11),s.Kc(19,"Peer Alias"),s.Ub(),s.Vb(20,"span",12),s.Kc(21),s.Ub(),s.Ub(),s.Ub(),s.Qb(22,"mat-divider",13),s.Vb(23,"div",9),s.Vb(24,"div",14),s.Vb(25,"h4",11),s.Kc(26,"Channel ID"),s.Ub(),s.Vb(27,"span",12),s.Kc(28),s.Ub(),s.Ub(),s.Ub(),s.Qb(29,"mat-divider",13),s.Vb(30,"div",9),s.Vb(31,"div",14),s.Vb(32,"h4",11),s.Kc(33,"Peer Public Key"),s.Ub(),s.Vb(34,"span",12),s.Kc(35),s.Ub(),s.Ub(),s.Ub(),s.Qb(36,"mat-divider",13),s.Vb(37,"div",9),s.Vb(38,"div",15),s.Vb(39,"h4",11),s.Kc(40,"mSatoshi to Us"),s.Ub(),s.Vb(41,"span",16),s.Kc(42),s.ic(43,"number"),s.Ub(),s.Ub(),s.Vb(44,"div",15),s.Vb(45,"h4",11),s.Kc(46,"Spendable (mSats)"),s.Ub(),s.Vb(47,"span",16),s.Kc(48),s.ic(49,"number"),s.Ub(),s.Ub(),s.Vb(50,"div",15),s.Vb(51,"h4",11),s.Kc(52,"Total (mSats)"),s.Ub(),s.Vb(53,"span",16),s.Kc(54),s.ic(55,"number"),s.Ub(),s.Ub(),s.Vb(56,"div",15),s.Vb(57,"h4",11),s.Kc(58,"State"),s.Ub(),s.Vb(59,"span",16),s.Kc(60),s.Ub(),s.Ub(),s.Ub(),s.Qb(61,"mat-divider",13),s.Vb(62,"div",9),s.Vb(63,"div",15),s.Vb(64,"h4",11),s.Kc(65,"Our Reserve (Sats)"),s.Ub(),s.Vb(66,"span",16),s.Kc(67),s.ic(68,"number"),s.Ub(),s.Ub(),s.Vb(69,"div",15),s.Vb(70,"h4",11),s.Kc(71,"Their Reserve (Sats)"),s.Ub(),s.Vb(72,"span",16),s.Kc(73),s.ic(74,"number"),s.Ub(),s.Ub(),s.Vb(75,"div",15),s.Vb(76,"h4",11),s.Kc(77,"Connected"),s.Ub(),s.Vb(78,"span",16),s.Kc(79),s.Ub(),s.Ub(),s.Vb(80,"div",15),s.Vb(81,"h4",11),s.Kc(82,"Private"),s.Ub(),s.Vb(83,"span",16),s.Kc(84),s.Ub(),s.Ub(),s.Ub(),s.Ic(85,Ao,9,3,"div",17),s.Vb(86,"div",18),s.Vb(87,"button",19),s.dc("click",function(){return t.onShowAdvanced()}),s.Ic(88,Po,2,0,"p",20),s.Ic(89,_o,2,0,"ng-template",null,21,s.Jc),s.Ub(),s.Ic(91,To,2,1,"button",22),s.Ic(92,Oo,2,0,"button",23),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.wc(90);s.Db(4),s.oc("icon",t.faReceipt),s.Db(5),s.oc("ngClass",s.sc(34,Ro,t.screenSize===t.screenSizeEnum.XS)),s.Db(7),s.Lc(t.channel.short_channel_id),s.Db(5),s.Lc(t.channel.alias),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.channel.channel_id),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.channel.id),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(43,24,t.channel.msatoshi_to_us)),s.Db(6),s.Lc(s.jc(49,26,t.channel.spendable_msatoshi)),s.Db(6),s.Lc(s.jc(55,28,t.channel.msatoshi_total)),s.Db(6),s.Lc(t.channel.state),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(68,30,t.channel.our_channel_reserve_satoshis)),s.Db(6),s.Lc(s.jc(74,32,t.channel.their_channel_reserve_satoshis)),s.Db(6),s.Lc(t.channel.connected?"Yes":"No"),s.Db(5),s.Lc(t.channel.private?"Yes":"No"),s.Db(1),s.oc("ngIf",t.showAdvanced),s.Db(1),s.oc("ngClass",s.tc(36,Ko,!t.showAdvanced,t.showAdvanced)),s.Db(2),s.oc("ngIf",!t.showAdvanced)("ngIfElse",e),s.Db(3),s.oc("ngIf",t.showCopy),s.Db(1),s.oc("ngIf",!t.showCopy)}},directives:[c.c,c.b,c.a,D.c,w.a,S.a,D.b,i.m,I.a,K.a,i.o,re.a,aa.a],pipes:[i.f],styles:[""]}),e})();function Eo(e,t){1&e&&s.Qb(0,"mat-progress-bar",33)}function zo(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1," Short Channel ID "),s.Ub())}function Bo(e,t){if(1&e&&(s.Vb(0,"span",40),s.Qb(1,"fa-icon",41),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faEyeSlash)}}function No(e,t){if(1&e&&(s.Vb(0,"span",42),s.Qb(1,"fa-icon",41),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faEye)}}const Qo=function(e){return{"max-width":e}};function Ho(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"div",36),s.Ic(2,Bo,2,1,"span",37),s.Ic(3,No,2,1,"span",38),s.Vb(4,"span",39),s.Kc(5),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(4,Qo,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),s.Db(1),s.oc("ngIf",e.private),s.Db(1),s.oc("ngIf",!e.private),s.Db(2),s.Lc(null==e?null:e.short_channel_id)}}function qo(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1," Alias "),s.Ub())}function Xo(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"div",36),s.Vb(2,"span",39),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(2,Qo,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),s.Db(2),s.Lc(null==e?null:e.alias)}}function jo(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1," Connected "),s.Ub())}function Go(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null!=e&&e.connected?"Connected":"Disconnected"," ")}}function $o(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1," Private "),s.Ub())}function Wo(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null!=e&&e.private?"Private":"Public"," ")}}function Jo(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1," State "),s.Ub())}function Yo(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.state,"")}}function Zo(e,t){1&e&&(s.Vb(0,"th",43),s.Kc(1," Local Balance (Sats) "),s.Ub())}function es(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"span",44),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,(null==e?null:e.msatoshi_to_us)/1e3,(null==e?null:e.msatoshi_to_us)<1e3?"1.0-4":"1.0-0")," ")}}function ts(e,t){1&e&&(s.Vb(0,"th",43),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function ns(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"span",44),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,(null==e?null:e.msatoshi_to_them)/1e3,(null==e?null:e.msatoshi_to_them)<1e3?"1.0-4":"1.0-0")," ")}}function is(e,t){1&e&&(s.Vb(0,"th",43),s.Kc(1," Total mSatoshis "),s.Ub())}function as(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"span",44),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.msatoshi_total)," ")}}function os(e,t){1&e&&(s.Vb(0,"th",43),s.Kc(1," Spendable Satoshi "),s.Ub())}function ss(e,t){if(1&e&&(s.Vb(0,"td",35),s.Vb(1,"span",44),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.spendable_msatoshi)," ")}}function cs(e,t){1&e&&(s.Vb(0,"th",45),s.Kc(1,"Balance Score "),s.Ub())}function ls(e,t){if(1&e&&(s.Vb(0,"td",46),s.Vb(1,"div",47),s.Vb(2,"mat-hint",48),s.Kc(3),s.ic(4,"number"),s.Ub(),s.Ub(),s.Qb(5,"mat-progress-bar",49),s.Ub()),2&e){const e=t.$implicit;s.Db(3),s.Lc(s.jc(4,2,e.balancedness||0)),s.Db(2),s.pc("value",e.msatoshi_to_us&&e.msatoshi_to_us>0?+e.msatoshi_to_us/(+e.msatoshi_to_us+ +e.msatoshi_to_them)*100:0)}}function rs(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",50),s.Vb(1,"div",51),s.Vb(2,"mat-select",52),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",53),s.dc("click",function(){return s.zc(e),s.hc().onChannelUpdate("all")}),s.Kc(5,"Update Fee Policy"),s.Ub(),s.Vb(6,"mat-option",53),s.dc("click",function(){return s.zc(e),s.hc().onDownloadCSV()}),s.Kc(7,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function bs(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",54),s.Vb(1,"div",55),s.Vb(2,"mat-select",56),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",53),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc().onChannelClick(i,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",53),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onViewRemotePolicy(n)}),s.Kc(7,"View Remote Fee"),s.Ub(),s.Vb(8,"mat-option",53),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onChannelUpdate(n)}),s.Kc(9,"Update Fee Policy"),s.Ub(),s.Vb(10,"mat-option",53),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onChannelClose(n)}),s.Kc(11,"Close Channel"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function ds(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No peers connected. Add a peer in order to open a channel."),s.Ub())}function us(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No channels available."),s.Ub())}function hs(e,t){if(1&e&&(s.Vb(0,"td",57),s.Ic(1,ds,2,0,"p",58),s.Ic(2,us,2,0,"p",58),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)),s.Db(1),s.oc("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1))}}const ms=function(e){return{"display-none":e}};function fs(e,t){if(1&e&&s.Qb(0,"tr",59),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,ms,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function ps(e,t){1&e&&s.Qb(0,"tr",60)}function gs(e,t){1&e&&s.Qb(0,"tr",61)}const ys=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},xs=function(){return["no_peer"]};let vs=(()=>{class e{constructor(e,t,n,i,a){this.logger=e,this.store=t,this.rtlEffects=n,this.clEffects=i,this.commonService=a,this.faEye=f.p,this.faEyeSlash=f.q,this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=p.j,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","msatoshi_to_us","msatoshi_to_them","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.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(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels"===e.action&&(this.flgLoading[0]="error")}),this.information=e.information,this.numPeers=e.peers&&e.peers.length?e.peers.length:0,this.totalBalance=e.balance.totalBalance,this.channelsData=e.allChannels.filter(e=>"CHANNELD_NORMAL"===e.state&&e.connected),this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.allChannels),this.logger.info(e)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onViewRemotePolicy(e){this.store.dispatch(new g.f({shortChannelID:e.short_channel_id,showError:!0})),this.clEffects.setLookupCL.pipe(Object(Je.a)(1)).subscribe(e=>{if(0===e.length)return!1;let t={};t=e[0].source!==this.information.id?e[0]:e[1],this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Remote Channel Policy",message:[[{key:"base_fee_millisatoshi",value:t.base_fee_millisatoshi,title:"Base Fees (mSats)",width:34,type:p.h.NUMBER},{key:"fee_per_millionth",value:t.fee_per_millionth,title:"Fee/Millionth",width:33,type:p.h.NUMBER},{key:"delay",value:t.delay,title:"Delay",width:33,type:p.h.NUMBER}]]}}))})}onChannelUpdate(e){"all"!==e&&"ONCHAIN"===e.state||("all"===e?(this.store.dispatch(new se.E({data:{type:p.b.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}]}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{if(e){const t=e[0].inputValue,n=e[1].inputValue;this.store.dispatch(new se.G("Updating Channel Policy...")),this.store.dispatch(new g.Jb({baseFeeMsat:t,feeRate:n,channelId:"all"}))}})):(this.myChanPolicy={fee_base_msat:0,fee_rate_milli_msat:0},this.store.dispatch(new se.G("Fetching Channel Policy...")),this.store.dispatch(new g.f({shortChannelID:e.short_channel_id,showError:!1})),this.clEffects.setLookupCL.pipe(Object(Je.a)(1)).subscribe(t=>{this.myChanPolicy=t.length>0&&t[0].destination===this.information.id?{fee_base_msat:t[0].base_fee_millisatoshi,fee_rate_milli_msat:t[0].fee_per_millionth}:t.length>1&&t[1].destination===this.information.id?{fee_base_msat:t[1].base_fee_millisatoshi,fee_rate_milli_msat:t[1].fee_per_millionth}:{fee_base_msat:0,fee_rate_milli_msat:0},this.logger.info(this.myChanPolicy),this.store.dispatch(new se.j),this.store.dispatch(new se.E({data:{type:p.b.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"Update fee policy for Channel: "+e.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}]}}))}),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[2])).subscribe(t=>{if(t){const n=t[0].inputValue,i=t[1].inputValue;this.store.dispatch(new se.G("Updating Channel Policy...")),this.store.dispatch(new g.Jb({baseFeeMsat:n,feeRate:i,channelId:e.channel_id}))}})),this.applyFilter())}onChannelClose(e){this.store.dispatch(new se.E({data:{type:p.b.CONFIRM,alertTitle:"Close Channel",titleMessage:"Closing channel: "+e.channel_id,noBtnText:"Cancel",yesBtnText:"Close Channel"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[3])).subscribe(t=>{t&&(this.store.dispatch(new se.G("Closing Channel...")),this.store.dispatch(new g.h({channelId:e.channel_id,force:!1})))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,t){this.store.dispatch(new se.D({data:{channel:e,showCopy:!0,component:Mo}}))}loadChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?1:-1}),this.channels=new ae.o([...e]),this.channels.filterPredicate=(e,t)=>((e.connected?"connected":"disconnected")+(e.channel_id?e.channel_id:"")+(e.short_channel_id?e.short_channel_id:"")+(e.id?e.id:"")+(e.alias?e.alias:"")+(e.private?"private":"public")+(e.state?e.state.toLowerCase():"")+(e.funding_txid?e.funding_txid:"")+(e.msatoshi_to_us?e.msatoshi_to_us:"")+(e.msatoshi_total?e.msatoshi_total:"")+(e.their_channel_reserve_satoshis?e.their_channel_reserve_satoshis:"")+(e.our_channel_reserve_satoshis?e.our_channel_reserve_satoshis:"")+(e.spendable_msatoshi?e.spendable_msatoshi:"")).includes(t),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]: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(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(ve.a),s.Pb(Ye.a),s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-open-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("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,"padding-gap-x","page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["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-4",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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(){return t.applyFilter()})("ngModelChange",function(e){return t.selFilter=e}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Ic(6,Eo,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,zo,2,0,"th",10),s.Ic(11,Ho,6,6,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,qo,2,0,"th",10),s.Ic(14,Xo,4,4,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,jo,2,0,"th",10),s.Ic(17,Go,2,1,"td",11),s.Sb(),s.Tb(18,14),s.Ic(19,$o,2,0,"th",10),s.Ic(20,Wo,2,1,"td",11),s.Sb(),s.Tb(21,15),s.Ic(22,Jo,2,0,"th",10),s.Ic(23,Yo,2,1,"td",11),s.Sb(),s.Tb(24,16),s.Ic(25,Zo,2,0,"th",17),s.Ic(26,es,4,4,"td",11),s.Sb(),s.Tb(27,18),s.Ic(28,ts,2,0,"th",17),s.Ic(29,ns,4,4,"td",11),s.Sb(),s.Tb(30,19),s.Ic(31,is,2,0,"th",17),s.Ic(32,as,4,3,"td",11),s.Sb(),s.Tb(33,20),s.Ic(34,os,2,0,"th",17),s.Ic(35,ss,4,3,"td",11),s.Sb(),s.Tb(36,21),s.Ic(37,cs,2,0,"th",22),s.Ic(38,ls,6,4,"td",23),s.Sb(),s.Tb(39,24),s.Ic(40,rs,8,0,"th",25),s.Ic(41,bs,12,0,"td",26),s.Sb(),s.Tb(42,27),s.Ic(43,hs,3,2,"td",28),s.Sb(),s.Ic(44,fs,1,3,"tr",29),s.Ic(45,ps,1,0,"tr",30),s.Ic(46,gs,1,0,"tr",31),s.Ub(),s.Ub(),s.Qb(47,"mat-paginator",32),s.Ub()),2&e&&(s.Db(4),s.oc("ngModel",t.selFilter),s.Db(2),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.channels)("ngClass",s.sc(11,ys,"error"===t.flgLoading[0])),s.Db(37),s.oc("matFooterRowDef",s.rc(13,xs)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,O.c,le.b,ce.c,ce.m,ce.p,M.b,i.o,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ne.a,l.a,ae.h,ie.b,ae.a,i.p,I.b,R.a,w.a,O.f,de.a,de.c,he.m,ae.d,ae.f,ae.j,ae.l],pipes:[i.f],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%}}"]}),e})();function Us(e,t){1&e&&s.Qb(0,"mat-progress-bar",29)}function ws(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," Short Channel ID "),s.Ub())}function Vs(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.short_channel_id,"")}}function Ds(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," Alias "),s.Ub())}function Cs(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.alias)}}function Ss(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," Connected "),s.Ub())}function Ls(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null!=e&&e.connected?"Connected":"Disconnected"," ")}}function Is(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," Private "),s.Ub())}function Fs(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null!=e&&e.private?"Private":"Public"," ")}}function ks(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," State "),s.Ub())}function As(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.state,"")}}function Ps(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," mSatoshi To Us "),s.Ub())}function _s(e,t){if(1&e&&(s.Vb(0,"td",31),s.Vb(1,"span",33),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.msatoshi_to_us)," ")}}function Ts(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Total (Sats) "),s.Ub())}function Os(e,t){if(1&e&&(s.Vb(0,"td",31),s.Vb(1,"span",33),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,(null==e?null:e.msatoshi_total)/1e3)," ")}}function Rs(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Spendable Satoshi "),s.Ub())}function Ks(e,t){if(1&e&&(s.Vb(0,"td",31),s.Vb(1,"span",33),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.spendable_msatoshi)," ")}}function Ms(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",34),s.Vb(1,"div",35),s.Vb(2,"mat-select",36),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",37),s.dc("click",function(){return s.zc(e),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Es(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-option",37),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc().onChannelClose(t)}),s.Kc(1,"Close Channel"),s.Ub()}}function zs(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",38),s.Vb(1,"div",35),s.Vb(2,"mat-select",39),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",37),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc().onChannelClick(i,n)}),s.Kc(5,"View Info"),s.Ub(),s.Ic(6,Es,2,0,"mat-option",40),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.Db(6),s.oc("ngIf",n.isCompatibleVersion&&!e.connected&&"CHANNELD_NORMAL"===e.state)}}function Bs(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No peers connected. Add a peer in order to open a channel."),s.Ub())}function Ns(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No channels available."),s.Ub())}function Qs(e,t){if(1&e&&(s.Vb(0,"td",41),s.Ic(1,Bs,2,0,"p",42),s.Ic(2,Ns,2,0,"p",42),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)),s.Db(1),s.oc("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1))}}const Hs=function(e){return{"display-none":e}};function qs(e,t){if(1&e&&s.Qb(0,"tr",43),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Hs,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Xs(e,t){1&e&&s.Qb(0,"tr",44)}function js(e,t){1&e&&s.Qb(0,"tr",45)}const Gs=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},$s=function(){return["no_peer"]};let Ws=(()=>{class e{constructor(e,t,n,i,a){this.logger=e,this.store=t,this.rtlEffects=n,this.clEffects=i,this.commonService=a,this.isCompatibleVersion=!1,this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=p.j,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","state","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["alias","connected","state","actions"]):this.screenSize===p.s.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(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels"===e.action&&(this.flgLoading[0]="error")}),this.information=e.information,this.information.api_version&&(this.isCompatibleVersion=this.commonService.isVersionCompatible(this.information.api_version,"0.4.2")),this.numPeers=e.peers&&e.peers.length?e.peers.length:0,this.totalBalance=e.balance.totalBalance,this.channelsData=e.allChannels.filter(e=>!("CHANNELD_NORMAL"===e.state&&e.connected)),this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.allChannels),this.logger.info(e)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,t){this.store.dispatch(new se.D({data:{channel:e,showCopy:!0,component:Mo}}))}onChannelClose(e){this.store.dispatch(new se.E({data:{type:p.b.CONFIRM,alertTitle:"Force Close Channel",titleMessage:"Force closing channel: "+e.channel_id,noBtnText:"Cancel",yesBtnText:"Force Close"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[3])).subscribe(t=>{t&&(this.store.dispatch(new se.G("Force Closing Channel...")),this.store.dispatch(new g.h({channelId:e.channel_id,force:!0})))})}loadChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?1:-1}),this.channels=new ae.o([...e]),this.channels.filterPredicate=(e,t)=>((e.connected?"connected":"disconnected")+(e.channel_id?e.channel_id:"")+(e.short_channel_id?e.short_channel_id:"")+(e.id?e.id:"")+(e.alias?e.alias:"")+(e.private?"private":"public")+(e.state?e.state.toLowerCase():"")+(e.funding_txid?e.funding_txid:"")+(e.msatoshi_to_us?e.msatoshi_to_us:"")+(e.msatoshi_total?e.msatoshi_total:"")+(e.their_channel_reserve_satoshis?e.their_channel_reserve_satoshis:"")+(e.our_channel_reserve_satoshis?e.our_channel_reserve_satoshis:"")+(e.spendable_msatoshi?e.spendable_msatoshi:"")).includes(t),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]: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(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(ve.a),s.Pb(Ye.a),s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-channel-pending-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("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,"padding-gap-x","page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["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_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-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(){return t.applyFilter()})("ngModelChange",function(e){return t.selFilter=e}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Ic(6,Us,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,ws,2,0,"th",10),s.Ic(11,Vs,2,1,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,Ds,2,0,"th",10),s.Ic(14,Cs,2,1,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,Ss,2,0,"th",10),s.Ic(17,Ls,2,1,"td",11),s.Sb(),s.Tb(18,14),s.Ic(19,Is,2,0,"th",10),s.Ic(20,Fs,2,1,"td",11),s.Sb(),s.Tb(21,15),s.Ic(22,ks,2,0,"th",10),s.Ic(23,As,2,1,"td",11),s.Sb(),s.Tb(24,16),s.Ic(25,Ps,2,0,"th",17),s.Ic(26,_s,4,3,"td",11),s.Sb(),s.Tb(27,18),s.Ic(28,Ts,2,0,"th",17),s.Ic(29,Os,4,3,"td",11),s.Sb(),s.Tb(30,19),s.Ic(31,Rs,2,0,"th",17),s.Ic(32,Ks,4,3,"td",11),s.Sb(),s.Tb(33,20),s.Ic(34,Ms,6,0,"th",21),s.Ic(35,zs,7,1,"td",22),s.Sb(),s.Tb(36,23),s.Ic(37,Qs,3,2,"td",24),s.Sb(),s.Ic(38,qs,1,3,"tr",25),s.Ic(39,Xs,1,0,"tr",26),s.Ic(40,js,1,0,"tr",27),s.Ub(),s.Ub(),s.Qb(41,"mat-paginator",28),s.Ub()),2&e&&(s.Db(4),s.oc("ngModel",t.selFilter),s.Db(2),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.channels)("ngClass",s.sc(11,Gs,"error"===t.flgLoading[0])),s.Db(31),s.oc("matFooterRowDef",s.rc(13,$s)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,O.c,le.b,ce.c,ce.m,ce.p,M.b,i.o,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ne.a,l.a,ae.h,ie.b,ae.a,de.a,de.c,he.m,ae.d,ae.f,ae.j,ae.l],pipes:[i.f],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();const Js=["peersForm"],Ys=["stepper"];function Zs(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.peerFormLabel)}}function ec(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Address is required."),s.Ub())}function tc(e,t){if(1&e&&(s.Vb(0,"div",39),s.Qb(1,"fa-icon",40),s.Vb(2,"span"),s.Kc(3),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(2),s.Lc(e.peerConnectionError)}}function nc(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.channelFormLabel)}}function ic(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function ac(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount must be a positive number."),s.Ub())}function oc(e,t){if(1&e&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Mc("Amount must be less than or equal to ",e.totalBalance,".")}}function sc(e,t){if(1&e&&(s.Vb(0,"mat-option",41),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.feeRateId),s.Db(1),s.Mc(" ",e.feeRateType," ")}}function cc(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Min Confirmation Blocks is required."),s.Ub())}function lc(e,t){if(1&e&&(s.Vb(0,"div",39),s.Qb(1,"fa-icon",40),s.Vb(2,"span"),s.Kc(3),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(2),s.Lc(e.channelConnectionError)}}let rc=(()=>{class e{constructor(e,t,n,i,a,o,s){this.dialogRef=e,this.data=t,this.store=n,this.clEffects=i,this.formBuilder=a,this.actions$=o,this.logger=s,this.faExclamationTriangle=f.o,this.peerAddress="",this.totalBalance=0,this.feeRateTypes=p.j,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new d.a,new d.a]}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:["",[ce.t.required]],peerAddress:[this.peerAddress,[ce.t.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[ce.t.required,ce.t.min(1),ce.t.max(this.totalBalance)]],isPrivate:[!1],selFeeRate:[null],flgMinConf:[!1],minConfValue:[null],hiddenAmount:["",[ce.t.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.channelFormGroup.controls.flgMinConf.valueChanges.pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{e?(this.channelFormGroup.controls.selFeeRate.setValue(null),this.channelFormGroup.controls.selFeeRate.disable(),this.channelFormGroup.controls.minConfValue.enable(),this.channelFormGroup.controls.minConfValue.setValidators([ce.t.required])):(this.channelFormGroup.controls.selFeeRate.enable(),this.channelFormGroup.controls.minConfValue.disable(),this.channelFormGroup.controls.minConfValue.setValidators(null))}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.R||e.type===g.r||e.type===g.o)).subscribe(e=>{e.type===g.R&&(this.logger.info(e.payload),this.flgEditable=!1,this.newlyAddedPeer=e.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),e.type===g.r&&this.dialogRef.close(),e.type===g.o&&("SaveNewPeer"===e.payload.action?this.peerConnectionError=e.payload.message:"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch(new se.G("Adding Peer...")),this.store.dispatch(new g.yb({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 se.G("Opening Channel...")),this.store.dispatch(new g.wb({peerId:this.newlyAddedPeer.id,satoshis:this.channelFormGroup.controls.fundingAmount.value,announce:!this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.selFeeRate.value,minconf:this.channelFormGroup.controls.flgMinConf.value?this.channelFormGroup.controls.minConfValue.value:null}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(e){switch(e.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)"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===e.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(oe.f),s.Pb(oe.a),s.Pb(x.h),s.Pb(Ye.a),s.Pb(ce.d),s.Pb(v.a),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-connect-peer"]],viewQuery:function(e,t){if(1&e&&(s.Pc(Js,!0),s.Pc(Ys,!0)),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first),s.vc(e=s.ec())&&(t.stepper=e.first)}},decls:55,vars:24,consts:[["fxLayout","row"],["fxFlex","100",1,"padding-gap-large"],["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,"mt-5px"],["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",""],["fxFlex","100"],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","60","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",1,"mt-1"],["fxFlex","48","fxLayoutAlign","start end"],["tabindex","4","placeholder","Fee Rate","formControlName","selFeeRate"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["fxFlex","2","tabindex","5","color","primary","formControlName","flgMinConf","name","flgMinConf","fxLayoutAlign","stretch start",1,"mr-2"],["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","button",3,"click"],["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"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Connect to a new peer"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.dc("click",function(){return t.onClose()}),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"div",7),s.Vb(10,"mat-vertical-stepper",8,9),s.dc("selectionChange",function(e){return t.stepSelectionChanged(e)}),s.Vb(12,"mat-step",10),s.Vb(13,"form",11),s.Ic(14,Zs,1,1,"ng-template",12),s.Vb(15,"mat-form-field",13),s.Qb(16,"input",14),s.Ic(17,ec,2,0,"mat-error",15),s.Ub(),s.Ic(18,tc,4,2,"div",16),s.Vb(19,"div",17),s.Vb(20,"button",18),s.dc("click",function(){return t.onConnectPeer()}),s.Kc(21),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(22,"mat-step",10),s.Vb(23,"form",19),s.Ic(24,nc,1,1,"ng-template",20),s.Vb(25,"div",21),s.Vb(26,"div",22),s.Vb(27,"mat-form-field",23),s.Qb(28,"input",24),s.Vb(29,"mat-hint"),s.Kc(30),s.Ub(),s.Vb(31,"span",25),s.Kc(32," Sats "),s.Ub(),s.Ic(33,ic,2,0,"mat-error",15),s.Ic(34,ac,2,0,"mat-error",15),s.Ic(35,oc,2,1,"mat-error",15),s.Ub(),s.Vb(36,"div",26),s.Vb(37,"mat-slide-toggle",27),s.Kc(38,"Private Channel"),s.Ub(),s.Ub(),s.Ub(),s.Vb(39,"div",28),s.Vb(40,"mat-form-field",29),s.Vb(41,"mat-select",30),s.Ic(42,sc,2,2,"mat-option",31),s.Ub(),s.Ub(),s.Vb(43,"div",32),s.Qb(44,"mat-checkbox",33),s.Vb(45,"mat-form-field",34),s.Qb(46,"input",35),s.Ic(47,cc,2,0,"mat-error",15),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(48,lc,4,2,"div",16),s.Vb(49,"div",17),s.Vb(50,"button",36),s.dc("click",function(){return t.onOpenChannel()}),s.Kc(51),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(52,"div",37),s.Vb(53,"button",38),s.Kc(54),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(10),s.oc("linear",!0),s.Db(2),s.oc("stepControl",t.peerFormGroup)("editable",t.flgEditable),s.Db(1),s.oc("formGroup",t.peerFormGroup),s.Db(4),s.oc("ngIf",null==t.peerFormGroup.controls.peerAddress.errors?null:t.peerFormGroup.controls.peerAddress.errors.required),s.Db(1),s.oc("ngIf",""!==t.peerConnectionError),s.Db(3),s.Lc(""!==t.peerConnectionError?"Retry":"Add Peer"),s.Db(1),s.oc("stepControl",t.channelFormGroup)("editable",t.flgEditable),s.Db(1),s.oc("formGroup",t.channelFormGroup),s.Db(5),s.oc("step",1e3),s.Db(2),s.Mc("Remaining Bal: ",t.totalBalance-(t.channelFormGroup.controls.fundingAmount.value?t.channelFormGroup.controls.fundingAmount.value:0),""),s.Db(3),s.oc("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.required),s.Db(1),s.oc("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.min),s.Db(1),s.oc("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.max),s.Db(7),s.oc("ngForOf",t.feeRateTypes),s.Db(4),s.oc("step",1)("min",0)("required",t.channelFormGroup.controls.flgMinConf.value),s.Db(1),s.oc("ngIf",t.channelFormGroup.controls.flgMinConf.value&&!t.channelFormGroup.controls.minConfValue.value),s.Db(1),s.oc("ngIf",""!==t.channelConnectionError),s.Db(3),s.Lc(""!==t.channelConnectionError?"Retry":"Open Channel"),s.Db(2),s.oc("mat-dialog-close",!1),s.Db(1),s.Lc(null!=t.newlyAddedPeer&&t.newlyAddedPeer.id?"Do It Later":"Close"))},directives:[c.c,c.a,D.c,c.b,S.a,D.b,Bn.h,Bn.a,ce.u,ce.n,ce.h,Bn.b,O.c,le.b,ce.c,re.a,ce.m,ce.g,ce.s,i.o,ce.q,O.f,O.g,ue.a,de.a,i.n,En.a,be.a,oe.d,O.b,w.a,he.m],styles:[""]}),e})();function bc(e,t){1&e&&s.Qb(0,"mat-progress-bar",32)}function dc(e,t){1&e&&(s.Vb(0,"th",33),s.Kc(1," Alias "),s.Ub())}const uc=function(e){return{"mr-0":e}};function hc(e,t){if(1&e&&s.Qb(0,"span",37),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,uc,e.screenSize===e.screenSizeEnum.XS))}}function mc(e,t){if(1&e&&s.Qb(0,"span",38),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,uc,e.screenSize===e.screenSizeEnum.XS))}}const fc=function(e){return{"max-width":e}};function pc(e,t){if(1&e&&(s.Vb(0,"td",34),s.Ic(1,hc,1,3,"span",35),s.Ic(2,mc,1,3,"span",36),s.Kc(3),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(4,fc,n.screenSize===n.screenSizeEnum.XS?"10rem":"40rem")),s.Db(1),s.oc("ngIf",null==e?null:e.connected),s.Db(1),s.oc("ngIf",!(null!=e&&e.connected)),s.Db(1),s.Mc(" ",null==e?null:e.alias," ")}}function gc(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1," ID "),s.Ub())}function yc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,fc,n.screenSize===n.screenSizeEnum.XS?"10rem":"40rem")),s.Db(1),s.Mc(" ",null==e?null:e.id," ")}}function xc(e,t){1&e&&(s.Vb(0,"th",33),s.Kc(1," Network Address "),s.Ub())}function vc(e,t){1&e&&(s.Vb(0,"span"),s.Kc(1,","),s.Qb(2,"br"),s.Ub())}function Uc(e,t){if(1&e&&(s.Vb(0,"span"),s.Kc(1),s.Ic(2,vc,3,0,"span",42),s.Ub()),2&e){const e=t.$implicit,n=t.last;s.Db(1),s.Lc(e),s.Db(1),s.oc("ngIf",!n)}}function wc(e,t){if(1&e&&(s.Vb(0,"td",34),s.Ic(1,Uc,3,2,"span",41),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,fc,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(1),s.oc("ngForOf",null==e?null:e.netaddr)}}function Vc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",43),s.Vb(1,"div",44),s.Vb(2,"mat-select",45),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",46),s.dc("click",function(){return s.zc(e),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Dc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-option",46),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc().onPeerDetach(t)}),s.Kc(1,"Disconnect"),s.Ub()}}function Cc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-option",46),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc().onConnectPeer(t)}),s.Kc(1,"Reconnect"),s.Ub()}}function Sc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",47),s.Vb(1,"div",48),s.Vb(2,"mat-select",45),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",46),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc().onPeerClick(i,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",46),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onOpenChannel(n)}),s.Kc(7,"Open Channel"),s.Ub(),s.Ic(8,Dc,2,0,"mat-option",49),s.Ic(9,Cc,2,0,"mat-option",49),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=t.$implicit;s.Db(8),s.oc("ngIf",e.connected),s.Db(1),s.oc("ngIf",!e.connected)}}function Lc(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No connected peers."),s.Ub())}function Ic(e,t){if(1&e&&(s.Vb(0,"td",50),s.Ic(1,Lc,2,0,"p",42),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)}}const Fc=function(e){return{"display-none":e}};function kc(e,t){if(1&e&&s.Qb(0,"tr",51),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Fc,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Ac(e,t){1&e&&s.Qb(0,"tr",52)}function Pc(e,t){if(1&e&&s.Qb(0,"tr",53),2&e){const e=t.$implicit,n=s.hc();s.oc("@newlyAddedRowAnimation",e.pub_key===n.newlyAddedPeer&&n.flgAnimate?"added":"notAdded")}}const _c=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Tc=function(){return["no_peer"]};let Oc=(()=>{class e{constructor(e,t,n,i,a,o){this.logger=e,this.store=t,this.rtlEffects=n,this.clEffects=i,this.actions$=a,this.commonService=o,this.faUsers=f.T,this.newlyAddedPeer="",this.flgAnimate=!0,this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.information={},this.availableBalance=0,this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.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(Object(u.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchPeers"===e.action&&(this.flgLoading[0]="error")}),this.information=e.information,this.availableBalance=e.balance.totalBalance||0,this.peersData=e.peers?e.peers:[],this.peersData.length>0&&this.loadPeersTable(this.peersData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!1),this.logger.info(e)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.sb)).subscribe(e=>{this.peerAddress=void 0,this.flgAnimate=!0})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,t){this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.id,message:[[{key:"id",value:e.id,title:"Public Key",width:100}],[{key:"netaddr",value:e.netaddr,title:"Address",width:100}],[{key:"alias",value:e.alias,title:"Alias",width:50},{key:"connected",value:e.connected?"True":"False",title:"Connected",width:50}]]}}))}onConnectPeer(e){this.store.dispatch(new se.D({data:{message:{peer:e.id?e:null,information:this.information,balance:this.availableBalance},component:rc}}))}onOpenChannel(e){this.store.dispatch(new se.D({data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:Lo}}))}onPeerDetach(e){this.store.dispatch(new se.E({data:{type:p.b.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.id),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[3])).subscribe(t=>{t&&(this.store.dispatch(new se.G("Disconnecting Peer...")),this.store.dispatch(new g.n({id:e.id,force:!1})))})}applyFilter(e){this.peers.filter=e.value.trim().toLowerCase()}loadPeersTable(e){this.peers=new ae.o([...e]),this.peers.sortingDataAccessor=(e,t)=>{switch(t){case"netaddr":if(e.netaddr&&e.netaddr[0]){let t=e.netaddr[0].toString().split(".");return t[0]?+t[0]:e.netaddr[0]}return"";default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.peers.sort=this.sort,this.peers.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),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(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(x.h),s.Pb(ve.a),s.Pb(Ye.a),s.Pb(v.a),s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-peers"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("Peers")}])],decls:36,vars:14,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["peersForm","ngForm"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"padding-gap-x","page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30"],["fxLayout","row","fxLayoutAlign","start start"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","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-4",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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.Vb(3,"button",3),s.dc("click",function(){return t.onConnectPeer({})}),s.Kc(4,"Add Peer"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"div",5),s.Vb(7,"div",6),s.Qb(8,"fa-icon",7),s.Vb(9,"span",8),s.Kc(10,"Connected Peers"),s.Ub(),s.Ub(),s.Vb(11,"mat-form-field",9),s.Vb(12,"div",10),s.Vb(13,"input",11),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(14,"div",12),s.Ic(15,bc,1,0,"mat-progress-bar",13),s.Vb(16,"table",14,15),s.Tb(18,16),s.Ic(19,dc,2,0,"th",17),s.Ic(20,pc,4,6,"td",18),s.Sb(),s.Tb(21,19),s.Ic(22,gc,2,0,"th",20),s.Ic(23,yc,2,4,"td",21),s.Sb(),s.Tb(24,22),s.Ic(25,xc,2,0,"th",17),s.Ic(26,wc,2,4,"td",18),s.Sb(),s.Tb(27,23),s.Ic(28,Vc,6,0,"th",24),s.Ic(29,Sc,10,2,"td",25),s.Sb(),s.Tb(30,26),s.Ic(31,Ic,2,1,"td",27),s.Sb(),s.Ic(32,kc,1,3,"tr",28),s.Ic(33,Ac,1,0,"tr",29),s.Ic(34,Pc,1,1,"tr",30),s.Ub(),s.Ub(),s.Qb(35,"mat-paginator",31),s.Ub(),s.Ub()),2&e&&(s.Db(8),s.oc("icon",t.faUsers),s.Db(7),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.peers)("ngClass",s.sc(11,_c,"error"===t.flgLoading[0])),s.Db(16),s.oc("matFooterRowDef",s.rc(13,Tc)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.a,c.b,ce.u,ce.n,ce.o,S.a,w.a,O.c,le.b,M.b,i.o,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ne.a,l.a,ae.h,ie.b,ae.a,i.p,I.b,R.a,i.n,de.a,de.c,he.m,ae.d,ae.f,ae.j,ae.l],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:[xe.a]}}),e})();const Rc=["queryRoutesForm"];function Kc(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Destination pubkey is required."),s.Ub())}function Mc(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Ec(e,t){1&e&&s.Qb(0,"mat-progress-bar",38)}function zc(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1," ID "),s.Ub())}function Bc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.id," ")}}function Nc(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1," Alias "),s.Ub())}function Qc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.alias," ")}}function Hc(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1," Channel "),s.Ub())}function qc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.channel," ")}}function Xc(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1," Direction "),s.Ub())}function jc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.direction," ")}}function Gc(e,t){1&e&&(s.Vb(0,"th",41),s.Kc(1," Delay "),s.Ub())}function $c(e,t){if(1&e&&(s.Vb(0,"td",40),s.Vb(1,"span",42),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==e?null:e.delay)," ")}}function Wc(e,t){1&e&&(s.Vb(0,"th",41),s.Kc(1," Amount (Sats) "),s.Ub())}function Jc(e,t){if(1&e&&(s.Vb(0,"td",40),s.Vb(1,"span",42),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,(null==e?null:e.msatoshi)/1e3)," ")}}function Yc(e,t){1&e&&(s.Vb(0,"th",43),s.Kc(1," Amount mSat "),s.Ub())}function Zc(e,t){if(1&e&&(s.Vb(0,"td",44),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.amount_msat," ")}}function el(e,t){1&e&&(s.Vb(0,"th",45),s.Vb(1,"span",42),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function tl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",44),s.Vb(1,"button",46),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc().onHopClick(i,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function nl(e,t){1&e&&s.Qb(0,"tr",47)}function il(e,t){1&e&&s.Qb(0,"tr",48)}const al=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}};let ol=(()=>{class e{constructor(e,t,n){this.store=e,this.clEffects=t,this.commonService=n,this.destinationPubkey="",this.amount=null,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=f.I,this.faExclamationTriangle=f.o,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","msatoshi","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["alias","direction","msatoshi","actions"]):this.screenSize===p.s.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(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.qrHops=new ae.o([]),this.qrHops.data=[],e.routes?(this.flgLoading[0]=!1,this.qrHops=new ae.o([...e.routes]),this.qrHops.data=e.routes):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null})}onQueryRoutes(){if(!this.destinationPubkey||!this.amount)return!0;this.flgLoading[0]=!0,this.store.dispatch(new g.P({destPubkey:this.destinationPubkey,amount:1e3*this.amount}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(e,t){this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Route Information",message:[[{key:"id",value:e.id,title:"ID",width:100,type:p.h.STRING}],[{key:"channel",value:e.channel,title:"Channel",width:50,type:p.h.STRING},{key:"alias",value:e.alias,title:"Peer Alias",width:50,type:p.h.STRING}],[{key:"msatoshi",value:e.msatoshi,title:"mSatoshi",width:50,type:p.h.NUMBER},{key:"amount_msat",value:e.amount_msat,title:"Amount mSat",width:50,type:p.h.STRING}],[{key:"direction",value:e.direction,title:"Direction",width:50,type:p.h.STRING},{key:"delay",value:e.delay,title:"Delay",width:50,type:p.h.NUMBER}]]}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(Ye.a),s.Pb(U.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-query-routes"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Ec(Rc,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.form=e.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,"padding-gap-x","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(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.dc("ngSubmit",function(){return s.zc(e),s.wc(2).form.valid&&t.onQueryRoutes()}),s.Vb(3,"div",3),s.Qb(4,"fa-icon",4),s.Vb(5,"span"),s.Kc(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),s.Ub(),s.Ub(),s.Vb(7,"mat-form-field",5),s.Vb(8,"input",6,7),s.dc("ngModelChange",function(e){return t.destinationPubkey=e}),s.Ub(),s.Ic(10,Kc,2,0,"mat-error",8),s.Ub(),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10),s.dc("ngModelChange",function(e){return t.amount=e}),s.Ub(),s.Ic(13,Mc,2,0,"mat-error",8),s.Ub(),s.Vb(14,"div",11),s.Vb(15,"button",12),s.dc("click",function(){return t.resetData()}),s.Kc(16,"Clear"),s.Ub(),s.Vb(17,"button",13),s.Kc(18,"Query Route"),s.Ub(),s.Ub(),s.Ub(),s.Vb(19,"div",14),s.Vb(20,"div",15),s.Qb(21,"fa-icon",16),s.Vb(22,"span",17),s.Kc(23,"Transaction Route"),s.Ub(),s.Ub(),s.Ub(),s.Vb(24,"div",18),s.Ic(25,Ec,1,0,"mat-progress-bar",19),s.Vb(26,"table",20,21),s.Tb(28,22),s.Ic(29,zc,2,0,"th",23),s.Ic(30,Bc,2,1,"td",24),s.Sb(),s.Tb(31,25),s.Ic(32,Nc,2,0,"th",23),s.Ic(33,Qc,2,1,"td",24),s.Sb(),s.Tb(34,26),s.Ic(35,Hc,2,0,"th",23),s.Ic(36,qc,2,1,"td",24),s.Sb(),s.Tb(37,27),s.Ic(38,Xc,2,0,"th",23),s.Ic(39,jc,2,1,"td",24),s.Sb(),s.Tb(40,28),s.Ic(41,Gc,2,0,"th",29),s.Ic(42,$c,4,3,"td",24),s.Sb(),s.Tb(43,30),s.Ic(44,Wc,2,0,"th",29),s.Ic(45,Jc,4,3,"td",24),s.Sb(),s.Tb(46,31),s.Ic(47,Yc,2,0,"th",32),s.Ic(48,Zc,2,1,"td",33),s.Sb(),s.Tb(49,34),s.Ic(50,el,3,0,"th",35),s.Ic(51,tl,3,0,"td",33),s.Sb(),s.Ic(52,nl,1,0,"tr",36),s.Ic(53,il,1,0,"tr",37),s.Ub(),s.Ub(),s.Ub()}2&e&&(s.Db(4),s.oc("icon",t.faExclamationTriangle),s.Db(4),s.oc("ngModel",t.destinationPubkey),s.Db(2),s.oc("ngIf",!t.destinationPubkey),s.Db(2),s.oc("ngModel",t.amount)("step",1e3)("min",0),s.Db(1),s.oc("ngIf",!t.amount),s.Db(8),s.oc("icon",t.faRoute),s.Db(4),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.qrHops)("ngClass",s.sc(14,al,"error"===t.flgLoading[0])),s.Db(26),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns))},directives:[c.c,c.a,ce.u,ce.n,ce.o,c.b,w.a,O.c,le.b,ce.c,ce.s,ce.m,ce.p,i.o,ce.q,be.a,S.a,M.b,ae.n,ie.a,i.m,I.a,ae.c,ae.i,ae.b,ae.k,ae.m,O.b,l.a,ae.h,ie.b,ae.a,ae.j,ae.l],pipes:[i.f],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}"]}),e})();var sl=n("iiaH");function cl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Message is required."),s.Ub())}let ll=(()=>{class e{constructor(e,t,n){this.dataService=e,this.snackBar=t,this.logger=n,this.message="",this.signedMessage="",this.signature="",this.unSubs=[new d.a,new d.a]}ngOnInit(){}onSign(){if(!this.message||""===this.message)return!0;this.dataService.signMessage(this.message).pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.signedMessage=this.message,this.signature=e.zbase})}onMessageChange(){this.signedMessage!==this.message&&(this.signature="")}onCopyField(e){this.snackBar.open("Signature copied."),this.logger.info("Copied Text: "+e)}resetData(){this.message="",this.signature="",this.signedMessage=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(sl.a),s.Pb(Mn.b),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.Vb(3,"mat-form-field",3),s.Vb(4,"textarea",4),s.dc("ngModelChange",function(e){return t.message=e})("keyup",function(){return t.onMessageChange()}),s.Ub(),s.Ic(5,cl,2,0,"mat-error",5),s.Ub(),s.Vb(6,"div",6),s.Vb(7,"button",7),s.dc("click",function(){return t.resetData()}),s.Kc(8,"Clear Field"),s.Ub(),s.Vb(9,"button",8),s.dc("click",function(){return t.onSign()}),s.Kc(10,"Sign"),s.Ub(),s.Ub(),s.Qb(11,"mat-divider",9),s.Vb(12,"div",10),s.Vb(13,"p"),s.Kc(14,"Generated Signature"),s.Ub(),s.Ub(),s.Vb(15,"div",11),s.Kc(16),s.Ub(),s.Vb(17,"div",12),s.Vb(18,"button",13),s.dc("copied",function(e){return t.onCopyField(e)}),s.Kc(19,"Copy Signature"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(4),s.oc("ngModel",t.message),s.Db(1),s.oc("ngIf",!t.message),s.Db(6),s.oc("inset",!0),s.Db(5),s.Lc(t.signature),s.Db(2),s.oc("payload",t.signature))},directives:[c.c,c.a,c.b,ce.u,ce.n,ce.o,O.c,le.b,ce.c,re.a,ce.s,ce.m,ce.p,i.o,S.a,K.a,aa.a,O.b],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function rl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Message is required."),s.Ub())}function bl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Signature is required."),s.Ub())}function dl(e,t){1&e&&(s.Vb(0,"p",13),s.Vb(1,"mat-icon",14),s.Kc(2,"close"),s.Ub(),s.Kc(3,"Verification failed, please double check message and signature"),s.Ub())}function ul(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Pubkey Used"),s.Ub())}function hl(e,t){if(1&e&&(s.Vb(0,"div",20),s.Vb(1,"p"),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=s.hc(2);s.Db(2),s.Lc(null==e.verifyRes?null:e.verifyRes.pubkey)}}function ml(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",21),s.Vb(1,"button",22),s.dc("copied",function(t){return s.zc(e),s.hc(2).onCopyField(t)}),s.Kc(2,"Copy Pubkey"),s.Ub(),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.oc("payload",null==e.verifyRes?null:e.verifyRes.pubkey)}}function fl(e,t){if(1&e&&(s.Vb(0,"div",15),s.Qb(1,"mat-divider",16),s.Vb(2,"div",17),s.Ic(3,ul,2,0,"p",5),s.Ub(),s.Ic(4,hl,3,1,"div",18),s.Ic(5,ml,3,1,"div",19),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("inset",!0),s.Db(2),s.oc("ngIf",e.verifyRes.verified),s.Db(1),s.oc("ngIf",e.verifyRes.verified),s.Db(1),s.oc("ngIf",e.verifyRes.verified)}}let pl=(()=>{class e{constructor(e,t,n){this.dataService=e,this.snackBar=t,this.logger=n,this.message="",this.verifiedMessage="",this.signature="",this.verifiedSignature="",this.showVerifyStatus=!1,this.verifyRes={pubkey:"",verified:null},this.unSubs=[new d.a,new d.a]}ngOnInit(){}onVerify(){if(!this.message||""===this.message||!this.signature||""===this.signature)return!0;this.dataService.verifyMessage(this.message,this.signature).pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.verifyRes=e,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(e){this.snackBar.open("Pubkey copied."),this.logger.info("Copied Text: "+e)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(sl.a),s.Pb(Mn.b),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.Vb(3,"mat-form-field",3),s.Vb(4,"textarea",4),s.dc("ngModelChange",function(e){return t.message=e})("keyup",function(){return t.onChange()}),s.Ub(),s.Ic(5,rl,2,0,"mat-error",5),s.Ub(),s.Vb(6,"mat-form-field",3),s.Vb(7,"input",6,7),s.dc("ngModelChange",function(e){return t.signature=e})("keyup",function(){return t.onChange()}),s.Ub(),s.Ic(9,bl,2,0,"mat-error",5),s.Ub(),s.Ic(10,dl,4,0,"p",8),s.Vb(11,"div",9),s.Vb(12,"button",10),s.dc("click",function(){return t.resetData()}),s.Kc(13,"Clear Fields"),s.Ub(),s.Vb(14,"button",11),s.dc("click",function(){return t.onVerify()}),s.Kc(15,"Verify"),s.Ub(),s.Ub(),s.Ic(16,fl,6,4,"div",12),s.Ub(),s.Ub()),2&e&&(s.Db(4),s.oc("ngModel",t.message),s.Db(1),s.oc("ngIf",!t.message),s.Db(2),s.oc("ngModel",t.signature),s.Db(2),s.oc("ngIf",!t.signature),s.Db(1),s.oc("ngIf",t.showVerifyStatus&&!t.verifyRes.verified),s.Db(6),s.oc("ngIf",t.showVerifyStatus&&t.verifyRes.verified))},directives:[c.c,c.a,c.b,ce.u,ce.n,ce.o,O.c,le.b,ce.c,re.a,ce.s,ce.m,ce.p,i.o,S.a,O.b,L.a,K.a,aa.a],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function gl(e,t){if(1&e&&(s.Vb(0,"div",5),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(e.errorMessage)}}function yl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",6),s.Qb(1,"div",7),s.Vb(2,"mat-form-field",8),s.Vb(3,"input",9),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().filterValue=t})("input",function(){return s.zc(e),s.hc().applyFilter()})("keyup",function(){return s.zc(e),s.hc().applyFilter()}),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("ngModel",e.filterValue)}}function xl(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Status"),s.Ub())}function vl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.status)}}function Ul(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Received Time"),s.Ub())}function wl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.received_time_str)}}function Vl(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Resolved Time"),s.Ub())}function Dl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.resolved_time_str)}}function Cl(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"In Channel"),s.Ub())}function Sl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc((null==e?null:e.in_channel_alias)||(null==e?null:e.in_channel))}}function Ll(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Out Channel"),s.Ub())}function Il(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc((null==e?null:e.out_channel_alias)||(null==e?null:e.out_channel))}}function Fl(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Amount In (Sats)"),s.Ub())}function kl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.in_msatoshi)/1e3,(null==e?null:e.in_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function Al(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Amount Out (Sats)"),s.Ub())}function Pl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.out_msatoshi)/1e3,(null==e?null:e.out_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function _l(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Fee (mSat)"),s.Ub())}function Tl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.jc(3,1,null==e?null:e.fee))}}function Ol(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1,"Payment Hash"),s.Ub())}function Rl(e,t){if(1&e&&(s.Vb(0,"td",40),s.Vb(1,"div"),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc("",s.lc(3,1,null==e?null:e.payment_hash,0,10),"...")}}function Kl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",41),s.Vb(1,"div",42),s.Vb(2,"mat-select",43),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",44),s.dc("click",function(){return s.zc(e),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ml(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",45),s.Vb(1,"button",46),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc(2).onForwardingEventClick(i,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function El(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No forwarding event available."),s.Ub())}function zl(e,t){if(1&e&&(s.Vb(0,"td",47),s.Ic(1,El,2,0,"p",48),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)}}const Bl=function(e){return{"display-none":e}};function Nl(e,t){if(1&e&&s.Qb(0,"tr",49),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,Bl,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Ql(e,t){1&e&&s.Qb(0,"tr",50)}function Hl(e,t){1&e&&s.Qb(0,"tr",51)}const ql=function(){return["no_event"]};function Xl(e,t){if(1&e&&(s.Vb(0,"div",10),s.Vb(1,"table",11,12),s.Tb(3,13),s.Ic(4,xl,2,0,"th",14),s.Ic(5,vl,2,1,"td",15),s.Sb(),s.Tb(6,16),s.Ic(7,Ul,2,0,"th",14),s.Ic(8,wl,2,1,"td",15),s.Sb(),s.Tb(9,17),s.Ic(10,Vl,2,0,"th",14),s.Ic(11,Dl,2,1,"td",15),s.Sb(),s.Tb(12,18),s.Ic(13,Cl,2,0,"th",14),s.Ic(14,Sl,2,1,"td",15),s.Sb(),s.Tb(15,19),s.Ic(16,Ll,2,0,"th",14),s.Ic(17,Il,2,1,"td",15),s.Sb(),s.Tb(18,20),s.Ic(19,Fl,2,0,"th",21),s.Ic(20,kl,4,4,"td",15),s.Sb(),s.Tb(21,22),s.Ic(22,Al,2,0,"th",21),s.Ic(23,Pl,4,4,"td",15),s.Sb(),s.Tb(24,23),s.Ic(25,_l,2,0,"th",21),s.Ic(26,Tl,4,3,"td",15),s.Sb(),s.Tb(27,24),s.Ic(28,Ol,2,0,"th",25),s.Ic(29,Rl,4,5,"td",26),s.Sb(),s.Tb(30,27),s.Ic(31,Kl,6,0,"th",28),s.Ic(32,Ml,3,0,"td",29),s.Sb(),s.Tb(33,30),s.Ic(34,zl,2,1,"td",31),s.Sb(),s.Ic(35,Nl,1,3,"tr",32),s.Ic(36,Ql,1,0,"tr",33),s.Ic(37,Hl,1,0,"tr",34),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("dataSource",e.forwardingHistoryEvents),s.Db(34),s.oc("matFooterRowDef",s.rc(5,ql)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}const jl=function(e){return{"error-border":e,"padding-gap-x":!0}};let Gl=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.eventsData=[],this.filterValue="",this.successfulEvents=[],this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["in_msatoshi","out_msatoshi","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.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(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.eventsData.length<=0&&(this.errorMessage="",e.effectErrors.forEach(e=>{"GetForwardingHistory"===e.action&&(this.errorMessage="object"==typeof e.message?JSON.stringify(e.message):e.message)}),this.successfulEvents=e.forwardingHistory&&e.forwardingHistory.forwarding_events&&e.forwardingHistory.forwarding_events.length>0?this.filterSuccessfulEvents(e.forwardingHistory.forwarding_events):[],this.loadForwardingEventsTable(this.successfulEvents),this.logger.info(e))})}ngAfterViewInit(){this.successfulEvents.length>0&&this.loadForwardingEventsTable(this.successfulEvents)}ngOnChanges(e){e.eventsData&&(this.eventsData=e.eventsData.currentValue,this.successfulEvents=this.eventsData,this.loadForwardingEventsTable(this.successfulEvents)),e.filterValue&&this.applyFilter()}filterSuccessfulEvents(e){return e.filter(e=>"settled"===e.status)}onForwardingEventClick(e,t){this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Event Information",message:[[{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:100,type:p.h.STRING}],[{key:"received_time_str",value:e.received_time_str,title:"Received Time",width:50,type:p.h.DATE_TIME},{key:"resolved_time_str",value:e.resolved_time_str,title:"Resolved Time",width:50,type:p.h.DATE_TIME}],[{key:"in_channel",value:e.in_channel_alias?e.in_channel_alias:e.in_channel,title:"Inbound Channel",width:50,type:p.h.STRING},{key:"out_channel",value:e.out_channel_alias?e.out_channel_alias:e.out_channel,title:"Outbound Channel",width:50,type:p.h.STRING}],[{key:"status",value:"settled"===e.status?"Settled":"Failed",title:"Status",width:50,type:p.h.STRING},{key:"fee",value:e.fee,title:"Fee (mSats)",width:50,type:p.h.NUMBER}],[{key:"in_msatoshi",value:e.in_msatoshi,title:"In (mSats)",width:50,type:p.h.NUMBER},{key:"out_msatoshi",value:e.out_msatoshi,title:"Out (mSats)",width:50,type:p.h.NUMBER}]]}}))}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new ae.o([...e]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.forwardingHistoryEvents.paginator=this.paginator,this.forwardingHistoryEvents.filterPredicate=(e,t)=>(e.received_time_str.toLowerCase()+e.resolved_time_str.toLowerCase()+e.in_channel+e.out_channel+e.in_msatoshi/1e3+e.out_msatoshi/1e3+e.fee).includes(t),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}applyFilter(){this.forwardingHistoryEvents.filter=this.filterValue.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-forwarding-history"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("Events")}]),s.Bb],decls:5,vars:9,consts:[["fxLayout","column","fxLayoutAlign","start stretch",3,"ngClass"],["class","p-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","padding-gap-x page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[1,"p-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"padding-gap-x","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"],["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","payment_hash"],["mat-header-cell","","class","pl-4","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["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"],["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,"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",""]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,gl,2,1,"div",1),s.Ic(2,yl,4,1,"div",2),s.Ic(3,Xl,38,6,"div",3),s.Qb(4,"mat-paginator",4),s.Ub()),2&e&&(s.oc("ngClass",s.sc(7,jl,""!==t.errorMessage)),s.Db(1),s.oc("ngIf",""!==t.errorMessage),s.Db(1),s.oc("ngIf",""===t.errorMessage),s.Db(1),s.oc("ngIf",""===t.errorMessage),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.b,i.m,I.a,i.o,ne.a,c.a,O.c,le.b,ce.c,ce.m,ce.p,M.b,ae.n,ie.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ae.h,ie.b,ae.a,de.a,de.c,he.m,S.a,ae.d,ae.f,ae.j,ae.l],pipes:[i.f,i.w],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();function $l(e,t){if(1&e&&(s.Vb(0,"div",5),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(e.errorMessage)}}function Wl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",6),s.Qb(1,"div",7),s.Vb(2,"mat-form-field",8),s.Vb(3,"input",9),s.dc("keyup",function(t){return s.zc(e),s.hc().applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub()}}function Jl(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Status"),s.Ub())}function Yl(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.ic(2,"titlecase"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,null==e?null:e.status))}}function Zl(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Received Time"),s.Ub())}function er(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.received_time_str)}}function tr(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Resolved Time"),s.Ub())}function nr(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(null==e?null:e.resolved_time_str)}}function ir(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"In Channel"),s.Ub())}function ar(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc((null==e?null:e.in_channel_alias)||(null==e?null:e.in_channel))}}function or(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1,"Out Channel"),s.Ub())}function sr(e,t){if(1&e&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc((null==e?null:e.out_channel_alias)||(null==e?null:e.out_channel))}}function cr(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Amount In (Sats)"),s.Ub())}function lr(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.in_msatoshi)/1e3,(null==e?null:e.in_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function rr(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Amount Out (Sats)"),s.Ub())}function br(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.kc(3,1,(null==e?null:e.out_msatoshi)/1e3,(null==e?null:e.out_msatoshi)<1e3?"1.0-4":"1.0-0"))}}function dr(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1,"Fee mSat"),s.Ub())}function ur(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",38),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(s.jc(3,1,null==e?null:e.fee))}}function hr(e,t){1&e&&(s.Vb(0,"th",39),s.Kc(1,"Payment Hash"),s.Ub())}function mr(e,t){if(1&e&&(s.Vb(0,"td",40),s.Vb(1,"div"),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc("",s.lc(3,1,null==e?null:e.payment_hash,0,10),"...")}}function fr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",41),s.Vb(1,"div",42),s.Vb(2,"mat-select",43),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",44),s.dc("click",function(){return s.zc(e),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function pr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",45),s.Vb(1,"button",46),s.dc("click",function(n){s.zc(e);const i=t.$implicit;return s.hc(2).onForwardingEventClick(i,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function gr(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No forwarding event available."),s.Ub())}function yr(e,t){if(1&e&&(s.Vb(0,"td",47),s.Ic(1,gr,2,0,"p",48),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)}}const xr=function(e){return{"display-none":e}};function vr(e,t){if(1&e&&s.Qb(0,"tr",49),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,xr,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Ur(e,t){1&e&&s.Qb(0,"tr",50)}function wr(e,t){1&e&&s.Qb(0,"tr",51)}const Vr=function(){return["no_event"]};function Dr(e,t){if(1&e&&(s.Vb(0,"div",10),s.Vb(1,"table",11,12),s.Tb(3,13),s.Ic(4,Jl,2,0,"th",14),s.Ic(5,Yl,3,3,"td",15),s.Sb(),s.Tb(6,16),s.Ic(7,Zl,2,0,"th",14),s.Ic(8,er,2,1,"td",15),s.Sb(),s.Tb(9,17),s.Ic(10,tr,2,0,"th",14),s.Ic(11,nr,2,1,"td",15),s.Sb(),s.Tb(12,18),s.Ic(13,ir,2,0,"th",14),s.Ic(14,ar,2,1,"td",15),s.Sb(),s.Tb(15,19),s.Ic(16,or,2,0,"th",14),s.Ic(17,sr,2,1,"td",15),s.Sb(),s.Tb(18,20),s.Ic(19,cr,2,0,"th",21),s.Ic(20,lr,4,4,"td",15),s.Sb(),s.Tb(21,22),s.Ic(22,rr,2,0,"th",21),s.Ic(23,br,4,4,"td",15),s.Sb(),s.Tb(24,23),s.Ic(25,dr,2,0,"th",21),s.Ic(26,ur,4,3,"td",15),s.Sb(),s.Tb(27,24),s.Ic(28,hr,2,0,"th",25),s.Ic(29,mr,4,5,"td",26),s.Sb(),s.Tb(30,27),s.Ic(31,fr,6,0,"th",28),s.Ic(32,pr,3,0,"td",29),s.Sb(),s.Tb(33,30),s.Ic(34,yr,2,1,"td",31),s.Sb(),s.Ic(35,vr,1,3,"tr",32),s.Ic(36,Ur,1,0,"tr",33),s.Ic(37,wr,1,0,"tr",34),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("dataSource",e.forwardingHistoryEvents),s.Db(34),s.oc("matFooterRowDef",s.rc(5,Vr)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}const Cr=function(e){return{"error-border":e,"padding-gap-x":!0}};let Sr=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["status","in_msatoshi","out_msatoshi","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["status","in_msatoshi","out_msatoshi","fee","actions"]):(this.flgSticky=!0,this.displayedColumns=["status","received_time","resolved_time","in_channel","out_channel","in_msatoshi","out_msatoshi","fee","actions"])}ngOnInit(){this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",e.effectErrors.forEach(e=>{"GetForwardingHistory"===e.action&&(this.errorMessage="object"==typeof e.message?JSON.stringify(e.message):e.message)}),this.failedEvents=e.forwardingHistory&&e.forwardingHistory.forwarding_events&&e.forwardingHistory.forwarding_events.length>0?this.filterFailedEvents(e.forwardingHistory.forwarding_events):[],this.loadForwardingEventsTable(this.failedEvents),this.logger.info(e)})}ngAfterViewInit(){this.failedEvents.length>0&&this.loadForwardingEventsTable(this.failedEvents)}filterFailedEvents(e){return e.filter(e=>"settled"!==e.status)}onForwardingEventClick(e,t){this.store.dispatch(new se.D({data:{type:p.b.INFORMATION,alertTitle:"Event Information",message:[[{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:100,type:p.h.STRING}],[{key:"received_time_str",value:e.received_time_str,title:"Received Time",width:50,type:p.h.DATE_TIME},{key:"resolved_time_str",value:e.resolved_time_str,title:"Resolved Time",width:50,type:p.h.DATE_TIME}],[{key:"in_channel",value:e.in_channel_alias?e.in_channel_alias:e.in_channel,title:"Inbound Channel",width:50,type:p.h.STRING},{key:"out_channel",value:e.out_channel_alias?e.out_channel_alias:e.out_channel,title:"Outbound Channel",width:50,type:p.h.STRING}],[{key:"status",value:"settled"===e.status?"Settled":"Unsettled",title:"Status",width:50,type:p.h.STRING},{key:"fee",value:e.fee,title:"Fee (mSats)",width:50,type:p.h.NUMBER}],[{key:"in_msatoshi",value:e.in_msatoshi,title:"In (mSats)",width:50,type:p.h.NUMBER},{key:"out_msatoshi",value:e.out_msatoshi,title:"Out (mSats)",width:50,type:p.h.NUMBER}]]}}))}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new ae.o([...e]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.forwardingHistoryEvents.paginator=this.paginator,this.forwardingHistoryEvents.filterPredicate=(e,t)=>(e.status+e.received_time_str+e.resolved_time_str+e.in_channel+e.out_channel+e.in_msatoshi/1e3+e.out_msatoshi/1e3+e.fee).includes(t),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Failed-transactions")}applyFilter(e){this.forwardingHistoryEvents.filter=e.value.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(U.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-failed-history"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ie.a,!0),s.Pc(ne.a,!0)),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first),s.vc(e=s.ec())&&(t.paginator=e.first)}},features:[s.Cb([{provide:ne.b,useValue:Object(p.B)("Events")}])],decls:5,vars:9,consts:[["fxLayout","column","fxLayoutAlign","start stretch",3,"ngClass"],["class","p-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","padding-gap-x page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[1,"p-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"padding-gap-x","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"],["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","payment_hash"],["mat-header-cell","","class","pl-4","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["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"],["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,"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",""]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,$l,2,1,"div",1),s.Ic(2,Wl,4,0,"div",2),s.Ic(3,Dr,38,6,"div",3),s.Qb(4,"mat-paginator",4),s.Ub()),2&e&&(s.oc("ngClass",s.sc(7,Cr,""!==t.errorMessage)),s.Db(1),s.oc("ngIf",""!==t.errorMessage),s.Db(1),s.oc("ngIf",""===t.errorMessage),s.Db(1),s.oc("ngIf",""===t.errorMessage),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[c.c,c.b,i.m,I.a,i.o,ne.a,c.a,O.c,le.b,M.b,ae.n,ie.a,ae.c,ae.i,ae.b,ae.e,ae.g,ae.k,ae.m,ae.h,ie.b,ae.a,de.a,de.c,he.m,S.a,ae.d,ae.f,ae.j,ae.l],pipes:[i.x,i.f,i.w],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();function Lr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",7),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&e){const e=t.$implicit,n=s.hc();s.pc("routerLink",e.link),s.oc("active",n.activeLink===e.link),s.Db(1),s.Lc(e.name)}}let Ir=(()=>{class e{constructor(e){this.router=e,this.faChartBar=f.f,this.links=[{link:"routingfees",name:"Routing Fees"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new d.a,new d.a,new d.a,new d.a]}ngOnInit(){let e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof a.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(a.g))},e.\u0275cmp=s.Jb({type:e,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(e,t){1&e&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"Reports"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Vb(7,"nav",5),s.Ic(8,Lr,2,3,"div",6),s.Ub(),s.Qb(9,"router-outlet"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faChartBar),s.Db(7),s.oc("ngForOf",t.links))},directives:[c.c,c.b,w.a,D.a,D.b,te.e,i.n,a.l,te.d,a.h],styles:[""]}),e})();var Fr=n("2yzq"),kr=n("LQLF"),Ar=n("Lnru");function Pr(e,t){if(1&e&&(s.Vb(0,"div",8),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&e){const e=s.hc();s.oc("@fadeIn",e.totalFeeMsat),s.Db(1),s.Nc("",s.kc(2,3,e.totalFeeMsat/1e3||0,"1.0-0")," Sats/",s.jc(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function _r(e,t){1&e&&(s.Vb(0,"div",9),s.Kc(1,"No fee report for the selected period"),s.Ub())}function Tr(e,t){if(1&e&&(s.Vb(0,"span"),s.Vb(1,"span",12),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Vb(4,"span",12),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub()),2&e){const e=t.model;s.Db(2),s.Mc("Events: ",s.jc(3,2,e.extra.totalEvents||0),""),s.Db(3),s.Mc("Fee: ",s.kc(6,4,e.value||0,"1.0-0"),"")}}function Or(e,t){if(1&e){const e=s.Wb();s.Vb(0,"ngx-charts-bar-vertical",10),s.dc("select",function(t){return s.zc(e),s.hc().onChartBarSelected(t)})("mouseup",function(t){return s.zc(e),s.hc().onChartMouseUp(t)}),s.Ic(1,Tr,7,7,"ng-template",null,11,s.Jc),s.Ub()}if(2&e){const e=s.hc();s.oc("view",e.view)("results",e.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function Rr(e,t){if(1&e&&s.Qb(0,"rtl-cl-forwarding-history",13),2&e){const e=s.hc();s.oc("eventsData",e.filteredEventsBySelectedPeriod)("filterValue",e.eventFilterValue)}}let Kr=(()=>{class e{constructor(e,t,n,i){this.logger=e,this.dataService=t,this.commonService=n,this.store=i,this.reportPeriod=p.r[0],this.secondsInADay=86400,this.events={},this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.errorMessage="",this.totalFeeMsat=null,this.today=new Date(Date.now()),this.timezoneOffset=60*this.today.getTimezoneOffset(),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=p.s,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===p.s.XS||this.screenSize===p.s.SM),this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",e.effectErrors.forEach(e=>{"GetForwardingHistory"===e.action&&(this.errorMessage="object"==typeof e.message?JSON.stringify(e.message):e.message)}),this.events=e.forwardingHistory&&e.forwardingHistory.forwarding_events?e.forwardingHistory:{},this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(e)})}ngAfterViewInit(){const e=this.commonService.getContainerSize();switch(this.screenSize){case p.s.MD:this.screenPaddingX=e.width/10;break;case p.s.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2]}filterForwardingEvents(e,t){const n=Math.round(e.getTime()/1e3)-this.timezoneOffset,i=Math.round(t.getTime()/1e3)-this.timezoneOffset;this.filteredEventsBySelectedPeriod=[],this.feeReportData=[],this.totalFeeMsat=null,this.events&&this.events.forwarding_events&&this.events.forwarding_events.length>0&&(this.events.forwarding_events.forEach(e=>{"settled"===e.status&&e.received_time>=n&&e.received_time<i&&this.filteredEventsBySelectedPeriod.push(e)}),this.feeReportData=this.prepareFeeReport(e))}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===p.r[1]?e.name.toUpperCase()+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+p.n[this.startDate.getMonth()].name.toUpperCase()+"/"+this.startDate.getFullYear()}prepareFeeReport(e){const t=Math.round(e.getTime()/1e3)-this.timezoneOffset;let n=[];if(this.reportPeriod===p.r[1]){for(let e=0;e<12;e++)n.push({name:p.n[e].name,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(e=>{let t=new Date(1e3*(+e.received_time+this.timezoneOffset)).getMonth();n[t].value=n[t].value+ +e.fee/1e3,n[t].extra.totalEvents=n[t].extra.totalEvents+1,this.totalFeeMsat=(this.totalFeeMsat?this.totalFeeMsat:0)+ +e.fee})}else{for(let t=0;t<this.getMonthDays(e.getMonth(),e.getFullYear());t++)n.push({name:t+1,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(e=>{let i=Math.floor((+e.received_time-t)/this.secondsInADay);n[i].value=n[i].value+ +e.fee/1e3,n[i].extra.totalEvents=n[i].extra.totalEvents+1,this.totalFeeMsat=(this.totalFeeMsat?this.totalFeeMsat:0)+ +e.fee})}return n}onSelectionChange(e){const t=e.selDate.getMonth(),n=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===p.r[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,t,1,0,0,0),this.endDate=new Date(n,t,this.getMonthDays(t,n),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,t){return 1===e&&t%4==0?p.n[e].days+1:p.n[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(sl.a),s.Pb(U.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-fee-report"]],hostBindings:function(e,t){1&e&&s.dc("mouseup",function(e){return t.onChartMouseUp(e)})},decls:9,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"eventsData","filterValue",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"eventsData","filterValue"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"rtl-horizontal-scroller",1),s.dc("stepChanged",function(e){return t.onSelectionChange(e)}),s.Ub(),s.Vb(2,"div",2),s.Ic(3,Pr,4,8,"div",3),s.Ic(4,_r,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,Or,3,11,"ngx-charts-bar-vertical",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,Rr,1,2,"rtl-cl-forwarding-history",7),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("ngIf",t.feeReportData.length>0&&t.filteredEventsBySelectedPeriod.length>0),s.Db(1),s.oc("ngIf",t.feeReportData.length<=0||t.filteredEventsBySelectedPeriod.length<=0),s.Db(2),s.oc("ngIf",t.feeReportData.length>0&&t.filteredEventsBySelectedPeriod.length>0),s.Db(2),s.oc("ngIf",t.filteredEventsBySelectedPeriod&&t.filteredEventsBySelectedPeriod.length>0))},directives:[c.c,c.b,c.a,kr.a,i.o,Ar.b,Gl],pipes:[i.f],styles:[""],data:{animation:[Fr.a]}}),e})();var Mr=n("d4ms");function Er(e,t){if(1&e&&(s.Vb(0,"div",10),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Nc(" Paid ",s.kc(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod/1e3||0,"1.0-0")," Sats/",s.jc(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function zr(e,t){if(1&e&&(s.Vb(0,"div",10),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.Nc(" Received ",s.kc(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod/1e3||0,"1.0-0")," Sats/",s.jc(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Br(e,t){if(1&e&&(s.Vb(0,"div",8),s.Ic(1,Er,4,7,"div",9),s.Ic(2,zr,4,7,"div",9),s.Ub()),2&e){const e=s.hc();s.oc("@fadeIn",e.transactionsReportSummary),s.Db(1),s.oc("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),s.Db(1),s.oc("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function Nr(e,t){1&e&&(s.Vb(0,"div",11),s.Kc(1,"No transactions report for the selected period"),s.Ub())}function Qr(e,t){if(1&e&&(s.Vb(0,"span",14),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&e){const e=t.model;s.Db(1),s.Oc("",e.name,": ",s.kc(2,4,e.value||0,"1.0-0"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",s.jc(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function Hr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"ngx-charts-bar-vertical-2d",12),s.dc("select",function(t){return s.zc(e),s.hc().onChartBarSelected(t)})("mouseup",function(t){return s.zc(e),s.hc().onChartMouseUp(t)}),s.Ic(1,Qr,4,9,"ng-template",null,13,s.Jc),s.Ub()}if(2&e){const e=s.hc();s.oc("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:4)}}function qr(e,t){if(1&e&&s.Qb(0,"rtl-transactions-report-table",15),2&e){const e=s.hc();s.oc("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("filterValue",e.transactionFilterValue)}}let Xr=(()=>{class e{constructor(e,t,n){this.dataService=e,this.commonService=t,this.store=n,this.scrollRanges=p.r,this.reportPeriod=p.r[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.timezoneOffset=60*this.today.getTimezoneOffset(),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=p.s,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===p.s.XS||this.screenSize===p.s.SM),this.store.select("cl").pipe(Object(u.a)(this.unSubs[0])).subscribe(e=>{"COMPLETE"===e.initialAPIResponseStatus[0]&&this.dataService.getTransactionsForReport().pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{this.payments=e.payments,this.invoices=e.invoices,this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData()})})}ngAfterViewInit(){const e=this.commonService.getContainerSize();switch(this.screenSize){case p.s.MD:this.screenPaddingX=e.width/10;break;case p.s.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2]}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(e){this.transactionFilterValue=this.reportPeriod===p.r[1]?e.series.toUpperCase()+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+p.n[this.startDate.getMonth()].name.toUpperCase()+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,t){const n=Math.round(e.getTime()/1e3)-this.timezoneOffset,i=Math.round(t.getTime()/1e3)-this.timezoneOffset;let a=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};let o=this.payments.filter(e=>"complete"===e.status&&e.created_at>=n&&e.created_at<i),s=this.invoices.filter(e=>"paid"===e.status&&e.paid_at>=n&&e.paid_at<i);if(this.transactionsReportSummary.paymentsSelectedPeriod=o.length,this.transactionsReportSummary.invoicesSelectedPeriod=s.length,this.reportPeriod===p.r[1]){for(let t=0;t<12;t++)a.push({name:p.n[t].name,date:new Date(e.getFullYear(),t,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});o.map(e=>{let t=new Date(1e3*(e.created_at+this.timezoneOffset)).getMonth();this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+e.msatoshi_sent,a[t].series[0].value=a[t].series[0].value+e.msatoshi_sent/1e3,a[t].series[0].extra.total=a[t].series[0].extra.total+1}),s.map(e=>{let t=new Date(1e3*(+e.paid_at+this.timezoneOffset)).getMonth();this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+e.msatoshi_received,a[t].series[1].value=a[t].series[1].value+e.msatoshi_received/1e3,a[t].series[1].extra.total=a[t].series[1].extra.total+1})}else{for(let t=0;t<this.getMonthDays(e.getMonth(),e.getFullYear());t++)a.push({name:(t+1).toString(),date:new Date(1e3*((t+1)*this.secondsInADay+n)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});o.map(e=>{let t=Math.floor((+e.created_at-n)/this.secondsInADay);this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+e.msatoshi_sent,a[t].series[0].value=a[t].series[0].value+e.msatoshi_sent/1e3,a[t].series[0].extra.total=a[t].series[0].extra.total+1}),s.map(e=>{let t=Math.floor((+e.paid_at-n)/this.secondsInADay);this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+e.msatoshi_received,a[t].series[1].value=a[t].series[1].value+e.msatoshi_received/1e3,a[t].series[1].extra.total=a[t].series[1].extra.total+1})}return a}prepareTableData(){return this.transactionsReportData.reduce((e,t)=>t.series[0].value>0||t.series[1].value>0?e.concat({date:t.date,date_str:this.commonService.convertTimestampToDate(t.date.getTime()/1e3),amount_paid:t.series[0].value,num_payments:t.series[0].extra.total,amount_received:t.series[1].value,num_invoices:t.series[1].extra.total}):e,[])}onSelectionChange(e){const t=e.selDate.getMonth(),n=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===p.r[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,t,1,0,0,0),this.endDate=new Date(n,t,this.getMonthDays(t,n),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(e,t){return 1===e&&t%4==0?p.n[e].days+1:p.n[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(sl.a),s.Pb(U.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-cl-transactions-report"]],hostBindings:function(e,t){1&e&&s.dc("mouseup",function(e){return t.onChartMouseUp(e)})},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(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"rtl-horizontal-scroller",1),s.dc("stepChanged",function(e){return t.onSelectionChange(e)}),s.Ub(),s.Vb(2,"div",2),s.Ic(3,Br,3,3,"div",3),s.Ic(4,Nr,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,Hr,3,13,"ngx-charts-bar-vertical-2d",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,qr,1,3,"rtl-transactions-report-table",7),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("ngIf",t.transactionsNonZeroReportData.length>0),s.Db(1),s.oc("ngIf",t.transactionsNonZeroReportData.length<=0),s.Db(2),s.oc("ngIf",t.transactionsNonZeroReportData.length>0),s.Db(2),s.oc("ngIf",t.transactionsNonZeroReportData.length>0))},directives:[c.c,c.b,c.a,kr.a,i.o,Ar.a,Mr.a],pipes:[i.f],styles:[""],data:{animation:[Fr.a]}}),e})();var jr=n("2h+y"),Gr=n("0dfH");const $r=a.k.forChild([{path:"",component:b,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:On,canActivate:[jr.b]},{path:"onchain",component:Wi,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:ao,canActivate:[jr.b]},{path:"send/:selTab",component:oo,data:{sweepAll:!1},canActivate:[jr.b]},{path:"sweep/:selTab",component:oo,data:{sweepAll:!0},canActivate:[jr.b]}]},{path:"connections",component:Zi,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:ko,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:vs,canActivate:[jr.b]},{path:"pending",component:Ws,canActivate:[jr.b]}]},{path:"peers",component:Oc,data:{sweepAll:!1},canActivate:[jr.b]}]},{path:"transactions",component:ta,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:bn,canActivate:[jr.b]},{path:"invoices",component:We,canActivate:[jr.b]},{path:"queryroutes",component:ol,canActivate:[jr.b]}]},{path:"messages",component:to,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:ll,canActivate:[jr.b]},{path:"verify",component:pl,canActivate:[jr.b]}]},{path:"routing",component:ia,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Gl,canActivate:[jr.b]},{path:"failedtransactions",component:Sr,canActivate:[jr.b]}]},{path:"reports",component:Ir,canActivate:[jr.b],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:Kr,canActivate:[jr.b]},{path:"transactions",component:Xr,canActivate:[jr.b]}]},{path:"lookups",component:Oa,canActivate:[jr.b]},{path:"rates",component:Za,canActivate:[jr.b]},{path:"**",component:Gr.a},{path:"network",redirectTo:"rates"},{path:"wallet",redirectTo:"home"},{path:"backup",redirectTo:"home"}]}]);var Wr=n("PCNd");let Jr=(()=>{class e{}return e.\u0275mod=s.Nb({type:e,bootstrap:[b]}),e.\u0275inj=s.Mb({factory:function(t){return new(t||e)},providers:[jr.b],imports:[[i.c,Wr.a,$r]]}),e})()}}]);