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/7.3f5e1768ebd105934cfb.js

1 line
442 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{tmAo:function(e,t,n){"use strict";n.r(t),n.d(t,"LNDModule",function(){return xm});var a=n("SVse"),i=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 i.e:this.loading=!0;break;case e instanceof i.c:case e instanceof i.b:case e instanceof i.d:this.loading=!1}})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-lnd-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,a.o,i.l,l.a],styles:[""],data:{animation:[o.a]}}),e})();var u=n("XNiG"),d=n("1G5W"),h=n("pLZG"),m=n("twK/"),p=n("wHSu"),f=n("7nzP"),g=n("MCVq"),y=n("cpEJ"),x=n("tqRt"),v=n("7bNT"),w=n("7o2P"),C=n("Nv++"),U=n("40+f"),V=n("PDjf"),D=n("rJgo"),S=n("Dxy4"),L=n("Tj54"),I=n("ura0");const _=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,_,e.information.color))}}function F(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,_,e.information.color)),s.Db(1),s.Mc(" ",s.jc(6,2,e.information.color)," ")}}function A(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 T=(()=>{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(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,F,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,A,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,a.o,a.n,a.p,I.b],pipes:[a.y],styles:[""]}),e})(),P=(()=>{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-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:[a.f],styles:[""]}),e})();var O=n("Q2Ze"),K=n("ZFy/"),R=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.remote_alias||e.remote_pubkey),s.pc("matTooltipDisabled",(e.remote_alias||e.remote_pubkey).length<26),s.Db(1),s.Nc("",s.lc(3,9,e.remote_alias||e.remote_pubkey,0,24),"",(e.remote_alias||e.remote_pubkey).length>25?"...":"",""),s.Db(6),s.Mc("",s.jc(9,13,e.local_balance||0)," Sats"),s.Db(3),s.oc("icon",n.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,15,e.balancedness||0),") "),s.Db(5),s.Mc("",s.jc(18,17,e.remote_balance||0)," Sats"),s.Db(2),s.pc("value",e.local_balance&&e.local_balance>0?+e.local_balance/(+e.local_balance+ +e.remote_balance)*100:0)}}function z(e,t){if(1&e&&(s.Vb(0,"div",15),s.Ic(1,E,20,19,"div",16),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.allChannels)}}function N(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 B=(()=>{class e{constructor(e){this.router=e,this.faBalanceScale=p.d,this.faDumbbell=p.l,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/lnd/connections")}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy"},decls:26,vars:13,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,N,4,0,"ng-template",null,14,s.Jc)),2&e){const e=s.wc(25);s.Db(8),s.Mc("",s.jc(9,7,t.channelBalances.localBalance||0)," Sats"),s.Db(3),s.oc("icon",t.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,9,(null==t.channelBalances?null:t.channelBalances.balancedness)||0),") "),s.Db(5),s.Mc("",s.jc(18,11,t.channelBalances.remoteBalance||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,C.a,K.a,l.a,R.a,M.b,a.o,a.n,S.a],pipes:[a.f,a.w],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),e})(),G=(()=>{class e{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){if(this.fees.month_fee_sum){this.totalFees=[{name:"Monthly",value:this.fees.month_fee_sum},{name:"Weekly",value:this.fees.week_fee_sum},{name:"Daily ",value:this.fees.day_fee_sum}];let e=Math.ceil(Math.log(this.fees.month_fee_sum+1)/Math.LN10),t=Math.pow(10,e-1);this.maxFeeValue=Math.ceil(this.fees.month_fee_sum/t)*t/5||100,Object.assign(this,this.totalFees)}else this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100,Object.assign(this,this.totalFees)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-fee-info"]],inputs:{fees:"fees"},features:[s.Bb],decls:44,vars:18,consts:[["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxFlex","20"],[1,"dashboard-info-title"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Daily"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Vb(7,"div"),s.Vb(8,"h4",1),s.Kc(9,"Weekly"),s.Ub(),s.Vb(10,"div",2),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",1),s.Kc(15,"Monthly"),s.Ub(),s.Vb(16,"div",2),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Vb(19,"div",3),s.Qb(20,"h4",4),s.Qb(21,"span",2),s.Ub(),s.Ub(),s.Vb(22,"div",0),s.Vb(23,"div"),s.Vb(24,"h4",1),s.Kc(25,"Transactions"),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,"Transactions"),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,"Transactions"),s.Ub(),s.Vb(38,"div",2),s.Kc(39),s.ic(40,"number"),s.Ub(),s.Ub(),s.Vb(41,"div",3),s.Qb(42,"h4",4),s.Qb(43,"span",2),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.Mc("",s.jc(6,6,null==t.fees?null:t.fees.day_fee_sum)," Sats"),s.Db(6),s.Mc("",s.jc(12,8,null==t.fees?null:t.fees.week_fee_sum)," Sats"),s.Db(6),s.Mc("",s.jc(18,10,null==t.fees?null:t.fees.month_fee_sum)," Sats"),s.Db(10),s.Lc(s.jc(28,12,null==t.fees?null:t.fees.daily_tx_count)),s.Db(6),s.Lc(s.jc(34,14,null==t.fees?null:t.fees.weekly_tx_count)),s.Db(6),s.Lc(s.jc(40,16,null==t.fees?null:t.fees.monthly_tx_count)))},directives:[c.c,c.a,c.b],pipes:[a.f],styles:[""]}),e})(),q=(()=>{class e{constructor(){this.channelsStatus={}}ngOnChanges(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus"},features:[s.Bb],decls:54,vars:24,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"],[1,"dot","tiny-dot","red"]],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.Vb(22,"div"),s.Vb(23,"h4",1),s.Kc(24,"Closing"),s.Ub(),s.Vb(25,"div",2),s.Qb(26,"span",6),s.Kc(27),s.ic(28,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(29,"div",0),s.Vb(30,"div"),s.Vb(31,"h4",1),s.Kc(32,"Capacity"),s.Ub(),s.Vb(33,"div",2),s.Kc(34),s.ic(35,"number"),s.Ub(),s.Ub(),s.Vb(36,"div"),s.Vb(37,"h4",1),s.Kc(38,"Capacity"),s.Ub(),s.Vb(39,"div",2),s.Kc(40),s.ic(41,"number"),s.Ub(),s.Ub(),s.Vb(42,"div"),s.Vb(43,"h4",1),s.Kc(44,"Capacity"),s.Ub(),s.Vb(45,"div",2),s.Kc(46),s.ic(47,"number"),s.Ub(),s.Ub(),s.Vb(48,"div"),s.Vb(49,"h4",1),s.Kc(50,"Capacity"),s.Ub(),s.Vb(51,"div",2),s.Kc(52),s.ic(53,"number"),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(6),s.Lc(s.jc(7,8,t.channelsStatus.active.channels||0)),s.Db(7),s.Lc(s.jc(14,10,t.channelsStatus.pending.channels||0)),s.Db(7),s.Lc(s.jc(21,12,t.channelsStatus.inactive.channels||0)),s.Db(7),s.Lc(s.jc(28,14,t.channelsStatus.closing.channels||0)),s.Db(7),s.Mc("",s.jc(35,16,t.channelsStatus.active.capacity||0)," Sats"),s.Db(6),s.Mc("",s.jc(41,18,t.channelsStatus.pending.capacity||0)," Sats"),s.Db(6),s.Mc("",s.jc(47,20,t.channelsStatus.inactive.capacity||0)," Sats"),s.Db(6),s.Mc("",s.jc(53,22,t.channelsStatus.closing.capacity||0)," Sats"))},directives:[c.c,c.a,c.b],pipes:[a.f],styles:[""]}),e})();var Q=n("CwT3"),H=n("/uX3"),j=n("hBQm");function $(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.jc(4,1,e.remote_balance||0)," Sats")}}function W(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",22),s.dc("click",function(){s.zc(e);const t=s.hc(2).$implicit;return s.hc(2).onLoopOut(t)}),s.Kc(1,"Loop Out"),s.Ub()}}function X(e,t){if(1&e&&(s.Vb(0,"div",19),s.Vb(1,"mat-hint",20),s.Vb(2,"strong",18),s.Kc(3,"Capacity: "),s.Ub(),s.Kc(4),s.ic(5,"number"),s.Ub(),s.Ic(6,W,2,0,"button",21),s.Ub()),2&e){const e=s.hc().$implicit,t=s.hc(2);s.Db(4),s.Mc("",s.jc(5,2,e.local_balance||0)," Sats"),s.Db(2),s.oc("ngIf",t.showLoop)}}function J(e,t){if(1&e&&s.Qb(0,"mat-progress-bar",23),2&e){const e=s.hc().$implicit,t=s.hc(2);s.pc("value",t.totalLiquidity>0?(+e.remote_balance||0)/t.totalLiquidity*100:0)}}function Y(e,t){if(1&e&&s.Qb(0,"mat-progress-bar",23),2&e){const e=s.hc().$implicit,t=s.hc(2);s.pc("value",t.totalLiquidity>0?(+e.local_balance||0)/t.totalLiquidity*100:0)}}function Z(e,t){if(1&e&&(s.Vb(0,"div",11),s.Vb(1,"span",12),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Vb(4,"div",13),s.Ic(5,$,5,3,"mat-hint",14),s.Ic(6,X,7,4,"div",15),s.Ub(),s.Ic(7,J,1,1,"mat-progress-bar",16),s.Ic(8,Y,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.remote_alias||e.remote_pubkey),s.pc("matTooltipDisabled",(e.remote_alias||e.remote_pubkey).length<26),s.Db(1),s.Nc("",s.lc(3,8,e.remote_alias||e.remote_pubkey,0,24),"",(e.remote_alias||e.remote_pubkey).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 ee(e,t){if(1&e&&(s.Vb(0,"div",9),s.Ic(1,Z,9,12,"div",10),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.allChannels)}}function te(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",26),s.dc("click",function(){return s.zc(e),s.hc(2).goToChannels()}),s.Kc(1,"Open Channel"),s.Ub()}}function ne(e,t){if(1&e&&(s.Vb(0,"div",24),s.Kc(1," No channels available. "),s.Ic(2,te,2,0,"button",25),s.Ub()),2&e){const e=s.hc();s.Db(2),s.oc("ngIf","Out"===e.direction)}}const ae=function(e,t,n){return{"mb-4":e,"mb-2":t,"mb-1":n}};let ie=(()=>{class e{constructor(e,t,n,a){this.router=e,this.loopService=t,this.commonService=n,this.store=a,this.targetConf=6,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.showLoop=!(!e.nodeSettings.swapServerUrl||""===e.nodeSettings.swapServerUrl.trim())})}goToChannels(){this.router.navigateByUrl("/lnd/connections")}onLoopOut(e){this.store.dispatch(new H.G("Getting Terms and Quotes...")),this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe(Object(d.a)(this.unSubs[1])).subscribe(t=>{this.store.dispatch(new H.j),this.store.dispatch(new H.D({minHeight:"56rem",data:{channel:e,minQuote:t[0],maxQuote:t[1],direction:f.m.LOOP_OUT,component:Q.a}}))})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(i.g),s.Pb(j.a),s.Pb(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels"},decls:13,vars:10,consts:[["fxLayout","column","fxLayoutAlign","start 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"],[3,"perfectScrollbar",4,"ngIf","ngIfElse"],["noChannelBlock",""],[3,"perfectScrollbar"],["fxLayout","column",4,"ngFor","ngForOf"],["fxLayout","column"],[1,"dashboard-capacity-header","mt-2",3,"matTooltip","matTooltipDisabled"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["class","font-size-90 color-primary",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],[1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxFlex","85","fxLayoutAlign","start start",1,"font-size-90","color-primary"],["fxFlex","15","fxLayoutAlign","end start","class","button-link-dashboard","color","primary","mat-button","","aria-label","Loop Out",3,"click",4,"ngIf"],["fxFlex","15","fxLayoutAlign","end start","color","primary","mat-button","","aria-label","Loop Out",1,"button-link-dashboard",3,"click"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"]],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.Ic(10,ee,2,1,"div",7),s.Ub(),s.Ic(11,ne,3,1,"ng-template",null,8,s.Jc)),2&e){const e=s.wc(12);s.oc("ngClass",s.uc(6,ae,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.jc(6,4,t.totalLiquidity)," Sats"),s.Db(5),s.oc("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",e)}},directives:[c.c,c.b,c.a,a.m,I.a,O.f,l.a,R.a,a.o,M.b,a.n,K.a,S.a],pipes:[a.f,a.w],styles:[""]}),e})();var oe=n("M9ds"),se=n("5QHs"),ce=n("LUZP"),le=n("OaSA"),re=n("iELJ"),be=n("s7LF"),ue=n("e6WT"),de=n("O4ig"),he=n("B0X+"),me=n("ZTz/"),pe=n("jMqV"),fe=n("UhP/");function ge(e,t){if(1&e&&(s.Vb(0,"mat-option",24),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 ye(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 xe(e,t){if(1&e&&(s.Vb(0,"div",25),s.Qb(1,"fa-icon",26),s.Ic(2,ye,2,1,"span",27),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 ve=(()=>{class e{constructor(e,t,n,a,i,o){this.dialogRef=e,this.data=t,this.store=n,this.decimalPipe=a,this.commonService=i,this.actions$=o,this.faExclamationTriangle=p.o,this.selNode={},this.memo="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=f.p,this.timeUnitEnum=f.y,this.timeUnits=f.w,this.selTimeUnit=f.y.SECS,this.invoiceError="",this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.information=e.information}),this.actions$.pipe(Object(d.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.m||e.type===g.u)).subscribe(e=>{e.type===g.u&&this.dialogRef.close(),e.type===g.m&&"SaveNewInvoice"===e.payload.action&&(this.invoiceError=e.payload.message)})}onAddInvoice(e){this.invoiceError="";let t=this.expiry?this.expiry:3600;this.selTimeUnit!==f.y.SECS&&(t=this.commonService.convertTime(this.expiry,this.selTimeUnit,f.y.SECS)),this.store.dispatch(new H.G("Adding Invoice...")),this.store.dispatch(new g.Qb({memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:t,pageSize:this.pageSize,openModal:!0}))}resetData(){this.memo="",this.invoiceValue=void 0,this.private=!1,this.expiry=void 0,this.invoiceValueHint="",this.selTimeUnit=f.y.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,f.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(d.a)(this.unSubs[2])).subscribe(e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,f.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(re.f),s.Pb(re.a),s.Pb(x.h),s.Pb(a.f),s.Pb(w.a),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-create-invoices"]],decls:36,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","space-between start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","end start"],["matInput","","autoFocus","","placeholder","Memo","tabindex","1","name","memo",3,"ngModel","ngModelChange"],["fxFlex","50","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","2","name","invoiceValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","24","fxLayoutAlign","start end"],["matInput","","placeholder","Expiry","type","number","tabindex","3","name","expiry",3,"ngModel","step","min","ngModelChange"],["tabindex","4","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",1,"mt-1"],["tabindex","4","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","5","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","6",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.memo=e}),s.Ub(),s.Ub(),s.Vb(13,"mat-form-field",11),s.Vb(14,"input",12),s.dc("ngModelChange",function(e){return t.invoiceValue=e})("keyup",function(){return t.onInvoiceValueChange()}),s.Ub(),s.Vb(15,"span",13),s.Kc(16),s.Ub(),s.Vb(17,"mat-hint"),s.Kc(18),s.Ub(),s.Ub(),s.Vb(19,"mat-form-field",14),s.Vb(20,"input",15),s.dc("ngModelChange",function(e){return t.expiry=e}),s.Ub(),s.Vb(21,"span",13),s.Kc(22),s.ic(23,"titlecase"),s.Ub(),s.Ub(),s.Vb(24,"mat-form-field",14),s.Vb(25,"mat-select",16),s.dc("selectionChange",function(e){return t.onTimeUnitChange(e)}),s.Ic(26,ge,3,4,"mat-option",17),s.Ub(),s.Ub(),s.Vb(27,"div",18),s.Vb(28,"mat-slide-toggle",19),s.dc("ngModelChange",function(e){return t.private=e}),s.Kc(29,"Private Routing Hints"),s.Ub(),s.Ub(),s.Ic(30,xe,3,2,"div",20),s.Vb(31,"div",21),s.Vb(32,"button",22),s.dc("click",function(){return t.resetData()}),s.Kc(33,"Clear Field"),s.Ub(),s.Vb(34,"button",23),s.dc("click",function(){s.zc(e);const n=s.wc(10);return t.onAddInvoice(n)}),s.Kc(35,"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.memo),s.Db(2),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(23,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,V.c,c.b,S.a,re.d,V.b,be.u,be.n,be.o,O.c,ue.b,be.c,de.a,be.m,be.p,be.q,he.a,O.g,O.f,me.a,a.n,pe.a,K.a,a.o,fe.m,C.a],pipes:[a.x],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();var we=n("+zbs"),Ce=n("mNcL");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().memo=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.memo),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 Ve(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().openCreateInvoiceModal()}),s.Kc(2,"Create Invoice"),s.Ub(),s.Ub()}}function De(e,t){1&e&&s.Qb(0,"mat-progress-bar",46)}function Se(e,t){1&e&&(s.Vb(0,"th",47),s.Kc(1," Date Created "),s.Ub())}const Le=function(e){return{"mr-0":e}};function Ie(e,t){if(1&e&&s.Qb(0,"span",51),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Le,e.screenSize===e.screenSizeEnum.XS))}}function _e(e,t){if(1&e&&s.Qb(0,"span",52),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Le,e.screenSize===e.screenSizeEnum.XS))}}function ke(e,t){if(1&e&&(s.Vb(0,"td",48),s.Ic(1,Ie,1,3,"span",49),s.Ic(2,_e,1,3,"span",50),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf",e.settled),s.Db(1),s.oc("ngIf",!e.settled),s.Db(1),s.Mc(" ",e.creation_date_str,"")}}function Fe(e,t){1&e&&(s.Vb(0,"th",53),s.Kc(1," Date Settled "),s.Ub())}function Ae(e,t){if(1&e&&(s.Vb(0,"td",54),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(e.settle_date_str||"-")}}function Te(e,t){1&e&&(s.Vb(0,"th",47),s.Kc(1," Memo "),s.Ub())}const Pe=function(e){return{"max-width":e}};function Oe(e,t){if(1&e&&(s.Vb(0,"td",48),s.Vb(1,"div",55),s.Vb(2,"span",56),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":"22rem")),s.Db(2),s.Lc(e.memo)}}function Ke(e,t){1&e&&(s.Vb(0,"th",57),s.Kc(1," Amount (Sats) "),s.Ub())}function Re(e,t){if(1&e&&(s.Vb(0,"td",48),s.Vb(1,"span",58),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.value)," ")}}function Me(e,t){1&e&&(s.Vb(0,"th",57),s.Kc(1," Amount Settled (Sats) "),s.Ub())}function Ee(e,t){if(1&e&&(s.Vb(0,"td",48),s.Vb(1,"span",58),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.amt_paid_sat)," ")}}function ze(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",59),s.Vb(1,"div",60),s.Vb(2,"mat-select",61),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",62),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 Ne=function(e){return{"pl-3":e}};function Be(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",63),s.Vb(1,"button",64),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc(2).onInvoiceClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}if(2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,Ne,e.screenSize!==e.screenSizeEnum.XS))}}function Ge(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No invoices available."),s.Ub())}function qe(e,t){if(1&e&&(s.Vb(0,"td",65),s.Ic(1,Ge,2,0,"p",66),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",67),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 je(e,t){1&e&&s.Qb(0,"tr",68)}function $e(e,t){if(1&e&&s.Qb(0,"tr",69),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.memo==n.newlyAddedInvoiceMemo&&e.value==n.newlyAddedInvoiceValue&&n.flgAnimate?"added":"notAdded")}}const We=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Xe=function(){return["no_invoice"]};function Je(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",16),s.Vb(1,"div",17),s.Vb(2,"div",18),s.Qb(3,"fa-icon",19),s.Vb(4,"span",20),s.Kc(5,"Invoices History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",21),s.Vb(7,"input",22),s.dc("keyup",function(t){return s.zc(e),s.hc().applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",23),s.Ic(9,De,1,0,"mat-progress-bar",24),s.Vb(10,"table",25,26),s.Tb(12,27),s.Ic(13,Se,2,0,"th",28),s.Ic(14,ke,4,3,"td",29),s.Sb(),s.Tb(15,30),s.Ic(16,Fe,2,0,"th",31),s.Ic(17,Ae,2,1,"td",32),s.Sb(),s.Tb(18,33),s.Ic(19,Te,2,0,"th",28),s.Ic(20,Oe,4,4,"td",29),s.Sb(),s.Tb(21,34),s.Ic(22,Ke,2,0,"th",35),s.Ic(23,Re,4,3,"td",29),s.Sb(),s.Tb(24,36),s.Ic(25,Me,2,0,"th",35),s.Ic(26,Ee,4,3,"td",29),s.Sb(),s.Tb(27,37),s.Ic(28,ze,6,0,"th",38),s.Ic(29,Be,3,3,"td",39),s.Sb(),s.Tb(30,40),s.Ic(31,qe,2,1,"td",41),s.Sb(),s.Ic(32,He,1,3,"tr",42),s.Ic(33,je,1,0,"tr",43),s.Ic(34,$e,1,1,"tr",44),s.Ub(),s.Vb(35,"mat-paginator",45),s.dc("page",function(t){return s.zc(e),s.hc().onPageChange(t)}),s.Ub(),s.Ub(),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(12,We,"error"===e.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(14,Xe)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("length",e.totalInvoices)("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Ye=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.decimalPipe=n,this.commonService=a,this.calledFrom="transactions",this.faHistory=p.r,this.selNode={},this.newlyAddedInvoiceMemo=null,this.newlyAddedInvoiceValue=null,this.flgAnimate=!0,this.memo="",this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoicesData=[],this.information={},this.flgLoading=[!0],this.flgSticky=!1,this.private=!1,this.expiryStep=100,this.totalInvoices=100,this.pageSize=f.p,this.pageSizeOptions=f.q,this.firstOffset=-1,this.lastOffset=-1,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","value","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["creation_date","settle_date","value","amt_paid_sat","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["creation_date","settle_date","memo","value","actions"]):(this.flgSticky=!0,this.displayedColumns=["creation_date","settle_date","memo","value","amt_paid_sat","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.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.firstOffset=+e.invoices.first_index_offset,this.lastOffset=+e.invoices.last_index_offset,this.invoicesData=e.invoices.invoices?e.invoices.invoices:[],this.invoicesData.length>0&&this.loadInvoicesTable(this.invoicesData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.invoices),this.logger.info(e)})}ngAfterViewInit(){this.invoicesData.length>0&&this.loadInvoicesTable(this.invoicesData)}onAddInvoice(e){let t=this.expiry?this.expiry:3600;this.flgAnimate=!0,this.newlyAddedInvoiceMemo=this.memo,this.newlyAddedInvoiceValue=this.invoiceValue,this.store.dispatch(new H.G("Adding Invoice...")),this.store.dispatch(new g.Qb({memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:t,pageSize:this.pageSize,openModal:!0})),this.resetData()}onInvoiceClick(e,t){this.store.dispatch(new H.D({data:{invoice:e,newlyAdded:!1,component:we.a}}))}loadInvoicesTable(e){this.invoices=new le.o(e?[...e]:[]),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),setTimeout(()=>{this.flgAnimate=!1},5e3),this.logger.info(this.invoices)}resetData(){this.memo="",this.invoiceValue=void 0,this.private=!1,this.expiry=void 0,this.invoiceValueHint=""}applyFilter(e){this.invoices.filter=e.value.trim().toLowerCase()}onPageChange(e){let t=!0,n=this.firstOffset;e.pageIndex<e.previousPageIndex&&(t=!1,n=this.lastOffset),e.pageIndex===e.previousPageIndex&&(t=!0,n=0),this.store.dispatch(new g.H({num_max_invoices:e.pageSize,index_offset:n,reversed:t}))}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,f.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,f.f.OTHER)+" "+e.unit}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}openCreateInvoiceModal(){this.store.dispatch(new H.D({data:{pageSize:this.pageSize,component:ve}}))}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.f),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-lightning-invoices"]],viewQuery:function(e,t){if(1&e&&s.Pc(ce.a,!0),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first)}},inputs:{calledFrom:"calledFrom"},features:[s.Cb([{provide:se.b,useValue:Object(f.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","end start"],["matInput","","placeholder","Memo","tabindex","1","name","memo",3,"ngModel","ngModelChange"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","2","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","5",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","","tabindex","6","placeholder","Filter",3,"keyup"],[1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","creation_date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","settle_date"],["mat-header-cell","","mat-sort-header","","class","pl-4",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["matColumnDef","memo"],["matColumnDef","value"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_paid_sat"],["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","","class","row-invoices",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"length","pageSize","pageSizeOptions","showFirstLastButtons","page"],["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"],["mat-header-cell","","mat-sort-header","",1,"pl-4"],["mat-cell","",1,"pl-4"],[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","",1,"row-invoices"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,Ue,15,6,"form",1),s.Ic(2,Ve,3,0,"div",2),s.Ic(3,Je,36,15,"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,a.o,be.u,be.n,be.o,O.c,ue.b,be.c,be.m,be.p,be.q,he.a,O.g,O.f,S.a,C.a,M.b,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,K.a,a.p,I.b,me.a,me.c,fe.m,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-memo[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-memo[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[Ce.a]}}),e})();var Ze=n("cp0P"),et=n("IzEk"),tt=n("iiaH"),nt=n("o4Yh");const at=["paymentReq"];function it(e,t){if(1&e&&(s.Vb(0,"mat-hint"),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(e.paymentDecodedHint)}}function ot(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function st(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.Lc(e.paymentDecodedHint)}}function ct(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment amount is required."),s.Ub())}function lt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",9),s.Vb(1,"input",28,29),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().paymentAmount=t})("change",function(t){return s.zc(e),s.hc().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,ct,2,0,"mat-error",12),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("ngModel",e.paymentAmount),s.Db(4),s.oc("ngIf",!e.paymentAmount)}}function rt(e,t){if(1&e&&(s.Vb(0,"mat-option",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc(" ",e.name," ")}}function bt(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("",e.selFeeLimitType.placeholder," is required.")}}function ut(e,t){if(1&e&&(s.Vb(0,"mat-option",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc(" ",e.remote_alias||e.chan_id," ")}}function dt(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 ht(e,t){if(1&e&&(s.Vb(0,"div",31),s.Qb(1,"fa-icon",32),s.Ic(2,dt,2,1,"span",12),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.paymentError)}}let mt=(()=>{class e{constructor(e,t,n,a,i,o,s){this.dialogRef=e,this.store=t,this.logger=n,this.commonService=a,this.decimalPipe=i,this.actions$=o,this.dataService=s,this.faExclamationTriangle=p.o,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.showAdvanced=!1,this.selActiveChannel={},this.activeChannels=[],this.filteredMinAmtActvChannels=[],this.feeLimit=null,this.selFeeLimitType=f.i[0],this.feeLimitTypes=f.i,this.advancedTitle="Advanced Options",this.paymentError="",this.unSubs=[new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.activeChannels=e.allChannels.filter(e=>e.active),this.filteredMinAmtActvChannels=this.activeChannels,this.logger.info(e)}),this.actions$.pipe(Object(d.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.m||e.type===g.sb)).subscribe(e=>{e.type===g.sb&&this.dialogRef.close(),e.type===g.m&&"SendPayment"===e.payload.action&&(delete this.paymentDecoded.num_satoshis,this.paymentError=e.payload.message)})}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp_str?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.dataService.decodePayment(this.paymentRequest,!0).pipe(Object(et.a)(1)).subscribe(e=>{this.selActiveChannel={},this.paymentDecoded=e,this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.zeroAmtInvoice=!1,this.filteredMinAmtActvChannels=this.activeChannels.filter(e=>e.local_balance>=this.paymentDecoded.num_satoshis),this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis,f.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(d.a)(this.unSubs[2])).subscribe(e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,f.f.OTHER)+") | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")):(this.zeroAmtInvoice=!0,this.filteredMinAmtActvChannels=this.activeChannels,this.paymentDecodedHint="Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None"))},e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+e.message,this.paymentReq.control.setErrors({decodeError:!0})}))}sendPayment(){this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.store.dispatch(new H.G("Sending Payment...")),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.zeroAmtInvoice=!1,this.store.dispatch(new g.Sb({paymentReq:this.paymentRequest,paymentDecoded:this.paymentDecoded,zeroAmtInvoice:!1,outgoingChannel:this.selActiveChannel,feeLimitType:this.selFeeLimitType,feeLimit:this.feeLimit,fromDialog:!0}))):(this.zeroAmtInvoice=!0,this.paymentDecoded.num_satoshis=this.paymentAmount,this.store.dispatch(new g.Sb({paymentReq:this.paymentRequest,paymentDecoded:this.paymentDecoded,zeroAmtInvoice:!0,outgoingChannel:this.selActiveChannel,feeLimitType:this.selFeeLimitType,feeLimit:this.feeLimit,fromDialog:!0})))}onAmountChange(e){delete this.paymentDecoded.num_satoshis}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentRequest&&this.paymentRequest.length>100&&(this.paymentReq.control.setErrors(null),this.zeroAmtInvoice=!1,this.dataService.decodePayment(this.paymentRequest,!0).pipe(Object(et.a)(1)).subscribe(e=>{this.paymentDecoded=e,this.selActiveChannel={},this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.zeroAmtInvoice=!1,this.filteredMinAmtActvChannels=this.activeChannels.filter(e=>e.local_balance>=this.paymentDecoded.num_satoshis),this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis,f.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(d.a)(this.unSubs[2])).subscribe(e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,f.f.OTHER)+") | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")):(this.zeroAmtInvoice=!0,this.filteredMinAmtActvChannels=this.activeChannels,this.paymentDecodedHint="Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None"))},e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+e.message,this.paymentReq.control.setErrors({decodeError:!0})}))}onAdvancedPanelToggle(e){this.advancedTitle=e?"Advanced Options | "+this.selFeeLimitType.name+("none"===this.selFeeLimitType.id?"":": "+this.feeLimit)+(this.selActiveChannel.remote_alias||this.selActiveChannel.chan_id?" | First Outgoing Channel: "+(this.selActiveChannel.remote_alias?this.selActiveChannel.remote_alias:this.selActiveChannel.chan_id):""):"Advanced Options"}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.filteredMinAmtActvChannels=this.activeChannels,this.feeLimit=null,this.selFeeLimitType=f.i[0],this.advancedTitle="Advanced Options",this.zeroAmtInvoice=!1,this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(x.h),s.Pb(y.b),s.Pb(w.a),s.Pb(a.f),s.Pb(v.a),s.Pb(tt.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-lightning-send-payments"]],viewQuery:function(e,t){if(1&e&&s.Pc(at,!0),2&e){let e;s.vc(e=s.ec())&&(t.paymentReq=e.first)}},decls:40,vars:19,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"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["fxFlex","100"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxFlex","100","fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","30","fxLayoutAlign","start end"],["tabindex","5","Placeholder","Fee Limits",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","26"],["matInput","","type","number","name","feeLmt","required","","tabindex","6",3,"ngModel","placeholder","step","min","disabled","ngModelChange"],["fLmt","ngModel"],["fxFlex","40","fxLayoutAlign","start end"],["tabindex","7","placeholder","First Outgoing Channel",3,"value","disabled","valueChange"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],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.Vb(9,"form",7,8),s.Vb(11,"mat-form-field",9),s.Vb(12,"textarea",10,11),s.dc("ngModelChange",function(e){return t.onPaymentRequestEntry(e)})("matTextareaAutosize",function(){return!0}),s.Ub(),s.Ic(14,it,2,1,"mat-hint",12),s.Ic(15,ot,2,0,"mat-error",12),s.Ic(16,st,2,1,"mat-error",12),s.Ub(),s.Ic(17,lt,6,2,"mat-form-field",13),s.Vb(18,"mat-expansion-panel",14),s.dc("closed",function(){return t.onAdvancedPanelToggle(!0)})("opened",function(){return t.onAdvancedPanelToggle(!1)}),s.Vb(19,"mat-expansion-panel-header"),s.Vb(20,"mat-panel-title"),s.Vb(21,"span"),s.Kc(22),s.Ub(),s.Ub(),s.Ub(),s.Vb(23,"div",15),s.Vb(24,"mat-form-field",16),s.Vb(25,"mat-select",17),s.dc("valueChange",function(e){return t.selFeeLimitType=e}),s.Ic(26,rt,2,2,"mat-option",18),s.Ub(),s.Ub(),s.Vb(27,"mat-form-field",19),s.Vb(28,"input",20,21),s.dc("ngModelChange",function(e){return t.feeLimit=e}),s.Ub(),s.Ic(30,bt,2,1,"mat-error",12),s.Ub(),s.Vb(31,"mat-form-field",22),s.Vb(32,"mat-select",23),s.dc("valueChange",function(e){return t.selActiveChannel=e}),s.Ic(33,ut,2,2,"mat-option",18),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(34,ht,3,2,"div",24),s.Vb(35,"div",25),s.Vb(36,"button",26),s.dc("click",function(){return t.resetData()}),s.Kc(37,"Clear Fields"),s.Ub(),s.Vb(38,"button",27),s.dc("click",function(){return t.onSendPayment()}),s.Kc(39,"Send Payment"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.wc(13);s.Db(6),s.oc("mat-dialog-close",!1),s.Db(6),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),s.Db(5),s.Lc(t.advancedTitle),s.Db(3),s.oc("value",t.selFeeLimitType),s.Db(1),s.oc("ngForOf",t.feeLimitTypes),s.Db(2),s.oc("ngModel",t.feeLimit)("placeholder",t.selFeeLimitType.placeholder)("step",1)("min",0)("disabled",t.selFeeLimitType===t.feeLimitTypes[0]),s.Db(2),s.oc("ngIf",t.selFeeLimitType!==t.feeLimitTypes[0]&&!t.feeLimit),s.Db(2),s.oc("value",t.selActiveChannel)("disabled",t.filteredMinAmtActvChannels&&t.filteredMinAmtActvChannels.length<1),s.Db(1),s.oc("ngForOf",t.filteredMinAmtActvChannels),s.Db(1),s.oc("ngIf",""!==t.paymentError)}},directives:[c.c,c.a,V.c,c.b,S.a,re.d,V.b,be.u,be.n,be.o,O.c,ue.b,be.c,ue.d,de.a,be.s,be.m,be.p,a.o,nt.c,nt.e,nt.f,me.a,a.n,be.q,he.a,O.f,O.b,fe.m,C.a],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})();var pt=n("X9mX"),ft=n("F12H");const gt=["sendPaymentForm"];function yt(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 xt(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function vt(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,yt,2,1,"mat-hint",9),s.Ic(6,xt,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 wt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",13),s.Vb(1,"button",14),s.dc("click",function(){return s.zc(e),s.hc().openSendPaymentModal()}),s.Kc(2,"Send Payment"),s.Ub(),s.Ub()}}function Ct(e,t){1&e&&s.Qb(0,"mat-progress-bar",53)}function Ut(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1,"Creation Date"),s.Ub())}const Vt=function(e){return{"mr-0":e}};function Dt(e,t){if(1&e&&s.Qb(0,"span",58),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function St(e,t){if(1&e&&s.Qb(0,"span",59),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function Lt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Ic(1,Dt,1,3,"span",56),s.Ic(2,St,1,3,"span",57),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf","SUCCEEDED"===e.status),s.Db(1),s.oc("ngIf","SUCCEEDED"!==e.status),s.Db(1),s.Mc(" ",null==e?null:e.creation_date_str," ")}}function It(e,t){1&e&&(s.Vb(0,"th",54),s.Kc(1,"Payment Hash"),s.Ub())}const _t=function(e){return{"max-width":e}};function kt(e,t){if(1&e&&(s.Vb(0,"td",60),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,_t,n.screenSize===n.screenSizeEnum.XS?"10rem":"35rem")),s.Db(1),s.Lc(null==e?null:e.payment_hash)}}function Ft(e,t){1&e&&(s.Vb(0,"th",61),s.Kc(1,"Fee (Sats)"),s.Ub())}function At(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",62),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 Tt(e,t){1&e&&(s.Vb(0,"th",61),s.Kc(1,"Value (Sats)"),s.Ub())}function Pt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",62),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.value))}}function Ot(e,t){1&e&&(s.Vb(0,"th",61),s.Kc(1,"#Hops"),s.Ub())}function Kt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",62),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc((null==e||null==e.htlcs[0]||null==e.htlcs[0].route||null==e.htlcs[0].route.hops?null:e.htlcs[0].route.hops.length)||0)}}function Rt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",63),s.Vb(1,"div",64),s.Vb(2,"mat-select",65),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",66),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 Mt(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",67),s.Vb(1,"button",68),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 Et(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No payments available."),s.Ub())}function zt(e,t){if(1&e&&(s.Vb(0,"td",69),s.Ic(1,Et,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 Nt(e,t){if(1&e&&s.Qb(0,"span",58),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function Bt(e,t){if(1&e&&s.Qb(0,"span",59),2&e){const e=s.hc(3);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function Gt(e,t){if(1&e&&s.Qb(0,"span",58),2&e){const e=s.hc(5);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function qt(e,t){if(1&e&&s.Qb(0,"span",59),2&e){const e=s.hc(5);s.oc("ngClass",s.sc(1,Vt,e.screenSize===e.screenSizeEnum.XS))}}function Qt(e,t){if(1&e&&(s.Vb(0,"span",72),s.Ic(1,Gt,1,3,"span",56),s.Ic(2,qt,1,3,"span",57),s.Kc(3),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf","SUCCEEDED"===e.status),s.Db(1),s.oc("ngIf","SUCCEEDED"!==e.status),s.Db(1),s.Mc(" ",e.attempt_time_str," ")}}function Ht(e,t){if(1&e&&(s.Tb(0),s.Ic(1,Qt,4,3,"span",71),s.Sb()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function jt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",70),s.Ic(2,Nt,1,3,"span",56),s.Ic(3,Bt,1,3,"span",57),s.Kc(4),s.Ub(),s.Ic(5,Ht,2,1,"ng-container",9),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.oc("ngIf","SUCCEEDED"===e.status),s.Db(1),s.oc("ngIf","SUCCEEDED"!==e.status),s.Db(1),s.Mc(" Total Attempts: ",null==e||null==e.htlcs?null:e.htlcs.length," "),s.Db(1),s.oc("ngIf",e.is_expanded)}}function $t(e,t){if(1&e&&(s.Vb(0,"span",70),s.Kc(1),s.Ub()),2&e){const e=t.index;s.Db(1),s.Mc(" HTLC ",e+1," ")}}function Wt(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,$t,2,1,"span",73),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function Xt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",70),s.Kc(2),s.Ub(),s.Ic(3,Wt,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 Jt(e,t){if(1&e&&(s.Vb(0,"span",74),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,null==e.route?null:e.route.total_fees,"1.0-0")," ")}}function Yt(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Jt,3,4,"span",75),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function Zt(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",74),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ic(4,Yt,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.fee,"1.0-0")),s.Db(2),s.oc("ngIf",e.is_expanded)}}function en(e,t){if(1&e&&(s.Vb(0,"span",74),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,null==e.route?null:e.route.total_amt,"1.0-0")," ")}}function tn(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,en,3,4,"span",75),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function nn(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",74),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ic(4,tn,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.value,"1.0-0")),s.Db(2),s.oc("ngIf",e.is_expanded)}}function an(e,t){if(1&e&&(s.Vb(0,"span",74),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,(null==e.route||null==e.route.hops?null:e.route.hops.length)||0,"1.0-0")," ")}}function on(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,an,3,4,"span",75),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function sn(e,t){if(1&e&&(s.Vb(0,"td",55),s.Vb(1,"span",74),s.Kc(2,"-"),s.Ub(),s.Ic(3,on,2,1,"span",9),s.Ub()),2&e){const e=t.$implicit;s.Db(3),s.oc("ngIf",e.is_expanded)}}function cn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",62),s.Vb(1,"button",79),s.dc("click",function(){s.zc(e);const n=t.$implicit,a=s.hc(2).$implicit;return s.hc(2).onHTLCClick(n,a)}),s.Kc(2),s.Ub(),s.Ub()}if(2&e){const e=t.index;s.Db(2),s.Mc("View ",e+1,"")}}function ln(e,t){if(1&e&&(s.Vb(0,"div"),s.Ic(1,cn,3,1,"div",78),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.htlcs)}}function rn(e,t){if(1&e&&(s.Vb(0,"td",76),s.Vb(1,"span",62),s.Vb(2,"button",77),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,ln,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 bn(e,t){if(1&e&&s.Qb(0,"tr",80),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const un=function(e){return{"display-none":e}};function dn(e,t){if(1&e&&s.Qb(0,"tr",81),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,un,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function hn(e,t){1&e&&s.Qb(0,"tr",82)}function mn(e,t){if(1&e&&s.Qb(0,"tr",80),2&e){const e=t.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const pn=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},fn=function(){return["no_payment"]};function gn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",15),s.Vb(1,"div",16),s.Vb(2,"div",17),s.Qb(3,"fa-icon",18),s.Vb(4,"span",19),s.Kc(5,"Payments History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",20),s.Vb(7,"input",21),s.dc("keyup",function(t){return s.zc(e),s.hc().applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",22),s.Vb(9,"div",23),s.Ic(10,Ct,1,0,"mat-progress-bar",24),s.Vb(11,"table",25,26),s.Tb(13,27),s.Ic(14,Ut,2,0,"th",28),s.Ic(15,Lt,4,3,"td",29),s.Sb(),s.Tb(16,30),s.Ic(17,It,2,0,"th",28),s.Ic(18,kt,2,4,"td",31),s.Sb(),s.Tb(19,32),s.Ic(20,Ft,2,0,"th",33),s.Ic(21,At,4,3,"td",29),s.Sb(),s.Tb(22,34),s.Ic(23,Tt,2,0,"th",33),s.Ic(24,Pt,4,3,"td",29),s.Sb(),s.Tb(25,35),s.Ic(26,Ot,2,0,"th",33),s.Ic(27,Kt,3,1,"td",29),s.Sb(),s.Tb(28,36),s.Ic(29,Rt,6,0,"th",37),s.Ic(30,Mt,3,0,"td",38),s.Sb(),s.Tb(31,39),s.Ic(32,zt,2,1,"td",40),s.Sb(),s.Tb(33,41),s.Ic(34,jt,6,4,"td",29),s.Sb(),s.Tb(35,42),s.Ic(36,Xt,4,2,"td",29),s.Sb(),s.Tb(37,43),s.Ic(38,Zt,5,5,"td",29),s.Sb(),s.Tb(39,44),s.Ic(40,nn,5,5,"td",29),s.Sb(),s.Tb(41,45),s.Ic(42,sn,4,1,"td",29),s.Sb(),s.Tb(43,46),s.Ic(44,rn,5,2,"td",47),s.Sb(),s.Ic(45,bn,1,1,"tr",48),s.Ic(46,dn,1,3,"tr",49),s.Ic(47,hn,1,0,"tr",50),s.Ic(48,mn,1,1,"tr",51),s.Ub(),s.Qb(49,"mat-paginator",52),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("icon",e.faHistory),s.Db(7),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.payments)("ngClass",s.sc(13,pn,"error"===e.flgLoading[0])),s.Db(34),s.oc("matRowDefColumns",e.htlcColumns)("matRowDefWhen",e.is_group),s.Db(1),s.oc("matFooterRowDef",s.rc(15,fn)),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 yn=(()=>{class e{constructor(e,t,n,a,i,o,s,c){this.logger=e,this.commonService=t,this.dataService=n,this.store=a,this.rtlEffects=i,this.lndEffects=o,this.decimalPipe=s,this.actions$=c,this.calledFrom="transactions",this.faHistory=p.r,this.newlyAddedPayment="",this.flgAnimate=!0,this.selNode={},this.flgLoading=[!0],this.information={},this.peers=[],this.paymentJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","fee","actions"],this.htlcColumns=["groupTotal","groupFee","groupAction"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["creation_date","fee","value","hops","actions"],this.htlcColumns=["groupTotal","groupFee","groupValue","groupHops","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["creation_date","payment_hash","fee","value","hops","actions"],this.htlcColumns=["groupTotal","groupHash","groupFee","groupValue","groupHops","groupAction"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.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.peers=e.peers,this.paymentJSONArr=e.payments&&e.payments.length>0?e.payments:[],this.paymentJSONArr&&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&&this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp_str?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe(Object(et.a)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp_str?(this.paymentDecoded.num_satoshis=this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis?(+this.paymentDecoded.num_msat/1e3).toString():"0",this.sendPayment()):this.resetData()})}sendPayment(){this.flgAnimate=!0,this.newlyAddedPayment=this.paymentDecoded.payment_hash,this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.store.dispatch(new H.E({data:{type:f.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:"destination",value:this.paymentDecoded.destination,title:"Destination",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp_str",value:this.paymentDecoded.timestamp_str,title:"Creation Date",width:50},{key:"num_satoshis",value:this.paymentDecoded.num_satoshis,title:"Amount (Sats)",width:50,type:f.h.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:f.h.NUMBER},{key:"cltv_expiry",value:this.paymentDecoded.cltv_expiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe(Object(et.a)(1)).subscribe(e=>{e&&(this.store.dispatch(new H.G("Sending Payment...")),this.store.dispatch(new g.Sb({paymentReq:this.paymentRequest,paymentDecoded:this.paymentDecoded,zeroAmtInvoice:!1,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new H.E({data:{type:f.b.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"destination",value:this.paymentDecoded.destination,title:"Destination",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp_str",value:this.paymentDecoded.timestamp_str,title:"Creation Date",width:40},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:f.h.NUMBER},{key:"cltv_expiry",value:this.paymentDecoded.cltv_expiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,getInputs:[{placeholder:"Amount (Sats)",inputType:f.h.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe(Object(et.a)(1)).subscribe(e=>{e&&(this.paymentDecoded.num_satoshis=e[0].inputValue,this.store.dispatch(new H.G("Sending Payment...")),this.store.dispatch(new g.Sb({paymentReq:this.paymentRequest,paymentDecoded:this.paymentDecoded,zeroAmtInvoice:!0,fromDialog:!1})),this.resetData())}))}openSendPaymentModal(){this.store.dispatch(new H.D({data:{component:mt}}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe(Object(et.a)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis?this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis,f.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(d.a)(this.unSubs[2])).subscribe(e=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,f.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats | Memo: "+this.paymentDecoded.description}):this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}is_group(e,t){return t.htlcs&&t.htlcs.length>1}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}getHopDetails(e){let t=this;return e.reduce(function(e,n){let a=t.peers.find(e=>e.pub_key===n.pub_key);return a&&a.alias?e.push("<pre>Channel: "+a.alias.padEnd(20)+"&Tab;&Tab;&Tab;Amount (Sats): "+t.decimalPipe.transform(n.amt_to_forward)+"</pre>"):t.dataService.getAliasesFromPubkeys(n.pub_key,!1).pipe(Object(d.a)(t.unSubs[1])).subscribe(a=>{e.push("<pre>Channel: "+(a.node&&a.node.alias?a.node.alias.padEnd(20):n.pub_key.substring(0,17)+"...")+"&Tab;&Tab;&Tab;Amount (Sats): "+t.decimalPipe.transform(n.amt_to_forward)+"</pre>")}),e},[])}onHTLCClick(e,t){t.payment_request&&""!==t.payment_request.trim()?this.dataService.decodePayment(t.payment_request,!1).pipe(Object(et.a)(1)).subscribe(n=>{this.showHTLCView(e,t,n)},n=>{this.showHTLCView(e,t,null)}):this.showHTLCView(e,t,null)}showHTLCView(e,t,n){const a=[[{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:f.h.STRING}],[{key:"preimage",value:e.preimage,title:"Preimage",width:100,type:f.h.STRING}],[{key:"payment_request",value:t.payment_request,title:"Payment Request",width:100,type:f.h.STRING}],[{key:"status",value:e.status,title:"Status",width:33,type:f.h.STRING},{key:"attempt_time_str",value:e.attempt_time_str,title:"Attempt Time",width:33,type:f.h.DATE_TIME},{key:"resolve_time_str",value:e.resolve_time_str,title:"Resolve Time",width:34,type:f.h.DATE_TIME}],[{key:"total_amt",value:e.route.total_amt,title:"Amount (Sats)",width:33,type:f.h.NUMBER},{key:"total_fees",value:e.route.total_fees,title:"Fee (Sats)",width:33,type:f.h.NUMBER},{key:"total_time_lock",value:e.route.total_time_lock,title:"Total Time Lock",width:34,type:f.h.NUMBER}],[{key:"hops",value:this.getHopDetails(e.route.hops),title:"Hops",width:100,type:f.h.ARRAY}]];n&&n.description&&""!==n.description&&a.splice(3,0,[{key:"description",value:n.description,title:"Description",width:100,type:f.h.STRING}]),this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"HTLC Information",message:a,scrollable:e.route&&e.route.hops&&e.route.hops.length>1}}))}onPaymentClick(e){if(e.htlcs&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length>0){let t=e.htlcs[0].route.hops.reduce((e,t)=>""===e?t.pub_key:e+","+t.pub_key,"");Object(Ze.a)(this.dataService.getAliasesFromPubkeys(t,!0).pipe(Object(d.a)(this.unSubs[3])).subscribe(t=>{this.showPaymentView(e,t.reduce((e,t)=>""===e?t:e+"\n"+t,""))}))}else this.showPaymentView(e,"")}showPaymentView(e,t){const n=[[{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:100,type:f.h.STRING}],[{key:"payment_preimage",value:e.payment_preimage,title:"Payment Preimage",width:100,type:f.h.STRING}],[{key:"payment_request",value:e.payment_request,title:"Payment Request",width:100,type:f.h.STRING}],[{key:"status",value:e.status,title:"Status",width:50,type:f.h.STRING},{key:"creation_date_str",value:e.creation_date_str,title:"Creation Date",width:50,type:f.h.DATE_TIME}],[{key:"value_msat",value:e.value_msat,title:"Value (mSats)",width:50,type:f.h.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:50,type:f.h.NUMBER}],[{key:"path",value:t,title:"Path",width:100,type:f.h.STRING}]];e.payment_request&&""!==e.payment_request.trim()?this.dataService.decodePayment(e.payment_request,!1).pipe(Object(et.a)(1)).subscribe(t=>{t&&t.description&&""!==t.description&&n.splice(3,0,[{key:"description",value:t.description,title:"Description",width:100,type:f.h.STRING}]),this.openPaymentAlert(n,e.htlcs&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length>1)}):this.openPaymentAlert(n,!1)}openPaymentAlert(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Payment Information",message:e,scrollable:t}}))}applyFilter(e){this.payments.filter=e.value.trim().toLowerCase()}loadPaymentsTable(e){this.payments=new le.o(e?[...e]:[]),this.payments.sortingDataAccessor=(e,t)=>{switch(t){case"hops":return e.htlcs.length&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length?e.htlcs[0].route.hops.length:0;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.payments.sort=this.sort,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)),t=e.reduce((e,t)=>(t.payment_request&&""!==t.payment_request.trim()&&(e=""===e?t.payment_request:e+","+t.payment_request),e),"");Object(Ze.a)(this.dataService.decodePayments(t).pipe(Object(d.a)(this.unSubs[4])).subscribe(t=>{let n=0;t.forEach((t,a)=>{for(;e[a+n].payment_hash!==t.payment_hash;)n+=1;e[a+n].description=t.description});let a=e.reduce((e,t)=>e.concat(t),[]);this.commonService.downloadFile(a,"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(w.a),s.Pb(tt.a),s.Pb(x.h),s.Pb(pt.a),s.Pb(ft.a),s.Pb(a.f),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-lightning-payments"]],viewQuery:function(e,t){if(1&e&&(s.Pc(gt,!0),s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayoutAlign","space-between stretch","fxLayout","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayoutAlign","space-between stretch","fxLayout","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"],["mat-flat-button","","color","primary","tabindex","4",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 start"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","creation_date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","payment_hash"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","fee"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","value"],["matColumnDef","hops"],["matColumnDef","actions"],["mat-header-cell","","class","px-2",4,"matHeaderCellDef"],["mat-cell","","class","px-2","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","groupTotal"],["matColumnDef","groupHash"],["matColumnDef","groupFee"],["matColumnDef","groupValue"],["matColumnDef","groupHops"],["matColumnDef","groupAction"],["mat-cell","","class","px-2",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot green","matTooltip","Succeeded","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Failed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Succeeded","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Failed","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-2"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-2"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"htlc-row-span"],["fxLayoutAlign","start center","class","htlc-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"htlc-row-span","pl-3"],["fxLayoutAlign","start center","class","htlc-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"htlc-row-span"],["fxLayoutAlign","end center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-2"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-htlc-expand",3,"click"],["fxLayoutAlign","end center",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-htlc-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,vt,12,3,"form",1),s.Ic(2,wt,3,0,"div",2),s.Ic(3,gn,50,16,"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,a.o,be.u,be.n,be.o,O.c,ue.b,be.c,ue.d,be.s,M.b,be.m,be.p,S.a,O.f,O.b,C.a,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.m,le.g,le.k,se.a,l.a,le.h,ce.b,le.a,K.a,a.p,I.b,me.a,me.c,fe.m,le.d,a.n,le.l,le.f,le.j],pipes:[a.f],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}.mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-htlc-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-htlc-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.htlc-row-span[_ngcontent-%COMP%]{min-height:4.2rem}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:17rem}"],data:{animation:[Ce.a]}}),e})();function xn(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 vn(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("/lnd/reports")}),s.Kc(1,"Fees Summary"),s.Ub()}}function wn(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 Cn=function(e){return{"error-border":e}};function Un(e,t){if(1&e&&s.Qb(0,"rtl-node-info",26),2&e){const e=s.hc(3);s.oc("information",e.information)("showColorFieldSeparately",!1)("ngClass",s.sc(3,Cn,"error"===e.flgLoading[0]))}}function Vn(e,t){if(1&e&&s.Qb(0,"rtl-balances-info",27),2&e){const e=s.hc(3);s.oc("balances",e.balances)("ngClass",s.sc(2,Cn,"error"===e.flgLoading[2]||"error"===e.flgLoading[3]))}}function Dn(e,t){if(1&e&&s.Qb(0,"rtl-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,Cn,"error"===e.flgLoading[3]))}}function Sn(e,t){if(1&e&&s.Qb(0,"rtl-fee-info",29),2&e){const e=s.hc(3);s.oc("fees",e.fees)("ngClass",s.sc(2,Cn,"error"===e.flgLoading[1]))}}function Ln(e,t){if(1&e&&s.Qb(0,"rtl-channel-status-info",30),2&e){const e=s.hc(3);s.oc("channelsStatus",e.channelsStatus)("ngClass",s.sc(2,Cn,"error"===e.flgLoading[3]||"error"===e.flgLoading[4]))}}function In(e,t){1&e&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}function _n(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,xn,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,vn,2,0,"button",16),s.Ic(15,wn,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,Un,1,5,"rtl-node-info",19),s.Ic(19,Vn,1,4,"rtl-balances-info",20),s.Ic(20,Dn,1,6,"rtl-channel-capacity-info",21),s.Ic(21,Sn,1,4,"rtl-fee-info",22),s.Ic(22,Ln,1,4,"rtl-channel-status-info",23),s.Ic(23,In,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","node"===e.id||"balance"===e.id?70:"fee"===e.id||"status"===e.id?78: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","capacity"),s.Db(1),s.oc("ngSwitchCase","fee"),s.Db(1),s.oc("ngSwitchCase","status")}}function kn(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,_n,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 Fn(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 An(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,Fn,3,1,"button",12),s.Vb(8,"mat-menu",13,40),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 Tn(e,t){if(1&e&&s.Qb(0,"rtl-node-info",41),2&e){const e=s.hc(3);s.oc("information",e.information)("ngClass",s.sc(2,Cn,"error"===e.flgLoading[0]))}}function Pn(e,t){if(1&e&&s.Qb(0,"rtl-balances-info",27),2&e){const e=s.hc(3);s.oc("balances",e.balances)("ngClass",s.sc(2,Cn,"error"===e.flgLoading[2]||"error"===e.flgLoading[3]))}}function On(e,t){if(1&e&&s.Qb(0,"rtl-channel-liquidity-info",42),2&e){const e=s.hc(3);s.oc("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("ngClass",s.sc(4,Cn,"error"===e.flgLoading[3]))}}function Kn(e,t){if(1&e&&s.Qb(0,"rtl-channel-liquidity-info",42),2&e){const e=s.hc(3);s.oc("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("ngClass",s.sc(4,Cn,"error"===e.flgLoading[3]))}}function Rn(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",25),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub(),s.Vb(3,"mat-menu",13,50),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("/lnd/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 Mn(e,t){1&e&&(s.Vb(0,"span",43),s.Vb(1,"mat-tab-group",44),s.Vb(2,"mat-tab",45),s.Qb(3,"rtl-lightning-invoices",46),s.Ub(),s.Vb(4,"mat-tab",47),s.Qb(5,"rtl-lightning-payments",46),s.Ub(),s.Vb(6,"mat-tab",48),s.Ic(7,Rn,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 En(e,t){1&e&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}const zn=function(e){return{"p-0":e}};function Nn(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",8),s.Vb(1,"mat-card",33),s.Ic(2,An,12,4,"mat-card-header",34),s.Vb(3,"mat-card-content",35),s.Vb(4,"div",36),s.Ic(5,Tn,1,4,"rtl-node-info",37),s.Ic(6,Pn,1,4,"rtl-balances-info",20),s.Ic(7,On,1,6,"rtl-channel-liquidity-info",38),s.Ic(8,Kn,1,6,"rtl-channel-liquidity-info",38),s.Ic(9,Mn,8,3,"span",39),s.Ic(10,En,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,zn,"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 Bn(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,Nn,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 Gn=(()=>{class e{constructor(e,t,n,a,i){switch(this.logger=e,this.store=t,this.actions$=n,this.commonService=a,this.router=i,this.faSmile=m.b,this.faFrown=m.a,this.faAngleDoubleDown=p.a,this.faAngleDoubleUp=p.b,this.faChartPie=p.g,this.faBolt=p.e,this.faServer=p.K,this.faNetworkWired=p.B,this.flgChildInfoUpdated=!1,this.userPersonaEnum=f.z,this.activeChannels=0,this.inactiveChannels=0,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.balances={onchain:-1,lightning:-1,total:0},this.allChannels=[],this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.screenSizeEnum=f.s,this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],this.unSubs=[new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize){case f.s.XS:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:6,rows:6},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}];break;case f.s.SM:case f.s.MD:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}];break;default:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:2,rows:5}]}}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],e.effectErrors.forEach(e=>{this.flgLoading[0]="FetchInfo"===e.action?"error":this.flgLoading[0],this.flgLoading[1]="FetchFees"===e.action?"error":this.flgLoading[1],this.flgLoading[2]="FetchBalance/channels"===e.action?"error":this.flgLoading[2],this.flgLoading[3]="FetchChannels/all"===e.action?"error":this.flgLoading[3],this.flgLoading[4]="FetchChannels/pending"===e.action?"error":this.flgLoading[4]}),this.flgLoading[0]=!e.information.identity_pubkey&&this.flgLoading[0],this.flgLoading[1]=!e.fees.day_fee_sum&&this.flgLoading[1],this.flgLoading[2]=!(+e.blockchainBalance.total_balance>=0&&e.totalLocalBalance>=0)&&this.flgLoading[2],this.flgLoading[3]=!(e.totalLocalBalance>=0&&e.totalRemoteBalance>=0)&&this.flgLoading[3],this.flgLoading[4]=("error"===this.flgLoading[4]||!e.numberOfPendingChannels)&&this.flgLoading[4],this.selNode=e.nodeSettings,this.information=e.information,this.fees=e.fees,this.balances.onchain=+e.blockchainBalance.total_balance>=0?+e.blockchainBalance.total_balance:0;let t=e.totalLocalBalance?+e.totalLocalBalance:0,n=e.totalRemoteBalance?+e.totalRemoteBalance:0;this.channelBalances={localBalance:t,remoteBalance:n,balancedness:+(1-Math.abs((t-n)/(t+n))).toFixed(3)},this.balances.lightning=e.totalLocalBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances),this.activeChannels=e.numberOfActiveChannels,this.inactiveChannels=e.numberOfInactiveChannels,this.channelsStatus={active:{channels:e.numberOfActiveChannels,capacity:e.totalCapacityActive},inactive:{channels:e.numberOfInactiveChannels,capacity:e.totalCapacityInactive},pending:{channels:e.numberOfPendingChannels.open.num_channels,capacity:e.numberOfPendingChannels.open.limbo_balance},closing:{channels:e.numberOfPendingChannels.closing.num_channels+e.numberOfPendingChannels.force_closing.num_channels+e.numberOfPendingChannels.waiting_close.num_channels,capacity:e.numberOfPendingChannels.total_limbo_balance}},this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannels=e.allChannels.filter(e=>!0===e.active),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.remote_balance>0),"remote_balance"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(e=>e.local_balance>0),"local_balance"))),this.allChannels.forEach(e=>{this.totalInboundLiquidity=this.totalInboundLiquidity+ +e.remote_balance,this.totalOutboundLiquidity=this.totalOutboundLiquidity+ +e.local_balance}),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.month_fee_sum>=0,this.logger.info(e)}),this.actions$.pipe(Object(d.a)(this.unSubs[2]),Object(h.a)(e=>e.type===g.r||e.type===g.zb)).subscribe(e=>{e.type===g.r&&(this.flgChildInfoUpdated=!1),e.type===g.zb&&(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.local_balance+ +e.remote_balance,a=+t.local_balance+ +t.remote_balance;return n>a?-1:n<a?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(w.a),s.Pb(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",3,"ngSwitch"],["fxFlex","100",3,"information","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",3,"perfectScrollbar",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information","ngClass"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",1,"w-100","dashboard-tabs-group"],["label","Receive"],[3,"calledFrom"],["label","Pay"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(e,t){if(1&e&&(s.Ic(0,kn,7,4,"div",0),s.Ic(1,Bn,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:[a.o,c.c,c.b,C.a,U.a,a.n,U.c,V.a,c.a,V.c,V.f,D.a,D.b,V.b,a.q,a.r,a.s,S.a,D.d,L.a,T,a.m,I.a,P,B,G,q,ie,M.b,oe.b,oe.a,Ye,yn,oe.c],styles:[""]}),e})();var qn=n("qmev"),Qn=n("8Qe2");function Hn(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 jn(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 $n=(()=>{class e{constructor(e,t,n){this.store=e,this.logger=t,this.router=n,this.selNode={},this.activePeers=0,this.activeChannels=0,this.faUsers=p.T,this.faChartPie=p.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 u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.f)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.selNode=e.nodeSettings,this.activePeers=e.peers&&e.peers.length?e.peers.length:0,this.activeChannels=e.numberOfActiveChannels,this.balances=[{title:"Total Balance",dataValue:e.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:e.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:e.blockchainBalance.unconfirmed_balance}],this.logger.info(e)})}onSelectedTabChange(e){this.router.navigateByUrl("/lnd/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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,Hn,2,1,"ng-template",8),s.Ub(),s.Vb(18,"mat-tab"),s.Ic(19,jn,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,C.a,V.a,V.b,qn.a,oe.b,oe.a,oe.c,c.a,i.l,Qn.a],styles:[""]}),e})();var Wn=n("JX91"),Xn=n("lJxs"),Jn=n("hNFU"),Yn=n("vrAh");const Zn=["form"];function ea(e,t){if(1&e&&(s.Vb(0,"mat-option",38),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.pub_key?e.pub_key:"")}}function ta(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer alias is required."),s.Ub())}function na(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer not found in the list."),s.Ub())}function aa(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",34),s.Vb(1,"input",35),s.dc("change",function(){return s.zc(e),s.hc().onSelectedPeerChanged()}),s.Ub(),s.Vb(2,"mat-autocomplete",36,37),s.dc("optionSelected",function(){return s.zc(e),s.hc().onSelectedPeerChanged()}),s.Ic(4,ea,2,2,"mat-option",24),s.ic(5,"async"),s.Ub(),s.Ic(6,ta,2,0,"mat-error",17),s.Ic(7,na,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 ia(e,t){1&e&&s.Rb(0)}function oa(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}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("Amount must be less than or equal to ",e.totalBalance,".")}}function ca(e,t){if(1&e&&(s.Vb(0,"mat-option",38),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.id),s.Db(1),s.Mc(" ",e.name," ")}}function la(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("","1"===e.selTransType?"Target Confirmation Blocks":"Fee"," is required.")}}function ra(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 ba(e,t){if(1&e&&(s.Vb(0,"div",39),s.Qb(1,"fa-icon",40),s.Ic(2,ra,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 ua(e,t){if(1&e&&(s.Vb(0,"mat-expansion-panel",42),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",43),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",9),s.Vb(8,"div",0),s.Vb(9,"div",34),s.Vb(10,"h4",44),s.Kc(11,"Pubkey"),s.Ub(),s.Vb(12,"span",45),s.Kc(13),s.Ub(),s.Ub(),s.Ub(),s.Qb(14,"mat-divider",46),s.Vb(15,"div",0),s.Vb(16,"div",47),s.Vb(17,"h4",44),s.Kc(18,"Address"),s.Ub(),s.Vb(19,"span",48),s.Kc(20),s.Ub(),s.Ub(),s.Vb(21,"div",47),s.Vb(22,"h4",44),s.Kc(23,"Inbound"),s.Ub(),s.Vb(24,"span",48),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.address)),s.Db(7),s.Lc(e.peer.pub_key),s.Db(7),s.Lc(null==e.peer?null:e.peer.address),s.Db(5),s.Lc(null!=e.peer&&e.peer.inbound?"True":"False")}}function da(e,t){if(1&e&&s.Ic(0,ua,26,4,"mat-expansion-panel",41),2&e){const e=s.hc();s.oc("ngIf",e.peer)}}let ha=(()=>{class e{constructor(e,t,n,a){this.dialogRef=e,this.data=t,this.store=n,this.actions$=a,this.selectedPeer=new be.e,this.amount=new be.e,this.faExclamationTriangle=p.o,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.selTransType="0",this.spendUnconfirmed=!1,this.transTypeValue="",this.transTypes=f.x,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.alertTitle=this.data.alertTitle,this.peer=this.data.message.peer?this.data.message.peer:null,this.peers=this.data.message.peers&&this.data.message.peers.length?this.data.message.peers:[],this.actions$.pipe(Object(d.a)(this.unSubs[0]),Object(h.a)(e=>e.type===g.m||e.type===g.o)).subscribe(e=>{e.type===g.m&&"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message),e.type===g.o&&this.dialogRef.close()});let e="",t="";this.sortedPeers=this.peers.sort((n,a)=>(e=n.alias?n.alias.toLowerCase():n.pub_key?n.pub_key.toLowerCase():"",t=a.alias?a.alias.toLowerCase():n.pub_key.toLowerCase(),e<t?-1:e>t?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe(Object(d.a)(this.unSubs[1]),Object(Wn.a)(""),Object(Xn.a)(e=>"string"==typeof e?e:e.alias?e.alias:e.pub_key),Object(Xn.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.pub_key?e.pub_key:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.pub_key?this.selectedPeer.value.pub_key: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].pub_key&&(this.selectedPubkey=e[0].pub_key)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!1,this.spendUnconfirmed=!1,this.selTransType="0",this.transTypeValue="",this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0||("1"===this.selTransType||"2"===this.selTransType)&&!this.transTypeValue)return!0;this.store.dispatch(new H.G("Opening Channel...")),this.store.dispatch(new g.Pb({selectedPeerPubkey:this.peer&&this.peer.pub_key?this.peer.pub_key:this.selectedPubkey,fundingAmount:this.fundingAmount,private:this.isPrivate,transType:this.selTransType,transTypeValue:this.transTypeValue,spendUnconfirmed:this.spendUnconfirmed}))}onAdvancedPanelToggle(e){this.advancedTitle=e?"Advanced Options | "+("1"===this.selTransType?"Target Confirmation Blocks: ":"2"===this.selTransType?"Fee (Sats/Byte): ":"Default")+("1"===this.selTransType||"2"===this.selTransType?this.transTypeValue:"")+" | Spend Unconfirmed Output: "+(this.spendUnconfirmed?"Yes":"No"):"Advanced Options"}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-open-channel"]],viewQuery:function(e,t){if(1&e&&s.Ec(Zn,!0),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first)}},decls:55,vars:26,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","60","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amnt",3,"ngModel","step","min","max","ngModelChange"],["amt","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","35","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","49"],["tabindex","3",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","number","tabindex","4","name","transTpValue",3,"ngModel","required","disabled","placeholder","step","min","ngModelChange"],["transTypeVal","ngModel"],["fxFlex","50","fxLayoutAlign","start center"],["tabindex","6","color","primary","name","spendUnconfirmed",3,"ngModel","ngModelChange"],["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"],["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,aa,8,8,"mat-form-field",10),s.Ub(),s.Ic(13,ia,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,oa,2,0,"mat-error",17),s.Ic(25,sa,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.selTransType=e}),s.Ic(38,ca,2,2,"mat-option",24),s.Ub(),s.Ub(),s.Vb(39,"mat-form-field",22),s.Vb(40,"input",25,26),s.dc("ngModelChange",function(e){return t.transTypeValue=e}),s.Ub(),s.Ic(42,la,2,1,"mat-error",17),s.Ub(),s.Ub(),s.Vb(43,"div",12),s.Vb(44,"div",27),s.Vb(45,"mat-slide-toggle",28),s.dc("ngModelChange",function(e){return t.spendUnconfirmed=e}),s.Kc(46,"Spend Unconfirmed Output"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(47,ba,3,2,"div",29),s.Vb(48,"div",30),s.Vb(49,"button",31),s.Kc(50,"Clear Fields"),s.Ub(),s.Vb(51,"button",32),s.Kc(52,"Open Channel"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(53,da,1,1,"ng-template",null,33,s.Jc)),2&e){const e=s.wc(54);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",e),s.Db(4),s.oc("ngModel",t.fundingAmount)("step",1e3)("min",1)("max",t.totalBalance),s.Db(3),s.Mc("(Remaining Bal: ",s.jc(21,24,t.totalBalance-(t.fundingAmount?t.fundingAmount:0)),")"),s.Db(3),s.Mc(" ",null==t.information?null:t.information.smaller_currency_unit,""),s.Db(1),s.oc("ngIf",null==t.amount.errors?null:t.amount.errors.required),s.Db(1),s.oc("ngIf",null==t.amount.errors?null:t.amount.errors.max),s.Db(2),s.oc("ngModel",t.isPrivate),s.Db(6),s.Lc(t.advancedTitle),s.Db(4),s.oc("value",t.selTransType),s.Db(1),s.oc("ngForOf",t.transTypes),s.Db(2),s.oc("ngModel",t.transTypeValue)("required","0"!==t.selTransType)("disabled","0"===t.selTransType)("placeholder","0"===t.selTransType?"Default":"1"===t.selTransType?"Target Confirmation Blocks":"Fee (Sats/Byte)")("step",1)("min",0),s.Db(2),s.oc("ngIf","0"!==t.selTransType&&!t.transTypeValue),s.Db(3),s.oc("ngModel",t.spendUnconfirmed),s.Db(2),s.oc("ngIf",""!==t.channelConnectionError)}},directives:[c.c,c.a,V.c,c.b,S.a,V.b,be.u,be.n,be.o,a.o,a.t,O.c,ue.b,be.q,be.c,he.a,Jn.a,be.s,be.m,be.p,O.f,O.g,pe.a,nt.c,nt.e,nt.f,me.a,a.n,de.a,Yn.c,be.f,Yn.a,fe.m,O.b,C.a,R.a],pipes:[a.f,a.b],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),e})();var ma=n("hzfI");const pa=["peersForm"],fa=["stepper"];function ga(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.peerFormLabel)}}function ya(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Address is required."),s.Ub())}function xa(e,t){if(1&e&&(s.Vb(0,"div",38),s.Qb(1,"fa-icon",39),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 va(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.channelFormLabel)}}function wa(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Ca(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount must be a positive number."),s.Ub())}function Ua(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 Va(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.id),s.Db(1),s.Mc(" ",e.name," ")}}function Da(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("","0"===e.channelFormGroup.controls.selTransType.value?"Default":"1"===e.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/Byte)"," is required.")}}function Sa(e,t){if(1&e&&(s.Vb(0,"div",38),s.Qb(1,"fa-icon",39),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 La=(()=>{class e{constructor(e,t,n,a,i,o,s){this.dialogRef=e,this.data=t,this.store=n,this.lndEffects=a,this.formBuilder=i,this.actions$=o,this.logger=s,this.faExclamationTriangle=p.o,this.peerAddress="",this.totalBalance=0,this.transTypes=f.x,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 u.a,new u.a]}ngOnInit(){this.totalBalance=this.data.message.balance,this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[be.t.required]],peerAddress:["",[be.t.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[be.t.required,be.t.min(1),be.t.max(this.totalBalance)]],isPrivate:[!1],selTransType:[f.x[0].id],transTypeValue:[{value:"",disabled:!0}],spendUnconfirmed:[!1],hiddenAmount:["",[be.t.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.channelFormGroup.controls.selTransType.valueChanges.pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e===f.x[0].id?(this.channelFormGroup.controls.transTypeValue.setValue(""),this.channelFormGroup.controls.transTypeValue.disable(),this.channelFormGroup.controls.transTypeValue.setValidators(null),this.channelFormGroup.controls.transTypeValue.setErrors(null)):(this.channelFormGroup.controls.transTypeValue.setValue(""),this.channelFormGroup.controls.transTypeValue.enable(),this.channelFormGroup.controls.transTypeValue.setValidators([be.t.required]))}),this.actions$.pipe(Object(d.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.bb||e.type===g.y||e.type===g.m)).subscribe(e=>{e.type===g.bb&&(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.y&&this.dialogRef.close(),e.type===g.m&&("SaveNewPeer"===e.payload.action||"FetchGraphNode"===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="";const e=this.peerFormGroup.controls.peerAddress.value.search("@");let t="",n="";e>-1?(t=this.peerFormGroup.controls.peerAddress.value.substring(0,e),n=this.peerFormGroup.controls.peerAddress.value.substring(e+1),this.connectPeerWithParams(t,n)):(this.store.dispatch(new H.G("Getting Node Address...")),this.store.dispatch(new g.F({pubkey:this.peerFormGroup.controls.peerAddress.value})),this.lndEffects.setGraphNode.pipe(Object(et.a)(1)).subscribe(e=>{this.store.dispatch(new H.j),n=e.node.addresses&&e.node.addresses[0].addr?e.node.addresses[0].addr:"",this.connectPeerWithParams(this.peerFormGroup.controls.peerAddress.value,n)}))}connectPeerWithParams(e,t){this.store.dispatch(new H.G("Adding Peer...")),this.store.dispatch(new g.Rb({pubkey:e,host:t,perm:!1}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0||"1"===this.channelFormGroup.controls.selTransType.value&&!this.channelFormGroup.controls.transTypeValue.value||"2"===this.channelFormGroup.controls.selTransType.value&&!this.channelFormGroup.controls.transTypeValue.value)return!0;this.channelConnectionError="",this.store.dispatch(new H.G("Opening Channel...")),this.store.dispatch(new g.Pb({selectedPeerPubkey:this.newlyAddedPeer.pub_key,fundingAmount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,transType:this.channelFormGroup.controls.selTransType.value,transTypeValue:this.channelFormGroup.controls.transTypeValue.value,spendUnconfirmed:this.channelFormGroup.controls.spendUnconfirmed.value}))}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:"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+this.newlyAddedPeer.alias:"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(re.f),s.Pb(re.a),s.Pb(x.h),s.Pb(ft.a),s.Pb(be.d),s.Pb(v.a),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-connect-peer"]],viewQuery:function(e,t){if(1&e&&(s.Pc(pa,!0),s.Pc(fa,!0)),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first),s.vc(e=s.ec())&&(t.stepper=e.first)}},decls:56,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","","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","30","fxLayoutAlign","start end"],["tabindex","3","formControlName","selTransType","placeholder","Transaction Type"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","30"],["matInput","","formControlName","transTypeValue","type","number","name","transTypeValue","tabindex","4",3,"placeholder","step","required"],["tabindex","6","color","primary","formControlName","spendUnconfirmed","name","spendUnconfirmed"],["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,ga,1,1,"ng-template",12),s.Vb(15,"mat-form-field",13),s.Qb(16,"input",14),s.Ic(17,ya,2,0,"mat-error",15),s.Ub(),s.Ic(18,xa,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,va,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,wa,2,0,"mat-error",15),s.Ic(34,Ca,2,0,"mat-error",15),s.Ic(35,Ua,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,Va,2,2,"mat-option",31),s.Ub(),s.Ub(),s.Vb(43,"mat-form-field",32),s.Qb(44,"input",33),s.Ic(45,Da,2,1,"mat-error",15),s.Ub(),s.Vb(46,"div",26),s.Vb(47,"mat-slide-toggle",34),s.Kc(48,"Spend Unconfirmed Output"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(49,Sa,4,2,"div",16),s.Vb(50,"div",17),s.Vb(51,"button",35),s.dc("click",function(){return t.onOpenChannel()}),s.Kc(52),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(53,"div",36),s.Vb(54,"button",37),s.Kc(55),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.transTypes),s.Db(2),s.oc("placeholder","0"===t.channelFormGroup.controls.selTransType.value?"Default":"1"===t.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/Byte)")("step",1)("required","0"!==t.channelFormGroup.controls.selTransType.value),s.Db(1),s.oc("ngIf",null==t.channelFormGroup.controls.transTypeValue.errors?null:t.channelFormGroup.controls.transTypeValue.errors.required),s.Db(4),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.pub_key?"Do It Later":"Close"))},directives:[c.c,c.a,V.c,c.b,S.a,V.b,ma.h,ma.a,be.u,be.n,be.h,ma.b,O.c,ue.b,be.c,de.a,be.m,be.g,be.s,a.o,be.q,O.f,O.g,pe.a,me.a,a.n,re.d,O.b,C.a,fe.m],styles:[""]}),e})();function Ia(e,t){1&e&&s.Qb(0,"mat-progress-bar",32)}function _a(e,t){1&e&&(s.Vb(0,"th",33),s.Kc(1," Alias "),s.Ub())}const ka=function(e){return{"max-width":e}};function Fa(e,t){if(1&e&&(s.Vb(0,"td",34),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,ka,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),s.Db(1),s.Mc(" ",null==e?null:e.alias," ")}}function Aa(e,t){1&e&&(s.Vb(0,"th",33),s.Kc(1," Public Key "),s.Ub())}function Ta(e,t){if(1&e&&(s.Vb(0,"td",34),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,ka,n.screenSize===n.screenSizeEnum.XS?"5rem":"35rem")),s.Db(1),s.Mc(" ",null==e?null:e.pub_key," ")}}function Pa(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1," Sats Sent "),s.Ub())}function Oa(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",37),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.sat_sent)," ")}}function Ka(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1," Sats Received "),s.Ub())}function Ra(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",37),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.sat_recv)," ")}}function Ma(e,t){1&e&&(s.Vb(0,"th",35),s.Kc(1," Ping "),s.Ub())}function Ea(e,t){if(1&e&&(s.Vb(0,"td",36),s.Vb(1,"span",37),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.ping_time)," ")}}function za(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",38),s.Vb(1,"div",39),s.Vb(2,"mat-select",40),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",41),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 Na(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",42),s.Vb(1,"div",39),s.Vb(2,"mat-select",40),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",41),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc().onPeerClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",41),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onOpenChannel(n)}),s.Kc(7,"Open Channel"),s.Ub(),s.Vb(8,"mat-option",41),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onPeerDetach(n)}),s.Kc(9,"Disconnect"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ba(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No connected peers."),s.Ub())}function Ga(e,t){if(1&e&&(s.Vb(0,"td",43),s.Ic(1,Ba,2,0,"p",44),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.peers&&e.peers.data)||(null==e.peers.data?null:e.peers.data.length)<1)}}const qa=function(e){return{"display-none":e}};function Qa(e,t){if(1&e&&s.Qb(0,"tr",45),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,qa,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Ha(e,t){1&e&&s.Qb(0,"tr",46)}function ja(e,t){1&e&&s.Qb(0,"tr",47)}const $a=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Wa=function(){return["no_peer"]};let Xa=(()=>{class e{constructor(e,t,n,a,i,o){this.logger=e,this.store=t,this.rtlEffects=n,this.lndEffects=a,this.actions$=i,this.commonService=o,this.availableBalance=0,this.faUsers=p.T,this.displayedColumns=[],this.peersData=[],this.information={},this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["alias","sat_sent","sat_recv","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["alias","sat_sent","sat_recv","ping_time","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","pub_key","sat_sent","sat_recv","ping_time","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchPeers"===e.action&&(this.flgLoading[0]="error")}),this.information=e.information,this.availableBalance=e.blockchainBalance.total_balance||0,this.peersData=e.peers,this.peersData.length>0&&this.loadPeersTable(this.peersData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!1),this.logger.info(e)})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.pub_key,message:[[{key:"pub_key",value:e.pub_key,title:"Public Key",width:100}],[{key:"address",value:e.address,title:"Address",width:100}],[{key:"alias",value:e.alias,title:"Alias",width:40},{key:"inbound",value:e.inbound?"True":"False",title:"Inbound",width:30},{key:"ping_time",value:e.ping_time,title:"Ping Time",width:30,type:f.h.NUMBER}],[{key:"sat_sent",value:e.sat_sent,title:"Satoshis Sent",width:50,type:f.h.NUMBER},{key:"sat_recv",value:e.sat_recv,title:"Satoshis Received",width:50,type:f.h.NUMBER}],[{key:"bytes_sent",value:e.bytes_sent,title:"Bytes Sent",width:50,type:f.h.NUMBER},{key:"bytes_recv",value:e.bytes_recv,title:"Bytes Received",width:50,type:f.h.NUMBER}]]}}))}onConnectPeer(){this.store.dispatch(new H.D({data:{message:{peer:null,information:this.information,balance:this.availableBalance},component:La}}))}onOpenChannel(e){this.store.dispatch(new H.D({data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},component:ha}}))}onPeerDetach(e){this.store.dispatch(new H.E({data:{type:f.b.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.pub_key),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe(Object(d.a)(this.unSubs[3])).subscribe(t=>{t&&(this.store.dispatch(new H.G("Disconnecting Peer...")),this.store.dispatch(new g.l({pubkey:e.pub_key})))})}applyFilter(e){this.peers.filter=e.value.trim().toLowerCase()}loadPeersTable(e){this.peers=new le.o(e?[...e]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,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(pt.a),s.Pb(ft.a),s.Pb(v.a),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-peers"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Peers")}])],decls:40,vars:14,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"],["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","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","pub_key"],["matColumnDef","sat_sent"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","sat_recv"],["matColumnDef","ping_time"],["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"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["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-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.Vb(2,"button",2),s.dc("click",function(){return t.onConnectPeer()}),s.Kc(3,"Add Peer"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"div",4),s.Vb(6,"div",5),s.Qb(7,"fa-icon",6),s.Vb(8,"span",7),s.Kc(9,"Connected Peers"),s.Ub(),s.Ub(),s.Vb(10,"mat-form-field",8),s.Vb(11,"input",9),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(12,"div",10),s.Ic(13,Ia,1,0,"mat-progress-bar",11),s.Vb(14,"table",12,13),s.Tb(16,14),s.Ic(17,_a,2,0,"th",15),s.Ic(18,Fa,2,4,"td",16),s.Sb(),s.Tb(19,17),s.Ic(20,Aa,2,0,"th",15),s.Ic(21,Ta,2,4,"td",16),s.Sb(),s.Tb(22,18),s.Ic(23,Pa,2,0,"th",19),s.Ic(24,Oa,4,3,"td",20),s.Sb(),s.Tb(25,21),s.Ic(26,Ka,2,0,"th",19),s.Ic(27,Ra,4,3,"td",20),s.Sb(),s.Tb(28,22),s.Ic(29,Ma,2,0,"th",19),s.Ic(30,Ea,4,3,"td",20),s.Sb(),s.Tb(31,23),s.Ic(32,za,6,0,"th",24),s.Ic(33,Na,10,0,"td",25),s.Sb(),s.Tb(34,26),s.Ic(35,Ga,2,1,"td",27),s.Sb(),s.Ic(36,Qa,1,3,"tr",28),s.Ic(37,Ha,1,0,"tr",29),s.Ic(38,ja,1,0,"tr",30),s.Ub(),s.Ub(),s.Qb(39,"mat-paginator",31),s.Ub(),s.Ub()),2&e&&(s.Db(7),s.oc("icon",t.faUsers),s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.peers)("ngClass",s.sc(11,$a,"error"===t.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,Wa)),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,S.a,C.a,O.c,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.p,I.b,me.a,me.c,fe.m,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-alias[_ngcontent-%COMP%]{flex:1 1 25%}.mat-column-alias[_ngcontent-%COMP%], .mat-column-pub_key[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-pub_key[_ngcontent-%COMP%]{flex:1 1 35%;padding-left:2rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem;flex:1 1 10%}.mat-column-ping_time[_ngcontent-%COMP%], .mat-column-sat_recv[_ngcontent-%COMP%], .mat-column-sat_sent[_ngcontent-%COMP%]{flex:1 1 13%;width:13%}"]}),e})();function Ja(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.numOpenChannels)}}function Ya(e,t){if(1&e&&(s.Vb(0,"span",7),s.Kc(1,"Pending"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numPendingChannels)}}function Za(e,t){if(1&e&&(s.Vb(0,"span",7),s.Kc(1,"Closed"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numClosedChannels)}}function ei(e,t){if(1&e&&(s.Vb(0,"span",7),s.Kc(1,"Active HTLCs"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numActiveHTLCs)}}let ti=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.router=n,this.numOpenChannels=0,this.numPendingChannels=0,this.numClosedChannels=0,this.numActiveHTLCs=0,this.peers=[],this.information={},this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"closed",name:"Closed"},{link:"activehtlcs",name:"Active HTLCs"}],this.activeLink=0,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.f)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.numOpenChannels=e.allChannels&&e.allChannels.length?e.allChannels.length:0,this.numPendingChannels=e.numberOfPendingChannels.total_channels?e.numberOfPendingChannels.total_channels:0,this.numClosedChannels=e.closedChannels&&e.closedChannels.length?e.closedChannels.length:0,this.numActiveHTLCs=e.allChannels.reduce((e,t)=>e+(t.pending_htlcs&&t.pending_htlcs.length>0?t.pending_htlcs.length:0),0),this.information=e.information,this.totalBalance=+e.blockchainBalance.total_balance,this.peers=e.peers,this.peers.forEach(e=>{e.alias&&""!==e.alias||(e.alias=e.pub_key.substring(0,15)+"...")}),this.logger.info(e)})}onOpenChannel(){this.store.dispatch(new H.D({data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:ha}}))}onSelectedTabChange(e){this.router.navigateByUrl("/lnd/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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channels-tables"]],decls:16,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,Ja,2,1,"ng-template",5),s.Ub(),s.Vb(8,"mat-tab"),s.Ic(9,Ya,2,1,"ng-template",5),s.Ub(),s.Vb(10,"mat-tab"),s.Ic(11,Za,2,1,"ng-template",5),s.Ub(),s.Vb(12,"mat-tab"),s.Ic(13,ei,2,1,"ng-template",5),s.Ub(),s.Ub(),s.Vb(14,"div",6),s.Qb(15,"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,oe.b,oe.a,oe.c,i.l,Qn.a],styles:[""]}),e})();var ni=n("zHaW"),ai=n("dEYt");function ii(e,t){if(1&e&&(s.Vb(0,"div"),s.Qb(1,"mat-divider",13),s.Vb(2,"div",9),s.Vb(3,"div",15),s.Vb(4,"h4",11),s.Kc(5,"Commit Fee"),s.Ub(),s.Vb(6,"span",16),s.Kc(7),s.ic(8,"number"),s.Ub(),s.Ub(),s.Vb(9,"div",15),s.Vb(10,"h4",11),s.Kc(11,"Commit Weight"),s.Ub(),s.Vb(12,"span",16),s.Kc(13),s.ic(14,"number"),s.Ub(),s.Ub(),s.Vb(15,"div",15),s.Vb(16,"h4",11),s.Kc(17,"Fee/KW"),s.Ub(),s.Vb(18,"span",16),s.Kc(19),s.ic(20,"number"),s.Ub(),s.Ub(),s.Vb(21,"div",15),s.Vb(22,"h4",11),s.Kc(23,"Static Remote Key"),s.Ub(),s.Vb(24,"span",16),s.Kc(25),s.Ub(),s.Ub(),s.Ub(),s.Qb(26,"mat-divider",13),s.Vb(27,"div",9),s.Vb(28,"div",15),s.Vb(29,"h4",11),s.Kc(30),s.Ub(),s.Vb(31,"span",16),s.Kc(32),s.ic(33,"number"),s.Ub(),s.Ub(),s.Vb(34,"div",15),s.Vb(35,"h4",11),s.Kc(36),s.Ub(),s.Vb(37,"span",16),s.Kc(38),s.ic(39,"number"),s.Ub(),s.Ub(),s.Vb(40,"div",15),s.Vb(41,"h4",11),s.Kc(42,"Unsettled Balance"),s.Ub(),s.Vb(43,"span",16),s.Kc(44),s.ic(45,"number"),s.Ub(),s.Ub(),s.Vb(46,"div",15),s.Vb(47,"h4",11),s.Kc(48,"CSV Delay"),s.Ub(),s.Vb(49,"span",16),s.Kc(50),s.ic(51,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(52,"mat-divider",13),s.Vb(53,"div",9),s.Vb(54,"div",15),s.Vb(55,"h4",11),s.Kc(56,"Local Reserve (Sats)"),s.Ub(),s.Vb(57,"span",16),s.Kc(58),s.ic(59,"number"),s.Ub(),s.Ub(),s.Vb(60,"div",15),s.Vb(61,"h4",11),s.Kc(62,"Remote Reserve (Sats)"),s.Ub(),s.Vb(63,"span",16),s.Kc(64),s.ic(65,"number"),s.Ub(),s.Ub(),s.Vb(66,"div",15),s.Vb(67,"h4",11),s.Kc(68,"Lifetime (Seconds)"),s.Ub(),s.Vb(69,"span",16),s.Kc(70),s.ic(71,"number"),s.Ub(),s.Ub(),s.Vb(72,"div",15),s.Vb(73,"h4",11),s.Kc(74,"Pending HTLCs"),s.Ub(),s.Vb(75,"span",16),s.Kc(76),s.ic(77,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(78,"mat-divider",13),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(8,18,e.channel.commit_fee)),s.Db(6),s.Lc(s.jc(14,20,e.channel.commit_weight)),s.Db(6),s.Lc(s.jc(20,22,e.channel.fee_per_kw)),s.Db(6),s.Lc(e.channel.static_remote_key?"Yes":"No"),s.Db(1),s.oc("inset",!0),s.Db(4),s.Lc(e.screenSize===e.screenSizeEnum.XS?"Total Sats Sent":"Total Satoshis Sent"),s.Db(2),s.Lc(s.jc(33,24,e.channel.total_satoshis_sent)),s.Db(4),s.Lc(e.screenSize===e.screenSizeEnum.XS?"Total Sats Recv":"Total Satoshis Received"),s.Db(2),s.Lc(s.jc(39,26,e.channel.total_satoshis_received)),s.Db(6),s.Lc(s.jc(45,28,e.channel.unsettled_balance)),s.Db(6),s.Lc(s.jc(51,30,e.channel.csv_delay)),s.Db(2),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(59,32,e.channel.local_chan_reserve_sat)),s.Db(6),s.Lc(s.jc(65,34,e.channel.remote_chan_reserve_sat)),s.Db(6),s.Lc(s.jc(71,36,e.channel.lifetime)),s.Db(6),s.Lc(s.jc(77,38,null==e.channel||null==e.channel.pending_htlcs?null:e.channel.pending_htlcs.length)),s.Db(2),s.oc("inset",!0)}}function oi(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Show Advanced"),s.Ub())}function si(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Hide Advanced"),s.Ub())}function ci(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 Channel ID"),s.Ub()}if(2&e){const e=s.hc();s.oc("payload",e.channel.chan_id)}}function li(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 ri=function(e){return{"xs-scroll-y":e}},bi=function(e,t){return{"mt-2":e,"mt-1":t}};let ui=(()=>{class e{constructor(e,t,n,a,i){this.dialogRef=e,this.data=t,this.logger=n,this.commonService=a,this.snackBar=i,this.faReceipt=p.H,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=f.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("Channel ID "+e+" copied."),this.logger.info("Copied Text: "+e)}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(y.b),s.Pb(w.a),s.Pb(ni.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,"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 Point"),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,"Local Balance"),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,"Remote Balance"),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,"Capacity"),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,"Uptime (Seconds)"),s.Ub(),s.Vb(59,"span",16),s.Kc(60),s.ic(61,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(62,"mat-divider",13),s.Vb(63,"div",9),s.Vb(64,"div",15),s.Vb(65,"h4",11),s.Kc(66,"Active"),s.Ub(),s.Vb(67,"span",16),s.Kc(68),s.Ub(),s.Ub(),s.Vb(69,"div",15),s.Vb(70,"h4",11),s.Kc(71,"Private"),s.Ub(),s.Vb(72,"span",16),s.Kc(73),s.Ub(),s.Ub(),s.Vb(74,"div",15),s.Vb(75,"h4",11),s.Kc(76,"Initiator"),s.Ub(),s.Vb(77,"span",16),s.Kc(78),s.Ub(),s.Ub(),s.Vb(79,"div",15),s.Vb(80,"h4",11),s.Kc(81,"Number of Updates"),s.Ub(),s.Vb(82,"span",16),s.Kc(83),s.ic(84,"number"),s.Ub(),s.Ub(),s.Ub(),s.Ic(85,ii,79,40,"div",17),s.Vb(86,"div",18),s.Vb(87,"button",19),s.dc("click",function(){return t.onShowAdvanced()}),s.Ic(88,oi,2,0,"p",20),s.Ic(89,si,2,0,"ng-template",null,21,s.Jc),s.Ub(),s.Ic(91,ci,2,1,"button",22),s.Ic(92,li,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,ri,t.screenSize===t.screenSizeEnum.XS)),s.Db(7),s.Lc(t.channel.chan_id),s.Db(5),s.Lc(t.channel.remote_alias),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.channel.channel_point),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.channel.remote_pubkey),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(43,24,t.channel.local_balance)),s.Db(6),s.Lc(s.jc(49,26,t.channel.remote_balance)),s.Db(6),s.Lc(s.jc(55,28,t.channel.capacity)),s.Db(6),s.Lc(s.jc(61,30,t.channel.uptime)),s.Db(2),s.oc("inset",!0),s.Db(6),s.Lc(t.channel.active?"Yes":"No"),s.Db(5),s.Lc(t.channel.private?"Yes":"No"),s.Db(5),s.Lc(t.channel.initiator?"Yes":"No"),s.Db(5),s.Lc(s.jc(84,32,t.channel.num_updates)),s.Db(2),s.oc("ngIf",t.showAdvanced),s.Db(1),s.oc("ngClass",s.tc(36,bi,!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,V.c,C.a,S.a,V.b,a.m,I.a,R.a,a.o,de.a,ai.a],pipes:[a.f],styles:[""]}),e})();const di=["stepper"];function hi(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.inputFormLabel)}}function mi(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function pi(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount must be a positive number."),s.Ub())}function fi(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 ",null==e.selChannel?null:e.selChannel.local_balance,".")}}function gi(e,t){if(1&e&&(s.Vb(0,"mat-option",54),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc(" ",e.remote_alias||e.chan_id," ")}}function yi(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer is required."),s.Ub())}function xi(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc();s.Lc(e.feeFormLabel)}}function vi(e,t){if(1&e&&(s.Vb(0,"mat-option",54),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Mc(" ",e.name," ")}}function wi(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("",e.feeFormGroup.controls.selFeeLimitType.value?e.feeFormGroup.controls.selFeeLimitType.value.placeholder:e.feeLimitTypes[0].placeholder," is required.")}}function Ci(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("",e.feeFormGroup.controls.selFeeLimitType.value?e.feeFormGroup.controls.selFeeLimitType.value.placeholder:e.feeLimitTypes[0].placeholder," must be a positive number.")}}function Ui(e,t){1&e&&s.Kc(0,"Invoice/Payment")}function Vi(e,t){1&e&&(s.Vb(0,"mat-icon",55),s.Kc(1,"check"),s.Ub())}function Di(e,t){1&e&&s.Qb(0,"mat-progress-bar",56)}function Si(e,t){if(1&e&&(s.Vb(0,"mat-icon",55),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(null!=e.paymentStatus&&e.paymentStatus.error?"close":"check")}}function Li(e,t){1&e&&s.Qb(0,"div",7)}function Ii(e,t){1&e&&s.Qb(0,"mat-progress-bar",56)}function _i(e,t){if(1&e&&(s.Vb(0,"h4",57),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(e.paymentStatus&&e.paymentStatus.payment_hash?"Rebalance Successful.":"Rebalance Failed.")}}function ki(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",58),s.dc("click",function(){return s.zc(e),s.hc().onRestart()}),s.Kc(1,"Start Again"),s.Ub()}}function Fi(e,t){1&e&&s.Rb(0)}function Ai(e,t){if(1&e&&s.Ic(0,Fi,1,0,"ng-container",59),2&e){const e=s.hc(),t=s.wc(109),n=s.wc(111);s.oc("ngTemplateOutlet",e.paymentStatus.error?t:n)}}function Ti(e,t){if(1&e&&(s.Vb(0,"div",7),s.Vb(1,"span",42),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(2),s.Lc("Error: "+(e.paymentStatus.error.error.error?e.paymentStatus.error.error.error:e.paymentStatus.error.error?e.paymentStatus.error.error:e.paymentStatus.error?e.paymentStatus.error:"Unknown"))}}function Pi(e,t){if(1&e&&(s.Vb(0,"div",7),s.Vb(1,"div",0),s.Vb(2,"div",60),s.Vb(3,"h4",61),s.Kc(4,"Payment Hash"),s.Ub(),s.Vb(5,"span",42),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Qb(7,"mat-divider",62),s.Vb(8,"div",0),s.Vb(9,"div",63),s.Vb(10,"h4",61),s.Kc(11),s.Ub(),s.Vb(12,"span",42),s.Kc(13),s.Ub(),s.Ub(),s.Vb(14,"div",63),s.Vb(15,"h4",61),s.Kc(16,"Number of Hops"),s.Ub(),s.Vb(17,"span",42),s.Kc(18),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(6),s.Lc(e.paymentStatus.payment_hash),s.Db(5),s.Mc("Total Fees (",e.paymentStatus.payment_route.total_fees_msat?"mSats":"Sats",")"),s.Db(2),s.Lc(e.paymentStatus.payment_route.total_fees_msat?e.paymentStatus.payment_route.total_fees_msat:e.paymentStatus.payment_route.total_fees?e.paymentStatus.payment_route.total_fees:0),s.Db(5),s.Lc(e.paymentStatus&&e.paymentStatus.payment_route&&e.paymentStatus.payment_route.hops&&e.paymentStatus.payment_route.hops.length?e.paymentStatus.payment_route.hops.length:0)}}let Oi=(()=>{class e{constructor(e,t,n,a,i,o,s){this.dialogRef=e,this.data=t,this.logger=n,this.store=a,this.actions$=i,this.formBuilder=o,this.decimalPipe=s,this.faInfoCircle=p.t,this.invoices={},this.selChannel={},this.activeChannels=[],this.filteredActiveChannels=[],this.feeLimitTypes=[],this.queryRoute={},this.paymentRequest="",this.paymentStatus=null,this.flgReusingInvoice=!1,this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1,this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee",this.flgEditable=!0,this.unSubs=[new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.selChannel=this.data.channel,f.i.forEach((e,t)=>{t>0&&this.feeLimitTypes.push(e)}),this.inputFormGroup=this.formBuilder.group({hiddenAmount:["",[be.t.required]],rebalanceAmount:["",[be.t.required,be.t.min(1),be.t.max(this.selChannel.local_balance)]],selRebalancePeer:[null,be.t.required]}),this.feeFormGroup=this.formBuilder.group({selFeeLimitType:[this.feeLimitTypes[0],be.t.required],feeLimit:["",[be.t.required,be.t.min(0)]],hiddenFeeLimit:["",[be.t.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.activeChannels=e.allChannels.filter(e=>e.active&&e.remote_balance>=this.inputFormGroup.controls.rebalanceAmount.value&&e.chan_id!==this.selChannel.chan_id),this.invoices=e.invoices,this.logger.info(e)}),this.actions$.pipe(Object(d.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.Kb||e.type===g.sb||e.type===g.cb)).subscribe(e=>{e.type===g.Kb&&(this.queryRoute=e.payload),e.type===g.sb&&(this.logger.info(e.payload),this.flgPaymentSent=!0,this.paymentStatus=e.payload,this.flgEditable=!0),e.type===g.cb&&(this.logger.info(e.payload),this.flgInvoiceGenerated=!0,this.sendPayment(e.payload.paymentRequest))})}onEstimateFee(){if(!this.inputFormGroup.controls.selRebalancePeer.value||!this.inputFormGroup.controls.rebalanceAmount.value)return!0;0===this.stepper.selectedIndex&&(this.inputFormGroup.controls.hiddenAmount.setValue(this.inputFormGroup.controls.rebalanceAmount.value),this.stepper.next()),this.queryRoute=null,this.feeFormGroup.reset(),this.feeFormGroup.controls.selFeeLimitType.setValue(this.feeLimitTypes[0]),this.store.dispatch(new g.W({destPubkey:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey,amount:this.inputFormGroup.controls.rebalanceAmount.value,outgoingChanId:this.selChannel.chan_id}))}stepSelectionChanged(e){switch(e.selectedIndex){case 0:this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee";break;case 1:this.inputFormLabel=this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?"Rebalancing Amount: "+this.decimalPipe.transform(this.inputFormGroup.controls.rebalanceAmount.value?this.inputFormGroup.controls.rebalanceAmount.value:0)+" Sats | Peer: "+(this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?this.inputFormGroup.controls.selRebalancePeer.value.remote_alias:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey.substring(0,15)+"..."):"Amount to rebalance",this.feeFormLabel="Select rebalance fee";break;case 2:this.inputFormLabel=this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?"Rebalancing Amount: "+this.decimalPipe.transform(this.inputFormGroup.controls.rebalanceAmount.value?this.inputFormGroup.controls.rebalanceAmount.value:0)+" Sats | Peer: "+(this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?this.inputFormGroup.controls.selRebalancePeer.value.remote_alias:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey.substring(0,15)+"..."):"Amount to rebalance",this.feeFormLabel=this.queryRoute&&this.queryRoute.routes&&this.queryRoute.routes.length>0&&(this.queryRoute.routes[0].total_fees_msat||this.queryRoute.routes[0].hops&&this.queryRoute.routes[0].hops.length)?this.feeFormGroup.controls.selFeeLimitType.value.placeholder+": "+this.decimalPipe.transform(this.feeFormGroup.controls.feeLimit.value?this.feeFormGroup.controls.feeLimit.value:0)+" | Hops: "+this.queryRoute.routes[0].hops.length:"Select rebalance fee";break;default:this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.inputFormGroup.controls.hiddenAmount.setValue(""):1===e.selectedIndex&&this.feeFormGroup.controls.hiddenFeeLimit.setValue(""))}onUseEstimate(){this.feeFormGroup.controls.selFeeLimitType.setValue(this.feeLimitTypes[0]),this.feeFormGroup.controls.feeLimit.setValue(this.queryRoute.routes&&this.queryRoute.routes.length>0&&this.queryRoute.routes[0].total_fees_msat?Math.ceil(+this.queryRoute.routes[0].total_fees_msat/1e3):0)}onRebalance(){if(!this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.rebalanceAmount.value<=0||this.inputFormGroup.controls.rebalanceAmount.value>+this.selChannel.local_balance||!this.feeFormGroup.controls.feeLimit.value||this.feeFormGroup.controls.feeLimit.value<0||!this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey)return!0;this.feeFormGroup.controls.hiddenFeeLimit.setValue(this.feeFormGroup.controls.feeLimit.value),this.stepper.next(),this.flgEditable=!1,this.paymentRequest="",this.paymentStatus=null,this.flgReusingInvoice=!1,this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1;let e=this.findUnsettledInvoice();e?(this.flgReusingInvoice=!0,this.sendPayment(e.payment_request)):this.store.dispatch(new g.Qb({memo:"Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats",invoiceValue:this.inputFormGroup.controls.rebalanceAmount.value,private:!1,expiry:3600,pageSize:f.p,openModal:!1}))}findUnsettledInvoice(){return this.invoices.invoices.find(e=>("0"===e.settle_date||""===e.settle_date||!e.settle_date)&&e.memo==="Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats"&&"CANCELED"!==e.state)}sendPayment(e){this.flgInvoiceGenerated=!0,this.paymentRequest=e,this.store.dispatch(new g.Sb({paymentReq:e,paymentDecoded:{},zeroAmtInvoice:!1,outgoingChannel:this.selChannel,feeLimitType:this.feeFormGroup.controls.selFeeLimitType.value,feeLimit:this.feeFormGroup.controls.feeLimit.value,allowSelfPayment:!0,lastHopPubkey:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey,fromDialog:!0}))}filterActiveChannels(){this.filteredActiveChannels=this.activeChannels.filter(e=>e.remote_balance>=this.inputFormGroup.controls.rebalanceAmount.value&&e.chan_id!==this.selChannel.chan_id)}onClose(){this.dialogRef.close(!1)}onRestart(){this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1,this.flgEditable=!0,this.stepper.reset(),this.inputFormGroup.reset(),this.feeFormGroup.reset(),this.statusFormGroup.reset()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(y.b),s.Pb(x.h),s.Pb(v.a),s.Pb(be.d),s.Pb(a.f))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-rebalance"]],viewQuery:function(e,t){if(1&e&&s.Pc(di,!0),2&e){let e;s.vc(e=s.ec())&&(t.stepper=e.first)}},decls:112,vars:43,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,"padding-gap-x-large"],[1,"page-title"],["tabindex","15","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"mt-5px"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","space-between stretch",1,"padding-gap-large"],["fxFlex","40"],["fxFlex","30"],[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",""],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","48"],["autoFocus","","matInput","","placeholder","Amount","type","number","tabindex","1","formControlName","rebalanceAmount","required","",3,"step","change"],["matSuffix",""],[4,"ngIf"],["fxFlex","48","fxLayoutAlign","start end"],["tabindex","2","formControlName","selRebalancePeer","placeholder","Receive from Peer","required",""],[3,"value",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","submit",3,"click"],["matStepLabel","","disabled","true"],["fxFlex","75",1,"alert"],["mat-stroked-button","","type","button","tabindex","4","matTooltip","Re-estimate Fee",1,"h-35px",3,"click"],[1,"mb-5px"],["mat-stroked-button","","type","button","tabindex","5",1,"h-35px",3,"click"],["tabindex","6","formControlName","selFeeLimitType","Placeholder","Fee Limits","required",""],["matInput","","formControlName","feeLimit","type","number","tabindex","7","required","",3,"placeholder","step"],["mat-stroked-button","","color","primary","tabindex","8","type","submit",3,"click"],[3,"stepControl"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"flat-expansion-panel","mb-2"],["fxLayoutAlign","start center","fxFlex","100"],["class","ml-1 icon-small",4,"ngIf"],[1,"foreground-secondary-text"],["fxFlex","100","color","primary","mode","indeterminate",4,"ngIf"],["fxFlex","100",1,"flat-expansion-panel",3,"expanded"],["fxLayout","column",4,"ngIf","ngIfElse"],["fxLayoutAlign","start","class","font-bold-500 mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-1"],["mat-flat-button","","color","primary","tabindex","11","type","button",3,"click",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["paymentStatusBlock",""],["paymentFailedBlock",""],["paymentSuccessfulBlock",""],[3,"value"],[1,"ml-1","icon-small"],["fxFlex","100","color","primary","mode","indeterminate"],["fxLayoutAlign","start",1,"font-bold-500","mt-1"],["mat-flat-button","","color","primary","tabindex","11","type","button",3,"click"],[4,"ngTemplateOutlet"],["fxFlex","100"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"w-100","my-1"],["fxFlex","50"]],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,"Channel Rebalance"),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,"div",8),s.Vb(11,"div",9),s.Qb(12,"fa-icon",10),s.Vb(13,"span"),s.Kc(14,"Circular Rebalance is a payment you make to *yourselves* to affect a relative change in the balances of two channels. This is accomplished by sending payment out from the selected channel and receiving it back on the channel with the selected peer. Please note, you will be paying routing fee to balance the channels in this manner."),s.Ub(),s.Ub(),s.Ub(),s.Vb(15,"div",11),s.Vb(16,"p",12),s.Vb(17,"strong"),s.Kc(18,"Channel Peer:\xa0"),s.Ub(),s.Kc(19),s.ic(20,"titlecase"),s.Ub(),s.Vb(21,"p",13),s.Vb(22,"strong"),s.Kc(23,"Channel ID:\xa0"),s.Ub(),s.Kc(24),s.Ub(),s.Qb(25,"p",13),s.Ub(),s.Vb(26,"mat-vertical-stepper",14,15),s.dc("selectionChange",function(e){return t.stepSelectionChanged(e)}),s.Vb(28,"mat-step",16),s.Vb(29,"form",17),s.Ic(30,hi,1,1,"ng-template",18),s.Vb(31,"div",19),s.Vb(32,"mat-form-field",20),s.Vb(33,"input",21),s.dc("change",function(){return t.filterActiveChannels()}),s.Ub(),s.Vb(34,"mat-hint"),s.Kc(35),s.Ub(),s.Vb(36,"span",22),s.Kc(37,"Sats"),s.Ub(),s.Ic(38,mi,2,0,"mat-error",23),s.Ic(39,pi,2,0,"mat-error",23),s.Ic(40,fi,2,1,"mat-error",23),s.Ub(),s.Vb(41,"mat-form-field",24),s.Vb(42,"mat-select",25),s.Ic(43,gi,2,2,"mat-option",26),s.Ub(),s.Ic(44,yi,2,0,"mat-error",23),s.Ub(),s.Ub(),s.Vb(45,"div",27),s.Vb(46,"button",28),s.dc("click",function(){return t.onEstimateFee()}),s.Kc(47,"Estimate Fee"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(48,"mat-step",16),s.Vb(49,"form",17),s.Ic(50,xi,1,1,"ng-template",29),s.Vb(51,"div",19),s.Vb(52,"div",19),s.Vb(53,"div",30),s.Qb(54,"fa-icon",10),s.Vb(55,"span"),s.Vb(56,"strong"),s.Kc(57,"Estimated Fee: "),s.Ub(),s.Kc(58),s.Vb(59,"strong"),s.Kc(60,"Number of Hops: "),s.Ub(),s.Kc(61),s.Ub(),s.Ub(),s.Vb(62,"button",31),s.dc("click",function(){return t.onEstimateFee()}),s.Vb(63,"mat-icon",32),s.Kc(64,"loop"),s.Ub(),s.Ub(),s.Vb(65,"button",33),s.dc("click",function(){return t.onUseEstimate()}),s.Kc(66,"Use Estimate"),s.Ub(),s.Ub(),s.Vb(67,"div",19),s.Vb(68,"mat-form-field",24),s.Vb(69,"mat-select",34),s.Ic(70,vi,2,2,"mat-option",26),s.Ub(),s.Ub(),s.Vb(71,"mat-form-field",20),s.Qb(72,"input",35),s.Ic(73,wi,2,1,"mat-error",23),s.Ic(74,Ci,2,1,"mat-error",23),s.Ub(),s.Ub(),s.Ub(),s.Vb(75,"div",27),s.Vb(76,"button",36),s.dc("click",function(){return t.onRebalance()}),s.Kc(77,"Rebalance"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(78,"mat-step",37),s.Vb(79,"form",17),s.Ic(80,Ui,1,0,"ng-template",18),s.Vb(81,"div",38),s.Vb(82,"mat-expansion-panel",39),s.Vb(83,"mat-expansion-panel-header"),s.Vb(84,"mat-panel-title"),s.Vb(85,"span",40),s.Kc(86),s.Ic(87,Vi,2,0,"mat-icon",41),s.Ub(),s.Ub(),s.Ub(),s.Vb(88,"div",7),s.Vb(89,"span",42),s.Kc(90),s.Ub(),s.Ub(),s.Ub(),s.Ic(91,Di,1,0,"mat-progress-bar",43),s.Vb(92,"mat-expansion-panel",44),s.Vb(93,"mat-expansion-panel-header"),s.Vb(94,"mat-panel-title"),s.Vb(95,"span",40),s.Kc(96),s.Ic(97,Si,2,1,"mat-icon",41),s.Ub(),s.Ub(),s.Ub(),s.Ic(98,Li,1,0,"div",45),s.Ub(),s.Ic(99,Ii,1,0,"mat-progress-bar",43),s.Ub(),s.Ic(100,_i,2,1,"h4",46),s.Vb(101,"div",47),s.Ic(102,ki,2,0,"button",48),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(103,"div",49),s.Vb(104,"button",50),s.Kc(105,"Close"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(106,Ai,1,1,"ng-template",null,51,s.Jc),s.Ic(108,Ti,3,1,"ng-template",null,52,s.Jc),s.Ic(110,Pi,19,4,"ng-template",null,53,s.Jc)),2&e){const e=s.wc(107);s.Db(12),s.oc("icon",t.faInfoCircle),s.Db(7),s.Lc(s.jc(20,41,t.selChannel.remote_alias)),s.Db(5),s.Lc(t.selChannel.chan_id),s.Db(2),s.oc("linear",!0),s.Db(2),s.oc("stepControl",t.inputFormGroup)("editable",t.flgEditable),s.Db(1),s.oc("formGroup",t.inputFormGroup),s.Db(4),s.oc("step",100),s.Db(2),s.Nc("(Local Bal: ",null==t.selChannel?null:t.selChannel.local_balance,", Remaining: ",(null==t.selChannel?null:t.selChannel.local_balance)-(t.inputFormGroup.controls.rebalanceAmount.value?t.inputFormGroup.controls.rebalanceAmount.value:0),")"),s.Db(3),s.oc("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.required),s.Db(1),s.oc("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.min),s.Db(1),s.oc("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.max),s.Db(3),s.oc("ngForOf",t.filteredActiveChannels),s.Db(1),s.oc("ngIf",null==t.inputFormGroup.controls.selRebalancePeer.errors?null:t.inputFormGroup.controls.selRebalancePeer.errors.required),s.Db(4),s.oc("stepControl",t.feeFormGroup)("editable",t.flgEditable),s.Db(1),s.oc("formGroup",t.feeFormGroup),s.Db(5),s.oc("icon",t.faInfoCircle),s.Db(4),s.Mc("",t.queryRoute&&t.queryRoute.routes&&t.queryRoute.routes.length>0&&t.queryRoute.routes[0].total_fees_msat?t.queryRoute.routes[0].total_fees_msat:0," mSats | "),s.Db(3),s.Mc("",t.queryRoute&&t.queryRoute.routes&&t.queryRoute.routes.length>0&&t.queryRoute.routes[0].hops&&t.queryRoute.routes[0].hops.length?t.queryRoute.routes[0].hops.length:0," "),s.Db(9),s.oc("ngForOf",t.feeLimitTypes),s.Db(2),s.pc("placeholder",t.feeFormGroup.controls.selFeeLimitType.value?t.feeFormGroup.controls.selFeeLimitType.value.placeholder:t.feeLimitTypes[0].placeholder),s.oc("step",1),s.Db(1),s.oc("ngIf",null==t.feeFormGroup.controls.feeLimit.errors?null:t.feeFormGroup.controls.feeLimit.errors.required),s.Db(1),s.oc("ngIf",null==t.feeFormGroup.controls.feeLimit.errors?null:t.feeFormGroup.controls.feeLimit.errors.min),s.Db(4),s.oc("stepControl",t.statusFormGroup),s.Db(1),s.oc("formGroup",t.statusFormGroup),s.Db(7),s.Lc(t.flgInvoiceGenerated?t.flgReusingInvoice?"Invoice re-used":"Invoice generated":"Generating invoice..."),s.Db(1),s.oc("ngIf",t.flgInvoiceGenerated),s.Db(3),s.Lc(t.paymentRequest),s.Db(1),s.oc("ngIf",!t.flgInvoiceGenerated),s.Db(1),s.oc("expanded",(t.flgInvoiceGenerated||t.flgReusingInvoice)&&t.flgPaymentSent),s.Db(4),s.Lc(t.flgInvoiceGenerated||t.flgPaymentSent?t.flgPaymentSent?null!=t.paymentStatus&&t.paymentStatus.error?"Payment failed":"Payment successful":"Processing payment...":"Payment waiting for Invoice"),s.Db(1),s.oc("ngIf",t.flgPaymentSent),s.Db(1),s.oc("ngIf",!t.paymentStatus)("ngIfElse",e),s.Db(1),s.oc("ngIf",t.flgInvoiceGenerated&&!t.flgPaymentSent),s.Db(1),s.oc("ngIf",t.flgInvoiceGenerated&&t.flgPaymentSent),s.Db(2),s.oc("ngIf",t.paymentStatus&&t.paymentStatus.error),s.Db(2),s.oc("mat-dialog-close",!1)}},directives:[c.c,c.a,V.c,c.b,S.a,V.b,C.a,ma.h,ma.a,be.u,be.n,be.h,ma.b,O.c,ue.b,be.q,be.c,de.a,be.m,be.g,be.s,O.f,O.g,a.o,me.a,a.n,K.a,L.a,nt.c,nt.e,nt.f,re.d,O.b,fe.m,l.a,a.t,R.a],pipes:[a.x],styles:[""]}),e})();function Ki(e,t){if(1&e&&(s.Vb(0,"div",16),s.Vb(1,"p",17),s.Vb(2,"mat-icon",18),s.Kc(3,"close"),s.Ub(),s.Kc(4),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(4),s.Lc(e.errorMsg)}}function Ri(e,t){if(1&e&&(s.Vb(0,"div",27),s.Qb(1,"fa-icon",28),s.Vb(2,"span"),s.Kc(3,"Priority/Fee for force closing inactive channels cannot be modified."),s.Ub(),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faInfoCircle)}}function Mi(e,t){if(1&e&&(s.Vb(0,"mat-option",29),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.id),s.Db(1),s.Mc(" ",e.name," ")}}function Ei(e,t){1&e&&(s.Vb(0,"mat-form-field",30),s.Qb(1,"input",31),s.Ub())}function zi(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Number of blocks is required."),s.Ub())}function Ni(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",32),s.Vb(1,"input",33,34),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).blocks=t}),s.Ub(),s.Ic(3,zi,2,0,"mat-error",35),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.oc("ngModel",e.blocks)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.blocks)}}function Bi(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Fees is required."),s.Ub())}function Gi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",32),s.Vb(1,"input",36,37),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).fees=t}),s.Ub(),s.Ic(3,Bi,2,0,"mat-error",35),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.oc("ngModel",e.fees)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.fees)}}function qi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",19),s.Ic(1,Ri,4,1,"div",20),s.Vb(2,"div",21),s.Vb(3,"mat-form-field",22),s.Vb(4,"mat-select",23),s.dc("valueChange",function(t){return s.zc(e),s.hc().selTransType=t}),s.Ic(5,Mi,2,2,"mat-option",24),s.Ub(),s.Ub(),s.Ic(6,Ei,2,0,"mat-form-field",25),s.Ic(7,Ni,4,4,"mat-form-field",26),s.Ic(8,Gi,4,4,"mat-form-field",26),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.channelToClose.active),s.Db(3),s.oc("value",e.selTransType)("disabled",!e.channelToClose.active),s.Db(1),s.oc("ngForOf",e.transTypes),s.Db(1),s.oc("ngIf","0"==e.selTransType),s.Db(1),s.oc("ngIf","1"==e.selTransType),s.Db(1),s.oc("ngIf","2"==e.selTransType)}}function Qi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",38),s.dc("click",function(){return s.zc(e),s.hc().resetData()}),s.Kc(1,"Clear"),s.Ub()}}function Hi(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",39),s.dc("click",function(){return s.zc(e),s.hc().onCloseChannel()}),s.Kc(1),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.Lc(e.channelToClose.active?"Close Channel":"Force Close")}}function ji(e,t){if(1&e){const e=s.Wb();s.Vb(0,"button",40),s.dc("click",function(){return s.zc(e),s.hc().onClose()}),s.Kc(1,"Ok"),s.Ub()}}let $i=(()=>{class e{constructor(e,t,n,a,i){this.dialogRef=e,this.data=t,this.store=n,this.actions$=a,this.logger=i,this.transTypes=f.x,this.selTransType="0",this.blocks=null,this.fees=null,this.faExclamationTriangle=p.o,this.faInfoCircle=p.t,this.flgPendingHtlcs=!1,this.errorMsg="Please wait for pending HTLCs to settle before attempting channel closure.",this.unSubs=[new u.a,new u.a]}ngOnInit(){this.channelToClose=this.data.channel,this.actions$.pipe(Object(d.a)(this.unSubs[0]),Object(h.a)(e=>e.type===g.m||e.type===g.tb)).subscribe(e=>{if(e.type===g.tb){let t=e.payload.find(e=>e.chan_id===this.data.channel.chan_id);t.pending_htlcs&&t.pending_htlcs.length&&t.pending_htlcs.length>0&&(this.flgPendingHtlcs=!0)}e.type===g.m&&"FetchChannels/all"===e.payload.action&&this.logger.error("Fetching latest channel information failed!\n"+e.payload.message)})}onCloseChannel(){if("1"===this.selTransType&&(!this.blocks||0===this.blocks)||"2"===this.selTransType&&(!this.fees||0===this.fees))return!0;let e={channelPoint:this.channelToClose.channel_point,forcibly:!this.channelToClose.active};this.blocks&&(e.targetConf=this.blocks),this.fees&&(e.satPerByte=this.fees),this.store.dispatch(new H.G(this.channelToClose.active?"Closing Channel...":"Force Closing Channel...")),this.store.dispatch(new g.j(e)),this.dialogRef.close(!1)}resetData(){this.selTransType="0",this.blocks=null,this.fees=null}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(x.h),s.Pb(v.a),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-close-channel"]],decls:19,vars:7,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"],["fxLayout","column",1,"bordered-box","my-2","p-2"],["fxLayoutAlign","start center",1,"pb-1","word-break"],["fxLayoutAlign","start center",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","reset","class","mr-1","tabindex","3","default","",3,"click",4,"ngIf"],["mat-flat-button","","color","primary","type","submit","tabindex","4",3,"click",4,"ngIf"],["mat-flat-button","","color","primary","type","submit","tabindex","5",3,"click",4,"ngIf"],["fxLayoutAlign","start center"],["fxFlex","100","fxLayoutAlign","start center",1,"color-warn"],[1,"mr-1","icon-small"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","class","alert alert-info",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex.gt-sm","48"],["tabindex","1",3,"value","disabled","valueChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48",4,"ngIf"],["fxFlex.gt-sm","48","fxLayoutAlign","start end",4,"ngIf"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],[3,"value"],["fxFlex","48"],["matInput","","placeholder","Default","disabled",""],["fxFlex.gt-sm","48","fxLayoutAlign","start end"],["matInput","","placeholder","Number of Blocks","type","number","name","blocks","required","","tabindex","2",3,"ngModel","step","min","ngModelChange"],["blcks","ngModel"],[4,"ngIf"],["matInput","","placeholder","Fees (Sats/Byte)","type","number","name","ccfees","required","","tabindex","3",3,"ngModel","step","min","ngModelChange"],["clchfee","ngModel"],["mat-stroked-button","","color","primary","type","reset","tabindex","3","default","",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","5",3,"click"]],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),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),s.Vb(10,"div",8),s.Vb(11,"p",9),s.Kc(12),s.Ub(),s.Ic(13,Ki,5,1,"div",10),s.Ic(14,qi,9,7,"div",11),s.Ub(),s.Vb(15,"div",12),s.Ic(16,Qi,2,0,"button",13),s.Ic(17,Hi,2,1,"button",14),s.Ic(18,ji,2,0,"button",15),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(5),s.Lc(t.channelToClose.active?"Close Channel":"Force Close Channel"),s.Db(7),s.Lc(t.channelToClose.active?"Closing channel: "+t.channelToClose.channel_point:"Force closing channel: "+t.channelToClose.channel_point),s.Db(1),s.oc("ngIf",t.flgPendingHtlcs),s.Db(1),s.oc("ngIf",!t.flgPendingHtlcs),s.Db(2),s.oc("ngIf",t.channelToClose.active&&!t.flgPendingHtlcs),s.Db(1),s.oc("ngIf",!t.flgPendingHtlcs),s.Db(1),s.oc("ngIf",t.flgPendingHtlcs))},directives:[c.c,c.a,V.c,c.b,S.a,V.b,be.u,be.n,be.o,a.o,L.a,O.c,me.a,a.n,C.a,fe.m,ue.b,be.q,be.c,he.a,be.s,be.m,be.p,O.b],styles:[""]}),e})();function Wi(e,t){1&e&&s.Qb(0,"mat-progress-bar",30)}function Xi(e,t){1&e&&(s.Vb(0,"th",31),s.Kc(1," Peer "),s.Ub())}function Ji(e,t){1&e&&s.Qb(0,"span",39)}function Yi(e,t){1&e&&s.Qb(0,"span",40)}function Zi(e,t){if(1&e&&(s.Vb(0,"span",41),s.Qb(1,"fa-icon",42),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faEyeSlash)}}function eo(e,t){if(1&e&&(s.Vb(0,"span",43),s.Qb(1,"fa-icon",42),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("icon",e.faEye)}}const to=function(e){return{"max-width":e}};function no(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"div",33),s.Ic(2,Ji,1,0,"span",34),s.Ic(3,Yi,1,0,"span",35),s.Ic(4,Zi,2,1,"span",36),s.Ic(5,eo,2,1,"span",37),s.Vb(6,"span",38),s.Kc(7),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(6,to,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(1),s.oc("ngIf",e.active),s.Db(1),s.oc("ngIf",!e.active),s.Db(1),s.oc("ngIf",e.private),s.Db(1),s.oc("ngIf",!e.private),s.Db(2),s.Lc(e.remote_alias||e.remote_pubkey)}}function ao(e,t){if(1&e&&(s.Vb(0,"th",44),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Mc("Uptime (",e.timeUnit,")")}}function io(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"span",45),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc("",e.uptime_str," ")}}function oo(e,t){1&e&&(s.Vb(0,"th",44),s.Kc(1,"Sats Sent "),s.Ub())}function so(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"span",45),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,e.total_satoshis_sent)," ")}}function co(e,t){1&e&&(s.Vb(0,"th",44),s.Kc(1,"Sats Received "),s.Ub())}function lo(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"span",45),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,e.total_satoshis_received)," ")}}function ro(e,t){1&e&&(s.Vb(0,"th",44),s.Kc(1,"Local Balance "),s.Ub())}function bo(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"span",45),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,e.local_balance)," ")}}function uo(e,t){1&e&&(s.Vb(0,"th",44),s.Kc(1,"Remote Balance "),s.Ub())}function ho(e,t){if(1&e&&(s.Vb(0,"td",32),s.Vb(1,"span",45),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,e.remote_balance)," ")}}function mo(e,t){1&e&&(s.Vb(0,"th",46),s.Kc(1,"Balance Score "),s.Ub())}function po(e,t){if(1&e&&(s.Vb(0,"td",47),s.Vb(1,"div",48),s.Vb(2,"mat-hint",49),s.Kc(3),s.ic(4,"number"),s.Ub(),s.Ub(),s.Qb(5,"mat-progress-bar",50),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.local_balance&&e.local_balance>0?+e.local_balance/(+e.local_balance+ +e.remote_balance)*100:0)}}function fo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",51),s.Vb(1,"div",52),s.Vb(2,"mat-select",53),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",54),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",54),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 go(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-option",54),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc().onCircularRebalance(t)}),s.Kc(1,"Circular Rebalance"),s.Ub()}}function yo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-option",54),s.dc("click",function(){s.zc(e);const t=s.hc().$implicit;return s.hc().onLoopOut(t)}),s.Kc(1,"Loop Out"),s.Ub()}}function xo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",55),s.Vb(1,"div",56),s.Vb(2,"mat-select",57),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",54),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc().onChannelClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",54),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",54),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.Ic(10,go,2,0,"mat-option",58),s.Ic(11,yo,2,0,"mat-option",58),s.Vb(12,"mat-option",54),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onChannelClose(n)}),s.Kc(13,"Close Channel"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(10),s.oc("ngIf",+e.versionsArr[0]>0||+e.versionsArr[1]>=9),s.Db(1),s.oc("ngIf",e.selNode.swapServerUrl)}}function vo(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 wo(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No channels available."),s.Ub())}function Co(e,t){if(1&e&&(s.Vb(0,"td",59),s.Ic(1,vo,2,0,"p",60),s.Ic(2,wo,2,0,"p",60),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 Uo=function(e){return{"display-none":e}};function Vo(e,t){if(1&e&&s.Qb(0,"tr",61),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Uo,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Do(e,t){1&e&&s.Qb(0,"tr",62)}function So(e,t){1&e&&s.Qb(0,"tr",63)}const Lo=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Io=function(){return["no_peer"]};let _o=(()=>{class e{constructor(e,t,n,a,i,o,s){this.logger=e,this.store=t,this.rtlEffects=n,this.lndEffects=a,this.commonService=i,this.loopService=o,this.decimalPipe=s,this.timeUnit="mins:secs",this.userPersonaEnum=f.z,this.selNode={},this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.versionsArr=[],this.faEye=p.p,this.faEyeSlash=p.q,this.targetConf=6,this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","local_balance","remote_balance","actions"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["remote_alias","uptime","local_balance","remote_balance","actions"]):(this.flgSticky=!0,this.displayedColumns=["remote_alias","uptime","total_satoshis_sent","total_satoshis_received","local_balance","remote_balance","balancedness","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels/all"===e.action&&(this.flgLoading[0]="error")}),this.selNode=e.nodeSettings,this.information=e.information,this.information&&this.information.version&&(this.versionsArr=this.information.version.split(".")),this.numPeers=e.peers&&e.peers.length?e.peers.length:0,this.totalBalance=+e.blockchainBalance.total_balance,this.channelsData=this.calculateUptime(e.allChannels),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.h(e.chan_id.toString()+"/"+this.information.identity_pubkey)),this.lndEffects.setLookup.pipe(Object(et.a)(1)).subscribe(e=>{if(!e.fee_base_msat&&!e.fee_rate_milli_msat&&!e.time_lock_delta)return!1;this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Remote Channel Policy",message:[[{key:"fee_base_msat",value:e.fee_base_msat,title:"Base Fees (mSats)",width:34,type:f.h.NUMBER},{key:"fee_rate_milli_msat",value:e.fee_rate_milli_msat,title:"Fee Rate (milli mSats)",width:33,type:f.h.NUMBER},{key:"time_lock_delta",value:e.time_lock_delta,title:"Time Lock Delta",width:33,type:f.h.NUMBER}]]}}))})}onCircularRebalance(e){this.store.dispatch(new H.D({data:{channel:e,component:Oi}}))}onChannelUpdate(e){"all"===e?(this.store.dispatch(new H.E({data:{type:f.b.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update All Channels",message:[],titleMessage:"Update fee policy for all channels",flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSat)",inputType:f.h.NUMBER.toLowerCase(),inputValue:1e3,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:f.h.NUMBER.toLowerCase(),inputValue:1,min:1,width:32},{placeholder:"Time Lock Delta",inputType:f.h.NUMBER.toLowerCase(),inputValue:40,width:32}]}})),this.rtlEffects.closeConfirm.pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{if(e){const t=e[0].inputValue,n=e[1].inputValue,a=e[2].inputValue;this.store.dispatch(new H.G("Updating Channel Policy...")),this.store.dispatch(new g.ec({baseFeeMsat:t,feeRate:n,timeLockDelta:a,chanPoint:"all"}))}})):(this.myChanPolicy={fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.store.dispatch(new H.G("Fetching Channel Policy...")),this.store.dispatch(new g.h(e.chan_id.toString())),this.lndEffects.setLookup.pipe(Object(et.a)(1)).subscribe(t=>{this.myChanPolicy=t.node1_pub===this.information.identity_pubkey?t.node1_policy:t.node2_pub===this.information.identity_pubkey?t.node2_policy:{fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.logger.info(this.myChanPolicy),this.store.dispatch(new H.j),this.store.dispatch(new H.E({data:{type:f.b.CONFIRM,alertTitle:"Update Fee Policy",titleMessage:"Update fee policy for channel point: "+e.channel_point,noBtnText:"Cancel",yesBtnText:"Update Channel",message:[],flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSat)",inputType:f.h.NUMBER.toLowerCase(),inputValue:""===this.myChanPolicy.fee_base_msat?0:this.myChanPolicy.fee_base_msat,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:f.h.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.fee_rate_milli_msat,min:1,width:32},{placeholder:"Time Lock Delta",inputType:f.h.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.time_lock_delta,width:32}]}}))}),this.rtlEffects.closeConfirm.pipe(Object(d.a)(this.unSubs[2])).subscribe(t=>{if(t){const n=t[0].inputValue,a=t[1].inputValue,i=t[2].inputValue;this.store.dispatch(new H.G("Updating Channel Policy...")),this.store.dispatch(new g.ec({baseFeeMsat:n,feeRate:a,timeLockDelta:i,chanPoint:e.channel_point}))}})),this.applyFilter()}onChannelClose(e){e.active&&this.store.dispatch(new g.B),this.store.dispatch(new H.D({width:"70%",data:{channel:e,component:$i}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,t){this.store.dispatch(new H.D({data:{channel:e,showCopy:!0,component:ui}}))}loadChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?1:-1}),this.channels=new le.o([...e]),this.channels.filterPredicate=(e,t)=>((e.active?"active":"inactive")+(e.chan_id?e.chan_id:"")+(e.remote_pubkey?e.remote_pubkey:"")+(e.remote_alias?e.remote_alias:"")+(e.capacity?e.capacity:"")+(e.local_balance?e.local_balance:"")+(e.remote_balance?e.remote_balance:"")+(e.total_satoshis_sent?e.total_satoshis_sent:"")+(e.total_satoshis_received?e.total_satoshis_received:"")+(e.commit_fee?e.commit_fee:"")+(e.private?"private":"public")).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)}calculateUptime(e){const t=3600,n=86400,a=31536e3;let i=60,o=1,s=0;switch(e.forEach(e=>{e.uptime&&+e.uptime>s&&(s=+e.uptime)}),!0){case s<t:this.timeUnit="Mins:Secs",i=60,o=1;break;case s>=t&&s<n:this.timeUnit="Hrs:Mins",i=t,o=60;break;case s>=n&&s<a:this.timeUnit="Days:Hrs",i=n,o=t;break;case s>a:this.timeUnit="Yrs:Days",i=a,o=n;break;default:this.timeUnit="Mins:Secs",i=60,o=1}return e.forEach(e=>{e.uptime_str=e.uptime?this.decimalPipe.transform(Math.floor(+e.uptime/i),"2.0-0")+":"+this.decimalPipe.transform(Math.round(+e.uptime%i/o),"2.0-0"):"---"}),e}onLoopOut(e){this.store.dispatch(new H.G("Getting Terms and Quotes...")),this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe(Object(d.a)(this.unSubs[0])).subscribe(t=>{this.store.dispatch(new H.j),this.store.dispatch(new H.D({minHeight:"56rem",data:{channel:e,minQuote:t[0],maxQuote:t[1],direction:f.m.LOOP_OUT,component:Q.a}}))})}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(pt.a),s.Pb(ft.a),s.Pb(w.a),s.Pb(j.a),s.Pb(a.f))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-open-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Channels")}])],decls:39,vars:14,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"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","remote_alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","uptime"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","total_satoshis_sent"],["matColumnDef","total_satoshis_received"],["matColumnDef","local_balance"],["matColumnDef","remote_balance"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-2",4,"matHeaderCellDef"],["mat-cell","","class","pl-2",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","dot green","matTooltip","Active","matTooltipPosition","right",4,"ngIf"],["class","dot yellow","matTooltip","Inactive","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Active","matTooltipPosition","right",1,"dot","green"],["matTooltip","Inactive","matTooltipPosition","right",1,"dot","yellow"],["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-2"],["mat-cell","",1,"pl-2"],["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"],[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,Wi,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,Xi,2,0,"th",10),s.Ic(11,no,8,8,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,ao,2,1,"th",13),s.Ic(14,io,3,1,"td",11),s.Sb(),s.Tb(15,14),s.Ic(16,oo,2,0,"th",13),s.Ic(17,so,4,3,"td",11),s.Sb(),s.Tb(18,15),s.Ic(19,co,2,0,"th",13),s.Ic(20,lo,4,3,"td",11),s.Sb(),s.Tb(21,16),s.Ic(22,ro,2,0,"th",13),s.Ic(23,bo,4,3,"td",11),s.Sb(),s.Tb(24,17),s.Ic(25,uo,2,0,"th",13),s.Ic(26,ho,4,3,"td",11),s.Sb(),s.Tb(27,18),s.Ic(28,mo,2,0,"th",19),s.Ic(29,po,6,4,"td",20),s.Sb(),s.Tb(30,21),s.Ic(31,fo,8,0,"th",22),s.Ic(32,xo,14,2,"td",23),s.Sb(),s.Tb(33,24),s.Ic(34,Co,3,2,"td",25),s.Sb(),s.Ic(35,Vo,1,3,"tr",26),s.Ic(36,Do,1,0,"tr",27),s.Ic(37,So,1,0,"tr",28),s.Ub(),s.Ub(),s.Qb(38,"mat-paginator",29),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,Lo,"error"===t.flgLoading[0])),s.Db(28),s.oc("matFooterRowDef",s.rc(13,Io)),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,ue.b,be.c,be.m,be.p,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.p,I.b,K.a,C.a,O.f,me.a,me.c,fe.m,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-remote_alias[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-remote_alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;flex:0 0 20%;width:20%}.mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_ngcontent-%COMP%]{flex:1 1 10%;width:10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:37.5em){.mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width:56.25em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 60%}}@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})();const ko=["outputIdx"];function Fo(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Index for change output is required."),s.Ub())}function Ao(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Invalid index value."),s.Ub())}function To(e,t){if(1&e&&(s.Vb(0,"mat-option",28),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.id),s.Db(1),s.Mc(" ",e.name," ")}}function Po(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Number of blocks is required."),s.Ub())}function Oo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",16),s.Vb(1,"input",29,30),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().blocks=t}),s.Ub(),s.Ic(3,Po,2,0,"mat-error",19),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("ngModel",e.blocks)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.blocks)}}function Ko(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Fees is required."),s.Ub())}function Ro(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",16),s.Vb(1,"input",31,32),s.dc("ngModelChange",function(t){return s.zc(e),s.hc().fees=t}),s.Ub(),s.Ic(3,Ko,2,0,"mat-error",19),s.Ub()}if(2&e){const e=s.hc();s.Db(1),s.oc("ngModel",e.fees)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.fees)}}function Mo(e,t){if(1&e&&(s.Vb(0,"div",33),s.Qb(1,"fa-icon",12),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.bumpFeeError)}}let Eo=(()=>{class e{constructor(e,t,n,a){this.dialogRef=e,this.data=t,this.store=n,this.dataService=a,this.transTypes=[...f.x],this.selTransType="1",this.blocks=null,this.fees=null,this.outputIndex=null,this.faInfoCircle=p.t,this.faExclamationTriangle=p.o,this.bumpFeeError="",this.unSubs=[new u.a,new u.a]}set payReq(e){e&&(this.outputIdx=e)}ngOnInit(){this.transTypes=this.transTypes.splice(1),this.bumpFeeChannel=this.data.pendingChannel;const e=this.bumpFeeChannel.channel&&this.bumpFeeChannel.channel.channel_point?this.bumpFeeChannel.channel.channel_point.split(":"):[];this.bumpFeeChannel.channel.txid_str=e[0]?e[0]:this.bumpFeeChannel.channel&&this.bumpFeeChannel.channel.channel_point?this.bumpFeeChannel.channel.channel_point:"",this.bumpFeeChannel.channel.output_index=e[1]?+e[1]:null}onBumpFee(){return this.outputIndex===this.bumpFeeChannel.channel.output_index?(this.outputIdx.control.setErrors({pendingChannelOutputIndex:!0}),!0):!this.outputIndex&&0!==this.outputIndex||!("1"!==this.selTransType||this.blocks&&0!==this.blocks)||!("2"!==this.selTransType||this.fees&&0!==this.fees)||void this.dataService.bumpFee(this.bumpFeeChannel.channel.txid_str,this.outputIndex,this.blocks,this.fees).pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.dialogRef.close(!1)},e=>{console.error(e),this.bumpFeeError=e.message?e.message:e})}resetData(){this.bumpFeeError="",this.selTransType="1",this.blocks=null,this.fees=null,this.outputIdx.control.setErrors(null)}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(x.h),s.Pb(tt.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-bump-fee"]],viewQuery:function(e,t){if(1&e&&s.Pc(ko,!0),2&e){let e;s.vc(e=s.ec())&&(t.payReq=e.first)}},decls:47,vars:13,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"],["fxLayout","column",1,"bordered-box","my-2","p-2"],["fxLayoutAlign","start center",1,"pb-1","word-break"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","100"],[1,"pl-1"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex.gt-sm","32","fxLayoutAlign","start end"],["matInput","","placeholder","Index for Change Output","type","number","tabindex","1","required","","name","outputIdx",3,"ngModel","step","min","ngModelChange"],["outputIdx","ngModel"],[4,"ngIf"],["fxFlex.gt-sm","32"],["tabindex","2",3,"value","valueChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex.gt-sm","32","fxLayoutAlign","start end",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","reset","tabindex","5","default","",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","6",3,"click"],[3,"value"],["matInput","","placeholder","Number of Blocks","type","number","name","blocks","required","","tabindex","3",3,"ngModel","step","min","ngModelChange"],["blcks","ngModel"],["matInput","","placeholder","Fees (Sats/Byte)","type","number","name","fees","required","","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"]],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,"Bump Fee"),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),s.Vb(10,"div",8),s.Vb(11,"p",9),s.Kc(12),s.Ub(),s.Vb(13,"div",10),s.Vb(14,"div",11),s.Qb(15,"fa-icon",12),s.Vb(16,"span",13),s.Kc(17,"Bumping fee on pending open channels is an advanced feature, attempt it only if you are familiar with the functionality of Bitcoin transactions. "),s.Vb(18,"div"),s.Kc(19,"Before attempting fee bump ensure the following:"),s.Ub(),s.Vb(20,"div",14),s.Kc(21,"1: Use a Bitcoin block explorer to ensure that channel opening transaction is not confirmed."),s.Ub(),s.Vb(22,"div",14),s.Kc(23,"2: The channel opening transaction must have a sizable change output, which can be spent further. The fee cannot be bumped without the change output."),s.Ub(),s.Vb(24,"div",14),s.Kc(25,"3: Find the index value of the change output via a block explorer."),s.Ub(),s.Vb(26,"div",14),s.Kc(27,"4: Enter the index value of the change output in the form below and the desired fee rate."),s.Ub(),s.Vb(28,"div",14),s.Kc(29,"5: Upon successful fee bump, use your block explorer to track the child transaction in the mempool, which should be linked with the change output transaction."),s.Ub(),s.Ub(),s.Ub(),s.Vb(30,"div",15),s.Vb(31,"mat-form-field",16),s.Vb(32,"input",17,18),s.dc("ngModelChange",function(e){return t.outputIndex=e}),s.Ub(),s.Ic(34,Fo,2,0,"mat-error",19),s.Ic(35,Ao,2,0,"mat-error",19),s.Ub(),s.Vb(36,"mat-form-field",20),s.Vb(37,"mat-select",21),s.dc("valueChange",function(e){return t.selTransType=e})("selectionChange",function(){return t.blocks=null,t.fees=null}),s.Ic(38,To,2,2,"mat-option",22),s.Ub(),s.Ub(),s.Ic(39,Oo,4,4,"mat-form-field",23),s.Ic(40,Ro,4,4,"mat-form-field",23),s.Ub(),s.Ic(41,Mo,4,2,"div",24),s.Ub(),s.Ub(),s.Vb(42,"div",25),s.Vb(43,"button",26),s.dc("click",function(){return t.resetData()}),s.Kc(44,"Clear"),s.Ub(),s.Vb(45,"button",27),s.dc("click",function(){return t.onBumpFee()}),s.Kc(46),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.wc(33);s.Db(12),s.Mc("Bump fee for channel point: ",null==t.bumpFeeChannel||null==t.bumpFeeChannel.channel?null:t.bumpFeeChannel.channel.channel_point,""),s.Db(3),s.oc("icon",t.faInfoCircle),s.Db(17),s.oc("ngModel",t.outputIndex)("step",1)("min",0),s.Db(2),s.oc("ngIf",null==e.errors?null:e.errors.required),s.Db(1),s.oc("ngIf",null==e.errors?null:e.errors.pendingChannelOutputIndex),s.Db(2),s.oc("value",t.selTransType),s.Db(1),s.oc("ngForOf",t.transTypes),s.Db(1),s.oc("ngIf","1"==t.selTransType),s.Db(1),s.oc("ngIf","2"==t.selTransType),s.Db(1),s.oc("ngIf",""!==t.bumpFeeError),s.Db(5),s.Lc(""!==t.bumpFeeError?"Retry Bump Fee":"Bump Fee")}},directives:[c.c,c.a,V.c,c.b,S.a,V.b,be.u,be.n,be.o,C.a,O.c,ue.b,be.q,be.c,he.a,be.s,be.m,be.p,a.o,me.a,a.n,O.b,fe.m],styles:[""]}),e})();function zo(e,t){1&e&&s.Qb(0,"mat-progress-bar",36)}function No(e,t){1&e&&(s.Vb(0,"mat-header-cell",37),s.Kc(1," Peer "),s.Ub())}const Bo=function(e){return{"max-width":e}};function Go(e,t){if(1&e&&(s.Vb(0,"mat-cell",38),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Bo,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),s.Db(1),s.Lc(e.channel.remote_alias)}}function qo(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Commit Fee (Sats) "),s.Ub())}function Qo(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.commit_fee))}}function Ho(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Commit Weight "),s.Ub())}function jo(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.commit_weight))}}function $o(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Capacity (Sats)"),s.Ub())}function Wo(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.capacity))}}function Xo(e,t){1&e&&(s.Vb(0,"mat-header-cell",41),s.Kc(1,"Actions"),s.Ub())}function Jo(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-cell",42),s.Vb(1,"div",43),s.Vb(2,"mat-select",44),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",45),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onOpenClick(n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",45),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onBumpFee(n)}),s.Kc(7,"Bump Fee"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Yo(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No pending channels."),s.Ub())}function Zo(e,t){if(1&e&&(s.Vb(0,"td",46),s.Ic(1,Yo,2,0,"p",47),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.pendingOpenChannels||!(null!=e.pendingOpenChannels&&e.pendingOpenChannels.data)||(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)<1)}}const es=function(e){return{"display-none":e}};function ts(e,t){if(1&e&&s.Qb(0,"tr",48),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,es,e.pendingOpenChannels&&(null==e.pendingOpenChannels?null:e.pendingOpenChannels.data)&&(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)>0))}}function ns(e,t){1&e&&s.Qb(0,"mat-header-row")}function as(e,t){1&e&&s.Qb(0,"mat-row",49)}function is(e,t){1&e&&s.Qb(0,"mat-progress-bar",36)}function os(e,t){1&e&&(s.Vb(0,"mat-header-cell",37),s.Kc(1," Peer "),s.Ub())}function ss(e,t){if(1&e&&(s.Vb(0,"mat-cell",38),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Bo,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),s.Db(1),s.Lc(e.channel.remote_alias)}}function cs(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Recovered Balance (Sats) "),s.Ub())}function ls(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.recovered_balance))}}function rs(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Limbo Balance (Sats) "),s.Ub())}function bs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.limbo_balance))}}function us(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1,"Capacity (Sats) "),s.Ub())}function ds(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.capacity))}}function hs(e,t){1&e&&(s.Vb(0,"mat-header-cell",50),s.Kc(1,"Actions"),s.Ub())}function ms(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-cell",51),s.Vb(1,"button",52),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onForceClosingClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function ps(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No pending channels."),s.Ub())}function fs(e,t){if(1&e&&(s.Vb(0,"td",46),s.Ic(1,ps,2,0,"p",47),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.pendingForceClosingChannels||!(null!=e.pendingForceClosingChannels&&e.pendingForceClosingChannels.data)||(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)<1)}}function gs(e,t){if(1&e&&s.Qb(0,"tr",48),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,es,e.pendingForceClosingChannels&&(null==e.pendingForceClosingChannels?null:e.pendingForceClosingChannels.data)&&(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)>0))}}function ys(e,t){1&e&&s.Qb(0,"mat-header-row")}function xs(e,t){1&e&&s.Qb(0,"mat-row",49)}function vs(e,t){1&e&&s.Qb(0,"mat-progress-bar",36)}function ws(e,t){1&e&&(s.Vb(0,"mat-header-cell",53),s.Kc(1," Peer "),s.Ub())}function Cs(e,t){if(1&e&&(s.Vb(0,"mat-cell",54),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Bo,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),s.Db(1),s.Lc(e.channel.remote_alias)}}function Us(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Local Balance (Sats) "),s.Ub())}function Vs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.local_balance))}}function Ds(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function Ss(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.remote_balance))}}function Ls(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Capacity (Sats) "),s.Ub())}function Is(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.capacity))}}function _s(e,t){1&e&&(s.Vb(0,"mat-header-cell",50),s.Kc(1,"Actions"),s.Ub())}function ks(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-cell",51),s.Vb(1,"button",55),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onClosingClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Fs(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No pending channels."),s.Ub())}function As(e,t){if(1&e&&(s.Vb(0,"td",46),s.Ic(1,Fs,2,0,"p",47),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.pendingClosingChannels||!(null!=e.pendingClosingChannels&&e.pendingClosingChannels.data)||(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)<1)}}function Ts(e,t){if(1&e&&s.Qb(0,"tr",48),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,es,e.pendingClosingChannels&&(null==e.pendingClosingChannels?null:e.pendingClosingChannels.data)&&(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)>0))}}function Ps(e,t){1&e&&s.Qb(0,"mat-header-row")}function Os(e,t){1&e&&s.Qb(0,"mat-row",49)}function Ks(e,t){1&e&&s.Qb(0,"mat-progress-bar",36)}function Rs(e,t){1&e&&(s.Vb(0,"mat-header-cell",53),s.Kc(1," Peer "),s.Ub())}function Ms(e,t){if(1&e&&(s.Vb(0,"mat-cell",54),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Bo,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),s.Db(1),s.Lc(e.channel.remote_alias)}}function Es(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Limbo Balance (Sats) "),s.Ub())}function zs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc("",s.jc(2,1,e.limbo_balance)," ")}}function Ns(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Local Balance (Sats) "),s.Ub())}function Bs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.local_balance))}}function Gs(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function qs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.remote_balance))}}function Qs(e,t){1&e&&(s.Vb(0,"mat-header-cell",39),s.Kc(1," Capacity (Sats) "),s.Ub())}function Hs(e,t){if(1&e&&(s.Vb(0,"mat-cell",40),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(s.jc(2,1,e.channel.capacity))}}function js(e,t){1&e&&(s.Vb(0,"mat-header-cell",50),s.Kc(1,"Actions"),s.Ub())}function $s(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-cell",51),s.Vb(1,"button",56),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onWaitClosingClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Ws(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No pending channels."),s.Ub())}function Xs(e,t){if(1&e&&(s.Vb(0,"td",46),s.Ic(1,Ws,2,0,"p",47),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.pendingWaitClosingChannels||!(null!=e.pendingWaitClosingChannels&&e.pendingWaitClosingChannels.data)||(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)<1)}}const Js=function(e){return{"py-0":!0,"display-none":e}};function Ys(e,t){if(1&e&&s.Qb(0,"tr",48),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Js,e.pendingWaitClosingChannels&&(null==e.pendingWaitClosingChannels?null:e.pendingWaitClosingChannels.data)&&(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)>0))}}function Zs(e,t){1&e&&s.Qb(0,"mat-header-row")}function ec(e,t){1&e&&s.Qb(0,"mat-row",49)}const tc=function(e){return{"w-100 error-border bordered-box":e,"bordered-box w-100":!0}},nc=function(){return["no_pending_open"]},ac=function(e){return{"error-border bordered-box":e,"bordered-box":!0}},ic=function(){return["no_pending_force_closing"]},oc=function(){return["no_pending_closing"]},sc=function(){return["no_pending_wait_closing"]};let cc=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.commonService=n,this.selNode={},this.selectedFilter="",this.information={},this.pendingChannels={},this.displayedOpenColumns=["remote_alias","commit_fee","commit_weight","capacity","actions"],this.pendingOpenChannelsLength=0,this.displayedForceClosingColumns=["remote_alias","recovered_balance","limbo_balance","capacity","actions"],this.pendingForceClosingChannelsLength=0,this.displayedClosingColumns=["remote_alias","local_balance","remote_balance","capacity","actions"],this.pendingClosingChannelsLength=0,this.displayedWaitClosingColumns=["remote_alias","limbo_balance","local_balance","remote_balance","actions"],this.pendingWaitClosingChannelsLength=0,this.flgLoading=[!0],this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.displayedOpenColumns=["remote_alias","actions"],this.displayedForceClosingColumns=["remote_alias","actions"],this.displayedClosingColumns=["remote_alias","actions"],this.displayedWaitClosingColumns=["remote_alias","actions"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.displayedOpenColumns=["remote_alias","commit_fee","actions"],this.displayedForceClosingColumns=["remote_alias","limbo_balance","actions"],this.displayedClosingColumns=["remote_alias","remote_balance","actions"],this.displayedWaitClosingColumns=["remote_alias","limbo_balance","actions"]):(this.displayedOpenColumns=["remote_alias","commit_fee","commit_weight","capacity","actions"],this.displayedForceClosingColumns=["remote_alias","recovered_balance","limbo_balance","capacity","actions"],this.displayedClosingColumns=["remote_alias","local_balance","remote_balance","capacity","actions"],this.displayedWaitClosingColumns=["remote_alias","limbo_balance","local_balance","remote_balance","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels/pending"===e.action&&(this.flgLoading[0]="error")}),this.selNode=e.nodeSettings,this.information=e.information,this.pendingChannels=e.pendingChannels,this.pendingChannels.total_limbo_balance&&(this.flgLoading[1]=!1),this.pendingChannels.pending_open_channels&&this.pendingChannels.pending_open_channels.length&&this.pendingChannels.pending_open_channels.length>0&&this.loadOpenChannelsTable(this.pendingChannels.pending_open_channels),this.pendingChannels.pending_force_closing_channels&&this.pendingChannels.pending_force_closing_channels.length&&this.pendingChannels.pending_force_closing_channels.length>0&&this.loadForceClosingChannelsTable(this.pendingChannels.pending_force_closing_channels),this.pendingChannels.pending_closing_channels&&this.pendingChannels.pending_closing_channels.length&&this.pendingChannels.pending_closing_channels.length>0&&this.loadClosingChannelsTable(this.pendingChannels.pending_closing_channels),this.pendingChannels.waiting_close_channels&&this.pendingChannels.waiting_close_channels.length&&this.pendingChannels.waiting_close_channels.length>0&&this.loadWaitClosingChannelsTable(this.pendingChannels.waiting_close_channels),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.information.identity_pubkey),this.logger.info(e)})}ngAfterViewInit(){this.pendingChannels.pending_open_channels&&this.pendingChannels.pending_open_channels.length&&this.pendingChannels.pending_open_channels.length>0&&this.loadOpenChannelsTable(this.pendingChannels.pending_open_channels),this.pendingChannels.pending_force_closing_channels&&this.pendingChannels.pending_force_closing_channels.length&&this.pendingChannels.pending_force_closing_channels.length>0&&this.loadForceClosingChannelsTable(this.pendingChannels.pending_force_closing_channels),this.pendingChannels.pending_closing_channels&&this.pendingChannels.pending_closing_channels.length&&this.pendingChannels.pending_closing_channels.length>0&&this.loadClosingChannelsTable(this.pendingChannels.pending_closing_channels),this.pendingChannels.waiting_close_channels&&this.pendingChannels.waiting_close_channels.length&&this.pendingChannels.waiting_close_channels.length>0&&this.loadWaitClosingChannelsTable(this.pendingChannels.waiting_close_channels)}onOpenClick(e){const t=JSON.parse(JSON.stringify(e,["commit_weight","confirmation_height","fee_per_kw","commit_fee"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Opening Channel Information",message:[[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.h.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.h.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.h.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.h.NUMBER},{key:"confirmation_height",value:a.confirmation_height,title:"Confirmation Height",width:25,type:f.h.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.h.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:25,type:f.h.NUMBER}],[{key:"fee_per_kw",value:a.fee_per_kw,title:"Fee/KW",width:25,type:f.h.NUMBER},{key:"commit_weight",value:a.commit_weight,title:"Commit Weight",width:25,type:f.h.NUMBER},{key:"commit_fee",value:a.commit_fee,title:"Commit Fee",width:50,type:f.h.NUMBER}]]}}))}onBumpFee(e){this.store.dispatch(new H.D({data:{pendingChannel:e,component:Eo}}))}onForceClosingClick(e){const t=JSON.parse(JSON.stringify(e,["closing_txid","limbo_balance","maturity_height","blocks_til_maturity","recovered_balance"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Force Closing Channel Information",message:[[{key:"closing_txid",value:a.closing_txid,title:"Closing Transaction ID",width:100,type:f.h.STRING}],[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.h.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.h.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.h.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.h.NUMBER},{key:"limbo_balance",value:a.limbo_balance,title:"Limbo Balance",width:25,type:f.h.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.h.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:25,type:f.h.NUMBER}],[{key:"maturity_height",value:a.maturity_height,title:"Maturity Height",width:25,type:f.h.NUMBER},{key:"blocks_til_maturity",value:a.blocks_til_maturity,title:"Blocks Till Maturity",width:25,type:f.h.NUMBER},{key:"recovered_balance",value:a.recovered_balance,title:"Recovered Balance",width:50,type:f.h.NUMBER}]]}}))}onClosingClick(e){const t=JSON.parse(JSON.stringify(e,["closing_txid"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Closing Channel Information",message:[[{key:"closing_txid",value:a.closing_txid,title:"Closing Transaction ID",width:50,type:f.h.STRING}],[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.h.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.h.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.h.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.h.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.h.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:50,type:f.h.NUMBER}]]}}))}onWaitClosingClick(e){const t=JSON.parse(JSON.stringify(e,["limbo_balance"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Wait Closing Channel Information",message:[[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.h.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.h.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.h.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.h.NUMBER},{key:"limbo_balance",value:a.limbo_balance,title:"Limbo Balance",width:25,type:f.h.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.h.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:25,type:f.h.NUMBER}]]}}))}loadOpenChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?-1:1}),this.pendingOpenChannelsLength=e.length?e.length:0,this.pendingOpenChannels=new le.o([...e]),this.pendingOpenChannels.sort=this.sort,this.pendingOpenChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingOpenChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingOpenChannels)}loadForceClosingChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?-1:1}),this.pendingForceClosingChannelsLength=e.length?e.length:0,this.pendingForceClosingChannels=new le.o([...e]),this.pendingForceClosingChannels.sort=this.sort,this.pendingForceClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingForceClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingForceClosingChannels)}loadClosingChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?-1:1}),this.pendingClosingChannelsLength=e.length?e.length:0,this.pendingClosingChannels=new le.o([...e]),this.pendingClosingChannels.sort=this.sort,this.pendingClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingClosingChannels)}loadWaitClosingChannelsTable(e){e.sort(function(e,t){return e.active===t.active?0:t.active?-1:1}),this.pendingWaitClosingChannelsLength=e.length?e.length:0,this.pendingWaitClosingChannels=new le.o([...e]),this.pendingWaitClosingChannels.sort=this.sort,this.pendingWaitClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingWaitClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingWaitClosingChannels)}applyFilter(e){this.selectedFilter=e.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(x.h),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-pending-table"]],viewQuery:function(e,t){if(1&e&&s.Pc(ce.a,!0),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first)}},decls:120,vars:44,consts:[["fxLayout","column",1,"mb-2"],[1,"page-title"],["displayMode","flat",1,"mt-1"],["mode","indeterminate",4,"ngIf"],["fxLayout","column",1,"flat-expansion-panel"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","remote_alias"],["mat-sort-header","",4,"matHeaderCellDef"],[3,"ngStyle",4,"matCellDef"],["matColumnDef","commit_fee"],["fxLayoutAlign","end center","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","commit_weight"],["matColumnDef","capacity"],["matColumnDef","actions"],["fxLayoutAlign","end center","class","pl-3 pr-4",4,"matHeaderCellDef"],["fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_pending_open"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","","fxLayoutAlign","start center",3,"ngClass",4,"matFooterRowDef"],[4,"matHeaderRowDef"],["fxLayoutAlign","stretch stretch",4,"matRowDef","matRowDefColumns"],[1,"table-container",3,"perfectScrollbar"],["matColumnDef","recovered_balance"],["matColumnDef","limbo_balance"],["fxLayoutAlign","end center","class","pl-4 pr-3",4,"matHeaderCellDef"],["fxLayoutAlign","end center","class","pl-4",4,"matCellDef"],["matColumnDef","no_pending_force_closing"],["class","pl-2","mat-sort-header","",4,"matHeaderCellDef"],["class","pl-2",3,"ngStyle",4,"matCellDef"],["matColumnDef","local_balance"],["matColumnDef","remote_balance"],["matColumnDef","no_pending_closing"],["matColumnDef","no_pending_wait_closing"],["mode","indeterminate"],["mat-sort-header",""],[3,"ngStyle"],["fxLayoutAlign","end center","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"pl-3","pr-4"],["fxLayoutAlign","end center",1,"px-3"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","","fxLayoutAlign","start center",3,"ngClass"],["fxLayoutAlign","stretch stretch"],["fxLayoutAlign","end center",1,"pl-4","pr-3"],["fxLayoutAlign","end center",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","2",3,"click"],["mat-sort-header","",1,"pl-2"],[1,"pl-2",3,"ngStyle"],["mat-stroked-button","","color","primary","type","button","tabindex","3",3,"click"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"span",1),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Vb(4,"mat-accordion",2),s.Ic(5,zo,1,0,"mat-progress-bar",3),s.Vb(6,"mat-expansion-panel",4),s.Vb(7,"mat-expansion-panel-header"),s.Vb(8,"mat-panel-title"),s.Kc(9),s.Ub(),s.Ub(),s.Vb(10,"div",5),s.Vb(11,"mat-table",6,7),s.Tb(13,8),s.Ic(14,No,2,0,"mat-header-cell",9),s.Ic(15,Go,2,4,"mat-cell",10),s.Sb(),s.Tb(16,11),s.Ic(17,qo,2,0,"mat-header-cell",12),s.Ic(18,Qo,3,3,"mat-cell",13),s.Sb(),s.Tb(19,14),s.Ic(20,Ho,2,0,"mat-header-cell",12),s.Ic(21,jo,3,3,"mat-cell",13),s.Sb(),s.Tb(22,15),s.Ic(23,$o,2,0,"mat-header-cell",12),s.Ic(24,Wo,3,3,"mat-cell",13),s.Sb(),s.Tb(25,16),s.Ic(26,Xo,2,0,"mat-header-cell",17),s.Ic(27,Jo,8,0,"mat-cell",18),s.Sb(),s.Tb(28,19),s.Ic(29,Zo,2,1,"td",20),s.Sb(),s.Ic(30,ts,1,3,"tr",21),s.Ic(31,ns,1,0,"mat-header-row",22),s.Ic(32,as,1,0,"mat-row",23),s.Ub(),s.Ub(),s.Ub(),s.Ic(33,is,1,0,"mat-progress-bar",3),s.Vb(34,"mat-expansion-panel",4),s.Vb(35,"mat-expansion-panel-header"),s.Vb(36,"mat-panel-title"),s.Kc(37),s.Ub(),s.Ub(),s.Vb(38,"div",24),s.Vb(39,"mat-table",6,7),s.Tb(41,8),s.Ic(42,os,2,0,"mat-header-cell",9),s.Ic(43,ss,2,4,"mat-cell",10),s.Sb(),s.Tb(44,25),s.Ic(45,cs,2,0,"mat-header-cell",12),s.Ic(46,ls,3,3,"mat-cell",13),s.Sb(),s.Tb(47,26),s.Ic(48,rs,2,0,"mat-header-cell",12),s.Ic(49,bs,3,3,"mat-cell",13),s.Sb(),s.Tb(50,15),s.Ic(51,us,2,0,"mat-header-cell",12),s.Ic(52,ds,3,3,"mat-cell",13),s.Sb(),s.Tb(53,16),s.Ic(54,hs,2,0,"mat-header-cell",27),s.Ic(55,ms,3,0,"mat-cell",28),s.Sb(),s.Tb(56,29),s.Ic(57,fs,2,1,"td",20),s.Sb(),s.Ic(58,gs,1,3,"tr",21),s.Ic(59,ys,1,0,"mat-header-row",22),s.Ic(60,xs,1,0,"mat-row",23),s.Ub(),s.Ub(),s.Ub(),s.Ic(61,vs,1,0,"mat-progress-bar",3),s.Vb(62,"mat-expansion-panel",4),s.Vb(63,"mat-expansion-panel-header"),s.Vb(64,"mat-panel-title"),s.Kc(65),s.Ub(),s.Ub(),s.Vb(66,"div",24),s.Vb(67,"mat-table",6,7),s.Tb(69,8),s.Ic(70,ws,2,0,"mat-header-cell",30),s.Ic(71,Cs,2,4,"mat-cell",31),s.Sb(),s.Tb(72,32),s.Ic(73,Us,2,0,"mat-header-cell",12),s.Ic(74,Vs,3,3,"mat-cell",13),s.Sb(),s.Tb(75,33),s.Ic(76,Ds,2,0,"mat-header-cell",12),s.Ic(77,Ss,3,3,"mat-cell",13),s.Sb(),s.Tb(78,15),s.Ic(79,Ls,2,0,"mat-header-cell",12),s.Ic(80,Is,3,3,"mat-cell",13),s.Sb(),s.Tb(81,16),s.Ic(82,_s,2,0,"mat-header-cell",27),s.Ic(83,ks,3,0,"mat-cell",28),s.Sb(),s.Tb(84,34),s.Ic(85,As,2,1,"td",20),s.Sb(),s.Ic(86,Ts,1,3,"tr",21),s.Ic(87,Ps,1,0,"mat-header-row",22),s.Ic(88,Os,1,0,"mat-row",23),s.Ub(),s.Ub(),s.Ub(),s.Ic(89,Ks,1,0,"mat-progress-bar",3),s.Vb(90,"mat-expansion-panel",4),s.Vb(91,"mat-expansion-panel-header"),s.Vb(92,"mat-panel-title"),s.Kc(93),s.Ub(),s.Ub(),s.Vb(94,"div",24),s.Vb(95,"mat-table",6,7),s.Tb(97,8),s.Ic(98,Rs,2,0,"mat-header-cell",30),s.Ic(99,Ms,2,4,"mat-cell",31),s.Sb(),s.Tb(100,26),s.Ic(101,Es,2,0,"mat-header-cell",12),s.Ic(102,zs,3,3,"mat-cell",13),s.Sb(),s.Tb(103,32),s.Ic(104,Ns,2,0,"mat-header-cell",12),s.Ic(105,Bs,3,3,"mat-cell",13),s.Sb(),s.Tb(106,33),s.Ic(107,Gs,2,0,"mat-header-cell",12),s.Ic(108,qs,3,3,"mat-cell",13),s.Sb(),s.Tb(109,15),s.Ic(110,Qs,2,0,"mat-header-cell",12),s.Ic(111,Hs,3,3,"mat-cell",13),s.Sb(),s.Tb(112,16),s.Ic(113,js,2,0,"mat-header-cell",27),s.Ic(114,$s,3,0,"mat-cell",28),s.Sb(),s.Tb(115,35),s.Ic(116,Xs,2,1,"td",20),s.Sb(),s.Ic(117,Ys,1,3,"tr",21),s.Ic(118,Zs,1,0,"mat-header-row",22),s.Ic(119,ec,1,0,"mat-row",23),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(2),s.Nc("Total Limbo Balance: ",s.jc(3,30,t.pendingChannels.total_limbo_balance)," ",null==t.information?null:t.information.smaller_currency_unit,""),s.Db(3),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(4),s.Mc("Pending Open (",t.pendingOpenChannelsLength,")"),s.Db(2),s.oc("dataSource",t.pendingOpenChannels)("ngClass",s.sc(32,tc,"error"===t.flgLoading[0])),s.Db(19),s.oc("matFooterRowDef",s.rc(34,nc)),s.Db(1),s.oc("matHeaderRowDef",t.displayedOpenColumns),s.Db(1),s.oc("matRowDefColumns",t.displayedOpenColumns),s.Db(1),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(4),s.Mc("Pending Force Closing (",t.pendingForceClosingChannelsLength,")"),s.Db(2),s.oc("dataSource",t.pendingForceClosingChannels)("ngClass",s.sc(35,ac,"error"===t.flgLoading[0])),s.Db(19),s.oc("matFooterRowDef",s.rc(37,ic)),s.Db(1),s.oc("matHeaderRowDef",t.displayedForceClosingColumns),s.Db(1),s.oc("matRowDefColumns",t.displayedForceClosingColumns),s.Db(1),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(4),s.Mc("Pending Closing (",t.pendingClosingChannelsLength,")"),s.Db(2),s.oc("dataSource",t.pendingClosingChannels)("ngClass",s.sc(38,ac,"error"===t.flgLoading[0])),s.Db(19),s.oc("matFooterRowDef",s.rc(40,oc)),s.Db(1),s.oc("matHeaderRowDef",t.displayedClosingColumns),s.Db(1),s.oc("matRowDefColumns",t.displayedClosingColumns),s.Db(1),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(4),s.Mc("Waiting Close (",t.pendingWaitClosingChannelsLength,")"),s.Db(2),s.oc("dataSource",t.pendingWaitClosingChannels)("ngClass",s.sc(41,ac,"error"===t.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(43,sc)),s.Db(1),s.oc("matHeaderRowDef",t.displayedWaitClosingColumns),s.Db(1),s.oc("matRowDefColumns",t.displayedWaitClosingColumns))},directives:[c.c,nt.a,a.o,nt.c,nt.e,nt.f,c.b,c.a,M.b,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,l.a,le.h,ce.b,le.a,a.p,I.b,me.a,me.c,fe.m,le.d,le.f,le.j,le.l,S.a],pipes:[a.f],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tr.mat-footer-row[_ngcontent-%COMP%] td.mat-footer-cell[_ngcontent-%COMP%]{border-bottom:none}"]}),e})();function lc(e,t){1&e&&s.Qb(0,"mat-progress-bar",28)}function rc(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Close Type "),s.Ub())}function bc(e,t){if(1&e&&(s.Vb(0,"td",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("matTooltip",n.channelClosureType[e.close_type].tooltip),s.Db(1),s.Mc("",n.channelClosureType[e.close_type].name," ")}}function uc(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Peer "),s.Ub())}const dc=function(e){return{"max-width":e}};function hc(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,dc,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(1),s.Mc(" ",e.remote_alias," ")}}function mc(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Capacity "),s.Ub())}function pc(e,t){if(1&e&&(s.Vb(0,"td",33),s.Vb(1,"span",34),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,e.capacity)," ")}}function fc(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Close Height "),s.Ub())}function gc(e,t){if(1&e&&(s.Vb(0,"td",33),s.Vb(1,"span",34),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,e.close_height)," ")}}function yc(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Settled Balance "),s.Ub())}function xc(e,t){if(1&e&&(s.Vb(0,"td",33),s.Vb(1,"span",34),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,e.settled_balance)," ")}}function vc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",35),s.Vb(1,"div",36),s.Vb(2,"mat-select",37),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",38),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 wc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",39),s.Vb(1,"span",34),s.Vb(2,"button",40),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc().onClosedChannelClick(a,n)}),s.Kc(3,"View Info"),s.Ub(),s.Ub(),s.Ub()}}function Cc(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No closed channels available."),s.Ub())}function Uc(e,t){if(1&e&&(s.Vb(0,"td",41),s.Ic(1,Cc,2,0,"p",42),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.closedChannels&&e.closedChannels.data)||(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)<1)}}const Vc=function(e){return{"display-none":e}};function Dc(e,t){if(1&e&&s.Qb(0,"tr",43),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Vc,(null==e.closedChannels?null:e.closedChannels.data)&&(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)>0))}}function Sc(e,t){1&e&&s.Qb(0,"tr",44)}function Lc(e,t){1&e&&s.Qb(0,"tr",45)}const Ic=function(e){return{"error-border":e}},_c=function(){return["no_closed_channel"]};let kc=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.actions$=n,this.commonService=a,this.channelClosureType=f.d,this.faHistory=p.r,this.displayedColumns=[],this.closedChannelsData=[],this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unsub=[new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","actions"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["close_type","remote_alias","settled_balance","actions"]):(this.flgSticky=!0,this.displayedColumns=["close_type","remote_alias","capacity","close_height","settled_balance","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unsub[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels/closed"===e.action&&(this.flgLoading[0]="error")}),this.closedChannelsData=e.closedChannels,this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.closedChannels),this.logger.info(e)})}ngAfterViewInit(){this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData)}applyFilter(e){this.closedChannels.filter=e.value.trim().toLowerCase()}onClosedChannelClick(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Closed Channel Information",message:[[{key:"close_type",value:this.channelClosureType[e.close_type].name,title:"Close Type",width:30,type:f.h.STRING},{key:"settled_balance",value:e.settled_balance,title:"Settled Balance",width:30,type:f.h.NUMBER},{key:"time_locked_balance",value:e.time_locked_balance,title:"Time Locked Balance",width:40,type:f.h.NUMBER}],[{key:"chan_id",value:e.chan_id,title:"Channel ID",width:30},{key:"capacity",value:e.capacity,title:"Capacity",width:30,type:f.h.NUMBER},{key:"close_height",value:e.close_height,title:"Close Height",width:40,type:f.h.NUMBER}],[{key:"remote_alias",value:e.remote_alias,title:"Peer Alias",width:30},{key:"remote_pubkey",value:e.remote_pubkey,title:"Peer Public Key",width:70}],[{key:"channel_point",value:e.channel_point,title:"Channel Point",width:100}],[{key:"closing_tx_hash",value:e.closing_tx_hash,title:"Closing Transaction Hash",width:100,type:f.h.STRING}]]}}))}loadClosedChannelsTable(e){this.closedChannels=new le.o([...e]),this.closedChannels.sort=this.sort,this.closedChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.closedChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.closedChannels.paginator=this.paginator,this.logger.info(this.closedChannels)}onDownloadCSV(){this.closedChannels.data&&this.closedChannels.data.length>0&&this.commonService.downloadFile(this.closedChannels.data,"Closed-channels")}ngOnDestroy(){this.unsub.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(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-closed-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Channels")}])],decls:33,vars:13,consts:[["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"],["fxFlex","30"],["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","close_type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"matTooltip",4,"matCellDef"],["matColumnDef","remote_alias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","capacity"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","close_height"],["matColumnDef","settled_balance"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["matColumnDef","no_closed_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"matTooltip"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(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.Ic(6,lc,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,rc,2,0,"th",10),s.Ic(11,bc,2,2,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,uc,2,0,"th",10),s.Ic(14,hc,2,4,"td",13),s.Sb(),s.Tb(15,14),s.Ic(16,mc,2,0,"th",15),s.Ic(17,pc,4,3,"td",16),s.Sb(),s.Tb(18,17),s.Ic(19,fc,2,0,"th",15),s.Ic(20,gc,4,3,"td",16),s.Sb(),s.Tb(21,18),s.Ic(22,yc,2,0,"th",15),s.Ic(23,xc,4,3,"td",16),s.Sb(),s.Tb(24,19),s.Ic(25,vc,6,0,"th",20),s.Ic(26,wc,4,0,"td",21),s.Sb(),s.Tb(27,22),s.Ic(28,Uc,2,1,"td",23),s.Sb(),s.Ic(29,Dc,1,3,"tr",24),s.Ic(30,Sc,1,0,"tr",25),s.Ic(31,Lc,1,0,"tr",26),s.Ub(),s.Ub(),s.Qb(32,"mat-paginator",27),s.Ub()),2&e&&(s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.closedChannels)("ngClass",s.sc(10,Ic,"error"===t.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(12,_c)),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,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,K.a,a.p,I.b,me.a,me.c,fe.m,S.a,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-close_type[_ngcontent-%COMP%]{flex:0 0 16%;min-width:5rem}.mat-column-remote_alias[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function Fc(e,t){1&e&&s.Qb(0,"mat-progress-bar",27)}function Ac(e,t){1&e&&(s.Vb(0,"th",28),s.Kc(1,"Amount (Sats)"),s.Ub())}function Tc(e,t){if(1&e&&(s.Vb(0,"span",33),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.jc(2,1,null==e?null:e.amount)," ")}}function Pc(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Tc,3,3,"span",32),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.pending_htlcs)}}function Oc(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",30),s.Kc(2),s.Ub(),s.Ic(3,Pc,2,1,"span",31),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Mc(" Active HTLCs: ",null==e||null==e.pending_htlcs?null:e.pending_htlcs.length," "),s.Db(1),s.oc("ngIf",e.is_expanded)}}function Kc(e,t){1&e&&(s.Vb(0,"th",28),s.Kc(1,"Alias/Incoming"),s.Ub())}function Rc(e,t){if(1&e&&(s.Vb(0,"span",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null!=e&&e.incoming?"Yes":"No"," ")}}function Mc(e,t){if(1&e&&(s.Tb(0),s.Ic(1,Rc,2,1,"span",34),s.Sb()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.pending_htlcs)}}function Ec(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",30),s.Kc(2),s.Ub(),s.Ic(3,Mc,2,1,"ng-container",31),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(null==e?null:e.remote_alias),s.Db(1),s.oc("ngIf",e.is_expanded)}}function zc(e,t){1&e&&(s.Vb(0,"th",35),s.Vb(1,"span",36),s.Kc(2,"Expiration Height"),s.Ub(),s.Ub())}function Nc(e,t){if(1&e&&(s.Vb(0,"span",36),s.Kc(1),s.ic(2,"number"),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,null==e?null:e.expiration_height,"1.0-0")," ")}}function Bc(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Nc,3,4,"span",37),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.pending_htlcs)}}function Gc(e,t){if(1&e&&(s.Vb(0,"td",29),s.Vb(1,"span",36),s.Kc(2),s.Ub(),s.Ic(3,Bc,2,1,"span",31),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(" "),s.Db(1),s.oc("ngIf",e.is_expanded)}}function qc(e,t){1&e&&(s.Vb(0,"th",38),s.Vb(1,"span",36),s.Kc(2,"Hash Lock"),s.Ub(),s.Ub())}function Qc(e,t){if(1&e&&(s.Vb(0,"span",36),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.hash_lock," ")}}function Hc(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,Qc,2,1,"span",37),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.pending_htlcs)}}function jc(e,t){if(1&e&&(s.Vb(0,"td",39),s.Vb(1,"span",36),s.Kc(2),s.Ub(),s.Ic(3,Hc,2,1,"span",31),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(" "),s.Db(1),s.oc("ngIf",e.is_expanded)}}function $c(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",40),s.Vb(1,"div",41),s.Vb(2,"mat-select",42),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",43),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 Wc(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",45),s.Vb(1,"button",48),s.dc("click",function(){s.zc(e);const n=t.$implicit,a=s.hc(2).$implicit;return s.hc().onHTLCClick(n,a)}),s.Kc(2),s.Ub(),s.Ub()}if(2&e){const e=t.index;s.Db(2),s.Mc("View ",e+1,"")}}function Xc(e,t){if(1&e&&(s.Vb(0,"div"),s.Ic(1,Wc,3,1,"div",47),s.Ub()),2&e){const e=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==e?null:e.pending_htlcs)}}function Jc(e,t){if(1&e&&(s.Vb(0,"td",44),s.Vb(1,"span",45),s.Vb(2,"button",46),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,Xc,2,1,"div",31),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 Yc(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No active htlc available."),s.Ub())}function Zc(e,t){if(1&e&&(s.Vb(0,"td",49),s.Ic(1,Yc,2,0,"p",31),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)}}const el=function(e){return{"display-none":e}};function tl(e,t){if(1&e&&s.Qb(0,"tr",50),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,el,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function nl(e,t){1&e&&s.Qb(0,"tr",51)}function al(e,t){1&e&&s.Qb(0,"tr",52)}const il=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},ol=function(){return["no_channel"]};let sl=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.flgLoading=[!0],this.channelsJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["amount","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["amount","incoming","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["amount","incoming","expiration_height","actions"]):(this.flgSticky=!0,this.displayedColumns=["amount","incoming","expiration_height","hash_lock","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchChannels/all"===e.action&&(this.flgLoading[0]="error")}),this.channelsJSONArr=e.allChannels&&e.allChannels.length>0?e.allChannels.filter(e=>e.pending_htlcs&&e.pending_htlcs.length>0):[],this.loadHTLCsTable(this.channelsJSONArr),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.channelsJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.loadHTLCsTable(this.channelsJSONArr)}onHTLCClick(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"HTLC Information",message:[[{key:"remote_alias",value:t.remote_alias,title:"Alias",width:100,type:f.h.STRING}],[{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:f.h.NUMBER},{key:"incoming",value:e.incoming?"Yes":"No",title:"Incoming",width:50,type:f.h.STRING}],[{key:"expiration_height",value:e.expiration_height,title:"Expiration Height",width:50,type:f.h.NUMBER},{key:"hash_lock",value:e.hash_lock,title:"Hash Lock",width:50,type:f.h.STRING}]]}}))}onChannelClick(e,t){this.store.dispatch(new H.D({data:{channel:e,showCopy:!0,component:ui}}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadHTLCsTable(e){this.channels=new le.o(e?[...e]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>{switch(t){case"amount":return this.commonService.sortByKey(e.pending_htlcs,t,"number",this.sort.direction),e.pending_htlcs&&e.pending_htlcs.length?e.pending_htlcs.length:null;case"incoming":return this.commonService.sortByKey(e.pending_htlcs,t,"boolean",this.sort.direction),e.remote_alias?e.remote_alias:e.remote_pubkey?e.remote_pubkey:null;case"expiration_height":case"hash_lock":return this.commonService.sortByKey(e.pending_htlcs,t,"number",this.sort.direction),e;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.channels.paginator=this.paginator,this.channels.filterPredicate=(e,t)=>(e.remote_alias+e.pending_htlcs.map(e=>JSON.stringify(e)+(e.incoming?"yes":"no"))).includes(t)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.flattenHTLCs(),"ActiveHTLCs")}flattenHTLCs(){return JSON.parse(JSON.stringify(this.channels.data)).reduce((e,t)=>e.concat(t.pending_htlcs?t.pending_htlcs:t),[])}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-active-htlcs-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("HTLCs")}])],decls:30,vars:13,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","","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","amount"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","incoming"],["matColumnDef","expiration_height"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","hash_lock"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pl-3 htlc-row-span",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-2",4,"matHeaderCellDef"],["mat-cell","","class","px-2",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayoutAlign","start center",1,"htlc-row-span"],[4,"ngIf"],["fxLayoutAlign","start center","class","htlc-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"htlc-row-span","pl-3"],["fxLayoutAlign","start center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",1,"htlc-row-span"],["fxLayoutAlign","end center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pl-3","htlc-row-span"],["mat-cell","",1,"pl-3"],["mat-header-cell","",1,"px-2"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","",1,"px-2"],["fxLayoutAlign","end center"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-htlc-expand",3,"click"],["fxLayoutAlign","end center",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-htlc-info",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.Ic(6,Fc,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,Ac,2,0,"th",10),s.Ic(11,Oc,4,2,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,Kc,2,0,"th",10),s.Ic(14,Ec,4,2,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,zc,3,0,"th",14),s.Ic(17,Gc,4,2,"td",11),s.Sb(),s.Tb(18,15),s.Ic(19,qc,3,0,"th",16),s.Ic(20,jc,4,2,"td",17),s.Sb(),s.Tb(21,18),s.Ic(22,$c,6,0,"th",19),s.Ic(23,Jc,5,2,"td",20),s.Sb(),s.Tb(24,21),s.Ic(25,Zc,2,1,"td",22),s.Sb(),s.Ic(26,tl,1,3,"tr",23),s.Ic(27,nl,1,0,"tr",24),s.Ic(28,al,1,0,"tr",25),s.Ub(),s.Ub(),s.Qb(29,"mat-paginator",26),s.Ub()),2&e&&(s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.channels)("ngClass",s.sc(10,il,"error"===t.flgLoading[0])),s.Db(19),s.oc("matFooterRowDef",s.rc(12,ol)),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,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.n,me.a,me.c,fe.m,S.a,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-amount[_ngcontent-%COMP%], .mat-column-expiration_height[_ngcontent-%COMP%]{flex:0 0 30%;width:30%}.mat-column-hash_lock[_ngcontent-%COMP%], .mat-column-incoming[_ngcontent-%COMP%]{flex:0 0 25%;width:25%;text-overflow:ellipsis}.htlc-row-span[_ngcontent-%COMP%]{min-height:4.2rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}"]}),e})();function cl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Wallet password is required."),s.Ub())}let ll=(()=>{class e{constructor(e){this.store=e,this.walletPassword=""}ngOnInit(){this.walletPassword=""}onUnlockWallet(){if(!this.walletPassword)return!0;this.store.dispatch(new H.G("Unlocking...")),this.store.dispatch(new g.dc({pwd:window.btoa(this.walletPassword)}))}resetData(){this.walletPassword=""}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-unlock-wallet"]],decls:12,vars:2,consts:[["fxLayout","column",1,"padding-gap","mb-2"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between"],["fxFlex","100","fxLayoutAlign","start"],["autoFocus","","matInput","","type","password","placeholder","Password","name","walletPassword","tabindex","1","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","3",3,"click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Vb(1,"form",1),s.Vb(2,"mat-form-field",2),s.Vb(3,"input",3),s.dc("ngModelChange",function(e){return t.walletPassword=e}),s.Ub(),s.Vb(4,"mat-hint"),s.Kc(5,"Enter Wallet Password"),s.Ub(),s.Ic(6,cl,2,0,"mat-error",4),s.Ub(),s.Vb(7,"div",5),s.Vb(8,"button",6),s.dc("click",function(){return t.resetData()}),s.Kc(9,"Clear Field"),s.Ub(),s.Vb(10,"button",7),s.dc("click",function(){return t.onUnlockWallet()}),s.Kc(11,"Unlock Wallet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("ngModel",t.walletPassword),s.Db(3),s.oc("ngIf",!t.walletPassword))},directives:[c.c,be.u,be.n,be.o,c.b,O.c,c.a,ue.b,be.c,de.a,be.s,be.m,be.p,O.f,a.o,S.a,O.b],styles:[""]}),e})();var rl=n("q59W");function bl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div"),s.Vb(1,"form",4),s.Vb(2,"div",5),s.Kc(3,"Warning: Your connection is unsecure, it's not safe to generate private keys over this connection.Are you sure you want to proceed?"),s.Ub(),s.Vb(4,"div",6),s.Vb(5,"button",7),s.dc("click",function(){s.zc(e);const t=s.hc();return t.proceed=!1,t.warnRes=!0}),s.Kc(6,"Do Not Proceed"),s.Ub(),s.Vb(7,"button",8),s.dc("click",function(){s.zc(e);const t=s.hc();return t.proceed=!0,t.warnRes=!0}),s.Kc(8,"Proceed"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function ul(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",9),s.Vb(1,"div",10),s.Kc(2,"Please re-configure & re-start RTL after securing your LND connction. You can close this window now."),s.Ub(),s.Vb(3,"div",6),s.Vb(4,"button",11),s.dc("click",function(){return s.zc(e),s.hc().warnRes=!1}),s.Kc(5,"Go Back"),s.Ub(),s.Ub(),s.Ub()}}function dl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Password is required."),s.Ub())}function hl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Password must be at least 8 characters in length."),s.Ub())}function ml(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Confirm password is required."),s.Ub())}function pl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Confirm password must be at least 8 characters in length."),s.Ub())}function fl(e,t){1&e&&(s.Vb(0,"div",41),s.Vb(1,"mat-icon",42),s.Kc(2,"cancel"),s.Ub(),s.Kc(3,"Passwords do not match. "),s.Ub())}function gl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Cipher seed is required."),s.Ub())}function yl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Invalid Cipher. Enter comma separated 24 words cipher seed."),s.Ub())}function xl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Passphrase is required."),s.Ub())}function vl(e,t){1&e&&(s.Vb(0,"mat-icon"),s.Kc(1,"vpn_key"),s.Ub())}function wl(e,t){1&e&&(s.Vb(0,"mat-icon"),s.Kc(1,"swap_calls"),s.Ub())}function Cl(e,t){1&e&&(s.Vb(0,"mat-icon"),s.Kc(1,"fingerprint"),s.Ub())}function Ul(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-vertical-stepper",12,13),s.Vb(2,"mat-step",14),s.Vb(3,"form",15),s.Vb(4,"mat-form-field",16),s.Qb(5,"input",17),s.Vb(6,"mat-hint"),s.Kc(7,"Enter Wallet Password"),s.Ub(),s.Ic(8,dl,2,0,"mat-error",1),s.Ic(9,hl,2,0,"mat-error",1),s.Ub(),s.Vb(10,"mat-form-field",16),s.Qb(11,"input",18),s.Vb(12,"mat-hint"),s.Kc(13,"Confirm Wallet Password"),s.Ub(),s.Ic(14,ml,2,0,"mat-error",1),s.Ic(15,pl,2,0,"mat-error",1),s.Ub(),s.Ic(16,fl,4,0,"div",19),s.Vb(17,"div",20),s.Vb(18,"button",21),s.Kc(19,"Next"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(20,"mat-step",22),s.Vb(21,"form",23),s.Vb(22,"div",24),s.Vb(23,"mat-slide-toggle",25),s.Kc(24,"Existing Cipher"),s.Ub(),s.Vb(25,"mat-form-field",26),s.Qb(26,"input",27),s.Vb(27,"mat-hint"),s.Kc(28,"Cipher Seed"),s.Ub(),s.Ic(29,gl,2,0,"mat-error",1),s.Ic(30,yl,2,0,"mat-error",1),s.Ub(),s.Ub(),s.Vb(31,"div",28),s.Vb(32,"button",29),s.Kc(33,"Back"),s.Ub(),s.Vb(34,"button",30),s.Kc(35,"Next"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(36,"mat-step",31),s.Vb(37,"form",23),s.Vb(38,"div",24),s.Vb(39,"mat-slide-toggle",32),s.Kc(40,"Existing Passphrase"),s.Ub(),s.Vb(41,"mat-form-field",33),s.Qb(42,"input",34),s.Vb(43,"mat-hint"),s.Kc(44,"Enter Passphrase"),s.Ub(),s.Ic(45,xl,2,0,"mat-error",1),s.Ub(),s.Ub(),s.Vb(46,"div",28),s.Vb(47,"button",35),s.dc("click",function(){return s.zc(e),s.hc().resetData()}),s.Kc(48,"Clear"),s.Ub(),s.Vb(49,"button",36),s.Kc(50,"Back"),s.Ub(),s.Vb(51,"button",37),s.dc("click",function(){return s.zc(e),s.hc().onInitWallet()}),s.Kc(52,"Initialize Wallet"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(53,vl,2,0,"ng-template",38),s.Ic(54,wl,2,0,"ng-template",39),s.Ic(55,Cl,2,0,"ng-template",40),s.Ub()}if(2&e){const e=s.hc();s.oc("linear",!0),s.Db(2),s.oc("stepControl",e.passwordFormGroup),s.Db(1),s.oc("formGroup",e.passwordFormGroup),s.Db(5),s.oc("ngIf",null==e.passwordFormGroup.controls.initWalletPassword.errors?null:e.passwordFormGroup.controls.initWalletPassword.errors.required),s.Db(1),s.oc("ngIf",null==e.passwordFormGroup.controls.initWalletPassword.errors?null:e.passwordFormGroup.controls.initWalletPassword.errors.minlength),s.Db(5),s.oc("ngIf",null==e.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:e.passwordFormGroup.controls.initWalletConfirmPassword.errors.required),s.Db(1),s.oc("ngIf",null==e.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:e.passwordFormGroup.controls.initWalletConfirmPassword.errors.minlength),s.Db(1),s.oc("ngIf",(null==e.passwordFormGroup.errors?null:e.passwordFormGroup.errors.unmatchedPasswords)&&(e.passwordFormGroup.controls.initWalletPassword.touched||e.passwordFormGroup.controls.initWalletPassword.dirty)&&(e.passwordFormGroup.controls.initWalletConfirmPassword.touched||e.passwordFormGroup.controls.initWalletConfirmPassword.dirty)),s.Db(4),s.oc("stepControl",e.cipherFormGroup),s.Db(1),s.oc("formGroup",e.cipherFormGroup),s.Db(2),s.oc("labelPosition","before"),s.Db(6),s.oc("ngIf",null==e.cipherFormGroup.controls.cipherSeed.errors?null:e.cipherFormGroup.controls.cipherSeed.errors.required),s.Db(1),s.oc("ngIf",!(null!=e.cipherFormGroup.controls.cipherSeed.errors&&e.cipherFormGroup.controls.cipherSeed.errors.required)&&(null==e.cipherFormGroup.controls.cipherSeed.errors?null:e.cipherFormGroup.controls.cipherSeed.errors.invalidCipher)),s.Db(6),s.oc("stepControl",e.passphraseFormGroup),s.Db(1),s.oc("formGroup",e.passphraseFormGroup),s.Db(2),s.oc("labelPosition","before"),s.Db(6),s.oc("ngIf",null==e.passphraseFormGroup.controls.passphrase.errors?null:e.passphraseFormGroup.controls.passphrase.errors.required)}}function Vl(e,t){if(1&e&&(s.Vb(0,"span",48),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(e)}}function Dl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div"),s.Vb(1,"form",4),s.Vb(2,"div",43),s.Kc(3,"YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!"),s.Ub(),s.Vb(4,"div",44),s.Ic(5,Vl,2,1,"span",45),s.Ub(),s.Vb(6,"div",46),s.Kc(7,"Wallet initialization is done."),s.Ub(),s.Vb(8,"div",46),s.Kc(9,"The node will be usable only after LND has synced completely with the network."),s.Ub(),s.Vb(10,"div",46),s.Kc(11,"Click continue only after writing down the seed."),s.Ub(),s.Vb(12,"div",6),s.Vb(13,"button",47),s.dc("click",function(){return s.zc(e),s.hc().onGoToHome()}),s.Kc(14,"Go To Home"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(5),s.oc("ngForOf",e.genSeedResponse)}}function Sl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div"),s.Vb(1,"form",4),s.Vb(2,"div",46),s.Kc(3,"Something went wrong! Unable to initialize wallet!"),s.Ub(),s.Vb(4,"div",6),s.Vb(5,"button",49),s.dc("click",function(){return s.zc(e),s.hc().resetData()}),s.Kc(6,"Restart"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ll(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div"),s.Vb(1,"form",4),s.Vb(2,"div",46),s.Kc(3,"Wallet recovery is done."),s.Ub(),s.Vb(4,"div",46),s.Kc(5,"The node will be usable only after LND has synced completely with the network."),s.Ub(),s.Vb(6,"div",6),s.Vb(7,"button",50),s.dc("click",function(){return s.zc(e),s.hc().onGoToHome()}),s.Kc(8,"Go To Home"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}const Il=e=>{const t=e.get("initWalletPassword"),n=e.get("initWalletConfirmPassword");return t&&n&&t.value!==n.value?{unmatchedPasswords:!0}:null},_l=e=>{const t=e.value?e.value.toString().trim().split(","):[];return t&&24!==t.length?{invalidCipher:!0}:null};let kl=(()=>{class e{constructor(e,t,n,a){this.store=e,this.formBuilder=t,this.lndEffects=n,this.router=a,this.insecureLND=!1,this.genSeedResponse=[],this.initWalletResponse="",this.proceed=!0,this.warnRes=!1,this.unsubs=[new u.a,new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.passwordFormGroup=this.formBuilder.group({initWalletPassword:["",[be.t.required,be.t.minLength(8)]],initWalletConfirmPassword:["",[be.t.required,be.t.minLength(8)]]},{validators:Il}),this.cipherFormGroup=this.formBuilder.group({existingCipher:[!1],cipherSeed:[{value:"",disabled:!0},[_l]]}),this.passphraseFormGroup=this.formBuilder.group({enterPassphrase:[!1],passphrase:[{value:"",disabled:!0}]}),this.cipherFormGroup.controls.existingCipher.valueChanges.pipe(Object(d.a)(this.unsubs[0])).subscribe(e=>{e?(this.cipherFormGroup.controls.cipherSeed.setValue(""),this.cipherFormGroup.controls.cipherSeed.enable()):(this.cipherFormGroup.controls.cipherSeed.setValue(""),this.cipherFormGroup.controls.cipherSeed.disable())}),this.passphraseFormGroup.controls.enterPassphrase.valueChanges.pipe(Object(d.a)(this.unsubs[1])).subscribe(e=>{e?(this.passphraseFormGroup.controls.passphrase.setValue(""),this.passphraseFormGroup.controls.passphrase.enable()):(this.passphraseFormGroup.controls.passphrase.setValue(""),this.passphraseFormGroup.controls.passphrase.disable())}),this.insecureLND=!window.location.protocol.includes("https:"),this.lndEffects.initWalletRes.pipe(Object(d.a)(this.unsubs[2])).subscribe(e=>{this.initWalletResponse=e}),this.lndEffects.genSeedResponse.pipe(Object(d.a)(this.unsubs[3])).subscribe(e=>{this.genSeedResponse=e,this.store.dispatch(new g.ab(this.passphraseFormGroup.controls.enterPassphrase.value?{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:this.genSeedResponse,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:this.genSeedResponse}))})}onInitWallet(){if(this.passwordFormGroup.invalid||this.cipherFormGroup.invalid||this.passphraseFormGroup.invalid)return!0;if(this.store.dispatch(new H.G("Initializing...")),this.cipherFormGroup.controls.existingCipher.value){const e=this.cipherFormGroup.controls.cipherSeed.value.toString().trim().split(",");this.store.dispatch(new g.ab(this.passphraseFormGroup.controls.enterPassphrase.value?{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:e,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:e}))}else this.store.dispatch(new g.T(this.passphraseFormGroup.controls.enterPassphrase.value?window.btoa(this.passphraseFormGroup.controls.passphrase.value):""))}onGoToHome(){setTimeout(()=>{this.store.dispatch(new H.cb),this.store.dispatch(new g.G({loadPage:"HOME"}))},1e3)}resetData(){this.genSeedResponse=[],this.initWalletResponse=""}ngOnDestroy(){this.unsubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(be.d),s.Pb(ft.a),s.Pb(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-initialize-wallet"]],viewQuery:function(e,t){if(1&e&&s.Pc(ma.c,!0),2&e){let e;s.vc(e=s.ec())&&(t.stepper=e.first)}},features:[s.Cb([{provide:rl.h,useValue:{displayDefaultIndicatorType:!1}}])],decls:7,vars:6,consts:[["fxLayout","column",1,"padding-gap","mb-4"],[4,"ngIf"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","stretch stretch",4,"ngIf"],[3,"linear",4,"ngIf"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mt-2"],["fxFlex","100","fxLayoutAlign","start"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","1","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","2",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","stretch stretch"],["fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",3,"click"],[3,"linear"],["stepper",""],["label","Wallet Password","state","password",3,"stepControl"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mt-1",3,"formGroup"],["fxFlex","49","fxLayoutAlign","start"],["matInput","","type","password","placeholder","Password","name","initWalletPassword","formControlName","initWalletPassword","tabindex","5","required",""],["matInput","","type","password","placeholder","Confirm Password","name","initWalletConfirmPassword","formControlName","initWalletConfirmPassword","tabindex","6","required",""],["class","validation-error-message",4,"ngIf"],["fxLayout","row",1,"my-2"],["mat-flat-button","","color","primary","tabindex","7","type","submit","matStepperNext",""],["label","Cipher","state","cipher",3,"stepControl"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start",1,"mt-1",3,"formGroup"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch"],["fxFlex","20","tabindex","8","color","primary","formControlName","existingCipher","name","existingCipher",1,"chkbox-wallet",3,"labelPosition"],["fxFlex","75","fxLayoutAlign","start",1,"my-1"],["autofocus","","matInput","","type","input","placeholder","Comma separated array of 24 words cipher seed","name","cipherSeed","formControlName","cipherSeed","tabindex","9","required",""],["fxLayout","row",1,"mb-2"],["mat-stroked-button","","color","primary","type","reset","tabindex","10","matStepperPrevious","",1,"mr-1","mt-1"],["mat-flat-button","","color","primary","tabindex","11","type","submit","matStepperNext","",1,"mt-1"],["label","Passphrase","state","passphrase",3,"stepControl"],["fxFlex","20","tabindex","10","color","primary","formControlName","enterPassphrase","name","enterPassphrase",1,"chkbox-wallet",3,"labelPosition"],["fxFlex","75","fxLayoutAlign","start"],["matInput","","type","input","type","password","placeholder","Passphrase","name","passphrase","formControlName","passphrase","tabindex","12","required",""],["mat-stroked-button","","color","warn","tabindex","13","type","reset",1,"mr-1","mt-1",3,"click"],["mat-stroked-button","","tabindex","14","color","primary","type","button","matStepperPrevious","",1,"mr-1","mt-1"],["mat-flat-button","","color","primary","tabindex","15","type","submit",1,"mt-1",3,"click"],["matStepperIcon","password"],["matStepperIcon","cipher"],["matStepperIcon","passphrase"],[1,"validation-error-message"],[1,"validation-error-icon","red"],["fxFlex","100","fxLayoutAlign","start",1,"blinker"],["fxFlex","40","fxLayout","row wrap",1,"mt-2"],["fxFlex","25","fxLayoutAlign","start","class","genseed-message",4,"ngFor","ngForOf"],["fxFlex","100","fxLayoutAlign","start",1,"mt-2"],["mat-flat-button","","color","primary","type","submit","tabindex","16",3,"click"],["fxFlex","25","fxLayoutAlign","start",1,"genseed-message"],["mat-stroked-button","","color","primary","tabindex","17","type","reset",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","18",3,"click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,bl,9,0,"div",1),s.Ic(2,ul,6,0,"div",2),s.Ic(3,Ul,56,17,"mat-vertical-stepper",3),s.Ic(4,Dl,15,1,"div",1),s.Ic(5,Sl,7,0,"div",1),s.Ic(6,Ll,9,0,"div",1),s.Ub()),2&e&&(s.Db(1),s.oc("ngIf",t.insecureLND&&!t.warnRes),s.Db(1),s.oc("ngIf",t.warnRes&&!t.proceed),s.Db(1),s.oc("ngIf",(!t.insecureLND||t.warnRes&&t.proceed)&&t.genSeedResponse.length<=0&&""===t.initWalletResponse),s.Db(1),s.oc("ngIf",t.genSeedResponse.length>0&&""!==t.initWalletResponse),s.Db(1),s.oc("ngIf",t.genSeedResponse.length>0&&""===t.initWalletResponse),s.Db(1),s.oc("ngIf",t.genSeedResponse.length<=0&&""!==t.initWalletResponse))},directives:[c.c,a.o,be.u,be.n,be.o,c.b,c.a,S.a,ma.h,ma.a,be.h,O.c,ue.b,be.c,be.m,be.g,be.s,O.f,ma.f,pe.a,ma.g,ma.d,O.b,L.a,a.n],styles:[""]}),e})(),Fl=(()=>{class e{constructor(){this.faWallet=p.U}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-wallet"]],decls:12,vars:1,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"],["label","Unlock"],["label","Initialize"]],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,"Wallet"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Vb(7,"mat-tab-group"),s.Vb(8,"mat-tab",5),s.Qb(9,"rtl-unlock-wallet"),s.Ub(),s.Vb(10,"mat-tab",6),s.Qb(11,"rtl-initialize-wallet"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(1),s.oc("icon",t.faWallet))},directives:[c.c,c.b,C.a,V.a,V.b,oe.b,oe.a,ll,kl],styles:[""]}),e})();function Al(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 Tl=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.router=n,this.faExchangeAlt=p.n,this.faChartPie=p.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 u.a,new u.a,new u.a,new u.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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.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("lnd").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.currencyUnits=e.nodeSettings.currencyUnits,this.balances=e.nodeSettings.userPersona===f.z.OPERATOR?[{title:"Local Capacity",dataValue:e.totalLocalBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:e.totalRemoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:e.totalLocalBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:e.totalRemoteBalance,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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,Al,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,C.a,V.a,V.b,qn.a,oe.e,a.n,c.a,i.l,oe.d,i.h],styles:[""]}),e})();function Pl(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Destination pubkey is required."),s.Ub())}function Ol(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Kl(e,t){1&e&&s.Qb(0,"mat-progress-bar",37)}function Rl(e,t){1&e&&(s.Vb(0,"th",38),s.Kc(1," Hop "),s.Ub())}function Ml(e,t){if(1&e&&(s.Vb(0,"td",39),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.hop_sequence," ")}}function El(e,t){1&e&&(s.Vb(0,"th",38),s.Kc(1," Peer "),s.Ub())}const zl=function(e){return{"max-width":e}};function Nl(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,zl,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Mc(" ",null==e?null:e.pubkey_alias," ")}}function Bl(e,t){1&e&&(s.Vb(0,"th",38),s.Kc(1," Channel "),s.Ub())}function Gl(e,t){if(1&e&&(s.Vb(0,"td",39),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.chan_id," ")}}function ql(e,t){1&e&&(s.Vb(0,"th",41),s.Kc(1," Capacity (Sats) "),s.Ub())}function Ql(e,t){if(1&e&&(s.Vb(0,"td",39),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.chan_capacity),"")}}function Hl(e,t){1&e&&(s.Vb(0,"th",41),s.Kc(1," Amount To Fwd (Sats) "),s.Ub())}function jl(e,t){if(1&e&&(s.Vb(0,"td",39),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.amt_to_forward)," ")}}function $l(e,t){1&e&&(s.Vb(0,"th",41),s.Kc(1," Fee (mSats) "),s.Ub())}function Wl(e,t){if(1&e&&(s.Vb(0,"td",39),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.fee_msat)," ")}}function Xl(e,t){1&e&&(s.Vb(0,"th",43),s.Vb(1,"span",42),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function Jl(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",44),s.Vb(1,"button",45),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc().onHopClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Yl(e,t){1&e&&s.Qb(0,"tr",46)}function Zl(e,t){1&e&&s.Qb(0,"tr",47)}const er=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}};let tr=(()=>{class e{constructor(e,t,n){this.store=e,this.lndEffects=t,this.commonService=n,this.destinationPubkey="",this.amount=null,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=p.I,this.faExclamationTriangle=p.o,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["pubkey_alias","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["hop_sequence","pubkey_alias","fee_msat","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["hop_sequence","pubkey_alias","chan_capacity","amt_to_forward_msat","fee_msat","actions"]):(this.flgSticky=!0,this.displayedColumns=["hop_sequence","pubkey_alias","chan_capacity","amt_to_forward_msat","fee_msat","actions"])}ngOnInit(){this.lndEffects.setQueryRoutes.pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.qrHops=new le.o([]),this.qrHops.data=[],e.routes&&e.routes[0].hops?(this.flgLoading[0]=!1,this.qrHops=new le.o([...e.routes[0].hops]),this.qrHops.data=e.routes[0].hops):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.W({destPubkey:this.destinationPubkey,amount:this.amount}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1}onHopClick(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Route Information",message:[[{key:"hop_sequence",value:e.hop_sequence,title:"Sequence",width:30,type:f.h.NUMBER},{key:"amt_to_forward",value:e.amt_to_forward,title:"Amount To Forward (Sats)",width:30,type:f.h.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:40,type:f.h.NUMBER}],[{key:"pubkey_alias",value:e.pubkey_alias,title:"Peer Alias",width:30,type:f.h.STRING},{key:"pub_key",value:e.pub_key,title:"Peer Pubkey",width:70,type:f.h.STRING}],[{key:"expiry",value:e.expiry,title:"Expiry",width:30,type:f.h.NUMBER},{key:"chan_id",value:e.chan_id,title:"Channel ID",width:30,type:f.h.STRING},{key:"chan_capacity",value:e.chan_capacity,title:"Channel Capacity",width:40,type:f.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(ft.a),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-query-routes"]],viewQuery:function(e,t){if(1&e&&s.Pc(ce.a,!0),2&e){let e;s.vc(e=s.ec())&&(t.sort=e.first)}},decls:51,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","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start center"],[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","hop_sequence"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","pubkey_alias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","chan_id"],["matColumnDef","chan_capacity"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_to_forward_msat"],["matColumnDef","fee_msat"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-4","pr-3"],["mat-cell","",1,"pl-4"],["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,Pl,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,Ol,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,Kl,1,0,"mat-progress-bar",19),s.Vb(26,"table",20,21),s.Tb(28,22),s.Ic(29,Rl,2,0,"th",23),s.Ic(30,Ml,2,1,"td",24),s.Sb(),s.Tb(31,25),s.Ic(32,El,2,0,"th",23),s.Ic(33,Nl,2,4,"td",26),s.Sb(),s.Tb(34,27),s.Ic(35,Bl,2,0,"th",23),s.Ic(36,Gl,2,1,"td",24),s.Sb(),s.Tb(37,28),s.Ic(38,ql,2,0,"th",29),s.Ic(39,Ql,4,3,"td",24),s.Sb(),s.Tb(40,30),s.Ic(41,Hl,2,0,"th",29),s.Ic(42,jl,4,3,"td",24),s.Sb(),s.Tb(43,31),s.Ic(44,$l,2,0,"th",29),s.Ic(45,Wl,4,3,"td",24),s.Sb(),s.Tb(46,32),s.Ic(47,Xl,3,0,"th",33),s.Ic(48,Jl,3,0,"td",34),s.Sb(),s.Ic(49,Yl,1,0,"tr",35),s.Ic(50,Zl,1,0,"tr",36),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,er,"error"===t.flgLoading[0])),s.Db(23),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns))},directives:[c.c,c.a,be.u,be.n,be.o,c.b,C.a,O.c,ue.b,be.c,be.s,be.m,be.p,a.o,be.q,he.a,S.a,M.b,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.k,le.m,O.b,l.a,le.h,ce.b,le.a,a.p,I.b,le.j,le.l],pipes:[a.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 nr=n("zQhy");function ar(e,t){1&e&&(s.Vb(0,"th",25),s.Kc(1,"Network"),s.Ub())}function ir(e,t){if(1&e&&(s.Vb(0,"td",26),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.network," ")}}function or(e,t){1&e&&(s.Vb(0,"th",25),s.Kc(1,"Address"),s.Ub())}function sr(e,t){if(1&e&&(s.Vb(0,"td",26),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Mc(" ",null==e?null:e.addr," ")}}function cr(e,t){1&e&&(s.Vb(0,"th",27),s.Vb(1,"span",28),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function lr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",29),s.Vb(1,"span",28),s.Vb(2,"button",30),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.node.pub_key+"@"+e.addr)}}function rr(e,t){1&e&&s.Qb(0,"tr",31)}function br(e,t){1&e&&s.Qb(0,"tr",32)}const ur=function(e){return{"background-color":e}};function dr(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",8),s.Vb(10,"h4",4),s.Kc(11,"Alias"),s.Ub(),s.Vb(12,"span",9),s.Kc(13),s.Vb(14,"span",10),s.Kc(15),s.Ub(),s.Ub(),s.Ub(),s.Vb(16,"div",8),s.Vb(17,"h4",4),s.Kc(18,"Last Update"),s.Ub(),s.Vb(19,"span",9),s.Kc(20),s.Ub(),s.Ub(),s.Ub(),s.Qb(21,"mat-divider",6),s.Vb(22,"div",7),s.Vb(23,"div",8),s.Vb(24,"h4",4),s.Kc(25,"Total Capacity (Sats)"),s.Ub(),s.Vb(26,"span",9),s.Kc(27),s.ic(28,"number"),s.Ub(),s.Ub(),s.Vb(29,"div",8),s.Vb(30,"h4",4),s.Kc(31,"Number of Channels"),s.Ub(),s.Vb(32,"span",9),s.Kc(33),s.ic(34,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(35,"mat-divider",6),s.Vb(36,"div",11),s.Vb(37,"h4",12),s.Kc(38,"Addresses"),s.Ub(),s.Vb(39,"div",13),s.Vb(40,"table",14,15),s.Tb(42,16),s.Ic(43,ar,2,0,"th",17),s.Ic(44,ir,2,1,"td",18),s.Sb(),s.Tb(45,19),s.Ic(46,or,2,0,"th",17),s.Ic(47,sr,2,1,"td",18),s.Sb(),s.Tb(48,20),s.Ic(49,cr,3,0,"th",21),s.Ic(50,lr,4,1,"td",22),s.Sb(),s.Ic(51,rr,1,0,"tr",23),s.Ic(52,br,1,0,"tr",24),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.node.pub_key),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.lookupResult.node.alias),s.Db(1),s.oc("ngStyle",s.sc(18,ur,null==e.lookupResult.node?null:e.lookupResult.node.color)),s.Db(1),s.Lc(null==e.lookupResult.node?null:e.lookupResult.node.color),s.Db(5),s.Lc(e.lookupResult.node.last_update_str),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(28,14,e.lookupResult.total_capacity)),s.Db(6),s.Lc(s.jc(34,16,e.lookupResult.num_channels)),s.Db(2),s.oc("inset",!0),s.Db(5),s.oc("dataSource",e.lookupResult.node.addresses),s.Db(11),s.oc("matHeaderRowDef",e.displayedColumns),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}let hr=(()=>{class e{constructor(e,t){this.logger=e,this.snackBar=t,this.displayedColumns=["network","addr","actions"]}ngOnInit(){}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(ni.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-node-lookup"]],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"],["fxLayout","column","fxFlex","50","fxLayoutAlign","end start",1,"my-1"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxLayout","column",1,"mt-2"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",3,"dataSource"],["table",""],["matColumnDef","network"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","addr"],["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,dr,53,20,"div",0),2&e&&s.oc("ngIf",t.lookupResult)},directives:[a.o,c.c,R.a,c.a,c.b,a.p,I.b,M.b,le.n,ce.a,le.c,le.i,le.b,le.k,le.m,le.h,ce.b,le.a,S.a,ai.a,le.j,le.l],pipes:[a.f],styles:[""]}),e})();function mr(e,t){1&e&&(s.Vb(0,"h3",16),s.Kc(1,"Node 1"),s.Ub())}function pr(e,t){1&e&&(s.Vb(0,"h3",16),s.Kc(1,"Node 1 (Your Node)"),s.Ub())}function fr(e,t){1&e&&(s.Vb(0,"h3",16),s.Kc(1,"Node 2"),s.Ub())}function gr(e,t){1&e&&(s.Vb(0,"h3",16),s.Kc(1,"Node 2 (Your Node)"),s.Ub())}function yr(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,"Channel Id"),s.Ub(),s.Vb(5,"span",5),s.Kc(6),s.Ub(),s.Ub(),s.Qb(7,"mat-divider",6),s.Vb(8,"div",3),s.Vb(9,"h4",4),s.Kc(10,"Channel Point"),s.Ub(),s.Vb(11,"span",5),s.Kc(12),s.Ub(),s.Ub(),s.Qb(13,"mat-divider",6),s.Vb(14,"div",7),s.Vb(15,"div",8),s.Vb(16,"h4",4),s.Kc(17,"Last Update"),s.Ub(),s.Vb(18,"span",5),s.Kc(19),s.Ub(),s.Ub(),s.Vb(20,"div",8),s.Vb(21,"h4",4),s.Kc(22,"Capacity (Sats)"),s.Ub(),s.Vb(23,"span",5),s.Kc(24),s.ic(25,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(26,"mat-divider",6),s.Vb(27,"div",9),s.Vb(28,"div",10),s.Vb(29,"div",11),s.Ic(30,mr,2,0,"h3",12),s.Ic(31,pr,2,0,"h3",12),s.Ub(),s.Qb(32,"mat-divider",13),s.Vb(33,"div",14),s.Vb(34,"h4",4),s.Kc(35,"Pubkey"),s.Ub(),s.Vb(36,"span",5),s.Kc(37),s.Ub(),s.Ub(),s.Qb(38,"mat-divider",13),s.Vb(39,"div",15),s.Vb(40,"h4",4),s.Kc(41,"Time Lock Delta"),s.Ub(),s.Vb(42,"span",5),s.Kc(43),s.Ub(),s.Ub(),s.Qb(44,"mat-divider",13),s.Vb(45,"div",15),s.Vb(46,"h4",4),s.Kc(47,"Min HTLC"),s.Ub(),s.Vb(48,"span",5),s.Kc(49),s.Ub(),s.Ub(),s.Qb(50,"mat-divider",13),s.Vb(51,"div",15),s.Vb(52,"h4",4),s.Kc(53,"Fee Base Msat"),s.Ub(),s.Vb(54,"span",5),s.Kc(55),s.Ub(),s.Ub(),s.Qb(56,"mat-divider",13),s.Vb(57,"div",15),s.Vb(58,"h4",4),s.Kc(59,"Fee Rate Milli Msat"),s.Ub(),s.Vb(60,"span",5),s.Kc(61),s.Ub(),s.Ub(),s.Qb(62,"mat-divider",13),s.Vb(63,"div",15),s.Vb(64,"h4",4),s.Kc(65,"Disabled"),s.Ub(),s.Vb(66,"span",5),s.Kc(67),s.Ub(),s.Ub(),s.Ub(),s.Vb(68,"div",10),s.Vb(69,"div"),s.Ic(70,fr,2,0,"h3",12),s.Ic(71,gr,2,0,"h3",12),s.Ub(),s.Qb(72,"mat-divider",13),s.Vb(73,"div",14),s.Vb(74,"h4",4),s.Kc(75,"Pubkey"),s.Ub(),s.Vb(76,"span",5),s.Kc(77),s.Ub(),s.Ub(),s.Qb(78,"mat-divider",13),s.Vb(79,"div",15),s.Vb(80,"h4",4),s.Kc(81,"Time Lock Delta"),s.Ub(),s.Vb(82,"span",5),s.Kc(83),s.Ub(),s.Ub(),s.Qb(84,"mat-divider",13),s.Vb(85,"div",15),s.Vb(86,"h4",4),s.Kc(87,"Min HTLC"),s.Ub(),s.Vb(88,"span",5),s.Kc(89),s.Ub(),s.Ub(),s.Qb(90,"mat-divider",13),s.Vb(91,"div",15),s.Vb(92,"h4",4),s.Kc(93,"Fee Base Msat"),s.Ub(),s.Vb(94,"span",5),s.Kc(95),s.Ub(),s.Ub(),s.Qb(96,"mat-divider",13),s.Vb(97,"div",15),s.Vb(98,"h4",4),s.Kc(99,"Fee Rate Milli Msat"),s.Ub(),s.Vb(100,"span",5),s.Kc(101),s.Ub(),s.Ub(),s.Qb(102,"mat-divider",13),s.Vb(103,"div",15),s.Vb(104,"h4",4),s.Kc(105,"Disabled"),s.Ub(),s.Vb(106,"span",5),s.Kc(107),s.Ub(),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.channel_id),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(e.lookupResult.chan_point),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.lookupResult.last_update_str),s.Db(5),s.Lc(s.jc(25,36,e.lookupResult.capacity)),s.Db(2),s.oc("inset",!0),s.Db(4),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.node1_pub),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.time_lock_delta),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.min_htlc),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.fee_base_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.fee_rate_milli_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.disabled),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.node2_pub),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.time_lock_delta),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.min_htlc),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.fee_base_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.fee_rate_milli_msat),s.Db(1),s.oc("inset",!0),s.Db(5),s.Lc(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.disabled)}}let xr=(()=>{class e{constructor(e){this.store=e,this.node1_match=!1,this.node2_match=!1,this.unSubs=[new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.lookupResult.node1_pub===e.information.identity_pubkey&&(this.node1_match=!0),this.lookupResult.node2_pub===e.information.identity_pubkey&&(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-channel-lookup"]],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"],[1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","50","fxLayoutAlign","end start",1,"my-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"],["fxLayout","column","fxFlex","10",1,"my-1"],[1,"page-title","font-bold-500"]],template:function(e,t){1&e&&s.Ic(0,yr,108,38,"div",0),2&e&&s.oc("ngIf",t.lookupResult)},directives:[a.o,c.c,R.a,c.a,c.b],pipes:[a.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 vr=["form"];function wr(e,t){if(1&e&&(s.Vb(0,"mat-radio-button",20),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 Cr(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 Ur(e,t){if(1&e&&(s.Vb(0,"span",27),s.Qb(1,"rtl-node-lookup",28),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("lookupResult",e.lookupValue)}}function Vr(e,t){if(1&e&&(s.Vb(0,"span",27),s.Qb(1,"rtl-channel-lookup",28),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("lookupResult",e.lookupValue)}}function Dr(e,t){1&e&&(s.Vb(0,"span",27),s.Vb(1,"h3"),s.Kc(2,"Error! Unable to find details!"),s.Ub(),s.Ub())}function Sr(e,t){if(1&e&&(s.Vb(0,"div",21),s.Vb(1,"div",22),s.Vb(2,"span",23),s.Kc(3),s.Ub(),s.Ub(),s.Vb(4,"div",24),s.Ic(5,Ur,2,1,"span",25),s.Ic(6,Vr,2,1,"span",25),s.Ic(7,Dr,3,0,"span",26),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)}}const Lr=function(e){return{"mt-2":e}};let Ir=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.actions$=a,this.lookupKey="",this.lookupValue={},this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Pubkey"},{id:1,name:"Channel",placeholder:"Channel ID"}],this.flgLoading=[!0],this.faSearch=p.J,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions$.pipe(Object(d.a)(this.unSubs[0]),Object(h.a)(e=>e.type===g.Eb||e.type===g.m)).subscribe(e=>{e.type===g.Eb&&(this.flgLoading[0]=!0,this.lookupValue=JSON.parse(JSON.stringify(e.payload)),this.flgSetLookupValue=!0,this.logger.info(this.lookupValue)),e.type===g.m&&"Lookup"===e.payload.action&&(this.flgLoading[0]="error")})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.lookupValue={},this.store.dispatch(new H.G("Searching "+this.lookupFields[this.selectedFieldId].name+"...")),this.selectedFieldId){case 0:this.store.dispatch(new g.eb(this.lookupKey.trim()));break;case 1:this.store.dispatch(new g.h(this.lookupKey.trim()))}}onSelectChange(e){this.resetData(),this.selectedFieldId=e.value}resetData(){this.form.resetForm(),this.flgSetLookupValue=!1,this.selectedFieldId=0,this.lookupKey="",this.lookupValue={},this.flgLoading.forEach((e,t)=>{this.flgLoading[t]=!0})}clearLookupValue(){this.lookupValue={},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(w.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-lookups"]],viewQuery:function(e,t){if(1&e&&s.Ec(vr,!0),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first)}},decls:23,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"],[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"],[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"],[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,wr,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,Cr,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,Sr,8,4,"div",19),s.Ub(),s.Ub(),s.Ub(),s.Ub()),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,Lr,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.lookupValue&&t.flgSetLookupValue))},directives:[c.c,c.b,C.a,c.a,V.a,V.b,be.u,be.n,be.o,nr.b,be.m,be.p,a.n,O.c,a.m,I.a,ue.b,be.c,be.s,a.o,S.a,nr.a,O.b,a.q,a.r,a.s,hr,xr],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 _r=n("TN/R");function kr(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Invalid date format."),s.Ub())}function Fr(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Invalid date format."),s.Ub())}function Ar(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",27),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 Tr=(()=>{class e{constructor(e,t){this.store=e,this.router=t,this.faMapSigns=p.y,this.today=new Date(Date.now()),this.lastMonthDay=new Date(this.today.getFullYear(),this.today.getMonth()-1,this.today.getDate()+1,0,0,0),this.yesterday=new Date(this.today.getFullYear(),this.today.getMonth(),this.today.getDate()-1,0,0,0),this.endDate=this.today,this.startDate=this.lastMonthDay,this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new u.a,new u.a,new u.a]}ngOnInit(){this.onEventsFetch();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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.f)).subscribe(e=>{let t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}onEventsFetch(){this.store.dispatch(new g.Vb({})),this.endDate||(this.endDate=this.today),this.startDate||(this.startDate=new Date(this.endDate.getFullYear(),this.endDate.getMonth()-1,this.endDate.getDate()+1,0,0,0)),this.store.dispatch(new g.U({end_time:Math.round(this.endDate.getTime()/1e3).toString(),start_time:Math.round(this.startDate.getTime()/1e3).toString()}))}resetData(){this.endDate=this.today,this.startDate=this.lastMonthDay}ngOnDestroy(){this.resetData(),this.store.dispatch(new g.Vb({})),this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-routing"]],decls:35,vars:15,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",1,"card-content-gap","mt-1"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mb-1",3,"ngSubmit"],["routingForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","49","fxLayoutAlign","start"],["matInput","","placeholder","Start Date","name","startDate","tabindex","1",3,"matDatepicker","max","ngModel","ngModelChange"],["strtDate","ngModel"],["matSuffix","",3,"for"],[3,"startAt"],["startDatepicker",""],[4,"ngIf"],["matInput","","placeholder","End Date","name","endDate","tabindex","2",3,"matDatepicker","min","max","ngModel","ngModelChange"],["enDate","ngModel"],["endDatepicker",""],["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","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"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,t){if(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,"form",7,8),s.dc("ngSubmit",function(){return t.onEventsFetch()}),s.Vb(10,"div",9),s.Vb(11,"mat-form-field",10),s.Vb(12,"input",11,12),s.dc("ngModelChange",function(e){return t.startDate=e}),s.Ub(),s.Qb(14,"mat-datepicker-toggle",13),s.Qb(15,"mat-datepicker",14,15),s.Ic(17,kr,2,0,"mat-error",16),s.Ub(),s.Vb(18,"mat-form-field",10),s.Vb(19,"input",17,18),s.dc("ngModelChange",function(e){return t.endDate=e}),s.Ub(),s.Qb(21,"mat-datepicker-toggle",13),s.Qb(22,"mat-datepicker",14,19),s.Ic(24,Fr,2,0,"mat-error",16),s.Ub(),s.Ub(),s.Vb(25,"div",20),s.Vb(26,"button",21),s.dc("click",function(){return t.resetData()}),s.Kc(27,"Clear"),s.Ub(),s.Vb(28,"button",22),s.Kc(29,"Fetch Events"),s.Ub(),s.Ub(),s.Ub(),s.Vb(30,"div",23),s.Vb(31,"nav",24),s.Ic(32,Ar,2,3,"div",25),s.Ub(),s.Ub(),s.Vb(33,"div",26),s.Qb(34,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.wc(13),n=s.wc(16),a=s.wc(20),i=s.wc(23);s.Db(2),s.oc("icon",t.faMapSigns),s.Db(10),s.oc("matDatepicker",n)("max",t.today)("ngModel",t.startDate),s.Db(2),s.oc("for",n),s.Db(1),s.oc("startAt",t.startDate),s.Db(2),s.oc("ngIf",e.errors),s.Db(2),s.oc("matDatepicker",i)("min",t.startDate)("max",t.today)("ngModel",t.endDate),s.Db(2),s.oc("for",i),s.Db(1),s.oc("startAt",t.endDate),s.Db(2),s.oc("ngIf",a.errors),s.Db(8),s.oc("ngForOf",t.links)}},directives:[c.c,c.b,C.a,c.a,V.a,V.b,be.u,be.n,be.o,O.c,ue.b,_r.b,Jn.a,be.c,be.m,be.p,_r.d,O.g,_r.a,a.o,he.a,S.a,oe.e,a.n,i.l,O.b,oe.d,i.h],styles:[""]}),e})();function Pr(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 Or(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 Kr(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1,"Timestamp"),s.Ub())}function Rr(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(e.timestamp_str)}}function Mr(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1,"Inbound Channel"),s.Ub())}function Er(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(e.alias_in)}}function zr(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1,"Outbound Channel"),s.Ub())}function Nr(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(e.alias_out)}}function Br(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1,"Inbound Amount (Sats)"),s.Ub())}function Gr(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.Lc(s.jc(3,1,e.amt_in))}}function qr(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1,"Outbound Amount (Sats)"),s.Ub())}function Qr(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.Lc(s.jc(3,1,e.amt_out))}}function Hr(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1,"Fee (mSats)"),s.Ub())}function jr(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.Lc(s.jc(3,1,e.fee_msat))}}function $r(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(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Wr(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",38),s.Vb(1,"button",39),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc(2).onForwardingEventClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Xr(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No forwarding event available."),s.Ub())}function Jr(e,t){if(1&e&&(s.Vb(0,"td",40),s.Ic(1,Xr,2,0,"p",41),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 Yr=function(e){return{"display-none":e}};function Zr(e,t){if(1&e&&s.Qb(0,"tr",42),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,Yr,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function eb(e,t){1&e&&s.Qb(0,"tr",43)}function tb(e,t){1&e&&s.Qb(0,"tr",44)}const nb=function(){return["no_event"]};function ab(e,t){if(1&e&&(s.Vb(0,"div",10),s.Vb(1,"table",11,12),s.Tb(3,13),s.Ic(4,Kr,2,0,"th",14),s.Ic(5,Rr,2,1,"td",15),s.Sb(),s.Tb(6,16),s.Ic(7,Mr,2,0,"th",14),s.Ic(8,Er,2,1,"td",15),s.Sb(),s.Tb(9,17),s.Ic(10,zr,2,0,"th",14),s.Ic(11,Nr,2,1,"td",15),s.Sb(),s.Tb(12,18),s.Ic(13,Br,2,0,"th",19),s.Ic(14,Gr,4,3,"td",15),s.Sb(),s.Tb(15,20),s.Ic(16,qr,2,0,"th",19),s.Ic(17,Qr,4,3,"td",15),s.Sb(),s.Tb(18,21),s.Ic(19,Hr,2,0,"th",19),s.Ic(20,jr,4,3,"td",15),s.Sb(),s.Tb(21,22),s.Ic(22,$r,6,0,"th",23),s.Ic(23,Wr,3,0,"td",24),s.Sb(),s.Tb(24,25),s.Ic(25,Jr,2,1,"td",26),s.Sb(),s.Ic(26,Zr,1,3,"tr",27),s.Ic(27,eb,1,0,"tr",28),s.Ic(28,tb,1,0,"tr",29),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("dataSource",e.forwardingHistoryEvents),s.Db(25),s.oc("matFooterRowDef",s.rc(5,nb)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}const ib=function(e){return{"error-border":e}};let ob=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.eventsData=[],this.filterValue="",this.forwardingHistoryData=[],this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","fee_msat","actions"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amt_in","amt_out","fee_msat","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","alias_in","alias_out","amt_in","amt_out","fee_msat","actions"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.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.forwardingHistoryData=e.forwardingHistory&&e.forwardingHistory.forwarding_events?e.forwardingHistory.forwarding_events:[],this.loadForwardingEventsTable(this.forwardingHistoryData),this.logger.info(e))})}ngAfterViewInit(){this.forwardingHistoryData.length>0&&this.loadForwardingEventsTable(this.forwardingHistoryData)}ngOnChanges(e){e.eventsData&&(this.eventsData=e.eventsData.currentValue,this.forwardingHistoryData=this.eventsData,this.loadForwardingEventsTable(this.forwardingHistoryData)),e.filterValue&&this.applyFilter()}onForwardingEventClick(e,t){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Event Information",message:[[{key:"timestamp_str",value:e.timestamp_str,title:"Timestamp",width:25,type:f.h.DATE_TIME},{key:"amt_in",value:e.amt_in,title:"Inbound Amount (Sats)",width:25,type:f.h.NUMBER},{key:"amt_out",value:e.amt_out,title:"Outbound Amount (Sats)",width:25,type:f.h.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:25,type:f.h.NUMBER}],[{key:"alias_in",value:e.alias_in,title:"Inbound Peer Alias",width:25,type:f.h.STRING},{key:"chan_id_in",value:e.chan_id_in,title:"Inbound Channel ID",width:25,type:f.h.STRING},{key:"alias_out",value:e.alias_out,title:"Outbound Peer Alias",width:25,type:f.h.STRING},{key:"chan_id_out",value:e.chan_id_out,title:"Outbound Channel ID",width:25,type:f.h.STRING}]]}}))}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new le.o(e?[...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.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.forwardingHistoryEvents.paginator=this.paginator,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(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-forwarding-history"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.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","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias_in"],["matColumnDef","alias_out"],["matColumnDef","amt_in"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_out"],["matColumnDef","fee_msat"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-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","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,Pr,2,1,"div",1),s.Ic(2,Or,4,1,"div",2),s.Ic(3,ab,29,6,"div",3),s.Qb(4,"mat-paginator",4),s.Ub()),2&e&&(s.oc("ngClass",s.sc(7,ib,""!==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,a.m,I.a,a.o,se.a,c.a,O.c,ue.b,be.c,be.m,be.p,M.b,le.n,ce.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,le.h,ce.b,le.a,me.a,me.c,fe.m,S.a,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();const sb=["tableOut"];function cb(e,t){if(1&e&&(s.Vb(0,"div",3),s.Kc(1),s.Ub()),2&e){const e=s.hc();s.Db(1),s.Lc(e.errorMessage)}}function lb(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1,"Channel ID"),s.Ub())}const rb=function(e){return{"max-width":e}};function bb(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,rb,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Lc(e.chan_id)}}function ub(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1,"Peer Alias"),s.Ub())}function db(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,rb,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Lc(e.alias)}}function hb(e,t){1&e&&(s.Vb(0,"th",36),s.Kc(1,"Events"),s.Ub())}function mb(e,t){if(1&e&&(s.Vb(0,"td",37),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,e.events))}}function pb(e,t){1&e&&(s.Vb(0,"th",36),s.Kc(1,"Total Amount (Sats)"),s.Ub())}function fb(e,t){if(1&e&&(s.Vb(0,"td",37),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,e.total_amount))}}function gb(e,t){1&e&&(s.Vb(0,"th",39),s.Vb(1,"span",38),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function yb(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",40),s.Vb(1,"button",41),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc(2).onRoutingPeerClick(a,n,"in")}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function xb(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No incoming routing peer available."),s.Ub())}function vb(e,t){if(1&e&&(s.Vb(0,"td",42),s.Ic(1,xb,2,0,"p",43),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.RoutingPeersIncoming&&e.RoutingPeersIncoming.data)||(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)<1)}}const wb=function(e){return{"display-none":e}};function Cb(e,t){if(1&e&&s.Qb(0,"tr",44),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,wb,(null==e.RoutingPeersIncoming?null:e.RoutingPeersIncoming.data)&&(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)>0))}}function Ub(e,t){1&e&&s.Qb(0,"tr",45)}function Vb(e,t){1&e&&s.Qb(0,"tr",46)}function Db(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1,"Channel ID"),s.Ub())}function Sb(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,rb,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Lc(e.chan_id)}}function Lb(e,t){1&e&&(s.Vb(0,"th",34),s.Kc(1,"Peer Alias"),s.Ub())}function Ib(e,t){if(1&e&&(s.Vb(0,"td",35),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,rb,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Lc(e.alias)}}function _b(e,t){1&e&&(s.Vb(0,"th",36),s.Kc(1,"Events"),s.Ub())}function kb(e,t){if(1&e&&(s.Vb(0,"td",37),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,e.events))}}function Fb(e,t){1&e&&(s.Vb(0,"th",36),s.Kc(1,"Total Amount (Sats)"),s.Ub())}function Ab(e,t){if(1&e&&(s.Vb(0,"td",37),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,e.total_amount))}}function Tb(e,t){1&e&&(s.Vb(0,"th",39),s.Vb(1,"span",38),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function Pb(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",47),s.Vb(1,"button",48),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc(2).onRoutingPeerClick(a,n,"out")}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Ob(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No outgoing routing peer available."),s.Ub())}function Kb(e,t){if(1&e&&(s.Vb(0,"td",42),s.Ic(1,Ob,2,0,"p",43),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=e.RoutingPeersOutgoing&&e.RoutingPeersOutgoing.data)||(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)<1)}}function Rb(e,t){if(1&e&&s.Qb(0,"tr",44),2&e){const e=s.hc(2);s.oc("ngClass",s.sc(1,wb,(null==e.RoutingPeersOutgoing?null:e.RoutingPeersOutgoing.data)&&(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)>0))}}function Mb(e,t){1&e&&s.Qb(0,"tr",45)}function Eb(e,t){1&e&&s.Qb(0,"tr",46)}const zb=function(e,t){return{"mt-2":e,"mt-1":t}},Nb=function(){return["no_incoming_event"]},Bb=function(e){return{"mt-2":e}},Gb=function(){return["no_outgoing_event"]};function qb(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",4),s.Vb(1,"div",5),s.Vb(2,"div",6),s.Vb(3,"div",7),s.Kc(4,"Incoming"),s.Ub(),s.Vb(5,"mat-form-field",8),s.Vb(6,"input",9),s.dc("keyup",function(t){return s.zc(e),s.hc().applyIncomingFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",10),s.Vb(8,"table",11,12),s.Tb(10,13),s.Ic(11,lb,2,0,"th",14),s.Ic(12,bb,2,4,"td",15),s.Sb(),s.Tb(13,16),s.Ic(14,ub,2,0,"th",14),s.Ic(15,db,2,4,"td",15),s.Sb(),s.Tb(16,17),s.Ic(17,hb,2,0,"th",18),s.Ic(18,mb,4,3,"td",19),s.Sb(),s.Tb(19,20),s.Ic(20,pb,2,0,"th",18),s.Ic(21,fb,4,3,"td",19),s.Sb(),s.Tb(22,21),s.Ic(23,gb,3,0,"th",22),s.Ic(24,yb,3,0,"td",23),s.Sb(),s.Tb(25,24),s.Ic(26,vb,2,1,"td",25),s.Sb(),s.Ic(27,Cb,1,3,"tr",26),s.Ic(28,Ub,1,0,"tr",27),s.Ic(29,Vb,1,0,"tr",28),s.Ub(),s.Ub(),s.Ub(),s.Vb(30,"div",29),s.Vb(31,"div",6),s.Vb(32,"div",7),s.Kc(33,"Outgoing"),s.Ub(),s.Vb(34,"mat-form-field",8),s.Vb(35,"input",9),s.dc("keyup",function(t){return s.zc(e),s.hc().applyOutgoingFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(36,"div",10),s.Vb(37,"table",30,31),s.Tb(39,13),s.Ic(40,Db,2,0,"th",14),s.Ic(41,Sb,2,4,"td",15),s.Sb(),s.Tb(42,16),s.Ic(43,Lb,2,0,"th",14),s.Ic(44,Ib,2,4,"td",15),s.Sb(),s.Tb(45,17),s.Ic(46,_b,2,0,"th",18),s.Ic(47,kb,4,3,"td",19),s.Sb(),s.Tb(48,20),s.Ic(49,Fb,2,0,"th",18),s.Ic(50,Ab,4,3,"td",19),s.Sb(),s.Tb(51,21),s.Ic(52,Tb,3,0,"th",22),s.Ic(53,Pb,3,0,"td",32),s.Sb(),s.Tb(54,33),s.Ic(55,Kb,2,1,"td",25),s.Sb(),s.Ic(56,Rb,1,3,"tr",26),s.Ic(57,Mb,1,0,"tr",27),s.Ic(58,Eb,1,0,"tr",28),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(2),s.oc("ngClass",s.tc(12,zb,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),s.Db(6),s.oc("dataSource",e.RoutingPeersIncoming),s.Db(19),s.oc("matFooterRowDef",s.rc(15,Nb)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(2),s.oc("ngClass",s.sc(16,Bb,e.screenSize!==e.screenSizeEnum.LG)),s.Db(6),s.oc("dataSource",e.RoutingPeersOutgoing),s.Db(19),s.oc("matFooterRowDef",s.rc(18,Gb)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns)}}const Qb=function(e){return{"error-border":e}};let Hb=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.actions$=a,this.routingPeersData=[],this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["chan_id","events","actions"]):this.screenSize===f.s.SM||this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["chan_id","alias","events","total_amount"]):(this.flgSticky=!0,this.displayedColumns=["chan_id","alias","events","total_amount"])}ngOnInit(){this.store.select("lnd").pipe(Object(d.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.routingPeersData=e.forwardingHistory&&e.forwardingHistory.forwarding_events?e.forwardingHistory.forwarding_events:[],this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(e)})}onRoutingPeerClick(e,t,n){let a=" Routing Information";a="in"===n?"Incoming"+a:"Outgoing"+a,this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:a,message:[[{key:"chan_id",value:e.chan_id,title:"Channel ID",width:50,type:f.h.STRING},{key:"alias",value:e.alias,title:"Peer Alias",width:50,type:f.h.STRING}],[{key:"events",value:e.events,title:"Events",width:50,type:f.h.NUMBER},{key:"total_amount",value:e.total_amount,title:"Total Amount (Sats)",width:50,type:f.h.NUMBER}]]}}))}loadRoutingPeersTable(e){if(e.length>0){const t=this.groupRoutingPeers(e);this.RoutingPeersIncoming=new le.o(t[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new le.o(t[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new le.o([]),this.RoutingPeersOutgoing=new le.o([])}groupRoutingPeers(e){const t=[],n=[];return e.forEach(e=>{const a=t.find(t=>t.chan_id===e.chan_id_in),i=n.find(t=>t.chan_id===e.chan_id_out);a?(a.events++,a.total_amount=+a.total_amount+ +e.amt_in):t.push({chan_id:e.chan_id_in,alias:e.alias_in,events:1,total_amount:+e.amt_in}),i?(i.events++,i.total_amount=+i.total_amount+ +e.amt_out):n.push({chan_id:e.chan_id_out,alias:e.alias_out,events:1,total_amount:+e.amt_out})}),[this.commonService.sortDescByKey(t,"total_amount"),this.commonService.sortDescByKey(n,"total_amount")]}applyIncomingFilter(e){this.RoutingPeersIncoming.filter=e.value.trim().toLowerCase()}applyOutgoingFilter(e){this.RoutingPeersOutgoing.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(w.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-routing-peers"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(sb,!0,ce.a)),2&e){let e;s.vc(e=s.ec())&&(t.sortIn=e.first),s.vc(e=s.ec())&&(t.sortOut=e.first)}},decls:3,vars:5,consts:[["fxLayout","column","fxLayoutAlign","start stretch",3,"ngClass"],["class","p-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","padding-gap-x page-sub-title-container",4,"ngIf"],[1,"p-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x","page-sub-title-container"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start start",1,"mb-6"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"padding-gap-x","page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start start","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","","fxFlex","100",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","chan_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","total_amount"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-2","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start start"],["mat-table","","matSort","","fxFlex","100",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["mat-cell","","class","pl-2",4,"matCellDef"],["matColumnDef","no_outgoing_event"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pr-3"],["mat-cell","","fxLayoutAlign","end center",1,"pl-2"],["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",""],["mat-cell","",1,"pl-2"],["mat-stroked-button","","color","primary","type","button","tabindex","5",3,"click"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,cb,2,1,"div",1),s.Ic(2,qb,59,19,"div",2),s.Ub()),2&e&&(s.oc("ngClass",s.sc(3,Qb,""!==t.errorMessage)),s.Db(1),s.oc("ngIf",""!==t.errorMessage),s.Db(1),s.oc("ngIf",""===t.errorMessage))},directives:[c.c,c.b,a.m,I.a,a.o,c.a,O.c,ue.b,M.b,le.n,ce.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,le.h,ce.b,le.a,a.p,I.b,S.a,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-chan_id[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function jb(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 $b=(()=>{class e{constructor(e){this.router=e,this.faChartBar=p.f,this.links=[{link:"routingfees",name:"Routing Fees"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new u.a,new u.a,new u.a,new u.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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,jb,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,C.a,V.a,V.b,oe.e,a.n,i.l,oe.d,i.h],styles:[""]}),e})();var Wb=n("2yzq"),Xb=n("LQLF"),Jb=n("Lnru");function Yb(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.events.total_fee_msat),s.Db(1),s.Nc("",s.kc(2,3,e.events.total_fee_msat/1e3||0,"1.0-0")," Sats/",s.jc(3,6,(null==e.events||null==e.events.forwarding_events?null:e.events.forwarding_events.length)||0)," Events")}}function Zb(e,t){1&e&&(s.Vb(0,"div",9),s.Kc(1,"No fee report for the selected period"),s.Ub())}function eu(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 tu(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,eu,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 nu(e,t){if(1&e&&s.Qb(0,"rtl-forwarding-history",13),2&e){const e=s.hc();s.oc("eventsData",null==e.events?null:e.events.forwarding_events)("filterValue",e.eventFilterValue)}}let au=(()=>{class e{constructor(e,t,n){this.dataService=e,this.commonService=t,this.store=n,this.reportPeriod=f.r[0],this.secondsInADay=86400,this.events={},this.eventFilterValue="",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=f.s,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.s.XS||this.screenSize===f.s.SM),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{"COMPLETE"===e.initialAPIResponseStatus[0]&&this.fetchEvents(this.startDate,this.endDate)})}ngAfterViewInit(){const e=this.commonService.getContainerSize();switch(this.screenSize){case f.s.MD:this.screenPaddingX=e.width/10;break;case f.s.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2]}fetchEvents(e,t){const n=(Math.round(e.getTime()/1e3)-this.timezoneOffset).toString(),a=(Math.round(t.getTime()/1e3)-this.timezoneOffset).toString();this.dataService.getForwardingHistory(n,a).pipe(Object(d.a)(this.unSubs[1])).subscribe(t=>{t.forwarding_events&&t.forwarding_events.length?(t.forwarding_events=t.forwarding_events.reverse(),this.events=t,this.feeReportData=this.prepareFeeReport(e)):(this.events={},this.feeReportData=[])})}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===f.r[1]?e.name.toUpperCase()+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+f.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===f.r[1]){for(let e=0;e<12;e++)n.push({name:f.n[e].name,value:1e-9,extra:{totalEvents:0}});this.events.forwarding_events.map(e=>{let t=new Date(1e3*(+e.timestamp+this.timezoneOffset)).getMonth();n[t].value=n[t].value+ +e.fee_msat/1e3,n[t].extra.totalEvents=n[t].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +e.fee_msat})}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.events.forwarding_events.map(e=>{let a=Math.floor((+e.timestamp-t)/this.secondsInADay);n[a].value=n[a].value+ +e.fee_msat/1e3,n[a].extra.totalEvents=n[a].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +e.fee_msat})}return n}onSelectionChange(e){const t=e.selDate.getMonth(),n=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===f.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.fetchEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,t){return 1===e&&t%4==0?f.n[e].days+1:f.n[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(tt.a),s.Pb(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,Yb,4,8,"div",3),s.Ic(4,Zb,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,tu,3,11,"ngx-charts-bar-vertical",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,nu,1,2,"rtl-forwarding-history",7),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(3),s.oc("ngIf",t.feeReportData.length>0&&t.events.forwarding_events),s.Db(1),s.oc("ngIf",t.feeReportData.length<=0||!t.events.forwarding_events),s.Db(2),s.oc("ngIf",t.feeReportData.length>0&&t.events.forwarding_events),s.Db(2),s.oc("ngIf",t.events&&(null==t.events?null:t.events.forwarding_events)))},directives:[c.c,c.b,c.a,Xb.a,a.o,Jb.b,ob],pipes:[a.f],styles:[""],data:{animation:[Wb.a]}}),e})();var iu=n("d4ms");function ou(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 su(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 cu(e,t){if(1&e&&(s.Vb(0,"div",8),s.Ic(1,ou,4,7,"div",9),s.Ic(2,su,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>0),s.Db(1),s.oc("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function lu(e,t){1&e&&(s.Vb(0,"div",11),s.Kc(1,"No transactions report for the selected period"),s.Ub())}function ru(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 bu(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,ru,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:8)}}function uu(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 du=(()=>{class e{constructor(e,t,n){this.dataService=e,this.commonService=t,this.store=n,this.scrollRanges=f.r,this.reportPeriod=f.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=f.s,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.s.XS||this.screenSize===f.s.SM),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{"COMPLETE"===e.initialAPIResponseStatus[0]&&this.dataService.getTransactionsForReport().pipe(Object(d.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 f.s.MD:this.screenPaddingX=e.width/10;break;case f.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===f.r[1]?e.series.toUpperCase()+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+f.n[this.startDate.getMonth()].name.toUpperCase()+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,t){const n=Math.round(e.getTime()/1e3)-this.timezoneOffset,a=Math.round(t.getTime()/1e3)-this.timezoneOffset;let i=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};let o=this.payments.filter(e=>"SUCCEEDED"===e.status&&e.creation_date>=n&&e.creation_date<a),s=this.invoices.filter(e=>e.settled&&+e.creation_date>=n&&+e.creation_date<a);if(this.transactionsReportSummary.paymentsSelectedPeriod=o.length,this.transactionsReportSummary.invoicesSelectedPeriod=s.length,this.reportPeriod===f.r[1]){for(let t=0;t<12;t++)i.push({name:f.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.creation_date+this.timezoneOffset)).getMonth();this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +e.value_msat+ +e.fee_msat,i[t].series[0].value=i[t].series[0].value+(+e.value_msat+ +e.fee_msat)/1e3,i[t].series[0].extra.total=i[t].series[0].extra.total+1}),s.map(e=>{let t=new Date(1e3*(+e.creation_date+this.timezoneOffset)).getMonth();this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +e.amt_paid_msat,i[t].series[1].value=i[t].series[1].value+ +e.amt_paid_msat/1e3,i[t].series[1].extra.total=i[t].series[1].extra.total+1})}else{for(let t=0;t<this.getMonthDays(e.getMonth(),e.getFullYear());t++)i.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.creation_date-n)/this.secondsInADay);this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +e.value_msat+ +e.fee_msat,i[t].series[0].value=i[t].series[0].value+(+e.value_msat+ +e.fee_msat)/1e3,i[t].series[0].extra.total=i[t].series[0].extra.total+1}),s.map(e=>{let t=Math.floor((+e.creation_date-n)/this.secondsInADay);this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +e.amt_paid_msat,i[t].series[1].value=i[t].series[1].value+ +e.amt_paid_msat/1e3,i[t].series[1].extra.total=i[t].series[1].extra.total+1})}return i}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-this.timezoneOffset),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===f.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?f.n[e].days+1:f.n[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(tt.a),s.Pb(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,cu,3,3,"div",3),s.Ic(4,lu,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,bu,3,13,"ngx-charts-bar-vertical-2d",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,uu,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,Xb.a,a.o,Jb.a,iu.a],pipes:[a.f],styles:[""],data:{animation:[Wb.a]}}),e})();const hu=["form"];function mu(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"UTXO Label is required."),s.Ub())}function pu(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.labelError)}}function fu(e,t){if(1&e&&(s.Vb(0,"div",16),s.Qb(1,"fa-icon",17),s.Ic(2,pu,2,1,"span",11),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("icon",e.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==e.labelError)}}let gu=(()=>{class e{constructor(e,t,n,a,i,o){this.dialogRef=e,this.data=t,this.dataService=n,this.store=a,this.snackBar=i,this.commonService=o,this.faExclamationTriangle=p.o,this.utxo=null,this.label="",this.labelError="",this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.utxo=this.data.utxo,this.label=this.utxo.label}onLabelUTXO(){if(!this.label||""===this.label)return!0;this.labelError="",this.store.dispatch(new H.G("Labelling UTXO...")),this.dataService.labelUTXO(this.utxo.outpoint.txid_bytes,this.label,!0).pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.store.dispatch(new H.j),this.store.dispatch(new g.M),this.store.dispatch(new g.N),this.snackBar.open("Successfully labelled the UTXO."),this.dialogRef.close()},e=>{this.store.dispatch(new H.j),this.labelError=e.error&&e.error.error&&e.error.error.error?e.error.error.error:e.error&&e.error.error?e.error.error:e.error?e.error:e,this.labelError="string"==typeof this.labelError?this.commonService.titleCase(this.labelError):JSON.stringify(this.labelError)})}resetData(){this.labelError="",this.label=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(tt.a),s.Pb(x.h),s.Pb(ni.b),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-lebel-modal"]],viewQuery:function(e,t){if(1&e&&s.Ec(hu,!0),2&e){let e;s.vc(e=s.ec())&&(t.form=e.first)}},decls:20,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",1,"padding-gap","overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex.gt-sm","100"],["autoFocus","","matInput","","placeholder","UTXO Label","name","label","tabindex","1","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["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"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],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,"Label UTXO"),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.dc("submit",function(){return t.onLabelUTXO()})("reset",function(){return t.resetData()}),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10),s.dc("ngModelChange",function(e){return t.label=e}),s.Ub(),s.Ic(13,mu,2,0,"mat-error",11),s.Ub(),s.Ic(14,fu,3,2,"div",12),s.Vb(15,"div",13),s.Vb(16,"button",14),s.Kc(17,"Clear"),s.Ub(),s.Vb(18,"button",15),s.Kc(19,"Label UTXO"),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.label),s.Db(1),s.oc("ngIf",!t.label),s.Db(1),s.oc("ngIf",""!==t.labelError))},directives:[c.c,c.a,V.c,c.b,S.a,re.d,V.b,be.u,be.n,be.o,O.c,ue.b,be.c,de.a,be.s,be.m,be.p,a.o,O.b,C.a],styles:[""]}),e})();function yu(e,t){1&e&&s.Qb(0,"mat-progress-bar",28)}function xu(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Transaction ID "),s.Ub())}function vu(e,t){1&e&&(s.Vb(0,"span",35),s.Vb(1,"mat-icon",36),s.Kc(2,"warning"),s.Ub(),s.Ub())}function wu(e,t){if(1&e&&(s.Vb(0,"span"),s.Ic(1,vu,3,0,"span",34),s.Ub()),2&e){const e=s.hc().$implicit;s.hc();const t=s.wc(34);s.Db(1),s.oc("ngIf",e.amount_sat<1e3)("ngIfElse",t)}}const Cu=function(e){return{"max-width":e}};function Uu(e,t){if(1&e&&(s.Vb(0,"td",30),s.Vb(1,"span",31),s.Ic(2,wu,2,2,"span",32),s.Vb(3,"span",33),s.Kc(4),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(3,Cu,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),s.Db(2),s.oc("ngIf",n.numDustUTXOs>0&&!n.isDustUTXO),s.Db(2),s.Lc(e.outpoint.txid_str)}}function Vu(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1," Output "),s.Ub())}function Du(e,t){if(1&e&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.Db(2),s.Lc(e.outpoint.output_index)}}function Su(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Label "),s.Ub())}function Lu(e,t){if(1&e&&(s.Vb(0,"td",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Cu,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),s.Db(1),s.Mc(" ",null==e?null:e.label," ")}}function Iu(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1," Amount (Sats) "),s.Ub())}function _u(e,t){if(1&e&&(s.Vb(0,"td",38),s.Vb(1,"span",39),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,e.amount_sat||0))}}function ku(e,t){1&e&&(s.Vb(0,"th",37),s.Kc(1," Confirmations "),s.Ub())}function Fu(e,t){if(1&e&&(s.Vb(0,"td",38),s.Vb(1,"span",39),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,e.confirmations||0))}}function Au(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",40),s.Vb(1,"div",41),s.Vb(2,"mat-select",42),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",43),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 Tu(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",44),s.Vb(1,"div",45),s.Vb(2,"mat-select",46),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",43),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onUTXOClick(n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",43),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onLabelUTXO(n)}),s.Kc(7,"Label"),s.Ub(),s.Vb(8,"mat-option",43),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onLeaseUTXO(n)}),s.Kc(9,"Lease"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Pu(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No UTXOs available."),s.Ub())}function Ou(e,t){if(1&e&&(s.Vb(0,"td",47),s.Ic(1,Pu,2,0,"p",32),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 Ku=function(e){return{"display-none":e}};function Ru(e,t){if(1&e&&s.Qb(0,"tr",48),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Ku,(null==e.listUTXOs?null:e.listUTXOs.data)&&(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)>0))}}function Mu(e,t){1&e&&s.Qb(0,"tr",49)}function Eu(e,t){1&e&&s.Qb(0,"tr",50)}function zu(e,t){1&e&&s.Qb(0,"mat-icon",36)}const Nu=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Bu=function(){return["no_utxo"]};let Gu=(()=>{class e{constructor(e,t,n,a,i,o){this.logger=e,this.commonService=t,this.dataService=n,this.store=a,this.rtlEffects=i,this.decimalPipe=o,this.numDustUTXOs=0,this.isDustUTXO=!1,this.addressType=f.A,this.faMoneyBillWave=p.A,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["amount_sat","confirmations","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["tx_id","output","amount_sat","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["tx_id","output","label","amount_sat","confirmations","actions"]):(this.flgSticky=!0,this.displayedColumns=["tx_id","output","label","amount_sat","confirmations","actions"])}ngOnChanges(){this.utxos&&this.utxos.length>0&&this.loadUTXOsTable(this.utxos)}applyFilter(e){this.listUTXOs.filter=e.value.trim().toLowerCase()}onUTXOClick(e){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"UTXO Information",message:[[{key:"txid",value:e.outpoint.txid_str,title:"Transaction ID",width:100,type:f.h.STRING}],[{key:"label",value:e.label,title:"Label",width:100,type:f.h.STRING}],[{key:"output_index",value:e.outpoint.output_index,title:"Output Index",width:34,type:f.h.NUMBER},{key:"amount_sat",value:e.amount_sat,title:"Amount (Sats)",width:33,type:f.h.NUMBER},{key:"confirmations",value:e.confirmations,title:"Confirmations",width:33,type:f.h.NUMBER}],[{key:"address_type",value:this.addressType[e.address_type].name,title:"Address Type",width:34},{key:"address",value:e.address,title:"Address",width:66}],[{key:"pk_script",value:e.pk_script,title:"PK Script",width:100,type:f.h.STRING}]]}}))}loadUTXOsTable(e){this.listUTXOs=new le.o([...e]),this.listUTXOs.filterPredicate=(e,t)=>((e.label?e.label:"")+(e.outpoint.txid_str?e.outpoint.txid_str:"")+(e.outpoint.output_index?e.outpoint.output_index:"")+(e.outpoint.txid_bytes?e.outpoint.txid_bytes:"")+(e.address?e.address:"")+(e.address_type?e.address_type:"")+(e.amount_sat?e.amount_sat:"")+(e.confirmations?e.confirmations:"")+(e.pk_script?e.pk_script:"")).includes(t),this.listUTXOs.sortingDataAccessor=(e,t)=>{switch(t){case"tx_id":return e.outpoint.txid_str.toLocaleLowerCase();case"output":return+e.outpoint.output_index;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.listUTXOs.sort=this.sort,this.listUTXOs.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.listUTXOs.paginator=this.paginator,this.logger.info(this.listUTXOs)}onLabelUTXO(e){this.store.dispatch(new H.D({data:{utxo:e,component:gu}}))}onLeaseUTXO(e){const t=[[{key:"txid_str",value:e.outpoint.txid_str,title:"Transaction ID",width:100}],[{key:"amount_sat",value:this.decimalPipe.transform(e.amount_sat),title:"Amount (Sats)",width:100}]];e.label&&t.splice(1,0,[{key:"label",value:e.label,title:"Label",width:100}]),this.store.dispatch(new H.E({data:{type:f.b.CONFIRM,alertTitle:"Lease UTXO",informationMessage:"The UTXO will be leased for 10 minutes.",message:t,noBtnText:"Cancel",yesBtnText:"Lease UTXO"}})),this.rtlEffects.closeConfirm.pipe(Object(d.a)(this.unSubs[0])).subscribe(t=>{t&&this.dataService.leaseUTXO(e.outpoint.txid_bytes,e.outpoint.output_index)})}onDownloadCSV(){this.listUTXOs.data&&this.listUTXOs.data.length>0&&this.commonService.downloadFile(this.listUTXOs.data,"UTXOs")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(w.a),s.Pb(tt.a),s.Pb(x.h),s.Pb(pt.a),s.Pb(a.f))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-utxos"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("UTXOs")}]),s.Bb],decls:35,vars:13,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","end stretch","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["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","tx_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","output"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","label"],["matColumnDef","amount_sat"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-3",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","",3,"ngStyle"],["fxLayout","row"],[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"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["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,"pl-3"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","2",1,"mr-0"],["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.Vb(2,"mat-form-field",2),s.Vb(3,"input",3),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(4,"div",4),s.Vb(5,"div",5),s.Ic(6,yu,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,xu,2,0,"th",10),s.Ic(11,Uu,5,5,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,Vu,2,0,"th",13),s.Ic(14,Du,3,1,"td",14),s.Sb(),s.Tb(15,15),s.Ic(16,Su,2,0,"th",10),s.Ic(17,Lu,2,4,"td",11),s.Sb(),s.Tb(18,16),s.Ic(19,Iu,2,0,"th",13),s.Ic(20,_u,4,3,"td",14),s.Sb(),s.Tb(21,17),s.Ic(22,ku,2,0,"th",13),s.Ic(23,Fu,4,3,"td",14),s.Sb(),s.Tb(24,18),s.Ic(25,Au,6,0,"th",19),s.Ic(26,Tu,10,0,"td",20),s.Sb(),s.Tb(27,21),s.Ic(28,Ou,2,1,"td",22),s.Sb(),s.Ic(29,Ru,1,3,"tr",23),s.Ic(30,Mu,1,0,"tr",24),s.Ic(31,Eu,1,0,"tr",25),s.Ub(),s.Qb(32,"mat-paginator",26),s.Ub(),s.Ub(),s.Ub(),s.Ic(33,zu,1,0,"ng-template",null,27,s.Jc)),2&e&&(s.Db(6),s.oc("ngIf",!0===t.errorLoading),s.Db(1),s.oc("dataSource",t.listUTXOs)("ngClass",s.sc(10,Nu,"error"===t.errorLoading)),s.Db(22),s.oc("matFooterRowDef",s.rc(12,Bu)),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,O.c,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.p,I.b,K.a,L.a,me.a,me.c,fe.m,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-label[_ngcontent-%COMP%]{padding-left:1rem;flex:1 1 15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-tx_id[_ngcontent-%COMP%]{flex:1 1 15%}.mat-column-tx_id[_ngcontent-%COMP%] .ellipsis-child[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();function qu(e,t){1&e&&s.Qb(0,"mat-progress-bar",28)}function Qu(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Date/Time "),s.Ub())}function Hu(e,t){if(1&e&&(s.Vb(0,"td",30),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.Lc(e.time_stamp_str)}}function ju(e,t){1&e&&(s.Vb(0,"th",29),s.Kc(1," Label "),s.Ub())}const $u=function(e){return{"max-width":e}};function Wu(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,$u,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),s.Db(1),s.Mc(" ",null==e?null:e.label," ")}}function Xu(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Amount (Sats) "),s.Ub())}function Ju(e,t){if(1&e&&(s.Vb(0,"span",35),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.amount))}}function Yu(e,t){if(1&e&&(s.Vb(0,"span",36),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.amount),")")}}function Zu(e,t){if(1&e&&(s.Vb(0,"td",30),s.Ic(1,Ju,3,3,"span",33),s.Ic(2,Yu,3,3,"span",34),s.Ub()),2&e){const e=t.$implicit;s.Db(1),s.oc("ngIf",e.amount>0||0===e.amount),s.Db(1),s.oc("ngIf",e.amount<0)}}function ed(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Fees (Sats) "),s.Ub())}function td(e,t){if(1&e&&(s.Vb(0,"td",30),s.Vb(1,"span",35),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,e.total_fees))}}function nd(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Block Height "),s.Ub())}function ad(e,t){if(1&e&&(s.Vb(0,"td",30),s.Vb(1,"span",35),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,e.block_height))}}function id(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Confirmations "),s.Ub())}function od(e,t){if(1&e&&(s.Vb(0,"td",30),s.Vb(1,"span",35),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.num_confirmations)," ")}}function sd(e,t){if(1&e){const e=s.Wb();s.Vb(0,"th",37),s.Vb(1,"div",38),s.Vb(2,"mat-select",39),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",40),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 cd(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",41),s.Vb(1,"button",42),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onTransactionClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function ld(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No transactions available."),s.Ub())}function rd(e,t){if(1&e&&(s.Vb(0,"td",43),s.Ic(1,ld,2,0,"p",44),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)}}const bd=function(e){return{"display-none":e}};function ud(e,t){if(1&e&&s.Qb(0,"tr",45),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,bd,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function dd(e,t){1&e&&s.Qb(0,"tr",46)}function hd(e,t){1&e&&s.Qb(0,"tr",47)}const md=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},pd=function(){return["no_transaction"]};let fd=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.actions$=a,this.faHistory=p.r,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.p,this.pageSizeOptions=f.q,this.screenSize="",this.screenSizeEnum=f.s,this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","actions"]):this.screenSize===f.s.SM?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","num_confirmations","total_fees","actions"]):this.screenSize===f.s.MD?(this.flgSticky=!1,this.displayedColumns=["time_stamp","label","amount","total_fees","num_confirmations","actions"]):(this.flgSticky=!0,this.displayedColumns=["time_stamp","label","amount","total_fees","block_height","num_confirmations","actions"])}ngOnChanges(){this.transactions&&this.transactions.length>0&&this.loadTransactionsTable(this.transactions)}applyFilter(e){this.listTransactions.filter=e.value.trim().toLowerCase()}onTransactionClick(e){this.store.dispatch(new H.D({data:{type:f.b.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"block_hash",value:e.block_hash,title:"Block Hash",width:100}],[{key:"tx_hash",value:e.tx_hash,title:"Transaction Hash",width:100}],[{key:"label",value:e.label,title:"Label",width:100,type:f.h.STRING}],[{key:"time_stamp_str",value:e.time_stamp_str,title:"Date/Time",width:50,type:f.h.DATE_TIME},{key:"block_height",value:e.block_height,title:"Block Height",width:50,type:f.h.NUMBER}],[{key:"num_confirmations",value:e.num_confirmations,title:"Number of Confirmations",width:34,type:f.h.NUMBER},{key:"total_fees",value:e.total_fees,title:"Total Fees (Sats)",width:33,type:f.h.NUMBER},{key:"amount",value:e.amount,title:"Amount (Sats)",width:33,type:f.h.NUMBER}],[{key:"dest_addresses",value:e.dest_addresses,title:"Destination Addresses",width:100,type:f.h.ARRAY}]],scrollable:e.dest_addresses&&e.dest_addresses.length>5}}))}loadTransactionsTable(e){this.listTransactions=new le.o([...e]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.listTransactions.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.listTransactions.paginator=this.paginator,this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(y.b),s.Pb(w.a),s.Pb(x.h),s.Pb(v.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-transaction-history"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:{transactions:"transactions",errorLoading:"errorLoading"},features:[s.Cb([{provide:se.b,useValue:Object(f.B)("Transactions")}]),s.Bb],decls:36,vars:13,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","end stretch","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["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","time_stamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","label"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","total_fees"],["matColumnDef","block_height"],["matColumnDef","num_confirmations"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["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"],[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.Vb(2,"mat-form-field",2),s.Vb(3,"input",3),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(4,"div",4),s.Vb(5,"div",5),s.Ic(6,qu,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,Qu,2,0,"th",10),s.Ic(11,Hu,2,1,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,ju,2,0,"th",10),s.Ic(14,Wu,2,4,"td",13),s.Sb(),s.Tb(15,14),s.Ic(16,Xu,2,0,"th",15),s.Ic(17,Zu,3,2,"td",11),s.Sb(),s.Tb(18,16),s.Ic(19,ed,2,0,"th",15),s.Ic(20,td,4,3,"td",11),s.Sb(),s.Tb(21,17),s.Ic(22,nd,2,0,"th",15),s.Ic(23,ad,4,3,"td",11),s.Sb(),s.Tb(24,18),s.Ic(25,id,2,0,"th",15),s.Ic(26,od,4,3,"td",11),s.Sb(),s.Tb(27,19),s.Ic(28,sd,6,0,"th",20),s.Ic(29,cd,3,0,"td",21),s.Sb(),s.Tb(30,22),s.Ic(31,rd,2,1,"td",23),s.Sb(),s.Ic(32,ud,1,3,"tr",24),s.Ic(33,dd,1,0,"tr",25),s.Ic(34,hd,1,0,"tr",26),s.Ub(),s.Qb(35,"mat-paginator",27),s.Ub(),s.Ub(),s.Ub()),2&e&&(s.Db(6),s.oc("ngIf",!0===t.errorLoading),s.Db(1),s.oc("dataSource",t.listTransactions)("ngClass",s.sc(10,md,"error"===t.errorLoading)),s.Db(25),s.oc("matFooterRowDef",s.rc(12,pd)),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,O.c,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.p,I.b,me.a,me.c,fe.m,S.a,le.d,le.f,le.j,le.l],pipes:[a.f],styles:[".mat-column-label[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();function gd(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 yd(e,t){if(1&e&&(s.Vb(0,"span",5),s.Kc(1,"Transactions"),s.Ub()),2&e){const e=s.hc();s.pc("matBadge",e.numTransactions)}}function xd(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 vd=(()=>{class e{constructor(e,t){this.logger=e,this.store=t,this.selectedTableIndex=0,this.selectedTableIndexChange=new s.o,this.transactions=[],this.numTransactions=0,this.utxos=[],this.numUtxos=0,this.dustUtxos=[],this.numDustUtxos=0,this.flgLoading=[!0,!0],this.unSubs=[new u.a]}ngOnInit(){this.store.dispatch(new g.M),this.store.dispatch(new g.N),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchUTXOs"===e.action&&(this.flgLoading[0]="error"),"FetchTransactions"===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.amount_sat<1e3),this.numDustUtxos=this.dustUtxos.length),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!e.utxos),e.transactions&&e.transactions.length>0&&(this.transactions=e.transactions,this.numTransactions=this.transactions.length),"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!e.transactions),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-utxo-tables"]],inputs:{selectedTableIndex:"selectedTableIndex"},outputs:{selectedTableIndexChange:"selectedTableIndexChange"},decls:11,vars:11,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"bordered-box"],[3,"selectedIndex","selectedIndexChange"],["mat-tab-label",""],["fxLayout","row","fxFlex","100",3,"utxos","errorLoading","numDustUTXOs","isDustUTXO"],["fxLayout","row","fxFlex","100",3,"transactions","errorLoading"],["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,gd,2,1,"ng-template",2),s.Qb(4,"rtl-on-chain-utxos",3),s.Ub(),s.Vb(5,"mat-tab"),s.Ic(6,yd,2,1,"ng-template",2),s.Qb(7,"rtl-on-chain-transaction-history",4),s.Ub(),s.Vb(8,"mat-tab"),s.Ic(9,xd,2,1,"ng-template",2),s.Qb(10,"rtl-on-chain-utxos",3),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("transactions",t.transactions)("errorLoading",t.flgLoading[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,oe.b,oe.a,oe.c,Gu,fd,Qn.a],styles:[""]}),e})();const wd=function(e,t){return[e,t]};function Cd(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,wd,e.link,n.selectedTable.name)),s.Db(1),s.Lc(e.name)}}let Ud=(()=>{class e{constructor(e,t,n){this.store=e,this.router=t,this.activatedRoute=n,this.selNode={},this.faExchangeAlt=p.n,this.faChartPie=p.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:"trans"},{id:2,name:"dustUtxos"}],this.selectedTable=this.tables[0],this.unSubs=[new u.a,new u.a,new u.a,new u.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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.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("lnd").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.selNode=e.nodeSettings,this.balances=[{title:"Total Balance",dataValue:e.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:e.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:e.blockchainBalance.unconfirmed_balance}]})}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(i.g),s.Pb(i.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,Cd,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-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,C.a,V.a,V.b,qn.a,oe.e,a.n,c.a,i.l,vd,oe.d,i.h],styles:[""]}),e})();var Vd=n("Ysfc");function Dd(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 Sd=(()=>{class e{constructor(e,t){this.store=e,this.lndEffects=t,this.addressTypes=f.a,this.selectedAddressType=f.a[0],this.newAddress=""}onGenerateAddress(){this.store.dispatch(new H.G("Getting New Address...")),this.store.dispatch(new g.V(this.selectedAddressType)),this.lndEffects.setNewAddress.pipe(Object(et.a)(1)).subscribe(e=>{this.newAddress=e,this.store.dispatch(new H.D({width:"58%",data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:Vd.a}}))})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(ft.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-receive"]],decls:8,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","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,Dd,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,me.a,be.m,be.p,a.n,S.a,fe.m],styles:[""]}),e})();var Ld=n("Cyaj");const Id=["form"],_d=["formSweepAll"],kd=["stepper"];function Fd(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Bitcoin address is required."),s.Ub())}function Ad(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Td(e,t){if(1&e&&(s.Vb(0,"mat-option",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e),s.Db(1),s.Lc(e)}}function Pd(e,t){if(1&e&&(s.Vb(0,"mat-option",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.id),s.Db(1),s.Mc(" ",e.name," ")}}function Od(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Number of blocks is required."),s.Ub())}function Kd(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",23),s.Vb(1,"input",32,33),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).transactionBlocks=t}),s.Ub(),s.Ic(3,Od,2,0,"mat-error",14),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.oc("ngModel",e.transactionBlocks)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.transactionBlocks)}}function Rd(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Fees is required."),s.Ub())}function Md(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-form-field",23),s.Vb(1,"input",34,35),s.dc("ngModelChange",function(t){return s.zc(e),s.hc(2).transactionFees=t}),s.Ub(),s.Ic(3,Rd,2,0,"mat-error",14),s.Ub()}if(2&e){const e=s.hc(2);s.Db(1),s.qc("placeholder","Fees (",null==e.nodeData?null:e.nodeData.smaller_currency_unit,"/Byte)"),s.oc("ngModel",e.transactionFees)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.transactionFees)}}function Ed(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 zd(e,t){if(1&e&&(s.Vb(0,"div",36),s.Qb(1,"fa-icon",37),s.Ic(2,Ed,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 Nd(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().transactionAddress=t}),s.Ub(),s.Ic(5,Fd,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().transactionAmount=t}),s.Ub(),s.Vb(9,"span",18),s.Kc(10),s.Ub(),s.Ic(11,Ad,2,0,"mat-error",14),s.Ub(),s.Vb(12,"mat-form-field",19),s.Vb(13,"mat-select",20),s.dc("selectionChange",function(t){return s.zc(e),s.hc().onAmountUnitChange(t)}),s.Ic(14,Td,2,2,"mat-option",21),s.Ub(),s.Ub(),s.Vb(15,"div",22),s.Vb(16,"mat-form-field",23),s.Vb(17,"mat-select",24),s.dc("valueChange",function(t){return s.zc(e),s.hc().selTransType=t}),s.Ic(18,Pd,2,2,"mat-option",21),s.Ub(),s.Ub(),s.Ic(19,Kd,4,4,"mat-form-field",25),s.Ic(20,Md,4,5,"mat-form-field",25),s.Ub(),s.Qb(21,"div",26),s.Ic(22,zd,3,2,"div",27),s.Vb(23,"div",28),s.Vb(24,"button",29),s.Kc(25,"Clear Fields"),s.Ub(),s.Vb(26,"button",30),s.Kc(27,"Send Funds"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(3),s.oc("ngModel",e.transactionAddress),s.Db(2),s.oc("ngIf",!e.transactionAddress),s.Db(2),s.oc("ngModel",e.transactionAmount)("step",100)("min",0),s.Db(3),s.Mc(" ",e.selAmountUnit," "),s.Db(1),s.oc("ngIf",!e.transactionAmount),s.Db(2),s.oc("value",e.selAmountUnit),s.Db(1),s.oc("ngForOf",e.amountUnits),s.Db(3),s.oc("value",e.selTransType),s.Db(1),s.oc("ngForOf",e.transTypes),s.Db(1),s.oc("ngIf","1"==e.selTransType),s.Db(1),s.oc("ngIf","2"==e.selTransType),s.Db(2),s.oc("ngIf",""!==e.sendFundError)}}function Bd(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(3);s.Lc(e.passwordFormLabel)}}function Gd(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Password is required."),s.Ub())}function qd(e,t){if(1&e){const e=s.Wb();s.Vb(0,"mat-step",42),s.Vb(1,"form",61),s.Ic(2,Bd,1,1,"ng-template",55),s.Vb(3,"div",0),s.Vb(4,"mat-form-field",62),s.Qb(5,"input",63),s.Ic(6,Gd,2,0,"mat-error",14),s.Ub(),s.Ub(),s.Vb(7,"div",64),s.Vb(8,"button",65),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 Qd(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(2);s.Lc(e.sendFundFormLabel)}}function Hd(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Bitcoin address is required."),s.Ub())}function jd(e,t){if(1&e&&(s.Vb(0,"mat-option",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit;s.oc("value",e.id),s.Db(1),s.Mc(" ",e.name," ")}}function $d(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Number of blocks is required."),s.Ub())}function Wd(e,t){if(1&e&&(s.Vb(0,"mat-form-field",66),s.Qb(1,"input",67),s.Ic(2,$d,2,0,"mat-error",14),s.Ub()),2&e){const e=s.hc(2);s.Db(1),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)}}function Xd(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Fees is required."),s.Ub())}function Jd(e,t){if(1&e&&(s.Vb(0,"mat-form-field",66),s.Qb(1,"input",68),s.Ic(2,Xd,2,0,"mat-error",14),s.Ub()),2&e){const e=s.hc(2);s.Db(1),s.qc("placeholder","Fees (",null==e.nodeData?null:e.nodeData.smaller_currency_unit,"/Byte)"),s.oc("step",1)("min",0),s.Db(1),s.oc("ngIf",null==e.sendFundFormGroup.controls.transactionFees.errors?null:e.sendFundFormGroup.controls.transactionFees.errors.required)}}function Yd(e,t){if(1&e&&s.Kc(0),2&e){const e=s.hc(2);s.Lc(e.confirmFormLabel)}}function Zd(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 eh(e,t){if(1&e&&(s.Vb(0,"div",36),s.Qb(1,"fa-icon",37),s.Ic(2,Zd,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 th(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",38),s.Vb(1,"mat-vertical-stepper",39,40),s.dc("selectionChange",function(t){return s.zc(e),s.hc().stepSelectionChanged(t)}),s.Ic(3,qd,10,4,"mat-step",41),s.Vb(4,"mat-step",42),s.Vb(5,"form",43),s.Ic(6,Qd,1,1,"ng-template",44),s.Vb(7,"div",45),s.Vb(8,"mat-form-field",46),s.Qb(9,"input",47),s.Ic(10,Hd,2,0,"mat-error",14),s.Ub(),s.Vb(11,"mat-form-field",48),s.Vb(12,"mat-select",49),s.Ic(13,jd,2,2,"mat-option",21),s.Ub(),s.Ub(),s.Ic(14,Wd,3,3,"mat-form-field",50),s.Ic(15,Jd,3,4,"mat-form-field",50),s.Ub(),s.Vb(16,"div",51),s.Vb(17,"button",52),s.Kc(18,"Next"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(19,"mat-step",53),s.Vb(20,"form",54),s.Ic(21,Yd,1,1,"ng-template",55),s.Vb(22,"div",38),s.Vb(23,"div",56),s.Qb(24,"fa-icon",57),s.Vb(25,"span"),s.Kc(26,"You are about to sweep all funds from RTL. Are you sure?"),s.Ub(),s.Ub(),s.Ic(27,eh,3,2,"div",27),s.Vb(28,"div",51),s.Vb(29,"button",58),s.dc("click",function(){return s.zc(e),s.hc().onSendFunds()}),s.Kc(30,"Sweep All Funds"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(31,"div",59),s.Vb(32,"button",60),s.Kc(33),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(3),s.oc("ngForOf",e.transTypes),s.Db(1),s.oc("ngIf","1"==e.sendFundFormGroup.controls.selTransType.value),s.Db(1),s.oc("ngIf","2"==e.sendFundFormGroup.controls.selTransType.value),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 nh=(()=>{class e{constructor(e,t,n,a,i,o,s,c,l,r){this.dialogRef=e,this.data=t,this.logger=n,this.store=a,this.rtlEffects=i,this.commonService=o,this.decimalPipe=s,this.snackBar=c,this.actions$=l,this.formBuilder=r,this.faExclamationTriangle=p.o,this.sweepAll=!1,this.selNode={},this.addressTypes=[],this.flgLoadingWallet=!0,this.selectedAddress={},this.blockchainBalance={},this.information={},this.newAddress="",this.transactionAddress="",this.transactionAmount=null,this.transactionFees=null,this.transactionBlocks=null,this.transTypes=[{id:"1",name:"Target Confirmation Blocks"},{id:"2",name:"Fee"}],this.selTransType="1",this.fiatConversion=!1,this.amountUnits=f.e,this.selAmountUnit=f.e[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=f.f,this.sendFundError="",this.flgValidated=!1,this.flgEditable=!0,this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds",this.confirmFormLabel="Confirm sweep",this.unSubs=[new u.a,new u.a,new u.a,new u.a,new u.a]}ngOnInit(){this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[be.t.required]],password:["",[be.t.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",be.t.required],transactionBlocks:[null],transactionFees:[null],selTransType:["1",be.t.required]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.selTransType.valueChanges.pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{"1"===e?(this.sendFundFormGroup.controls.transactionBlocks.setValidators([be.t.required]),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionFees.setValidators(null),this.sendFundFormGroup.controls.transactionFees.setValue(null)):(this.sendFundFormGroup.controls.transactionBlocks.setValidators(null),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionFees.setValidators([be.t.required]),this.sendFundFormGroup.controls.transactionFees.setValue(null))}),this.store.select("root").pipe(Object(d.a)(this.unSubs[1])).subscribe(e=>{this.fiatConversion=e.selNode.settings.fiatConversion,this.amountUnits=e.selNode.settings.currencyUnits,this.appConfig=e.appConfig,this.nodeData=e.nodeData,this.logger.info(e)}),this.actions$.pipe(Object(d.a)(this.unSubs[2]),Object(h.a)(e=>e.type===g.m||e.type===g.wb)).subscribe(e=>{e.type===g.wb&&(this.store.dispatch(new H.F(this.sweepAll?"All Funds Sent Successfully!":"Fund Sent Successfully!")),this.dialogRef.close()),e.type===g.m&&"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 H.u(Ld(this.passwordFormGroup.controls.password.value))),this.rtlEffects.isAuthorizedRes.pipe(Object(et.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="";let e=this.transactionAmount?this.transactionAmount:0;this.transactionAmount&&this.selAmountUnit!==f.g.SATS&&this.commonService.convertCurrency(e,this.selAmountUnit===this.amountUnits[2]?f.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(d.a)(this.unSubs[3])).subscribe(t=>{e=+this.decimalPipe.transform(t[this.amountUnits[0]],this.currencyUnitFormats[this.amountUnits[0]]).replace(/,/g,"")}),this.store.dispatch(new H.G("Sending Funds..."));const t={amount:e,sendAll:this.sweepAll};this.sweepAll?(t.address=this.sendFundFormGroup.controls.transactionAddress.value,"1"===this.sendFundFormGroup.controls.selTransType.value&&(t.blocks=this.sendFundFormGroup.controls.transactionBlocks.value),"2"===this.sendFundFormGroup.controls.selTransType.value&&(t.fees=this.sendFundFormGroup.controls.transactionFees.value)):(t.address=this.transactionAddress,"1"===this.selTransType&&(t.blocks=this.transactionBlocks),"2"===this.selTransType&&(t.fees=this.transactionFees)),this.store.dispatch(new g.Tb(t))}get invalidValues(){return this.sweepAll?!this.sendFundFormGroup.controls.transactionAddress.value||""===this.sendFundFormGroup.controls.transactionAddress.value||"1"===this.sendFundFormGroup.controls.selTransType.value&&(!this.sendFundFormGroup.controls.transactionBlocks.value||this.sendFundFormGroup.controls.transactionBlocks.value<=0)||"2"===this.sendFundFormGroup.controls.selTransType.value&&(!this.sendFundFormGroup.controls.transactionFees.value||this.sendFundFormGroup.controls.transactionFees.value<=0):!this.transactionAddress||""===this.transactionAddress||!this.transactionAmount||this.transactionAmount<=0||"1"===this.selTransType&&(!this.transactionBlocks||this.transactionBlocks<=0)||"2"===this.selTransType&&(!this.transactionFees||this.transactionFees<=0)}resetData(){this.sendFundError="",this.selTransType="1",this.transactionAddress="",this.transactionBlocks=null,this.transactionFees=null,this.sweepAll||(this.transactionAmount=null)}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.transTypes[this.sendFundFormGroup.controls.selTransType.value-1].name+("2"===this.sendFundFormGroup.controls.selTransType.value?" ("+this.nodeData.smaller_currency_unit+"/Byte)":"")+": "+("1"===this.sendFundFormGroup.controls.selTransType.value?this.sendFundFormGroup.controls.transactionBlocks.value:this.sendFundFormGroup.controls.transactionFees.value);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("")}onAmountUnitChange(e){let t=this,n=e.value===this.amountUnits[2]?f.g.OTHER:e.value;this.transactionAmount&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(this.transactionAmount?this.transactionAmount:0,this.sweepAll?f.g.SATS:this.selAmountUnit===this.amountUnits[2]?f.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(d.a)(this.unSubs[3])).subscribe(e=>{t.transactionAmount=+t.decimalPipe.transform(e[n],t.currencyUnitFormats[n]).replace(/,/g,"")}),this.selAmountUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(re.f),s.Pb(re.a),s.Pb(y.b),s.Pb(x.h),s.Pb(pt.a),s.Pb(w.a),s.Pb(a.f),s.Pb(ni.b),s.Pb(v.a),s.Pb(be.d))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-send-modal"]],viewQuery:function(e,t){if(1&e&&(s.Ec(Id,!0),s.Pc(_d,!0),s.Pc(kd,!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.gt-sm","55"],["autoFocus","","matInput","","placeholder","Bitcoin Address","tabindex","1","name","address","required","",3,"ngModel","ngModelChange"],["address","ngModel"],[4,"ngIf"],["fxFlex.gt-sm","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"ngModel","step","min","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex.gt-sm","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","60","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["fxFlex","48"],["tabindex","4",3,"value","valueChange"],["fxFlex","48",4,"ngIf"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","40","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["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"],["matInput","","placeholder","Number of Blocks","type","number","name","blcks","required","","tabindex","5",3,"ngModel","step","min","ngModelChange"],["blocks","ngModel"],["matInput","","type","number","name","chainFees","required","","tabindex","6",3,"ngModel","placeholder","step","min","ngModelChange"],["fees","ngModel"],["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"],["fxLayout","column","fxFlex","98","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["fxFlex.gt-sm","45"],["matInput","","formControlName","transactionAddress","placeholder","Bitcoin Address","tabindex","4","name","address","required",""],["fxFlex.gt-sm","25"],["formControlName","selTransType","tabindex","5"],["fxFlex.gt-sm","25","fxLayoutAlign","start end",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","8","type","button","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"],["fxFlex","100"],["autoFocus","","matInput","","placeholder","Password","type","password","tabindex","1","formControlName","password","required",""],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","button",3,"click"],["fxFlex.gt-sm","25","fxLayoutAlign","start end"],["matInput","","formControlName","transactionBlocks","placeholder","Number of Blocks","type","number","name","blcks","required","","tabindex","6",3,"step","min"],["matInput","","formControlName","transactionFees","type","number","name","chainFees","required","","tabindex","7",3,"placeholder","step","min"]],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,Nd,28,14,"form",7),s.Ub(),s.Ub(),s.Ub(),s.Ic(10,th,34,15,"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,V.c,c.b,S.a,re.d,V.b,a.o,be.u,be.n,be.o,O.c,ue.b,be.c,de.a,be.s,be.m,be.p,be.q,he.a,O.g,me.a,a.n,O.b,fe.m,C.a,ma.h,ma.a,be.h,ma.b,be.g,ma.f],styles:[""]}),e})(),ah=(()=>{class e{constructor(e,t){this.store=e,this.activatedRoute=t,this.sweepAll=!1,this.unSubs=[new u.a,new u.a]}ngOnInit(){this.activatedRoute.data.pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>this.sweepAll=e.sweepAll)}openSendFundsModal(){this.store.dispatch(new H.D({data:{sweepAll:this.sweepAll,component:nh}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(s.Pb(x.h),s.Pb(i.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,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})();const ih=function(e){return{"error-border":e}};function oh(e,t){if(1&e&&s.Qb(0,"rtl-node-info",24),2&e){const e=s.hc(3);s.oc("information",e.information)("showColorFieldSeparately",!0)("ngClass",s.sc(3,ih,"error"===e.flgLoading[0]))}}function sh(e,t){if(1&e&&s.Qb(0,"rtl-channel-status-info",25),2&e){const e=s.hc(3);s.oc("channelsStatus",e.channelsStatus)("ngClass",s.sc(2,ih,"error"===e.flgLoading[3]||"error"===e.flgLoading[4]))}}function ch(e,t){if(1&e&&s.Qb(0,"rtl-fee-info",26),2&e){const e=s.hc(3);s.oc("fees",e.fees)("ngClass",s.sc(2,ih,"error"===e.flgLoading[2]))}}function lh(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",12),s.Vb(1,"div",13),s.Vb(2,"div",14),s.Vb(3,"div",15),s.Qb(4,"fa-icon",16),s.Vb(5,"span"),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",17),s.Vb(8,"mat-card",18),s.Vb(9,"mat-card-content",19),s.Vb(10,"div",20),s.Ic(11,oh,1,5,"rtl-node-info",21),s.Ic(12,sh,1,4,"rtl-channel-status-info",22),s.Ic(13,ch,1,4,"rtl-fee-info",23),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")}}function rh(e,t){if(1&e&&(s.Vb(0,"mat-grid-list",10),s.Ic(1,lh,14,8,"mat-grid-tile",11),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngForOf",e.nodeCards)}}function bh(e,t){1&e&&s.Rb(0)}function uh(e,t){if(1&e&&(s.Vb(0,"div",30),s.Ic(1,bh,1,0,"ng-container",31),s.Ub()),2&e){const e=s.hc(2),t=s.wc(9);s.oc("ngClass",s.sc(2,ih,"error"===e.flgLoading[1])),s.Db(1),s.oc("ngTemplateOutlet",t)}}function dh(e,t){1&e&&s.Rb(0)}function hh(e,t){if(1&e&&(s.Vb(0,"div",30),s.Ic(1,dh,1,0,"ng-container",31),s.Ub()),2&e){const e=s.hc(2),t=s.wc(11);s.oc("ngClass",s.sc(2,ih,"error"===e.flgLoading[1])),s.Db(1),s.oc("ngTemplateOutlet",t)}}function mh(e,t){1&e&&s.Rb(0)}function ph(e,t){if(1&e&&(s.Vb(0,"div",30),s.Ic(1,mh,1,0,"ng-container",31),s.Ub()),2&e){const e=s.hc(2),t=s.wc(13);s.oc("ngClass",s.sc(2,ih,"error"===e.flgLoading[1])),s.Db(1),s.oc("ngTemplateOutlet",t)}}function fh(e,t){if(1&e&&(s.Vb(0,"mat-grid-tile",27),s.Vb(1,"mat-card",28),s.Vb(2,"mat-card-content",19),s.Vb(3,"div",20),s.Ic(4,uh,2,4,"div",29),s.Ic(5,hh,2,4,"div",29),s.Ic(6,ph,2,4,"div",29),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&e){const e=t.$implicit;s.oc("colspan",e.cols)("rowspan",e.rows),s.Db(3),s.oc("ngSwitch",e.id),s.Db(1),s.oc("ngSwitchCase","general"),s.Db(1),s.oc("ngSwitchCase","channels"),s.Db(1),s.oc("ngSwitchCase","degrees")}}function gh(e,t){if(1&e&&(s.Vb(0,"div",32),s.Vb(1,"div"),s.Vb(2,"h4",33),s.Kc(3,"Network Capacity"),s.Ub(),s.Vb(4,"div",34),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Vb(7,"div"),s.Vb(8,"h4",33),s.Kc(9,"Number of Nodes"),s.Ub(),s.Vb(10,"div",34),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",33),s.Kc(15,"Number of Channels"),s.Ub(),s.Vb(16,"span",34),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(5),s.Mc("",s.jc(6,3,e.networkInfo.total_network_capacity)," Sats"),s.Db(6),s.Lc(s.jc(12,5,e.networkInfo.num_nodes)),s.Db(6),s.Lc(s.jc(18,7,e.networkInfo.num_channels))}}function yh(e,t){if(1&e&&(s.Vb(0,"div",32),s.Vb(1,"div"),s.Vb(2,"h4",33),s.Kc(3,"Max Channel Size"),s.Ub(),s.Vb(4,"div",34),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Vb(7,"div"),s.Vb(8,"h4",33),s.Kc(9,"Avg Channel Size"),s.Ub(),s.Vb(10,"div",34),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",33),s.Kc(15,"Min Channel Size"),s.Ub(),s.Vb(16,"span",34),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(5),s.Lc(s.jc(6,3,e.networkInfo.max_channel_size)),s.Db(6),s.Lc(s.jc(12,5,e.networkInfo.avg_channel_size)),s.Db(6),s.Lc(s.jc(18,7,e.networkInfo.min_channel_size))}}function xh(e,t){if(1&e&&(s.Vb(0,"div",32),s.Vb(1,"div"),s.Vb(2,"h4",33),s.Kc(3,"Max Out Degree"),s.Ub(),s.Vb(4,"div",34),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Vb(7,"div"),s.Vb(8,"h4",33),s.Kc(9,"Avg Out Degree"),s.Ub(),s.Vb(10,"div",34),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ub(),s.Vb(13,"div",35),s.Qb(14,"h4",33),s.Qb(15,"span",34),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(5),s.Lc(s.jc(6,2,e.networkInfo.max_out_degree)),s.Db(6),s.Lc(s.kc(12,4,e.networkInfo.avg_out_degree,"1.0-2"))}}const vh=function(e){return{"mt-1":e}};let wh=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.faProjectDiagram=p.F,this.faBolt=p.e,this.faServer=p.K,this.faNetworkWired=p.B,this.selNode={},this.information={},this.channelsStatus={},this.networkInfo={},this.networkCards=[],this.nodeCards=[],this.screenSize="",this.screenSizeEnum=f.s,this.userPersonaEnum=f.z,this.flgLoading=[!0,!0,!0,!0,!0,!0],this.unSubs=[new u.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.s.XS?(this.networkCards=[{id:"general",cols:3,rows:1},{id:"channels",cols:3,rows:1},{id:"degrees",cols:3,rows:1}],this.nodeCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1}]):(this.networkCards=[{id:"general",cols:1,rows:1},{id:"channels",cols:1,rows:1},{id:"degrees",cols:1,rows:1}],this.nodeCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:1,rows:1},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:1,rows:1},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:1,rows:1}])}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{e.effectErrors.forEach(e=>{"FetchInfo"===e.action&&(this.flgLoading[0]="error"),"FetchNetwork"===e.action&&(this.flgLoading[1]="error"),"FetchFees"===e.action&&(this.flgLoading[2]="error"),"FetchChannels/all"===e.action&&(this.flgLoading[3]="error"),"FetchChannels/pending"===e.action&&(this.flgLoading[4]="error")}),this.selNode=e.nodeSettings,this.information=e.information,"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.information.identity_pubkey),this.networkInfo=e.networkInfo,"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!this.networkInfo.num_nodes),this.fees=e.fees,"error"!==this.flgLoading[2]&&(this.flgLoading[2]=!this.fees.day_fee_sum),this.channelsStatus={active:{channels:e.numberOfActiveChannels,capacity:e.totalCapacityActive},inactive:{channels:e.numberOfInactiveChannels,capacity:e.totalCapacityInactive},pending:{channels:e.numberOfPendingChannels.open.num_channels,capacity:e.numberOfPendingChannels.open.limbo_balance},closing:{channels:e.numberOfPendingChannels.closing.num_channels+e.numberOfPendingChannels.force_closing.num_channels+e.numberOfPendingChannels.waiting_close.num_channels,capacity:e.numberOfPendingChannels.total_limbo_balance}},e.totalLocalBalance>=0&&e.totalRemoteBalance>=0&&"error"!==this.flgLoading[3]&&(this.flgLoading[3]=!1),e.numberOfPendingChannels&&"error"!==this.flgLoading[4]&&(this.flgLoading[4]=!1),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(w.a),s.Pb(x.h))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-network-info"]],decls:14,vars:6,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch",1,"mb-4"],["cols","3","rowHeight","330px",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container",3,"ngClass"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","3","rowHeight","250px"],["fxLayout","row",3,"colspan","rowspan",4,"ngFor","ngForOf"],["generalBlock",""],["channelsBlock",""],["degreesBlock",""],["cols","3","rowHeight","330px"],["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"],[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"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass"],["fxFlex","100",3,"channelsStatus","ngClass"],["fxFlex","100",3,"fees","ngClass"],["fxLayout","row",3,"colspan","rowspan"],["fxLayout","row","fxFlex","95","fxLayoutAlign","start stretch",1,"dashboard-card","h-93"],["fxFlex","100",3,"ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"ngClass"],[4,"ngTemplateOutlet"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxFlex","20"]],template:function(e,t){1&e&&(s.Vb(0,"div",0),s.Ic(1,rh,2,1,"mat-grid-list",1),s.Vb(2,"div",2),s.Qb(3,"fa-icon",3),s.Vb(4,"span",4),s.Kc(5,"Network"),s.Ub(),s.Ub(),s.Vb(6,"mat-grid-list",5),s.Ic(7,fh,7,6,"mat-grid-tile",6),s.Ub(),s.Ub(),s.Ic(8,gh,19,9,"ng-template",null,7,s.Jc),s.Ic(10,yh,19,9,"ng-template",null,8,s.Jc),s.Ic(12,xh,16,7,"ng-template",null,9,s.Jc)),2&e&&(s.Db(1),s.oc("ngIf",t.selNode.userPersona!==t.userPersonaEnum.OPERATOR),s.Db(1),s.oc("ngClass",s.sc(4,vh,t.screenSize!==t.screenSizeEnum.XS)),s.Db(1),s.oc("icon",t.faProjectDiagram),s.Db(4),s.oc("ngForOf",t.networkCards))},directives:[c.c,c.b,a.o,a.m,I.a,C.a,U.a,a.n,U.c,c.a,V.a,V.b,a.q,a.r,T,q,G,a.t],pipes:[a.f],styles:[""]}),e})();function Ch(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 Uh=(()=>{class e{constructor(e){this.router=e,this.faDownload=p.k,this.links=[{link:"bckup",name:"Backup"},{link:"restore",name:"Restore"}],this.activeLink=this.links[0].link,this.unSubs=[new u.a,new u.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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-backup"]],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,"Channels Backup"),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,Ch,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.faDownload),s.Db(7),s.oc("ngForOf",t.links))},directives:[c.c,c.b,C.a,V.a,V.b,oe.e,a.n,c.a,i.l,oe.d,i.h],styles:[""]}),e})();function Vh(e,t){if(1&e){const e=s.Wb();s.Vb(0,"div",23),s.Vb(1,"h4",24),s.Kc(2),s.Ub(),s.Vb(3,"div",25),s.Vb(4,"button",26),s.dc("click",function(){return s.zc(e),s.hc().onRestoreChannels({})}),s.Kc(5,"Restore All"),s.Ub(),s.Ub(),s.Ub()}if(2&e){const e=s.hc();s.Db(2),s.Mc("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function Dh(e,t){if(1&e&&(s.Vb(0,"div",27),s.Vb(1,"h4",24),s.Kc(2),s.Ub(),s.Vb(3,"h4",28),s.Kc(4,"All channel backup file not found! To perform channel restoration, channel backup file/s must be placed at the above location."),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(2),s.Mc("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function Sh(e,t){if(1&e&&(s.Vb(0,"div",27),s.Vb(1,"h4",24),s.Kc(2),s.Ub(),s.Ub()),2&e){const e=s.hc();s.Db(2),s.Mc("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function Lh(e,t){1&e&&s.Qb(0,"mat-progress-bar",29)}function Ih(e,t){1&e&&(s.Vb(0,"th",30),s.Kc(1," Channel Point "),s.Ub())}const _h=function(e){return{"max-width":e}};function kh(e,t){if(1&e&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,_h,n.screenSize===n.screenSizeEnum.XS?"10rem":"45rem")),s.Db(1),s.Lc(null==e?null:e.channel_point)}}function Fh(e,t){1&e&&(s.Vb(0,"th",32),s.Vb(1,"span",33),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function Ah(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",34),s.Vb(1,"span",33),s.Vb(2,"button",35),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onRestoreChannels(n)}),s.Kc(3,"Restore"),s.Ub(),s.Ub(),s.Ub()}}function Th(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No singular channel backups available."),s.Ub())}function Ph(e,t){if(1&e&&(s.Vb(0,"td",36),s.Ic(1,Th,2,0,"p",37),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!e.channels||!e.channels.data||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)}}const Oh=function(e){return{"display-none":e}};function Kh(e,t){if(1&e&&s.Qb(0,"tr",38),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Oh,e.channels&&e.channels.data&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Rh(e,t){1&e&&s.Qb(0,"tr",39)}function Mh(e,t){1&e&&s.Qb(0,"tr",40)}const Eh=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},zh=function(){return["no_channel"]};let Nh=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.lndEffects=n,this.commonService=a,this.pageSize=f.p,this.pageSizeOptions=f.q,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.allRestoreExists=!1,this.flgLoading=[!0],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch(new g.nb),this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.logger.info(e)}),this.lndEffects.setRestoreChannelList.pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.allRestoreExists=e.all_restore_exists,this.channelsData=e.files,this.channelsData.length>0&&this.loadRestoreTable(this.channelsData),("error"!==this.flgLoading[0]||e&&e.files)&&(this.flgLoading[0]=!1),this.logger.info(e)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadRestoreTable(this.channelsData)}onRestoreChannels(e){this.store.dispatch(new H.G("Restoring Channels...")),this.store.dispatch(new g.mb({channelPoint:e.channel_point?e.channel_point:"ALL"}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadRestoreTable(e){this.channels=new le.o([...e]),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.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.channels.paginator=this.paginator}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(ft.a),s.Pb(w.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-restore-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Channels")}])],decls:24,vars:16,consts:[["fxLayout","column",1,"mt-2"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between start","fxLayout.gt-md","row wrap",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"padding-gap-x","page-sub-title-container","mt-2"],["fxFlex","70"],["fxFlex","30"],["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","channel_point"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-4",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","100"],["fxLayout","row",1,"mt-2"],["mat-flat-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxLayoutAlign","space-between start","fxLayout.gt-md","row wrap"],["fxFlex","100",1,"mt-1"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-cell",""],["mat-stroked-button","","color","primary","type","button","tabindex","1",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,Vh,6,1,"div",1),s.Ic(2,Dh,5,1,"div",2),s.Ic(3,Sh,3,1,"div",2),s.Vb(4,"div",3),s.Qb(5,"div",4),s.Vb(6,"mat-form-field",5),s.Vb(7,"input",6),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",7),s.Ic(9,Lh,1,0,"mat-progress-bar",8),s.Vb(10,"table",9,10),s.Tb(12,11),s.Ic(13,Ih,2,0,"th",12),s.Ic(14,kh,2,4,"td",13),s.Sb(),s.Tb(15,14),s.Ic(16,Fh,3,0,"th",15),s.Ic(17,Ah,4,0,"td",16),s.Sb(),s.Tb(18,17),s.Ic(19,Ph,2,1,"td",18),s.Sb(),s.Ic(20,Kh,1,3,"tr",19),s.Ic(21,Rh,1,0,"tr",20),s.Ic(22,Mh,1,0,"tr",21),s.Ub(),s.Ub(),s.Qb(23,"mat-paginator",22),s.Ub()),2&e&&(s.Db(1),s.oc("ngIf",t.allRestoreExists),s.Db(1),s.oc("ngIf",!t.allRestoreExists&&(!t.channels||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<=0)),s.Db(1),s.oc("ngIf",!t.allRestoreExists&&t.channels&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0),s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.channels)("ngClass",s.sc(13,Eh,"error"===t.flgLoading[0])),s.Db(10),s.oc("matFooterRowDef",s.rc(15,zh)),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,a.o,c.b,c.a,O.c,ue.b,M.b,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,S.a,l.a,le.h,ce.b,le.a,a.p,I.b,le.d,le.f,le.j,le.l],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function Bh(e,t){1&e&&s.Qb(0,"mat-progress-bar",31)}function Gh(e,t){1&e&&(s.Vb(0,"th",32),s.Kc(1," Channel Point "),s.Ub())}const qh=function(e){return{"max-width":e}};function Qh(e,t){if(1&e&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&e){const e=t.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,qh,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),s.Db(1),s.Lc(null==e?null:e.channel_point)}}function Hh(e,t){1&e&&(s.Vb(0,"th",34),s.Vb(1,"span",35),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function jh(e,t){if(1&e){const e=s.Wb();s.Vb(0,"td",36),s.Vb(1,"div",37),s.Vb(2,"mat-select",38),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",39),s.dc("click",function(n){s.zc(e);const a=t.$implicit;return s.hc().onChannelClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",39),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onBackupChannels(n)}),s.Kc(7,"Backup"),s.Ub(),s.Vb(8,"mat-option",39),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onDownloadBackup(n)}),s.Kc(9,"Download Backup"),s.Ub(),s.Vb(10,"mat-option",39),s.dc("click",function(){s.zc(e);const n=t.$implicit;return s.hc().onVerifyChannels(n)}),s.Kc(11,"Verify"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function $h(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"No channels available."),s.Ub())}function Wh(e,t){if(1&e&&(s.Vb(0,"td",40),s.Ic(1,$h,2,0,"p",41),s.Ub()),2&e){const e=s.hc();s.Db(1),s.oc("ngIf",!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)}}const Xh=function(e){return{"display-none":e}};function Jh(e,t){if(1&e&&s.Qb(0,"tr",42),2&e){const e=s.hc();s.oc("ngClass",s.sc(1,Xh,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Yh(e,t){1&e&&s.Qb(0,"tr",43)}function Zh(e,t){1&e&&s.Qb(0,"tr",44)}const em=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},tm=function(){return["no_channel"]};let nm=(()=>{class e{constructor(e,t,n,a,i){this.logger=e,this.store=t,this.actions$=n,this.commonService=a,this.rtlEffects=i,this.faInfoCircle=p.t,this.faExclamationTriangle=p.o,this.faArchive=p.c,this.pageSize=f.p,this.pageSizeOptions=f.q,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.flgLoading=[!0],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=f.s,this.unSubs=[new u.a,new u.a,new u.a,new u.a],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select("lnd").pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,e.effectErrors.forEach(e=>{"Fetchchannels"===e.action&&(this.flgLoading[0]="error")}),this.channelsData=e.allChannels,this.channelsData.length>0&&this.loadBackupTable(this.channelsData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!1),this.logger.info(e)}),this.actions$.pipe(Object(d.a)(this.unSubs[1]),Object(h.a)(e=>e.type===g.tb||e.type===H.S)).subscribe(e=>{e.type===g.tb&&(this.selectedChannel=void 0),e.type===H.S&&(this.commonService.downloadFile(e.payload,"Backup-Channel-"+(this.selectedChannel.channel_point?this.selectedChannel.channel_point:"All"),".bak",".bak"),this.selectedChannel=void 0,this.store.dispatch(new H.j))})}ngAfterViewInit(){this.channelsData.length>0&&this.loadBackupTable(this.channelsData)}onBackupChannels(e){this.store.dispatch(new H.G("Backup Channels...")),this.store.dispatch(new g.d({channelPoint:e.channel_point?e.channel_point:"ALL",showMessage:""}))}onVerifyChannels(e){this.store.dispatch(new H.G("Verify Channels...")),this.store.dispatch(new g.hc({channelPoint:e.channel_point?e.channel_point:"ALL"}))}onDownloadBackup(e){this.selectedChannel=e,this.store.dispatch(new H.G("Downloading Backup File...")),this.store.dispatch(new H.q({channelPoint:e.channel_point?e.channel_point:"all"}))}onChannelClick(e,t){this.store.dispatch(new H.D({data:{channel:e,showCopy:!1,component:ui}}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadBackupTable(e){this.channels=new le.o(e?[...e]:[]),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.channels.filterPredicate=(e,t)=>((e.active?"active":"inactive")+(e.channel_point?e.channel_point:"")+(e.chan_id?e.chan_id:"")+(e.remote_pubkey?e.remote_pubkey:"")+(e.remote_alias?e.remote_alias:"")+(e.capacity?e.capacity:"")+(e.local_balance?e.local_balance:"")+(e.remote_balance?e.remote_balance:"")+(e.total_satoshis_sent?e.total_satoshis_sent:"")+(e.total_satoshis_received?e.total_satoshis_received:"")+(e.commit_fee?e.commit_fee:"")+(e.private?"private":"public")).includes(t)}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(w.a),s.Pb(pt.a))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-channel-backup-table"]],viewQuery:function(e,t){if(1&e&&(s.Pc(ce.a,!0),s.Pc(se.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:se.b,useValue:Object(f.B)("Channels")}])],decls:42,vars:17,consts:[["fxLayout","column"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","100",1,"alert","alert-info"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","1",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","2",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"padding-gap-x","page-sub-title-container","mt-2"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30"],["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","channel_point"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","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"],["mat-header-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-cell","","fxLayoutAlign","end center"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[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.Vb(1,"div",1),s.Vb(2,"div",2),s.Qb(3,"fa-icon",3),s.Vb(4,"span"),s.Kc(5,"Save your backup files in a redundant location."),s.Ub(),s.Ub(),s.Vb(6,"div",4),s.Qb(7,"fa-icon",3),s.Vb(8,"span"),s.Vb(9,"strong"),s.Kc(10,"Backup Folder Location: "),s.Ub(),s.Kc(11),s.Ub(),s.Ub(),s.Vb(12,"div",5),s.Vb(13,"button",6),s.dc("click",function(){return t.onVerifyChannels({})}),s.Kc(14,"Verify All"),s.Ub(),s.Vb(15,"button",7),s.dc("click",function(){return t.onBackupChannels({})}),s.Kc(16,"Backup All"),s.Ub(),s.Vb(17,"button",8),s.dc("click",function(){return t.onDownloadBackup({})}),s.Kc(18,"Download Backup"),s.Ub(),s.Ub(),s.Ub(),s.Vb(19,"div",9),s.Vb(20,"div",10),s.Qb(21,"fa-icon",11),s.Vb(22,"span",12),s.Kc(23,"Backups"),s.Ub(),s.Ub(),s.Vb(24,"mat-form-field",13),s.Vb(25,"input",14),s.dc("keyup",function(e){return t.applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(26,"div",15),s.Ic(27,Bh,1,0,"mat-progress-bar",16),s.Vb(28,"table",17,18),s.Tb(30,19),s.Ic(31,Gh,2,0,"th",20),s.Ic(32,Qh,2,4,"td",21),s.Sb(),s.Tb(33,22),s.Ic(34,Hh,3,0,"th",23),s.Ic(35,jh,12,0,"td",24),s.Sb(),s.Tb(36,25),s.Ic(37,Wh,2,1,"td",26),s.Sb(),s.Ic(38,Jh,1,3,"tr",27),s.Ic(39,Yh,1,0,"tr",28),s.Ic(40,Zh,1,0,"tr",29),s.Ub(),s.Ub(),s.Qb(41,"mat-paginator",30),s.Ub()),2&e&&(s.Db(3),s.oc("icon",t.faExclamationTriangle),s.Db(4),s.oc("icon",t.faInfoCircle),s.Db(4),s.Mc("",t.selNode.channelBackupPath,"."),s.Db(10),s.oc("icon",t.faArchive),s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.channels)("ngClass",s.sc(14,em,"error"===t.flgLoading[0])),s.Db(10),s.oc("matFooterRowDef",s.rc(16,tm)),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,C.a,S.a,O.c,ue.b,M.b,a.o,le.n,ce.a,a.m,I.a,le.c,le.i,le.b,le.e,le.g,le.k,le.m,se.a,l.a,le.h,ce.b,le.a,a.p,I.b,me.a,me.c,fe.m,le.d,le.f,le.j,le.l],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function am(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 im=(()=>{class e{constructor(e){this.router=e,this.faUserCheck=p.P,this.links=[{link:"sign",name:"Sign"},{link:"verify",name:"Verify"}],this.activeLink=this.links[0].link,this.unSubs=[new u.a,new u.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(d.a)(this.unSubs[0]),Object(h.a)(e=>e instanceof i.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(i.g))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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,am,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,C.a,V.a,V.b,oe.e,a.n,c.a,i.l,oe.d,i.h],styles:[""]}),e})();function om(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Message is required."),s.Ub())}let sm=(()=>{class e{constructor(e,t,n){this.dataService=e,this.snackBar=t,this.logger=n,this.message="",this.signedMessage="",this.signature="",this.unSubs=[new u.a,new u.a]}ngOnInit(){}onSign(){if(!this.message||""===this.message)return!0;this.dataService.signMessage(this.message).pipe(Object(d.a)(this.unSubs[0])).subscribe(e=>{this.signedMessage=this.message,this.signature=e.signature})}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(tt.a),s.Pb(ni.b),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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","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,om,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,be.u,be.n,be.o,O.c,ue.b,be.c,de.a,be.s,be.m,be.p,a.o,S.a,R.a,ai.a,O.b],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function cm(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Message is required."),s.Ub())}function lm(e,t){1&e&&(s.Vb(0,"mat-error"),s.Kc(1,"Signature is required."),s.Ub())}function rm(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 bm(e,t){1&e&&(s.Vb(0,"p"),s.Kc(1,"Pubkey Used"),s.Ub())}function um(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 dm(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 hm(e,t){if(1&e&&(s.Vb(0,"div",15),s.Qb(1,"mat-divider",16),s.Vb(2,"div",17),s.Ic(3,bm,2,0,"p",5),s.Ub(),s.Ic(4,um,3,1,"div",18),s.Ic(5,dm,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.valid),s.Db(1),s.oc("ngIf",e.verifyRes.valid),s.Db(1),s.oc("ngIf",e.verifyRes.valid)}}let mm=(()=>{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:"",valid:null},this.unSubs=[new u.a,new u.a]}ngOnInit(){}onVerify(){if(!this.message||""===this.message||!this.signature||""===this.signature)return!0;this.dataService.verifyMessage(this.message,this.signature).pipe(Object(d.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:"",valid: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(tt.a),s.Pb(ni.b),s.Pb(y.b))},e.\u0275cmp=s.Jb({type:e,selectors:[["rtl-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","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,cm,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,lm,2,0,"mat-error",5),s.Ub(),s.Ic(10,rm,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,hm,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.valid),s.Db(6),s.oc("ngIf",t.showVerifyStatus&&t.verifyRes.valid))},directives:[c.c,c.a,c.b,be.u,be.n,be.o,O.c,ue.b,be.c,de.a,be.s,be.m,be.p,a.o,S.a,O.b,L.a,R.a,ai.a],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();var pm=n("0dfH"),fm=n("2h+y");const gm=i.k.forChild([{path:"",component:b,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:Gn,canActivate:[fm.d]},{path:"wallet",component:Fl,canActivate:[fm.a]},{path:"onchain",component:Ud,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:Sd,canActivate:[fm.d]},{path:"send/:selTab",component:ah,data:{sweepAll:!1},canActivate:[fm.d]},{path:"sweep/:selTab",component:ah,data:{sweepAll:!0},canActivate:[fm.d]}]},{path:"connections",component:$n,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:ti,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:_o,canActivate:[fm.d]},{path:"pending",component:cc,canActivate:[fm.d]},{path:"closed",component:kc,canActivate:[fm.d]},{path:"activehtlcs",component:sl,canActivate:[fm.d]}]},{path:"peers",component:Xa,data:{sweepAll:!1},canActivate:[fm.d]}]},{path:"transactions",component:Tl,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:yn,canActivate:[fm.d]},{path:"invoices",component:Ye,canActivate:[fm.d]},{path:"queryroutes",component:tr,canActivate:[fm.d]}]},{path:"messages",component:im,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:sm,canActivate:[fm.d]},{path:"verify",component:mm,canActivate:[fm.d]}]},{path:"channelbackup",component:Uh,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"bckup"},{path:"bckup",component:nm,canActivate:[fm.d]},{path:"restore",component:Nh,canActivate:[fm.d]}]},{path:"routing",component:Tr,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:ob,canActivate:[fm.d]},{path:"peers",component:Hb,canActivate:[fm.d]}]},{path:"reports",component:$b,canActivate:[fm.d],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:au,canActivate:[fm.d]},{path:"transactions",component:du,canActivate:[fm.d]}]},{path:"lookups",component:Ir,canActivate:[fm.d]},{path:"network",component:wh,canActivate:[fm.d]},{path:"**",component:pm.a},{path:"rates",redirectTo:"network"}]}]);var ym=n("PCNd");let xm=(()=>{class e{}return e.\u0275mod=s.Nb({type:e,bootstrap:[b]}),e.\u0275inj=s.Mb({factory:function(t){return new(t||e)},providers:[fm.d],imports:[[a.c,ym.a,gm]]}),e})()}}]);