mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 01:40:29 +01:00
5107c300eb
2FA Fix
1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[267],{1203:(Q,P,t)=>{t.d(P,{D:()=>V});var a=t(7579),y=t(2722),m=t(7731),C=t(8377),c=t(4650),T=t(62),D=t(9653),A=t(6895),H=t(1576),e=t(7392),w=t(266),N=t(3848);function S(h,u){if(1&h&&(c.TgZ(0,"mat-icon",10),c._uU(1,"info_outline"),c.qZA()),2&h){const f=c.oxw().$implicit;c.Q6J("matTooltip",f.tooltip)}}function x(h,u){if(1&h&&(c.TgZ(0,"span",11),c._uU(1),c.ALo(2,"number"),c.qZA()),2&h){const f=c.oxw().$implicit;c.xp6(1),c.hij(" ",c.lcZ(2,1,f.dataValue)," ")}}function E(h,u){if(1&h&&(c.TgZ(0,"span",11),c._uU(1),c.ALo(2,"number"),c.qZA()),2&h){const f=c.oxw().$implicit,s=c.oxw(2);c.xp6(1),c.hij(" ",c.xi3(2,1,f[s.currencyUnitEnum.BTC],s.currencyUnitFormats.BTC)," ")}}function g(h,u){if(1&h&&(c.TgZ(0,"span",11),c._uU(1),c.ALo(2,"number"),c.qZA()),2&h){const f=c.oxw().$implicit,s=c.oxw(2);c.xp6(1),c.hij(" ",c.xi3(2,1,f[s.currencyUnitEnum.OTHER],s.currencyUnitFormats.OTHER)," ")}}function U(h,u){if(1&h&&(c.TgZ(0,"div",6)(1,"div",7),c._uU(2),c.YNc(3,S,2,1,"mat-icon",8),c.qZA(),c.YNc(4,x,3,3,"span",9),c.YNc(5,E,3,4,"span",9),c.YNc(6,g,3,4,"span",9),c.qZA()),2&h){const f=u.$implicit,s=c.oxw().$implicit,z=c.oxw();c.xp6(2),c.hij(" ",f.title," "),c.xp6(1),c.Q6J("ngIf",f.tooltip),c.xp6(1),c.Q6J("ngIf",s===z.currencyUnitEnum.SATS),c.xp6(1),c.Q6J("ngIf",s===z.currencyUnitEnum.BTC),c.xp6(1),c.Q6J("ngIf",z.fiatConversion&&s!==z.currencyUnitEnum.SATS&&s!==z.currencyUnitEnum.BTC&&""===z.conversionErrorMsg)}}function b(h,u){if(1&h&&(c.TgZ(0,"div",12)(1,"div",13),c._uU(2),c.qZA()()),2&h){const f=c.oxw(2);c.xp6(2),c.Oqu(f.conversionErrorMsg)}}function F(h,u){if(1&h&&(c.TgZ(0,"mat-tab",2)(1,"div",3),c.YNc(2,U,7,5,"div",4),c.qZA(),c.YNc(3,b,3,1,"div",5),c.qZA()),2&h){const f=u.$implicit,s=c.oxw();c.s9C("label",f),c.xp6(2),c.Q6J("ngForOf",s.values),c.xp6(1),c.Q6J("ngIf",s.fiatConversion&&f!==s.currencyUnitEnum.SATS&&f!==s.currencyUnitEnum.BTC&&""!==s.conversionErrorMsg)}}class V{constructor(u,f){this.commonService=u,this.store=f,this.values=[],this.currencyUnitEnum=m.NT,this.currencyUnitFormats=m.Xz,this.currencyUnits=[],this.fiatConversion=!1,this.conversionErrorMsg="",this.unSubs=[new a.x,new a.x,new a.x]}ngOnInit(){this.store.select(C.dT).pipe((0,y.R)(this.unSubs[0])).subscribe(u=>{this.fiatConversion=u.settings.fiatConversion,this.currencyUnits=u.settings.currencyUnits,this.fiatConversion||this.currencyUnits.splice(2,1),this.currencyUnits.length>1&&this.values[0]&&this.values[0].dataValue>=0&&this.getCurrencyValues(this.values)})}ngOnChanges(){this.currencyUnits.length>1&&this.values[0]&&this.values[0].dataValue>=0&&this.getCurrencyValues(this.values)}getCurrencyValues(u){u.forEach(f=>{f.dataValue>0?(this.commonService.convertCurrency(f.dataValue,m.NT.SATS,m.NT.BTC,"",!0).pipe((0,y.R)(this.unSubs[1])).subscribe(s=>{f[m.NT.BTC]=s.BTC}),this.commonService.convertCurrency(f.dataValue,m.NT.SATS,m.NT.OTHER,this.currencyUnits[2],this.fiatConversion).pipe((0,y.R)(this.unSubs[2])).subscribe({next:s=>{f[m.NT.OTHER]=s.OTHER},error:s=>{this.conversionErrorMsg="Conversion Error: "+s}})):(f[m.NT.BTC]=f.dataValue,""===this.conversionErrorMsg&&(f[m.NT.OTHER]=f.dataValue))})}ngOnDestroy(){this.unSubs.forEach(u=>{u.next(null),u.complete()})}}V.\u0275fac=function(u){return new(u||V)(c.Y36(T.v),c.Y36(D.yh))},V.\u0275cmp=c.Xpm({type:V,selectors:[["rtl-currency-unit-converter"]],inputs:{values:"values"},features:[c.TTD],decls:2,vars:1,consts:[["mat-stretch-tabs","false","mat-align-tabs","start"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","center start","class","cc-data-block",4,"ngFor","ngForOf"],["fxLayout","row","fxFlex","100","class","p-1 error-border mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center start",1,"cc-data-block"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"cc-data-title"],["matTooltipPosition","below","class","info-icon",3,"matTooltip",4,"ngIf"],["class","cc-data-value",4,"ngIf"],["matTooltipPosition","below",1,"info-icon",3,"matTooltip"],[1,"cc-data-value"],["fxLayout","row","fxFlex","100",1,"p-1","error-border","mt-1"],[1,"cc-data-block"]],template:function(u,f){1&u&&(c.TgZ(0,"mat-tab-group",0),c.YNc(1,F,4,3,"mat-tab",1),c.qZA()),2&u&&(c.xp6(1),c.Q6J("ngForOf",f.currencyUnits))},dependencies:[A.sg,A.O5,H.xw,H.Wh,H.yH,e.Hw,w.gM,N.uX,N.SP,A.JJ]})},9122:(Q,P,t)=>{t.d(P,{n:()=>f});var a=t(7274),y=t(2687),m=t(7731),C=t(4650),c=t(5043),T=t(62),D=t(7009),A=t(6895),H=t(2216),e=t(1576),w=t(5829),N=t(4859),S=t(3546),x=t(4850),E=t(658),g=t(5199),U=t(3390);const b=function(s){return{"display-none":s}};function F(s,z){if(1&s&&(C.TgZ(0,"div",20),C._UZ(1,"qr-code",21),C.qZA()),2&s){const d=C.oxw();C.Q6J("ngClass",C.VKq(4,b,d.screenSize===d.screenSizeEnum.XS||d.screenSize===d.screenSizeEnum.SM)),C.xp6(1),C.Q6J("value",d.address)("size",d.qrWidth)("errorCorrectionLevel","L")}}function V(s,z){if(1&s&&(C.TgZ(0,"div",22),C._UZ(1,"qr-code",21),C.qZA()),2&s){const d=C.oxw();C.Q6J("ngClass",C.VKq(4,b,d.screenSize!==d.screenSizeEnum.XS&&d.screenSize!==d.screenSizeEnum.SM)),C.xp6(1),C.Q6J("value",d.address)("size",d.qrWidth)("errorCorrectionLevel","L")}}function h(s,z){if(1&s&&(C.TgZ(0,"div",13)(1,"div",14)(2,"h4",15),C._uU(3,"Address Type"),C.qZA(),C.TgZ(4,"span",23),C._uU(5),C.qZA()()()),2&s){const d=C.oxw();C.xp6(5),C.Oqu(d.addressType)}}function u(s,z){1&s&&C._UZ(0,"mat-divider",17)}class f{constructor(z,d,R,k,Z){this.dialogRef=z,this.data=d,this.logger=R,this.commonService=k,this.snackBar=Z,this.faReceipt=y.dLy,this.address="",this.addressType="",this.qrWidth=230,this.screenSize="",this.screenSizeEnum=m.cu}ngOnInit(){this.address=this.data.address,this.addressType=this.data.addressType,this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onCopyAddress(z){this.snackBar.open("Generated address copied."),this.logger.info("Copied Text: "+z)}}f.\u0275fac=function(z){return new(z||f)(C.Y36(a.so),C.Y36(a.WI),C.Y36(c.mQ),C.Y36(T.v),C.Y36(D.ux))},f.\u0275cmp=C.Xpm({type:f,selectors:[["rtl-on-chain-generated-address"]],decls:25,vars:8,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","35","fxLayoutAlign","center start","class","modal-qr-code-container padding-gap-large",3,"ngClass",4,"ngIf"],["fxFlex","65"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","2","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],["fxFlex","50","fxLayoutAlign","center start","class","modal-qr-code-container padding-gap-large",3,"ngClass",4,"ngIf"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["fxLayout","row"],["fxFlex","100"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"overflow-wrap","foreground-secondary-text"],[1,"w-100","my-1"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-1"],["autoFocus","","mat-button","","color","primary","tabindex","1","type","submit","rtlClipboard","",3,"payload","copied"],["fxFlex","35","fxLayoutAlign","center start",1,"modal-qr-code-container","padding-gap-large",3,"ngClass"],[3,"value","size","errorCorrectionLevel"],["fxFlex","50","fxLayoutAlign","center start",1,"modal-qr-code-container","padding-gap-large",3,"ngClass"],[1,"foreground-secondary-text"]],template:function(z,d){1&z&&(C.TgZ(0,"div",0),C.YNc(1,F,2,6,"div",1),C.TgZ(2,"div",2)(3,"mat-card-header",3)(4,"div",4),C._UZ(5,"fa-icon",5),C.TgZ(6,"span",6),C._uU(7),C.qZA()(),C.TgZ(8,"button",7),C.NdJ("click",function(){return d.onClose()}),C._uU(9,"X"),C.qZA()(),C.TgZ(10,"mat-card-content",8)(11,"div",9),C.YNc(12,V,2,6,"div",10),C.YNc(13,h,6,1,"div",11),C.YNc(14,u,1,0,"mat-divider",12),C.TgZ(15,"div",13)(16,"div",14)(17,"h4",15),C._uU(18,"Address"),C.qZA(),C.TgZ(19,"span",16),C._uU(20),C.qZA()()(),C._UZ(21,"mat-divider",17),C.TgZ(22,"div",18)(23,"button",19),C.NdJ("copied",function(k){return d.onCopyAddress(k)}),C._uU(24,"Copy Address"),C.qZA()()()()()()),2&z&&(C.xp6(1),C.Q6J("ngIf",d.address),C.xp6(4),C.Q6J("icon",d.faReceipt),C.xp6(2),C.Oqu(d.screenSize===d.screenSizeEnum.XS?"Address":"Generated Address"),C.xp6(5),C.Q6J("ngIf",d.address),C.xp6(1),C.Q6J("ngIf",""!==d.addressType),C.xp6(1),C.Q6J("ngIf",""!==d.addressType),C.xp6(6),C.Oqu(d.address),C.xp6(3),C.Q6J("payload",d.address))},dependencies:[A.mk,A.O5,H.BN,e.xw,e.Wh,e.yH,w.oO,N.lW,S.dn,S.dk,x.d,E.uU,g.y,U.h]})},7671:(Q,P,t)=>{t.d(P,{D:()=>B});var a=t(4650),y=t(113),m=t(7731),C=t(5043),c=t(6895),T=t(4006),D=t(1576),A=t(4859),H=t(9602),e=t(7392),w=t(4144),N=t(9549),S=t(4385),x=t(3238),E=t(3353);class g extends x.LF{constructor(l,i){super(l,i)}format(l,i){return"MMM YYYY"===i?m.gg[l.getMonth()].name+", "+l.getFullYear():"YYYY"===i?l.getFullYear().toString():l.getDate()+"/"+m.gg[l.getMonth()].name+"/"+l.getFullYear()}}g.\u0275fac=function(l){return new(l||g)(a.LFG(x.Ad,8),a.LFG(E.t4))},g.\u0275prov=a.Yz7({token:g,factory:g.\u0275fac});class F{}F.\u0275fac=function(l){return new(l||F)},F.\u0275dir=a.lG2({type:F,selectors:[["","monthlyDate",""]],features:[a._Bn([{provide:x._A,useClass:g},{provide:x.sG,useValue:{parse:{dateInput:"LL"},display:{dateInput:"MMM YYYY",monthYearLabel:"YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"YYYY"}}}])]});class V{}V.\u0275fac=function(l){return new(l||V)},V.\u0275dir=a.lG2({type:V,selectors:[["","yearlyDate",""]],features:[a._Bn([{provide:x._A,useClass:g},{provide:x.sG,useValue:{parse:{dateInput:"LL"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"YYYY"}}}])]});var h=t(9843),u=t(6534);const f=["monthlyDatepicker"],s=["yearlyDatepicker"],z=function(){return{animationDirection:"forward"}};function d(M,l){if(1&M&&a.GkF(0,9),2&M){a.oxw();const i=a.MAs(19);a.Q6J("ngTemplateOutlet",i)("ngTemplateOutletContext",a.DdM(2,z))}}const R=function(){return{animationDirection:"backward"}};function k(M,l){if(1&M&&a.GkF(0,9),2&M){a.oxw();const i=a.MAs(19);a.Q6J("ngTemplateOutlet",i)("ngTemplateOutletContext",a.DdM(2,R))}}const Z=function(){return{animationDirection:""}};function Y(M,l){if(1&M&&a.GkF(0,9),2&M){a.oxw();const i=a.MAs(19);a.Q6J("ngTemplateOutlet",i)("ngTemplateOutletContext",a.DdM(2,Z))}}function W(M,l){if(1&M&&(a.TgZ(0,"mat-option",17),a._uU(1),a.ALo(2,"titlecase"),a.qZA()),2&M){const i=l.$implicit;a.Q6J("value",i),a.xp6(1),a.hij(" ",a.lcZ(2,2,i)," ")}}function G(M,l){if(1&M){const i=a.EpF();a.TgZ(0,"mat-form-field",18)(1,"input",19,20),a.NdJ("ngModelChange",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.selectedValue=_)}),a.qZA(),a._UZ(3,"mat-datepicker-toggle",21),a.TgZ(4,"mat-datepicker",22,23),a.NdJ("monthSelected",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.onMonthSelected(_))})("dateSelected",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.onMonthSelected(_))}),a.qZA()()}if(2&M){const i=a.MAs(5),p=a.oxw(2);a.xp6(1),a.Q6J("matDatepicker",i)("min",p.first)("max",p.last)("ngModel",p.selectedValue),a.xp6(2),a.Q6J("for",i),a.xp6(1),a.Q6J("startAt",p.selectedValue)}}function q(M,l){if(1&M){const i=a.EpF();a.TgZ(0,"mat-form-field",24)(1,"input",25,26),a.NdJ("ngModelChange",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.selectedValue=_)}),a.qZA(),a._UZ(3,"mat-datepicker-toggle",21),a.TgZ(4,"mat-datepicker",27,28),a.NdJ("yearSelected",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.onYearSelected(_))})("monthSelected",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.onYearSelected(_))})("dateSelected",function(_){a.CHM(i);const v=a.oxw(2);return a.KtG(v.onYearSelected(_))}),a.qZA()()}if(2&M){const i=a.MAs(5),p=a.oxw(2);a.xp6(1),a.Q6J("matDatepicker",i)("min",p.first)("max",p.last)("ngModel",p.selectedValue),a.xp6(2),a.Q6J("for",i),a.xp6(1),a.Q6J("startAt",p.selectedValue)}}function K(M,l){if(1&M){const i=a.EpF();a.TgZ(0,"div",10)(1,"div",11)(2,"mat-select",12),a.NdJ("ngModelChange",function(_){a.CHM(i);const v=a.oxw();return a.KtG(v.selScrollRange=_)})("selectionChange",function(_){a.CHM(i);const v=a.oxw();return a.KtG(v.onRangeChanged(_))}),a.YNc(3,W,3,4,"mat-option",13),a.qZA()(),a.TgZ(4,"div",14),a.YNc(5,G,6,6,"mat-form-field",15),a.YNc(6,q,6,6,"mat-form-field",16),a.qZA()()}if(2&M){const i=a.oxw();a.Q6J("@sliderAnimation",i.animationDirection),a.xp6(2),a.Q6J("ngModel",i.selScrollRange),a.xp6(1),a.Q6J("ngForOf",i.scrollRanges),a.xp6(2),a.Q6J("ngIf",i.selScrollRange===i.scrollRanges[0]),a.xp6(1),a.Q6J("ngIf",i.selScrollRange===i.scrollRanges[1])}}class B{constructor(l){this.logger=l,this.scrollRanges=m.op,this.selScrollRange=this.scrollRanges[0],this.today=new Date(Date.now()),this.first=new Date(2018,0,1,0,0,0),this.last=new Date(this.today.getFullYear(),this.today.getMonth(),this.today.getDate(),0,0,0),this.disablePrev=!1,this.disableNext=!0,this.animationDirection="",this.selectedValue=this.last,this.stepChanged=new a.vpe}onRangeChanged(l){this.selScrollRange=l.value,this.onStepChange("LAST")}onMonthSelected(l){this.selectedValue=l,this.onStepChange("SELECTED"),this.monthlyDatepicker.close()}onYearSelected(l){this.selectedValue=l,this.onStepChange("SELECTED"),this.yearlyDatepicker.close()}onStepChange(l){switch(this.logger.info(l),l){case"FIRST":this.animationDirection="backward",this.selectedValue!==this.first&&(this.selectedValue=this.first,this.stepChanged.emit({selDate:this.selectedValue,selScrollRange:this.selScrollRange}));break;case"PREVIOUS":this.selectedValue=this.selScrollRange===m.op[1]?new Date(this.selectedValue.getFullYear()-1,0,1,0,0,0):new Date(this.selectedValue.getFullYear(),this.selectedValue.getMonth()-1,1,0,0,0),this.animationDirection="backward",this.stepChanged.emit({selDate:this.selectedValue,selScrollRange:this.selScrollRange});break;case"NEXT":this.selectedValue=this.selScrollRange===m.op[1]?new Date(this.selectedValue.getFullYear()+1,0,1,0,0,0):new Date(this.selectedValue.getFullYear(),this.selectedValue.getMonth()+1,1,0,0,0),this.animationDirection="forward",this.stepChanged.emit({selDate:this.selectedValue,selScrollRange:this.selScrollRange});break;case"LAST":this.animationDirection="forward",this.selectedValue=this.last,this.stepChanged.emit({selDate:this.selectedValue,selScrollRange:this.selScrollRange});break;default:this.animationDirection="",this.stepChanged.emit({selDate:this.selectedValue,selScrollRange:this.selScrollRange})}this.disablePrev=this.selScrollRange===m.op[1]?this.selectedValue.getFullYear()<=this.first.getFullYear():this.selectedValue.getFullYear()<=this.first.getFullYear()&&this.selectedValue.getMonth()<=this.first.getMonth(),this.disableNext=this.selScrollRange===m.op[1]?this.selectedValue.getFullYear()>=this.last.getFullYear():this.selectedValue.getFullYear()>=this.last.getFullYear()&&this.selectedValue.getMonth()>=this.last.getMonth(),this.logger.info(this.disablePrev),this.logger.info(this.disableNext),setTimeout(()=>{this.animationDirection=""},800)}onChartMouseUp(l){"monthlyDate"===l.srcElement.name?this.monthlyDatepicker.open():"yearlyDate"===l.srcElement.name&&this.yearlyDatepicker.open()}}B.\u0275fac=function(l){return new(l||B)(a.Y36(C.mQ))},B.\u0275cmp=a.Xpm({type:B,selectors:[["rtl-horizontal-scroller"]],viewQuery:function(l,i){if(1&l&&(a.Gf(f,5),a.Gf(s,5)),2&l){let p;a.iGM(p=a.CRH())&&(i.monthlyDatepicker=p.first),a.iGM(p=a.CRH())&&(i.yearlyDatepicker=p.first)}},hostBindings:function(l,i){1&l&&a.NdJ("click",function(_){return i.onChartMouseUp(_)})},outputs:{stepChanged:"stepChanged"},decls:20,vars:5,consts:[["fxLayout","row","fxLayoutAlign","space-between stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","20"],["mat-icon-button","","color","primary","type","button","tabindex","1",1,"pr-4",3,"click"],["mat-icon-button","","color","primary","type","button","tabindex","2",3,"disabled","click"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","20"],["mat-icon-button","","color","primary","type","button","tabindex","5",1,"pr-4",3,"disabled","click"],["mat-icon-button","","color","primary","type","button","tabindex","6",3,"click"],["controlsPanel",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["fxLayout","row","fxLayoutAlign","center center","fxFlex","58"],["fxFlex","50","fxLayoutAlign","center center","fxLayoutAlign.gt-xs","end center",1,"font-bold-700"],["fxFlex","60","fxFlex.gt-md","30","name","selScrlRange","tabindex","3",1,"font-bold-700",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","50","fxLayout","row","fxLayoutAlign","center center","fxLayoutAlign.gt-xs","start center"],["monthlyDate","","fxLayoutAlign","center center",4,"ngIf"],["yearlyDate","","fxLayoutAlign","center center",4,"ngIf"],[3,"value"],["monthlyDate","","fxLayoutAlign","center center"],["matInput","","name","monthlyDate","tabindex","4","readonly","",3,"matDatepicker","min","max","ngModel","ngModelChange"],["monthlyDt","ngModel"],["matSuffix","",3,"for"],["startView","year",3,"startAt","monthSelected","dateSelected"],["monthlyDatepicker",""],["yearlyDate","","fxLayoutAlign","center center"],["matInput","","name","yearlyDate","tabindex","4","readonly","",3,"matDatepicker","min","max","ngModel","ngModelChange"],["yearlyDt","ngModel"],["startView","multi-year",3,"startAt","yearSelected","monthSelected","dateSelected"],["yearlyDatepicker",""]],template:function(l,i){1&l&&(a.TgZ(0,"div",0)(1,"div",1)(2,"button",2),a.NdJ("click",function(){return i.onStepChange("FIRST")}),a.TgZ(3,"mat-icon"),a._uU(4,"skip_previous"),a.qZA()(),a.TgZ(5,"button",3),a.NdJ("click",function(){return i.onStepChange("PREVIOUS")}),a.TgZ(6,"mat-icon"),a._uU(7,"navigate_before"),a.qZA()()(),a.YNc(8,d,1,3,"ng-container",4),a.YNc(9,k,1,3,"ng-container",4),a.YNc(10,Y,1,3,"ng-container",4),a.TgZ(11,"div",5)(12,"button",6),a.NdJ("click",function(){return i.onStepChange("NEXT")}),a.TgZ(13,"mat-icon"),a._uU(14,"navigate_next"),a.qZA()(),a.TgZ(15,"button",7),a.NdJ("click",function(){return i.onStepChange("LAST")}),a.TgZ(16,"mat-icon"),a._uU(17,"skip_next"),a.qZA()()()(),a.YNc(18,K,7,5,"ng-template",null,8,a.W1O)),2&l&&(a.xp6(5),a.Q6J("disabled",i.disablePrev),a.xp6(3),a.Q6J("ngIf","forward"===i.animationDirection),a.xp6(1),a.Q6J("ngIf","backward"===i.animationDirection),a.xp6(1),a.Q6J("ngIf",""===i.animationDirection),a.xp6(2),a.Q6J("disabled",i.disableNext))},dependencies:[c.sg,c.O5,c.tP,T.Fj,T.JJ,T.On,D.xw,D.Wh,D.yH,A.RK,H.Mq,H.hl,H.nW,e.Hw,w.Nt,N.KE,N.R9,S.gD,x.ey,F,V,h.F,u.q,c.rS],data:{animation:[y.l]}})},165:(Q,P,t)=>{t.d(P,{g:()=>I});var a=t(8739),y=t(6308),m=t(671),C=t(7731),c=t(7861),T=t(7579),D=t(2722),A=t(8377),H=t(4385),e=t(4650),w=t(62),N=t(9653),S=t(6895),x=t(9445),E=t(4006),g=t(1576),U=t(5829),b=t(4859),F=t(4144),V=t(9549),h=t(3238),u=t(6839);function f(o,n){if(1&o&&(e.TgZ(0,"mat-option",30),e._uU(1),e.qZA()),2&o){const r=n.$implicit,L=e.oxw();e.Q6J("value",r),e.xp6(1),e.Oqu(L.getLabel(r))}}function s(o,n){1&o&&(e.TgZ(0,"th",31),e._uU(1,"Date"),e.qZA())}function z(o,n){if(1&o&&(e.TgZ(0,"td",32),e._uU(1),e.ALo(2,"date"),e.qZA()),2&o){const r=n.$implicit,L=e.oxw();e.xp6(1),e.Oqu(e.xi3(2,1,null==r?null:r.date,L.dataRange===L.scrollRanges[1]?"MMM/yyyy":"dd/MMM/yyyy"))}}function d(o,n){1&o&&(e.TgZ(0,"th",33),e._uU(1,"Amount Paid (Sats)"),e.qZA())}function R(o,n){if(1&o&&(e.TgZ(0,"td",32)(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&o){const r=n.$implicit;e.xp6(2),e.Oqu(e.xi3(3,1,null==r?null:r.amount_paid,"1.0-2"))}}function k(o,n){1&o&&(e.TgZ(0,"th",33),e._uU(1,"# Payments"),e.qZA())}function Z(o,n){if(1&o&&(e.TgZ(0,"td",32)(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&o){const r=n.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,null==r?null:r.num_payments))}}function Y(o,n){1&o&&(e.TgZ(0,"th",33),e._uU(1,"Amount Received (Sats)"),e.qZA())}function W(o,n){if(1&o&&(e.TgZ(0,"td",32)(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&o){const r=n.$implicit;e.xp6(2),e.Oqu(e.xi3(3,1,null==r?null:r.amount_received,"1.0-2"))}}function G(o,n){1&o&&(e.TgZ(0,"th",33),e._uU(1,"# Invoices"),e.qZA())}function q(o,n){if(1&o&&(e.TgZ(0,"td",32)(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&o){const r=n.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,null==r?null:r.num_invoices))}}function K(o,n){if(1&o){const r=e.EpF();e.TgZ(0,"th",35)(1,"div",36)(2,"mat-select",37),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",38),e.NdJ("click",function(){e.CHM(r);const O=e.oxw();return e.KtG(O.onDownloadCSV())}),e._uU(5,"Download CSV"),e.qZA()()()()}}function B(o,n){if(1&o){const r=e.EpF();e.TgZ(0,"td",39)(1,"button",40),e.NdJ("click",function(){const X=e.CHM(r).$implicit,e2=e.oxw();return e.KtG(e2.onTransactionClick(X))}),e._uU(2,"View Info"),e.qZA()()}}function M(o,n){1&o&&(e.TgZ(0,"p"),e._uU(1,"No transaction available."),e.qZA())}function l(o,n){if(1&o&&(e.TgZ(0,"td",41),e.YNc(1,M,2,0,"p",42),e.qZA()),2&o){const r=e.oxw();e.xp6(1),e.Q6J("ngIf",!(null!=r.transactions&&r.transactions.data)||(null==r.transactions||null==r.transactions.data?null:r.transactions.data.length)<1)}}const i=function(o){return{"display-none":o}};function p(o,n){if(1&o&&e._UZ(0,"tr",43),2&o){const r=e.oxw();e.Q6J("ngClass",e.VKq(1,i,(null==r.transactions?null:r.transactions.data)&&(null==r.transactions||null==r.transactions.data?null:r.transactions.data.length)>0))}}function _(o,n){1&o&&e._UZ(0,"tr",44)}function v(o,n){1&o&&e._UZ(0,"tr",45)}const J=function(){return["all"]},$=function(){return["no_transaction"]};class I{constructor(n,r,L,O){this.commonService=n,this.store=r,this.datePipe=L,this.camelCaseWithReplace=O,this.dataRange=C.op[0],this.dataList=[],this.selFilter="",this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.tableSetting={tableId:"transactions",recordsPerPage:C.IV,sortBy:"date",sortOrder:C.Pi.DESCENDING},this.nodePageDefs=C.hG,this.selFilterBy="all",this.timezoneOffset=60*new Date(Date.now()).getTimezoneOffset(),this.scrollRanges=C.op,this.transactions=new m.by([]),this.pageSize=C.IV,this.pageSizeOptions=C.TJ,this.screenSize="",this.screenSizeEnum=C.cu,this.unSubs=[new T.x,new T.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(A.dT).pipe((0,D.R)(this.unSubs[0])).subscribe(n=>{this.nodePageDefs="CLN"===n.lnImplementation?C.At:"ECL"===n.lnImplementation?C.Xk:C.hG}),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:C.IV,this.dataList&&this.dataList.length>0&&this.loadTransactionsTable(this.dataList)}ngAfterViewInit(){setTimeout(()=>{this.setTableWidgets()},0)}ngOnChanges(n){n.dataList&&!n.dataList.firstChange&&(this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:C.IV,this.loadTransactionsTable(this.dataList)),n.selFilter&&!n.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}onTransactionClick(n){const r=[[{key:"date",value:this.datePipe.transform(n.date,this.dataRange===C.op[1]?"MMM/yyyy":"dd/MMM/yyyy"),title:"Date",width:100,type:C.Gi.DATE}],[{key:"amount_paid",value:Math.round(n.amount_paid),title:"Amount Paid (Sats)",width:50,type:C.Gi.NUMBER},{key:"num_payments",value:n.num_payments,title:"# Payments",width:50,type:C.Gi.NUMBER}],[{key:"amount_received",value:Math.round(n.amount_received),title:"Amount Received (Sats)",width:50,type:C.Gi.NUMBER},{key:"num_invoices",value:n.num_invoices,title:"# Invoices",width:50,type:C.Gi.NUMBER}]];this.store.dispatch((0,c.qR)({payload:{data:{type:C.n_.INFORMATION,alertTitle:"Transaction Summary",message:r}}}))}applyFilter(){this.transactions&&(this.transactions.filter=this.selFilter.trim().toLowerCase())}getLabel(n){const r=this.nodePageDefs.reports[this.tableSetting.tableId].allowedColumns.find(L=>L.column===n);return r?r.label?r.label:this.camelCaseWithReplace.transform(r.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.transactions.filterPredicate=(n,r)=>{let L="";switch(this.selFilterBy){case"all":L=(n.date?(this.datePipe.transform(n.date,"dd/MMM")+"/"+n.date.getFullYear()).toLowerCase():"")+JSON.stringify(n).toLowerCase();break;case"date":L=this.datePipe.transform(new Date(n[this.selFilterBy]||0),this.dataRange===this.scrollRanges[1]?"MMM/yyyy":"dd/MMM/yyyy")?.toLowerCase()||"";break;default:L=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return L.includes(r)}}loadTransactionsTable(n){this.transactions=new m.by(n?[...n]:[]),this.setTableWidgets()}setTableWidgets(){this.transactions&&this.transactions.data&&this.transactions.data.length>0&&(this.transactions.sort=this.sort,this.transactions.sortingDataAccessor=(n,r)=>n[r]&&isNaN(n[r])?n[r].toLocaleLowerCase():n[r]?+n[r]:null,this.transactions.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter())}onDownloadCSV(){this.transactions.data&&this.transactions.data.length>0&&this.commonService.downloadFile(this.dataList,"Transactions-report-"+this.dataRange.toLowerCase())}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(),n.complete()})}}I.\u0275fac=function(n){return new(n||I)(e.Y36(w.v),e.Y36(N.yh),e.Y36(S.uU),e.Y36(x.D3))},I.\u0275cmp=e.Xpm({type:I,selectors:[["rtl-transactions-report-table"]],viewQuery:function(n,r){if(1&n&&(e.Gf(y.YE,5),e.Gf(a.NW,5)),2&n){let L;e.iGM(L=e.CRH())&&(r.sort=L.first),e.iGM(L=e.CRH())&&(r.paginator=L.first)}},inputs:{dataRange:"dataRange",dataList:"dataList",selFilter:"selFilter",displayedColumns:"displayedColumns",tableSetting:"tableSetting"},features:[e._Bn([{provide:H.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:a.ye,useValue:(0,C.pt)("Transactions")}]),e.TTD],decls:43,vars:14,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"matSortActive","matSortDirection","dataSource"],["table",""],["matColumnDef","date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","amount_paid"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","num_payments"],["matColumnDef","amount_received"],["matColumnDef","num_invoices"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,r){1&n&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2),e._UZ(3,"div",3),e.TgZ(4,"div",4)(5,"mat-form-field",5)(6,"mat-label"),e._uU(7,"Filter By"),e.qZA(),e.TgZ(8,"mat-select",6),e.NdJ("ngModelChange",function(O){return r.selFilterBy=O})("selectionChange",function(){return r.selFilter="",r.applyFilter()}),e.TgZ(9,"perfect-scrollbar"),e.YNc(10,f,2,2,"mat-option",7),e.qZA()()(),e.TgZ(11,"mat-form-field",5)(12,"mat-label"),e._uU(13,"Filter"),e.qZA(),e.TgZ(14,"input",8),e.NdJ("ngModelChange",function(O){return r.selFilter=O})("input",function(){return r.applyFilter()})("keyup",function(){return r.applyFilter()}),e.qZA()()()(),e.TgZ(15,"div",9)(16,"div",10)(17,"table",11,12),e.ynx(19,13),e.YNc(20,s,2,0,"th",14),e.YNc(21,z,3,4,"td",15),e.BQk(),e.ynx(22,16),e.YNc(23,d,2,0,"th",17),e.YNc(24,R,4,4,"td",15),e.BQk(),e.ynx(25,18),e.YNc(26,k,2,0,"th",17),e.YNc(27,Z,4,3,"td",15),e.BQk(),e.ynx(28,19),e.YNc(29,Y,2,0,"th",17),e.YNc(30,W,4,4,"td",15),e.BQk(),e.ynx(31,20),e.YNc(32,G,2,0,"th",17),e.YNc(33,q,4,3,"td",15),e.BQk(),e.ynx(34,21),e.YNc(35,K,6,0,"th",22),e.YNc(36,B,3,0,"td",23),e.BQk(),e.ynx(37,24),e.YNc(38,l,2,1,"td",25),e.BQk(),e.YNc(39,p,1,3,"tr",26),e.YNc(40,_,1,0,"tr",27),e.YNc(41,v,1,0,"tr",28),e.qZA(),e._UZ(42,"mat-paginator",29),e.qZA()()()()),2&n&&(e.xp6(8),e.Q6J("ngModel",r.selFilterBy),e.xp6(2),e.Q6J("ngForOf",e.DdM(12,J).concat(r.displayedColumns.slice(0,-1))),e.xp6(4),e.Q6J("ngModel",r.selFilter),e.xp6(3),e.Q6J("matSortActive",r.tableSetting.sortBy)("matSortDirection",r.tableSetting.sortOrder)("dataSource",r.transactions),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(13,$)),e.xp6(1),e.Q6J("matHeaderRowDef",r.displayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",r.displayedColumns),e.xp6(1),e.Q6J("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions)("showFirstLastButtons",r.screenSize!==r.screenSizeEnum.XS))},dependencies:[S.mk,S.sg,S.O5,E.Fj,E.JJ,E.On,g.xw,g.Wh,g.yH,U.oO,b.lW,F.Nt,V.KE,V.hX,H.gD,H.$L,h.ey,y.YE,y.nU,m.BZ,m.fO,m.as,m.w1,m.Dz,m.nj,m.mD,m.Ke,m.ge,m.ev,m.yh,m.XQ,m.Gk,m.Q2,a.NW,u.Vv,u.$V,S.JJ,S.uU]})},3396:(Q,P,t)=>{t.d(P,{KfU:()=>P2,ctA:()=>n1});var P2={prefix:"far",iconName:"face-frown",icon:[512,512,[9785,"frown"],"f119","M143.9 398.6C131.4 394.1 124.9 380.3 129.4 367.9C146.9 319.4 198.9 288 256 288C313.1 288 365.1 319.4 382.6 367.9C387.1 380.3 380.6 394.1 368.1 398.6C355.7 403.1 341.9 396.6 337.4 384.1C328.2 358.5 297.2 336 256 336C214.8 336 183.8 358.5 174.6 384.1C170.1 396.6 156.3 403.1 143.9 398.6V398.6zM208.4 208C208.4 225.7 194 240 176.4 240C158.7 240 144.4 225.7 144.4 208C144.4 190.3 158.7 176 176.4 176C194 176 208.4 190.3 208.4 208zM304.4 208C304.4 190.3 318.7 176 336.4 176C354 176 368.4 190.3 368.4 208C368.4 225.7 354 240 336.4 240C318.7 240 304.4 225.7 304.4 208zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"]},n1={prefix:"far",iconName:"face-smile",icon:[512,512,[128578,"smile"],"f118","M256 352C293.2 352 319.2 334.5 334.4 318.1C343.3 308.4 358.5 307.7 368.3 316.7C378 325.7 378.6 340.9 369.6 350.6C347.7 374.5 309.7 400 256 400C202.3 400 164.3 374.5 142.4 350.6C133.4 340.9 133.1 325.7 143.7 316.7C153.5 307.7 168.7 308.4 177.6 318.1C192.8 334.5 218.8 352 256 352zM208.4 208C208.4 225.7 194 240 176.4 240C158.7 240 144.4 225.7 144.4 208C144.4 190.3 158.7 176 176.4 176C194 176 208.4 190.3 208.4 208zM304.4 208C304.4 190.3 318.7 176 336.4 176C354 176 368.4 190.3 368.4 208C368.4 225.7 354 240 336.4 240C318.7 240 304.4 225.7 304.4 208zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"]}}}]); |