1(self.webpackChunkbackoffice_frontend=self.webpackChunkbackoffice_frontend||[]).push([[571],{571:(nt,O,l)=>{"use strict";l.r(O),l.d(O,{fundsRoutes:()=>Gr});var t=l(1360),Q=l(1985),I=l(5558),P=l(7673),k=l(7468),u=l(8141),j=l(1277),J=l(911),y=l(9873),x=l(643),b=l(7387),d=l(5294),v=l(8599),C=l(5162);let R=(()=>{class e{constructor(){this.rest=(0,t.WQX)(C.G)}getPayoutInfo(n){return this.rest.get("/office/v2/payout",n)}postPayout(n){return this.rest.post("/office/v2/payout",n)}postPayoutBankAccount(n,o){return this.rest.post(`/office/v2/payout/bank-account/${n}`,o)}postCard(n){return this.rest.post("/office/v2/payout/cards",n)}getCards(){return this.rest.get("/office/v2/payout/cards")}deleteCard(n,o){return this.rest.delete(`/office/v2/payout/cards/${n}/${o}`)}getAccounts(){return this.rest.get("/office/v2/bank-account")}postAccount(n){return this.rest.post("/office/v2/bank-account",n)}putAccount(n,o){return this.rest.put(`/office/v2/bank-account/${o}`,n)}deleteAccount(n){return this.rest.delete(`/office/v2/bank-account/${n}`)}getCommissionBankAccount(n){return this.rest.get("/office/v2/payout/commission/bank-account",n)}postDirectCardPayout(n){return this.rest.post("/office/v2/payout/direct-card",n)}transferToPartner(n){return this.rest.post("/office/v2/balance/transfer",n)}getRecipient(n){return this.rest.get("/office/v2/balance/recipient",{backofficeId:n})}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var w=l(8079);let $=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(w.i);super(n),this.payoutApi=(0,t.WQX)(R),this.router=(0,t.WQX)(x.Ix),this.payoutState=n}getPayoutInfo(n){return this.payoutApi.getPayoutInfo(n).pipe((0,u.M)(o=>{this.set("info",o)}))}postPayout(n){return this.payoutApi.postPayout(n)}getRecipient(n){return this.payoutApi.getRecipient(n)}clearPayoutInfo(){this.set("info",null),this.set("bankAccounts",null)}getCommissionBankAccount(n){return this.payoutApi.getCommissionBankAccount(n).pipe((0,u.M)(o=>{this.set("bankAccounts",o)}))}postPayoutBankAccount(n,o){return this.payoutApi.postPayoutBankAccount(n,{amount:o})}postDirectCardPayout(n){return this.payoutApi.postDirectCardPayout(n)}transferToPartner(n){return this.payoutApi.transferToPartner(n)}goToFunds(){this.router.navigate([b.ij,v.FUNDS_ROUTE])}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var F=l(7588);const T=()=>{const e=(0,t.WQX)(F.RK),a=(0,t.WQX)($),n=(0,t.WQX)(J.y),o=(0,t.WQX)(j.F),i=(s,_,S,E)=>{(!s.bankAccountAvailable||_.status!=y.F.SET)&&!S&&!(E>0)&&a.goToFunds()};return new Q.c(s=>{e.initialized$.pipe((0,I.n)(_=>a.value.info&&n.value.info&&null!==o.value.hasUnsigned?(i(a.value.info,n.value.info,o.value.hasUnsigned,o.value.totalIncome),s.next(!0),(0,P.of)()):_?(0,k.p)([a.getPayoutInfo({amount:null}),n.getInnInfo(),o.getReportSignCheck()]).pipe((0,u.M)(([S,E,{hasUnsigned:Y,totalIncome:at}])=>{i(S,E,Y,at),s.next(!0)})):(0,P.of)())).subscribe()})};var m=l(1142),p=l(699),r=l(6468),h=l(980),M=l(2267),N=l(3871),W=l(2063),D=l(2444),L=l(1140),B=l(1413),G=l(6977),g=l(7471),c=l(9417);const an=["content"];function rn(e,a){1&e&&(t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-100",2),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.j41(5,"gamma-notification")(6,"gamma-typo-100",3),t.EFF(7),t.nI1(8,"transloco"),t.k0s(),t.j41(9,"gamma-typo-100",3),t.EFF(10),t.nI1(11,"transloco"),t.k0s(),t.j41(12,"gamma-typo-100",4),t.EFF(13),t.nI1(14,"transloco"),t.k0s()()()),2&e&&(t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(4,8,"agent.reports.help.title")," "),t.R7$(3),t.Y8G("block",!0),t.R7$(),t.SpI(" ",t.bMT(8,10,"agent.reports.help.text1")," "),t.R7$(2),t.Y8G("block",!0),t.R7$(),t.SpI(" ",t.bMT(11,12,"agent.reports.help.text2")," "),t.R7$(2),t.Y8G("block",!0),t.R7$(),t.SpI(" ",t.bMT(14,14,"agent.reports.help.text3")," "))}let sn=(()=>{class e{constructor(){this.dialogsService=(0,t.WQX)(L.wX),this.content=(0,t.ebz)("content"),this.closeModal$=new B.B}show(){this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-report-help"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,an,5),2&o&&t.NyB()},decls:6,vars:3,consts:[["content",""],["appearance","outline-button",3,"click"],[3,"strong"],[1,"mb-8",3,"block"],[3,"block"]],template:function(o,i){if(1&o){const s=t.RV6();t.j41(0,"gamma-button",1),t.bIt("click",function(){return t.eBV(s),t.Njj(i.show())}),t.j41(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()(),t.DNE(4,rn,15,16,"ng-template",null,0,t.C5r)}
12&o&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"agent.reports.help.title")," "))},dependencies:[g.Kj,c.X1,r.Qp,r.BP,r.UA,r.zP,r.vj],encapsulation:2,changeDetection:0})}}return e})();var gt=l(9079),Yt=l(5591),dt=l(6952);function cn(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.k0s()),2&e){const n=a.$implicit;t.R7$(),t.SpI(" ",n," ")}}let ln=(()=>{class e{constructor(){this.destroyRef=(0,t.WQX)(t.abz),this.agentReportsFacade=(0,t.WQX)(j.F),this.route=(0,t.WQX)(x.nX),this.START_YEAR=2025,this.loadData=(0,t.CGW)(),this.control=new c.MJ(null),this.selectIdentityMatcher=(n,o)=>n===o}ngOnInit(){this.initSelect(this.START_YEAR),this.control.valueChanges.pipe((0,u.M)(n=>{this.agentReportsFacade.setYear(n),this.loadData.emit()}),(0,gt.pQ)(this.destroyRef)).subscribe(),this.control.value||this.control.patchValue(this.route.snapshot.queryParams?.year||this.agentReportsFacade.value.year||(0,dt.po)())}initSelect(n){const o=[];for(let s=parseInt((0,dt.po)(),10);s>=n;s--)o.push(s);this.selectItems=o}selectItem(n){this.control.setValue(n)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-reports-filter"]],outputs:{loadData:"loadD
1ata"},decls:8,vars:11,consts:[["itemContent",""],[1,"filters"],[1,"filters__select",3,"selectItem","items","selectControl","placeholder","selectIdentityMatcher","valueContent","itemContent"]],template:function(o,i){if(1&o){const s=t.RV6();t.qex(0),t.j41(1,"div",1)(2,"app-select-dialog",2),t.nI1(3,"transloco"),t.bIt("selectItem",function(S){return t.eBV(s),t.Njj(i.selectItem(S))}),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.DNE(6,cn,2,1,"ng-template",null,0,t.C5r),t.k0s(),t.bVm()}if(2&o){const s=t.sdS(7);t.R7$(2),t.Y8G("items",i.selectItems)("selectControl",i.control)("placeholder",t.bMT(3,7,"common.year"))("selectIdentityMatcher",i.selectIdentityMatcher)("valueContent",s)("itemContent",s),t.R7$(2),t.SpI(" ",t.bMT(5,9,"common.year")," ")}},dependencies:[g.Kj,Yt.a,r.vj],styles:[".filters[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);margin-bottom:var(--spacer-16)}.filters__select[_ngcontent-%COMP%]{min-width:200px}@media screen and (max-width: 767px){.filters[_ngcontent-%COMP%]{flex-direction:column}}"],changeDetection:0})}}return e})();var X=l(9437),V=l(8810),pn=l(9704),et=l(9117),dn=l(1248);const Vt=e=>({0:e});function mn(e,a){1&e&&(t.j41(0,"div",2)(1,"div",4),t.nrm(2,"gamma-loader",5),t.k0s()()),2&e&&(t.R7$(2),t.Y8G("loader",!0))}function un(e,a){1&e&&(t.j41(0,"div",3),t.nrm(1,"gamma-svg",6),t.j41(2,"gamma-typo-100",7),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100"),t.EFF(6),t.nI1(7,"transloco"),t.k0s()()),2&e&&(t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(4,3,"agent.reports.sign.limit.exceeded")," "),t.R7$(3),t.JRh(t.bMT(7,5,"agent.reports.sign.contact.support")))}function _n(e,a){if(1&e&&(t.j41(0,"gamma-typo-50",13),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e){const n=t.XpG(2);t.R7$(),t.SpI(" ",t.i5U(2,1,"agent.reports.sign.signing.helper",t.eq3(4,Vt,n.expiredTime()))," ")}}function gn(e,a){if(1&e){const n=t.RV6();t.j41(0,"a",17),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.request())}),t.j41(1,"gamma-typo-50",18),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()}2&e&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"agent.reports.sign.signing.helper.refresh")," "))}function fn(e,a){1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"agent.reports.sign.signing.enter.code")," "))}function hn(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",2)(1,"div",8)(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100",9),t.EFF(6),t.nI1(7,"transloco"),t.k0s()(),t.j41(8,"div",10)(9,"div",11),t.nrm(10,"gamma-input",12),t.j41(11,"div"),t.DNE(12,_n,3,6,"gamma-typo-50",13)(13,gn,4,3,"a",14),t.k0s(),t.DNE(14,fn,3,3,"ng-template",null,0,t.C5r),t.k0s()(),t.j41(16,"div",15)(17,"gamma-button",16),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.signing())}),t.EFF(18),t.nI1(19,"transloco"),t.k0s()()()}if(2&e){const n=t.sdS(15),o=t.XpG();t.R7$(3),t.JRh(t.bMT(4,8,"agent.reports.sign.signing.title")),t.R7$(2),t.Y8G("color","grey-500"),t.R7$(),t.SpI(" ",t.i5U(7,10,"agent.reports.sign.signing.subtitle",t.eq3(15,Vt,o.signingData().phone))," "),t.R7$(4),t.Y8G("label",n),t.R7$(2),t.vxM(o.refreshRequest()?-1:12),t.R7$(),t.vxM(o.refreshRequest()?13:-1),t.R7$(4),t.Y8G("disabled",o.form.invalid||o.loadingSign()),t.R7$(),t.SpI(" ",t.bMT(19,13,"common.verify")," ")}}function Cn(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",2)(1,"div",8)(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100",9),t.EFF(6),t.nI1(7,"transloco"),t.k0s()(),t.j41(8,"div",10)(9,"a",19)(10,"div",20),t.nrm(11,"gamma-svg",21),t.k0s(),t.j41(12,"div",22)(13,"gamma-typo-100"),t.EFF(14),t.nI1(15,"transloco"),t.k0s(),t.j41(16,"gamma-typo-50",9),t.EFF(17),t.nI1(18,"transloco"),t.k0s()()(),t.j41(19,"div",23)(20,"gamma-checkbox",24),t.EFF(21),t.nI1(22,"transloco"),t.k0s()()(),t.j41(23,"div",15)(24,"gamma-button",16),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.request())}),t.EFF(25),t.nI1(26,"transloco"),t.k0s()()()}if(2&e){const n=t.XpG();t.R7$(3),t.JRh(t.bMT(4,10,"agent.reports.sign.agreement.title")),t.R7$(2),t.Y8G("color","grey-500"),t.R7$(),t.SpI(" ",t.bMT(7,12,"agent.reports.sign.agreement.subtitle")," "),t.R7$(3),t.Y8G("href",n.remoteDocumentLinksService.getAgreementPepDocument(),t.B4B),t.R7$(5),t.JRh(t.bMT(15,14,"agent.reports.sign.agreement")),t.R7$(2),t.Y8G("color","grey-500"),t.R7$(),t.SpI(" ",t.bMT(18,16,"agent.reports.sign.agreement.description")," "),t.R7$(4),t.SpI(" ",t.bMT(22,18,"agent.reports.sign.agreement.checkbox")," "),t.R7$(3),t.Y8G("disabled",n.form.invali
1d),t.R7$(),t.SpI(" ",t.bMT(26,20,"agent.reports.sign.agreement.action")," ")}}let yn=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.remoteDocumentLinksService=(0,t.WQX)(pn.s),this.alertService=(0,t.WQX)(r.Nx),this.agentReportsFacade=(0,t.WQX)(j.F),this.countdownService=(0,t.WQX)(dn.V),this.storageService=(0,t.WQX)(et.n),this.completeSing=(0,t.CGW)(),this.form=new c.gE({agreement:new c.MJ(!0,[c.k0.requiredTrue])}),this.loadingRequest=(0,t.vPA)(!1),this.loadingSign=(0,t.vPA)(!1),this.refreshRequest=(0,t.vPA)(!1),this.errorLimit=(0,t.vPA)(!1),this.currentPage=(0,t.vPA)(0),this.signingData=(0,t.vPA)(null),this.minutes=(0,t.vPA)("00"),this.seconds=(0,t.vPA)("00"),this.expiredTime=(0,t.EWP)(()=>`${this.minutes()}:${this.seconds()}`)}request(){const n=this.storageService.get(et.g.PARTNER_SIGNING_DATA),o=(0,dt.rz)();if(n?.nextAttempt>o)return this.runTimer(1e3*(n.nextAttempt-o)),this.signingData.set(n),void this.addCodeToForm();this.loadingRequest.set(!0),this.refreshRequest.set(!1),this.agentReportsFacade.postRequest().pipe((0,u.M)(i=>{this.signingData.set(i),this.runTimer(i.nextAttempt),this.addCodeToForm(),this.saveTimeToStorage(i)}),(0,X.W)(i=>("errors.sign.code.dayLimit"===i.error.errorCode&&this.errorLimit.set(!0),this.notifyAlertError(i.error.message),(0,V.$)(()=>i))),(0,h.j)(()=>{this.loadingRequest.set(!1)})).subscribe()}signing(){this.loadingSign.set(!0),this.agentReportsFacade.postSigning({code:this.form.get("code").value,token:this.signingData().token}).pipe((0,u.M)(()=>{this.completeSing.emit()}),(0,X.W)(n=>(this.notifyAlertError(n.error.message),(0,V.$)(()=>n))),(0,h.j)(()=>{this.loadingSign.set(!1)})).subscribe()}addCodeToForm(){this.form.get("agreement")&&(this.form.removeControl("agreement"),this.form.addControl("code",new c.MJ(null,[c.k0.required,
1c.k0.minLength(4),c.k0.maxLength(6)])))}saveTimeToStorage(n){const i=n.nextAttempt/1e3+(0,dt.rz)();this.storageService.set(et.g.PARTNER_SIGNING_DATA,{...n,nextAttempt:i})}notifyAlertError(n){this.alertService.open(n,{appearance:"error"}).subscribe()}runTimer(n){let o=n;const i=setInterval(()=>{if(o>dt.kL)this.minutes.set("59"),this.seconds.set("59");else{const{minutes:s,seconds:_}=this.countdownService.calculateSignNextAttempt(o);this.minutes.set(s),this.seconds.set(_)}0===o&&(clearInterval(i),this.storageService.remove(et.g.PARTNER_SIGNING_DATA),this.refreshRequest.set(!0)),o-=1e3},1e3)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-reports-sign-dialog"]],outputs:{completeSing:"completeSing"},decls:5,vars:2,consts:[["label",""],[3,"formGroup"],[1,"card__outline","sign-card"],[1,"card__outline","sign-card","align-center","justify-center","gap-3"],[1,"sign-card__loader"],["size","l",3,"loader"],["src","gamma::icon-large-circle-canceled",1,"sign-card__limit-icon"],[3,"strong"],[1,"sign-card__header"],[3,"color"],[1,"sign-card__content"],[1,"sign-card__input"],["formControlName","code",3,"label"],["color","grey-500"],[1,"sign-card__refresh"],[1,"sign-card__footer"],[3,"click","disabled"],[1,"sign-card__refresh",3,"click"],["color","color-backoffice-300"],["target","_blank",1,"card__outline","flex","gap-4",3,"href"],[1,"sign-card__document-icon"],["src","gamma::icon-medium-pdf"],[1,"flex-dir-column","gap-2"],[1,"sign-card__checkbox"],["size","s","formControlName","agreement"]],template:function(o,i){if(1&o&&(t.j41(0,"gamma-form",1),t.DNE(1,mn,3,1,"div",2)(2,un,8,7,"div",3)(3,hn,20,17,"div",2)(4,Cn,27,22,"div",2),t.k0s()),2&o){let s;t.Y8G("formGroup",i.form),t.R7$(),t.vxM((s=!0)===i.loadingRequest()?1:s===(i.errorLimit()&&!i.loadingRequest())?2:s===(!!i.signingData()&&!i.loadingRequest())?3:4)}},dependencies:[g.Kj,c.X1,c.BC,c.cb,c.j4,c.JD,r.xh,r.vj,r.Py,r.Qp,r.VU,r.dx,r.Sj,r.b$,r.PY],styles:[".sign-card[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto;padding:0;max-width:464px;min-height:354px;display:flex;flex-direction:column}.sign-card__loader[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;justify-content:center}.sign-card__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-4);padding:var(--spacer-24) var(--spacer-32) var(--spacer-24) var(--spacer-24);border-bottom:1px solid var(--grey-200)}.sign-card__footer[_ngcontent-%COMP%]{padding:24px;border-top:1px solid var(--grey-200);display:flex;justify-content:flex-end}.sign-card__content[_ngcontent-%COMP%]{padding:var(--spacer-32) var(--spacer-24)}.sign-card__document[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16)}.sign-card__document-icon[_ngcontent-%COMP%]{width:44px;height:44px;position:relative;border-radius:var(--border-radius-300);background-color:var(--color-info-100)}.sign-card__document-icon[_ngcontent-%COMP%] gamma-svg[_ngcontent-%COMP%]{--app-icon-color: var(--color-info-300);position:absolute;bottom:6px;right:6px}.sign-card__checkbox[_ngcontent-%COMP%]{margin-top:var(--spacer-24)}.sign-card__input[_ngcontent-%COMP%]{text-align:center}.sing-card__refresh[_ngcontent-%COMP%]{text-decoration:underline;text-decoration-color:var(--color-backoffice-300);cursor:pointer}.sign-card__limit-icon[_ngcontent-%COMP%]{--app-icon-color: var(--color-danger-300);padding-bottom:var(--spacer-8)}@media screen and (min-width: 768px){.sign-card[_ngcontent-%COMP%]{margin-top:140px}}"],changeDetection:0})}}return e})();var f=l(1635),Tt=l(9870),U=l(8761),H=l(1645);function bn(e,a){1&e&&(t.j41(0,"div",0),t.nrm(1,"gamma-svg",2),t.j41(2,"gamma-typo-100",3),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()),2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"agent.reports.table.status.signed")," "))}function vn(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-button",4),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.sign(i.agentReportItem().id))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&e){const n=t.XpG(2);t.Y8G("showLoader",n.loading()),t.R7$(),t.SpI(" ",t.bMT(2,2,"agent.reports.sign.agreement.action")," ")}}function Tn(e,a){if(1&e&&t.DNE(0,bn,5,3,"div",0)(1,vn,3,4,"gamma-button",1),2&e){const n=t.XpG();
1t.vxM(n.agentReportItem().signed&&!n.agentReportItem().resignRequired?0:1)}}let xn=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.agentReportsFacade=(0,t.WQX)(j.F),this.agentReportItem=t.hFB.required(),this.loadList=(0,t.CGW)(),this.loading=(0,t.vPA)(!1)}sign(n){this.loading.set(!0),this.agentReportsFacade.postSign(n).pipe((0,u.M)(()=>{this.loadList.emit(),this.loading.set(!1)}),(0,X.W)(o=>(this.loading.set(!1),(0,V.$)(()=>o)))).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-reports-action"]],inputs:{agentReportItem:[1,"agentReportItem"]},outputs:{loadList:"loadList"},decls:1,vars:1,consts:[[1,"agent-reports__action"],["appearance","outline-button",3,"showLoader"],["src","gamma::icon-xsmall-circle-checked"],["color","color-backoffice-300"],["appearance","outline-button",3,"click","showLoader"]],template:function(o,i){1&o&&t.DNE(0,Tn,2,1),2&o&&t.vxM(i.agentReportItem().canSign?0:-1)},dependencies:[g.Kj,r.Qp,r.vj,r.dx],styles:[".agent-reports__action[_ngcontent-%COMP%]{--app-icon-color: var(--color-backoffice-300)}.agent-reports__action[_ngcontent-%COMP%] gamma-svg[_ngcontent-%COMP%]{vertical-align:middle}"],changeDetection:0})}}return e})();var xt=function(e){return e.INCOME="INCOME",e.WITHDRAW="WITHDRAW",e.ZERO_NO_BCE="ZERO_NO_BCE",e.ZERO="ZERO",e}(xt||{});function Mn(e,a){1&e&&(t.EFF(0),t.nI1(1,"transloco")),2&e&&t.SpI(" ",t.bMT(1,1,"funds.commission.january.hint")," ")}function kn(e,a){if(1&e&&(t.j41(0,"gamma-svg",1),t.DNE(1,Mn,2,3,"ng-template",null,0,t.C5r),t.k0s()),2&e){const n=t.sdS(2);t.Y8G("guiHint",n)("guiHintAppearance","dark")("guiHintDirection","bottom")("guiHintShowDelay",0)}}let Rn=(()=>{class e{constructor(){this.period=(0,t.hFB)(void 0)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-report-commission-hint"]],inputs:{period:[1,"period"]},decls:1,vars:1,consts:[["commissionHintTmpl",""],["src","gamma::icon-medium-alert-circle",1,"cursor-pointer",3,"guiHint","guiHintAppearance","guiHintDirection","guiHintShowDelay"]],template:function(o,i){1&o&&t.DNE(0,kn,3,4,"gamma-svg",1),2&o&&t.vxM("2025-01-01"===i.period()?0:-1)},dependencies:[g.Kj,c.X1,r.dx,r._X],encapsulation:2,changeDetection:0})}}return e})();var A=l(2881),K=l(7349);const wn=()=>({key:"funds.table.myOperations.date.title"}),$n=()=>({key:"funds.table.myOperations.amount.title"}),In=()=>({key:"funds.withdrawal.payoutWithdrawalDialog.commission"}),Dn=()=>["/","direct","funds","agent-reports","taxes_report"],An=e=>({period:e}),Z=e=>({agentReportItem:e});function Fn(e,a){if(1&e&&(t.j41(0,"gamma-typo-100",12),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e){const n=a.key,o=t.XpG(2),i=t.XpG();t.Y8G("strong",o===i.EBreakpoint.DESKTOP_LARGE),t.R7$(),t.SpI(" ",t.bMT(2,2,n)," ")}}function Sn(e,a){1&e&&t.eu8(0)}function En(e,a){if(1&e&&t.DNE(0,Sn,1,0,"ng-container",13),2&e){t.XpG();const n=t.sdS(2);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.lJ4(2,wn))}}function Pn(e,a){1&e&&t.eu8(0)}function jn(e,a){if(1&e&&t.DNE(0,Pn,1,0,"ng-container",13),2&e){t.XpG();const n=t.sdS(2);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.lJ4(2,$n))}}function Gn(e,a){1&e&&t.eu8(0)}function Bn(e,a){1&e&&(t.EFF(0),t.nI1(1,"transloco")),2&e&&t.SpI(" ",t.bMT(1,1,"funds.commission.info.hint")," ")}function On(e,a){if(1&e&&(t.j41(0,"div",14),t.DNE(1,Gn,1,0,"ng-container",13),t.j41(2,"gamma-svg",15),t.DNE(3,Bn,2,3,"ng-template",null,9,t.C5r),t.k0s()()),2&e){const n=t.sdS(4);t.XpG();const o=t.sdS(2);t.R7$(),t.Y8G("ngTemplateOutlet",o)("ngTemplateOutletContext",t.lJ4(6,In)),t.R7$(),t.Y8G("guiHint",n)("guiHintAppearance","dark")("guiHintDirection","bottom")("guiHintShowDelay",0)}}function Nn(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"date"),t.nI1(3,"titlecase"),t.k0s()),2&e){const n=a.agentReportItem;t.R7$(),t.SpI(" ",t.bMT(3,4,t.i5U(2,1,n.periodStart,"LLLL y"))," ")}}function Ln(e,a){if(1&e&&(t.j41(0,"gamma-typo-100",16),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=a.agentReportItem,o=t.XpG(3);t.Y8G("strong",!0),t.R7$(),t.Lme(" ",t.bMT(2,3,n.total),"",t.bMT(3,5,o.EInternalCurrency.RUB)," ")}}function Xn(e,a){if(1&e&&(t.j41(0,"div",14)(1,"gamma-typo-100",16),t.EFF(2),t.nI1(3,"appNumberFormat"),t.nI1(4,"gammaCurrency"),t.k0s(),t.nrm(5,"app-agent-report-commission-hint",17),t.k0s()),2&e){const n=a.agentReportItem,o=t.XpG(3);t.R7$(),t.Y8G("strong",!0),t.R7$(),t.Lme(" ",t.bMT(3,4,n.commissionFee),"",t.bMT(4,6,o.EInternalCurrency.RUB)," "),t.R7$(3),t.Y8G("period",n.periodStart)}}function Wn(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",21),t.bIt("click",function(){t.eBV(n);const i=t.XpG().agentReportItem,s=t.XpG(3);return t.Njj(s.preview(i))}),t.nrm(1,"gamma-svg",22),t.j41(2,"gamma-typo-100",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()}if(2&e){const n=t.XpG().agentReportItem,o=t.XpG(3);t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(4,2,o.getActName(n))," ")}}function Yn(e,a){if(1&e&&(t.j41(0,"div",20),t.nrm(1,"gamma-svg",24),t.j41(2,"gamma-typo-100",23),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()),2&e){const n=t.XpG().agentReportItem;t.Y8G("routerLink",t.lJ4(6,Dn))("queryParams",t.eq3(7,An,n.periodStart)),t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(4,4,"agent.reports.table.history")," ")}}function Vn(e,a){if(1&e&&(t.j41(0,"gamma-loader",18),t.DNE(1,Wn,5,4,"div",19),t.k0s(),t.DNE(2,Yn,5,9,"div",20)),2&e){const n=a.agentReportItem,o=t.XpG(3);t.Y8G("loader",o.loadingPreviews().has(n.id))("overlay",!0)("size","s"),t.R7$(),t.vxM(o.getActName(n)?1:-1),t.R7$(),t.vxM(n.actType===o.EActType.INCOME||n.actType===o.EActType.WITHDRAW?2:-1)}}function Un(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-agent-reports-action",25),t.bIt("loadList",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.loadList.emit())}),t.k0s()}2&e&&t.Y8G("agentReportItem",a.agentReportItem)}function Qn(e,a){1&e&&t.eu8(0)}function Hn(e,a){1&e&&t.eu8(0)}function zn(e,a){1&e&&t.eu8(0)}function Jn(e,a){1&e&&t.eu8(0)}function Kn(e,a){1&e&&t.eu8(0)}function Zn(e,a){1&e&&t.eu8(0)}function qn(e,a){1&e&&t.eu8(0)}function te(e,a){1&e&&t.eu8(0)}function ne(e,a){if(1&e&&(t.j41(0,"tr")(1,"td"),t.DNE(2,Jn,1,0,"ng-container",13),t.k0s(),t.j41(3,"td"),t.DNE(4,Kn,1,0,"ng-container",13),t.k0s(),t.j41(5,"td"),t.DNE(6,Zn,1,0,"ng-container",13),t.k0s(),t.j41(7,"td",30),t.DNE(8,qn,1,0,"ng-container",13),t.k0s(),t.j41(9,"td",30),t.DNE(10,te,1,0,"ng-container",13),t.k0s(),t.nrm(11,"td"),t.k0s()),2&e){const n=a.$implicit;t.XpG(3);const o=t.sdS(10),i=t.sdS(12),s=t.sdS(14),_=t.sdS(16),S=t.sdS(18);t.R7$(2),t.Y8G("ngTemplateOutlet",o)("ngTemplateOutletContext",t.eq3(10,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(12,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",t.eq3(14,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",_)("ngTemplateOutletContext",t.eq3(16,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",S)("ngTemplateOutletContext",t.eq3(18,Z,n))}}function ee(e,a){if(1&e&&(t.j41(0,"table",26)(1,"colgroup"),t.nrm(2,"col",28)(3,"col",28)(4,"col",28)(5,"col",28)(6,"col",28),t.k0s(),t.j41(7,"thead")(8,"tr")(9,"td"),t.DNE(10,Qn,1,0,"ng-container",29),t.k0s(),t.j41(11,"td"),t.DNE(12,Hn,1,0,"ng-container",29),t.k0s(),t.j41(13,"td"),t.DNE(14,zn,1,0,"ng-container",29),t.k0s(),t.nrm(15,"td")(16,"td"),t.k0s()(),t.j41(17,"tbody"),t.Z7z(18,ne,12,20,"tr",null,t.fX1),t.k0s()()),2&e){const n=t.XpG(2),o=t.sdS(4),i=t.sdS(6),s=t.sdS(8);t.Y8G("width","100%"),t.R7$(2),t.Y8G("width","20%"),t.R7$(),t.Y8G("width","15%"),t.R7$(),t.Y8G("width","15%"),t.R7$(),t.Y8G("width","30%"),t.R7$(),t.Y8G("width","20%"),t.R7$(4),t.Y8G("ngTemplateOutlet",o),t.R7$(2),t.Y8G("ngTemplateOutlet",i),t.R7$(2),t.Y8G("ngTemplateOutlet",s),t.R7$(4),t.Dyx(n.rows)}}function oe(e,a){1&e&&t.eu8(0)}function ae(e,a){1&e&&t.eu8(0)}function ie(e,a){1&e&&t.eu8(0)}function re(e,a){1&e&&t.eu8(0)}function se(e,a){1&e&&t.eu8(0)}function ce(e,a){1&e&&t.eu8(0)}function le(e,a){1&e&&t.eu8(0)}function pe(e,a){1&e&&t.eu8(0)}function de(e,a){if(1&e&&(t.j41(0,"div",31)(1,"div",32)(2,"div",33),t.DNE(3,oe,1,0,"ng-container",29)(4,ae,1,0,"ng-container",13),t.k0s(),t.j41(5,"div",33),t.DNE(6,ie,1,0,"ng-container",29)(7,re,1,0,"ng-container",13),t.k0s()(),t.j41(8,"div",32),t.nrm(9,"div",33),t.j41(10,"div",33),t.DNE(11,se,1,0,"ng-container",29)(12,ce,1,0,"ng-container",13),t.k0s()(),t.j41(13,"div",34),t.DNE(14,le,1,0,"ng-container",13)(15,pe,1,0,"ng-container",13),t.k0s()()),2&e){const n=a.$implicit;t.XpG(3);const o=t.sdS(4),i=t.sdS(6),s=t.sdS(8),_=t.sdS(10),S=t.sdS(12),E=t.sdS(14),Y=t.
1sdS(16),at=t.sdS(18);t.R7$(3),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",_)("ngTemplateOutletContext",t.eq3(13,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",i),t.R7$(),t.Y8G("ngTemplateOutlet",S)("ngTemplateOutletContext",t.eq3(15,Z,n)),t.R7$(4),t.Y8G("ngTemplateOutlet",s),t.R7$(),t.Y8G("ngTemplateOutlet",E)("ngTemplateOutletContext",t.eq3(17,Z,n)),t.R7$(2),t.Y8G("ngTemplateOutlet",Y)("ngTemplateOutletContext",t.eq3(19,Z,n)),t.R7$(),t.Y8G("ngTemplateOutlet",at)("ngTemplateOutletContext",t.eq3(21,Z,n))}}function me(e,a){if(1&e&&(t.j41(0,"div",27),t.Z7z(1,de,16,23,"div",31,t.fX1),t.k0s()),2&e){const n=t.XpG(2);t.R7$(),t.Dyx(n.rows)}}function ue(e,a){if(1&e&&t.DNE(0,ee,20,9,"table",26)(1,me,3,0,"div",27),2&e){const n=t.XpG(2),o=t.XpG();t.vxM(n===o.EBreakpoint.DESKTOP_LARGE?0:-1),t.R7$(),t.vxM(n!==o.EBreakpoint.DESKTOP_LARGE?1:-1)}}function _e(e,a){1&e&&(t.nrm(0,"gamma-empty-state",11),t.nI1(1,"transloco")),2&e&&t.Y8G("imageWidth",140)("imageHeight",140)("imageUrl","/assets/images/funds/empty-report.png")("description",t.bMT(1,4,"common.nothingFound"))}function ge(e,a){if(1&e&&(t.j41(0,"gamma-scrollbar",10),t.DNE(1,Fn,3,4,"ng-template",null,0,t.C5r)(3,En,1,3,"ng-template",null,1,t.C5r)(5,jn,1,3,"ng-template",null,2,t.C5r)(7,On,5,7,"ng-template",null,3,t.C5r)(9,Nn,4,6,"ng-template",null,4,t.C5r)(11,Ln,4,7,"ng-template",null,5,t.C5r)(13,Xn,6,8,"ng-template",null,6,t.C5r)(15,Vn,3,5,"ng-template",null,7,t.C5r)(17,Un,1,1,"ng-template",null,8,t.C5r)(19,ue,2,2),t.nI1(20,"async"),t.DNE(21,_e,2,6,"gamma-empty-state",11),t.nI1(22,"async"),t.k0s()),2&e){const n=t.XpG(2);t.Y8G("hidden",!0),t.R7$(19),t.vxM(!1===t.bMT(20,3,n.isEmpty$)?19:-1),t.R7$(2),t.vxM(t.bMT(22,5,n.isEmpty$)?21:-1)}}function fe(e,a){if(1&e&&(t.DNE(0,ge,23,7,"gamma-scrollbar",10),t.nI1(1,"async")),2&e){let n;const o=t.XpG();t.vxM((n=t.bMT(1,1,o.agentReports$))?0:-1,n)}}class mt{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.agentReportsFacade=(0,t.WQX)(j.F),this.store=(0,t.WQX)(D.t),this.EBreakpoint=M.r,this.EInternalCurrency=H.oy,this.EActType=xt,this.loadList=(0,t.CGW)(),this.agentReportsState=this.store.state("agentReports"),this.agentReports$=this.agentReportsState.select$(a=>a),this.isEmpty$=this.agentReportsState.select$(a=>!(a.total>0)),this.loadingPreviews=(0,t.vPA)(new Set)}preview(a){this.loadingPreviews.update(n=>new Set(n).add(a.id)),a.signed&&!a.resignRequired?this.agentReportsFacade.downloadSigned(a).pipe((0,h.j)(()=>{setTimeout(()=>{this.loadingPreviews.update(n=>{const o=new Set(n);return o.delete(a.id),o})},500)})).subscribe():this.agentReportsFacade.getPreview(a).pipe((0,h.j)(()=>{setTimeout(()=>{this.loadingPreviews.update(n=>{const o=new Set(n);return o.delete(a.id),o})},500)})).subscribe()}getActName(a){return a.actType===xt.INCOME?"agent.reports.table.income":""}static{this.\u0275fac=function(n){return new(n||mt)}}static{this.\u0275cmp=t.VBU({type:mt,selectors:[["app-agent-reports-table"]],outputs:{loadList:"loadList"},decls:2,vars:3,consts:[["tableTitleText",""],["tableTitleDateCreated",""],["tableTitleAmount",""],["tableTitleCommission",""],["tableValueDateCreated",""],["tableValueAmount",""],["tableValueCommission",""],["tableValuePdf",""],["tableValueAction",""],["hint",""],[1,"agent-reports",3,"hidden"],[1,"agent-reports__empty",3,"imageWidth","imageHeight","imageUrl","description"],["color","grey-500",3,"strong"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"flex","align-center","gap-2"],["src","gamma::icon-medium-question",1,"cursor-pointer",3,"guiHint","guiHintAppearance","guiHintDirection","guiHintShowDelay"],[3,"strong"],[3,"period"],[1,"flex","lg:justify-end","mb-8",3,"loader","overlay","size"],[1,"agent-reports__pdf","cursor-pointer"],[1,"agent-reports__pdf","cursor-pointer",3,"routerLink","queryParams"],[1,"agent-reports__pdf","cursor-pointer",3,"click"],["src","gamma::icon-medium-pdf"],["color","color-backoffice-300",3,"strong"],["src","gamma::icon-medium-transaction-list"],[3,"loadList","agentReportItem"],[1,"agent-reports__table",3,"width"],[1,"table-card__wrapper"],["span","1",3,"width"],[4,"ngTemplateOutlet"],[1,"_right"],[1,"table-card"],[1,"table-card__row"],[1,"table-card__cell"],[1,"table-card__footer"]],template:function(n,o){if(1&n&&(t.DNE(0,fe,2,3),t.nI1(1,"async")),2&n){let i;t.vxM((i=t.bMT(1,1,o.breakpoint$))?0:-1,i)}},dependencies:[A.Jj,g.Kj,A.PV,A.vh,A.T3,c.X1,K.K,xn,Rn,Tt.Wk,r.os,r.VU,r.GY,r.dx,r.vj,r.BU,r._X],styles:[".agent-reports[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.agent-reports__empty[_ngcontent-%COMP%]{min-height:60vh}.agent-reports__table[_ngcontent-%COMP%]{min-width:500px}.agent-reports__pagination[_ngcontent-%COMP%]{display:flex;margin-top:var(--spacer-16)}.table-card__wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.table-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--grey-200);border-radius:var(--border-radius-500);background-color:var(--white)}.table-card__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer-16);padding:var(--spacer-16) var(--spacer-16) var(--spacer-24) var(--spacer-16)}.table-card__row[_ngcontent-%COMP%]:first-of-type{border-bottom:1px solid var(--grey-200);padding:var(--spacer-24) var(--spacer-16)}.table-card__footer[_ngcontent-%COMP%]{padding:var(--spacer-16) var(--spacer-16) var(--spacer-24) var(--spacer-16);display:flex;gap:var(--spacer-16);flex-direction:column}.table-card__cell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:var(--spacer-4)}table[_ngcontent-%COMP%] ._center[_ngcontent-%COMP%]{text-align:center}table[_ngcontent-%COMP%] ._right[_ngcontent-%COMP%]{text-align:right}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:var(--spacer-16) var(--spacer-12);vertical-align:middle}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background-color:var(--white);border-bottom:1px solid var(--grey-200)}.agent-reports__pdf[_ngcontent-%COMP%], .agent-reports__action[_ngcontent-%COMP%]{--app-icon-color: var(--color-backoffice-300);display:inline-flex;align-items:center;gap:var(--spacer-4)}"],changeDetection:0})}}function he(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-agent-reports-filter",7),t.bIt("loadData",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.loadList())}),t.k0s()}}function Ce(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",4),t.DNE(1,he,1,0,"app-agent-reports-filter"),t.nrm(2,"app-agent-report-help"),t.k0s(),t.j41(3,"div",5)(4,"app-agent-reports-table",6),t.bIt("loadList",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.loadList())}),t.k0s()()}if(2&e){const n=t.XpG(2);t.R7$(),t.vxM(n.showSigning()?-1:1)}}function ye(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-agent-reports-sign-dialog",8),t.bIt("completeSing",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.completeSing())}),t.k0s()}}function be(e,a){if(1&e&&(t.j41(0,"app-page-layout")(1,"section",0),t.nrm(2,"app-page-header",1),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"section",2)(5,"gamma-loader",3),t.nI1(6,"async"),t.DNE(7,Ce,5,1)(8,ye,1,0,"app-agent-reports-sign-dialog"),t.k0s()()()),2&e){const n=t.XpG();t.R7$(2),t.Y8G("backPath",n.BACK_PATH)("title",t.bMT(3,6,"agent.reports.title")),t.R7$(3),t.Y8G("loader",t.bMT(6,8,n.agentReportsLoading$))("overlay",!0),t.R7$(2),t.vxM(n.showSigning()?-1:7),t.R7$(),t.vxM(n.showSigning()?8:-1)}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],mt.prototype,"getActName",null);let ve=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.store=(0,t.WQX)(D.t),this.agentReportsFacade=(0,t.WQX)(j.F),this.EBreakpoint=M.r,this.BACK_PATH=b.ij+"/"+v.FUNDS_ROUTE,this.MAX_PAGE_ITEMS=12,this.isEmpty=(0,t.vPA)(!1),this.showSigning=(0,t.vPA)(!1),this.profileState=this.store.state("profile"),this.agentReportsState=this.store.state("agentReports"),this.agentReportsLoading$=this.agentReportsState.select$(n=>n.loading)}loadList(){this.agentReportsFacade.getAgentReports(this.MAX_PAGE_ITEMS).pipe((0,u.M)(n=>{n.data||this.showSigning.set(!0)}),(0,h.j)(()=>{this.isEmpty.set(!this.agentReportsState.value.total)})).subscribe()}completeSing(){this.loadList(),this.showSigning.set(!1)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-reports"]
1],decls:2,vars:3,consts:[["header-section",""],[1,"mb-8",3,"backPath","title"],["content-section","",1,"content-section"],[3,"loader","overlay"],[1,"filter"],[1,"py-16"],[3,"loadList"],[3,"loadData"],[3,"completeSing"]],template:function(o,i){if(1&o&&(t.DNE(0,be,9,10,"app-page-layout"),t.nI1(1,"async")),2&o){let s;t.vxM((s=t.bMT(1,1,i.breakpoint$))?0:-1,s)}},dependencies:[r.VU,A.Jj,g.Kj,c.X1,ln,mt,yn,sn,W.J,N.y],styles:["[_nghost-%COMP%]{width:100%}.filter[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-8)}@media screen and (max-width: 767px){.agent-report__wrapper[_ngcontent-%COMP%]{flex-direction:column;gap:var(--spacer-24)}.filter[_ngcontent-%COMP%]{flex-direction:column}.filter[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%}}"],changeDetection:0})}}return e})();var Te=l(3205),Mt=l(6743),kt=l(3847),Rt=l(2204);let wt=(()=>{class e{constructor(){this.replaceLinks=(0,t.CGW)()}onClick(n){const o=n.target;"a"===o.tagName.toLowerCase()&&(n.preventDefault(),n.stopPropagation(),this.replaceLinks.emit(o))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275dir=t.FsC({type:e,selectors:[["","replaceLinks",""]],hostBindings:function(o,i){1&o&&t.bIt("click",function(_){return i.onClick(_)})},outputs:{replaceLinks:"replaceLinks"}})}}return e})();var $t=l(7268),xe=l(2751);let Me=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(xe.w);super(n),this.profileApi=(0,t.WQX)($t.i),this.userDeferredRewardsState=n}getList(n,o){return this.profileApi.getDeferredRewardsList({max:n,offset:n*o}).pipe((0,u.M)(i=>{this.set("rows",i.rows),this.set("total",i.total)}))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var It=l(6199);class ot{constructor(){this.PAGE_SIZE_OPTIONS=[10,25,50],this.DEFAULT_PAGE_SIZE=10,this.currentPage=0,this.pageSize=this.DEFAULT_PAGE_SIZE,this.route=(0,t.WQX)(x.nX),this.router=(0,t.WQX)(x.Ix),this.storageService=(0,t.WQX)(et.n)}ngOnInit(){const a=this.route.snapshot.queryParams;this.pageSize=this.resolvePageSize(a.pageSize),this.currentPage=Number(a.currentPage)||0,this.loadList(this.currentPage)}loadList(a=0){this.currentPage=a,this.syncQueryParams(),this.fetchPage(a)}buildPageSizeActions(a){return this.PAGE_SIZE_OPTIONS.map(n=>({title:String(n),active:!0,disabled:n===a,action:()=>this.changePageSize(n)}))}changePageSize(a){a!==this.pageSize&&(this.pageSize=a,this.storageService.set(et.g.PAGE_SIZE,a),this.loadList(0))}getPageCount(a,n){return Math.ceil(a/n)}syncQueryParams(){this.router.navigate([],{relativeTo:this.route,queryParams:{currentPage:this.currentPage||null,pageSize:this.pageSize===this.DEFAULT_PAGE_SIZE?null:this.pageSize},queryParamsHandling:"merge",replaceUrl:!0})}resolvePageSize(a){return this.toAllowedPageSize(a)??this.toAllowedPageSize(this.storageService.get(et.g.PAGE_SIZE))??this.DEFAULT_PAGE_SIZE}toAllowedPageSize(a){const n=Number(a);return this.PAGE_SIZE_OPTIONS.includes(n)?n:null}static{this.\u0275fac=function(n){return new(n||ot)}}static{this.\u0275dir=t.FsC({type:ot})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Number]),(0,f.Sn)("design:returntype",Array)],ot.prototype,"buildPageSizeActions",null),(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Number,Number]),(0,f.Sn)("design:returntype",Number)],ot.prototype,"getPageCount",null);const ke=()=>({width:"20%"}),Re=()=>({width:"20%",class:"_right"}),we=()=>({width:"60%"}),Dt=(e,a,n)=>[e,a,n],At=e=>({data:e}),$e=e=>({count:e});function Ie(e,a){1&e&&t.nrm(0,"app-table-head-text",9)}function De(e,a){1&e&&t.nrm(0,"app-table-head-text",10)}function Ae(e,a){1&e&&t.nrm(0,"app-table-head-text",11)}function Fe(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"date"),t.k0s()),2&e){const n=a.data;t.R7$(),t.SpI(" ",t.i5U(2,1,n.dateCreated,"HH:mm dd.MM.yyyy")," ")}}function Se(e,a){if(1&e&&(t.j41(0,"gamma-typo-100",12),t.EFF(1),t.nI1(2,"appNumberFormat"),t.k0s()),2&e){const n=a.data;t.Y8G("strong",!0)("color","grey-800"),t.R7$(),t.SpI(" ",n.amount?t.bMT(2,3,n.amount):""," ")}}function Ee(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-typo-100",13),t.bIt("replaceLinks",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.processNoteLink(i))}),t.k0s()}if(2&e){const n=a.data,o=t.XpG(2);t.Y8G("innerHTML",o.replacedText(n.note),t.npT)}}function Pe(e,a){if(1&e&&t.nrm(0,"app-table-desktop",14),2&e){const n=t.XpG(2);t.XpG();const o=t.sdS(1),i=t.sdS(3),s=t.sdS(5),_=t.sdS(7),S=t.sdS(9),E=t.sdS(11);t.Y8G("rows",n.rows)("options",t.sMw(7,Dt,t.lJ4(4,ke),t.lJ4(5,Re),t.lJ4(6,we)))("headTemplates",t.sMw(11,Dt,o,i,s))("bodyTemplates",t.sMw(15,Dt,_,S,E))}}function je(e,a){1&e&&t.eu8(0)}function Ge(e,a){1&e&&t.eu8(0)}function Be(e,a){1&e&&t.eu8(0)}function Oe(e,a){1&e&&t.eu8(0)}function Ne(e,a){if(1&e&&(t.j41(0,"div",19),t.DNE(1,Be,1,0,"ng-container",20)(2,Oe,1,0,"ng-container",21),t.k0s()),2&e){const n=t.XpG().$implicit;t.XpG(4);const o=t.sdS(3),i=t.sdS(9);t.R7$(),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(3,At,n))}}function Le(e,a){1&e&&t.eu8(0)}function Xe(e,a){1&e&&t.eu8(0)}function We(e,a){if(1&e&&(t.j41(0,"div",17)(1,"div",18)(2,"div",19),t.DNE(3,je,1,0,"ng-container",20)(4,Ge,1,0,"ng-container",21),t.k0s(),t.DNE(5,Ne,3,5,"div",19),t.k0s(),t.j41(6,"div",18)(7,"div",19),t.DNE(8,Le,1,0,"ng-container",20)(9,Xe,1,0,"ng-container",21),t.k0s()()()),2&e){const n=a.$implicit;t.XpG(4);const o=t.sdS(1),i=t.sdS(5),s=t.sdS(7),_=t.sdS(11);t.R7$(3),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",t.eq3(7,At,n)),t.R7$(),t.vxM(n.amount?5:-1),t.R7$(3),t.Y8G("ngTemplateOutlet",i),t.R7$(),t.Y8G("ngTemplateOutlet",_)("ngTemplateOutletContext",t.eq3(9,At,n))}}function Ye(e,a){if(1&e&&(t.j41(0,"div",15),t.Z7z(1,We,10,11,"div",17,t.fX1),t.k0s()),2&e){const n=t.XpG(2);t.R7$(),t.Dyx(n.rows)}}function Ve(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",16)(1,"gamma-pagination",22),t.bIt("indexChange",function(i){t.eBV(n);const s=t.XpG(4);return t.Njj(s.loadList(i))}),t.k0s(),t.j41(2,"app-actions-dropdown",23)(3,"gamma-button",24),t.EFF(4),t.nI1(5,"transloco"),t.k0s()()()}if(2&e){const n=t.XpG(2),o=t.XpG(2);t.R7$(),t.Y8G("currentPage",o.currentPage)("pageCount",o.getPageCount(n.total,o.pageSize)),t.R7$(),t.Y8G("hasContent",!0)("actionsDropdownItems",o.buildPageSizeActions(o.pageSize)),t.R7$(),t.Y8G("iconRight","gamma::icon-small-arrow-down"),t.R7$(),t.SpI(" ",t.i5U(5,6,"funds.table.pageSize.label",t.eq3(9,$e,o.pageSize))," ")}}function Ue(e,a){if(1&e&&t.DNE(0,Pe,1,19,"app-table-desktop",14)(1,Ye,3,0,"div",15)(2,Ve,6,11,"div",16),2&e){const n=t.XpG(),o=t.XpG(),i=t.XpG();t.vxM(o===i.EBreakpoint.DESKTOP_LARGE?0:-1),t.R7$(),t.vxM(o!==i.EBreakpoint.DESKTOP_LARGE?1:-1),t.R7$(),t.vxM(n.total>0?2:-1)}}function Qe(e,a){if(1&e&&(t.j41(0,"gamma-scrollbar",6),t.DNE(1,Ue,3,3),t.k0s()),2&e){const n=t.XpG(2);t.Y8G("hidden",!0),t.R7$(),t.vxM(n.loading?-1:1)}}function He(e,a){1&e&&(t.nrm(0,"gamma-empty-state",8),t.nI1(1,"transloco")),2&e&&t.Y8G("imageUrl","/assets/images/empty-default-image.svg")("description",t.bMT(1,2,"funds.table.waitingForModeration.empty"))}function ze(e,a){if(1&e&&(t.DNE(0,Ie,1,0,"ng-template",null,0,t.C5r)(2,De,1,0,"ng-template",null,1,t.C5r)(4,Ae,1,0,"ng-template",null,2,t.C5r)(6,Fe,3,4,"ng-template",null,3,t.C5r)(8,Se,3,5,"ng-template",null,4,t.C5r)(10,Ee,1,1,"ng-template",null,5,t.C5r)(12,Qe,2,2,"gamma-scrollbar",6),t.nI1(13,"async"),t.nrm(14,"gamma-loader",7),t.DNE(15,He,2,4,"gamma-empty-state",8)),2&e){let n;const o=t.XpG();t.R7$(12),t.vxM((n=t.bMT(13,3,o.deferredRewards$))?12:-1,n),t.R7$(2),t.Y8G("loader",o.loading),t.R7$(),t.vxM(o.isEmpty&&!o.loading?15:-1)}}class ct extends ot{constructor(){super(...arguments),this.breakpoint$=(0,t.WQX)(p.$n),this.userDeferredRewardsFacade=(0,t.WQX)(Me),this.store=(0,t.WQX)(D.t),this.binarDetailFacade=(0,t.WQX)(It.u),this.EBreakpoint=M.r,this.isEmpty=!1,this.loading=!1,this.state=this.store.state("userDeferredRewards"),this.deferredRewards$=this.state.select$(a=>
1a)}fetchPage(a){this.state.value.total||(this.loading=!0),this.userDeferredRewardsFacade.getList(this.pageSize,a).pipe((0,h.j)(()=>{this.loading=!1,this.isEmpty=!this.state.value.total})).subscribe()}processNoteLink(a){const n=a.href.split("/"),o=Number(n[n.length-1]);this.binarDetailFacade.showPartnerDialog(o)}replacedText(a){return a.replace(/# (\d+)/g,'<a href="/direct/team/binar/$1"># $1</a>')}static{this.\u0275fac=(()=>{let a;return function(o){return(a||(a=t.xGo(ct)))(o||ct)}})()}static{this.\u0275cmp=t.VBU({type:ct,selectors:[["app-my-deferred-rewards-table"]],features:[t.Vt3],decls:2,vars:3,consts:[["tableHeadDateCreated",""],["tableHeadAmount",""],["tableHeadDescription",""],["tableValueDateCreated",""],["tableValueAmount",""],["tableValueDescription",""],[1,"my-operations",3,"hidden"],[1,"col-12","lg:col-10",3,"loader"],[1,"pb-48",3,"imageUrl","description"],["key","funds.table.waitingForModeration.date.title"],["key","funds.table.waitingForModeration.amount.title"],["key","funds.table.waitingForModeration.description.title"],[3,"strong","color"],[3,"replaceLinks","innerHTML"],[3,"rows","options","headTemplates","bodyTemplates"],[1,"table-card__wrapper"],[1,"my-operations__footer"],[1,"table-card"],[1,"table-card__row"],[1,"table-card__cell"],[4,"ngTemplateOutlet"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"my-operations__pagination",3,"indexChange","currentPage","pageCount"],[1,"my-operations__page-size",3,"hasContent","actionsDropdownItems"],["appearance","outline-button","size","m",3,"iconRight"]],template:function(n,o){if(1&n&&(t.DNE(0,ze,16,5),t.nI1(1,"async")),2&n){let i;t.vxM((i=t.bMT(1,1,o.breakpoint$))?0:-1,i)}},dependencies:[A.Jj,g.Kj,A.vh,A.T3,c.X1,K.K,Rt.j,kt.i,wt,r.GY,r.vj,r.Nm,r.VU,r.os,Mt.c,r.Qp],styles:[".my-operations[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.my-operations__pagination[_ngcontent-%COMP%]{display:flex;margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacer-16);margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%] .my-operations__pagination[_ngcontent-%COMP%]{flex:1 1 auto;margin-top:0}.table-card__wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.table-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--grey-200);border-radius:var(--border-radius-500);background-color:var(--white)}.table-card__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer-16);padding:var(--spacer-8) var(--spacer-16) var(--spacer-24) var(--spacer-16)}.table-card__row[_ngcontent-%COMP%]:first-of-type{border-bottom:1px solid var(--grey-200);padding:var(--spacer-24) var(--spacer-16)}.table-card__cell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:var(--spacer-4)}"],changeDetection:0})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[String]),(0,f.Sn)("design:returntype",String)],ct.prototype,"replacedText",null);var Je=l(7535);let Ke=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(Je.B);super(n),this.profileApi=(0,t.WQX)($t.i),this.userOperationsState=n}getList(n,o){return this.profileApi.getOperationsList({max:n,offset:n*o}).pipe((0,u.M)(i=>{this.set("rows",i.rows),this.set("total",i.total)}))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Ze=()=>({width:"17%"}),qe=()=>({width:"17%",class:"_right"}),to=()=>({width:"12%",class:"_right"}),no=()=>({width:"50%"}),Ft=(e,a,n,o)=>[e,a,n,o],ft=e=>({data:e}),eo=e=>({count:e}),oo=(e,a)=>a.id;function ao(e,a){1&e&&t.nrm(0,"app-table-head-text",11)}function io(e,a){1&e&&t.nrm(0,"app-table-head-text",12)}function ro(e,a){1&e&&t.nrm(0,"app-table-head-text",13)}function so(e,a){1&e&&t.nrm(0,"app-table-head-text",14)}function co(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"date"),t.k0s()),2&e){const n=a.data;t.R7$(),t.SpI(" ",t.i5U(2,1,n.dateCreated,"HH:mm dd.MM.yyyy")," ")}}function lo(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=t.XpG().data;t.R7$(),t.Lme(" ",t.bMT(2,2,n.details.oldBalance)," ",t.bMT(3,4,null==n.currencyAmount?null:n.currencyAmount.formatName)," ")}}function po(e,a){if(1&e&&t.DNE(0,lo,4,6,"gamma-typo-100"),2&e){const n=a.data;t.vxM(null!=(null==n.details?null:n.details.oldBalance)?0:-1)}}function mo(e,a){if(1&e&&(t.j41(0,"gamma-typo-100",15),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=a.data;t.Y8G("strong",!0)("color",n.amount>0?"color-backoffice-300":"color-danger-300"),t.R7$(),t.Lme(" ",n.amount?t.bMT(2,4,n.amount):""," ",t.bMT(3,6,null==n.currencyAmount?null:n.currencyAmount.formatName)," ")}}function uo(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-typo-100",16),t.bIt("replaceLinks",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.processLink(i))}),t.k0s()}if(2&e){const n=a.data,o=t.XpG(2);t.Y8G("innerHTML",o.replacedText(n.description),t.npT)}}function _o(e,a){if(1&e&&t.nrm(0,"app-table-desktop",17),2&e){const n=t.XpG(2);t.XpG();const o=t.sdS(1),i=t.sdS(3),s=t.sdS(5),_=t.sdS(7),S=t.sdS(9),E=t.sdS(11),Y=t.sdS(13),at=t.sdS(15);
1t.Y8G("rows",n.rows)("options",t.ziG(8,Ft,t.lJ4(4,Ze),t.lJ4(5,qe),t.lJ4(6,to),t.lJ4(7,no)))("headTemplates",t.ziG(13,Ft,o,i,s,_))("bodyTemplates",t.ziG(18,Ft,S,E,Y,at))}}function go(e,a){1&e&&t.eu8(0)}function fo(e,a){1&e&&t.eu8(0)}function ho(e,a){1&e&&t.eu8(0)}function Co(e,a){1&e&&t.eu8(0)}function yo(e,a){if(1&e&&(t.j41(0,"div",22),t.DNE(1,ho,1,0,"ng-container",23)(2,Co,1,0,"ng-container",24),t.k0s()),2&e){const n=t.XpG().$implicit;t.XpG(4);const o=t.sdS(3),i=t.sdS(11);t.R7$(),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(3,ft,n))}}function bo(e,a){1&e&&t.eu8(0)}function vo(e,a){1&e&&t.eu8(0)}function To(e,a){if(1&e&&(t.j41(0,"div",22),t.DNE(1,bo,1,0,"ng-container",23)(2,vo,1,0,"ng-container",24),t.k0s()),2&e){const n=t.XpG().$implicit;t.XpG(4);const o=t.sdS(5),i=t.sdS(13);t.R7$(),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(3,ft,n))}}function xo(e,a){1&e&&t.eu8(0)}function Mo(e,a){1&e&&t.eu8(0)}function ko(e,a){if(1&e&&(t.j41(0,"div",20)(1,"div",21)(2,"div",22),t.DNE(3,go,1,0,"ng-container",23)(4,fo,1,0,"ng-container",24),t.k0s(),t.DNE(5,yo,3,5,"div",22)(6,To,3,5,"div",22),t.k0s(),t.j41(7,"div",21)(8,"div",22),t.DNE(9,xo,1,0,"ng-container",23)(10,Mo,1,0,"ng-container",24),t.k0s()()()),2&e){const n=a.$implicit;t.XpG(4);const o=t.sdS(1),i=t.sdS(7),s=t.sdS(9),_=t.sdS(15);t.R7$(3),t.Y8G("ngTemplateOutlet",o),t.R7$(),t.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",t.eq3(8,ft,n)),t.R7$(),t.vxM(null!=(null==n.details?null:n.details.oldBalance)?5:-1),t.R7$(),t.vxM(n.amount?6:-1),t.R7$(3),t.Y8G("ngTemplateOutlet",i),t.R7$(),t.Y8G("ngTemplateOutlet",_)("ngTemplateOutletContext",t.eq3(10,ft,n))}}function Ro(e,a){if(1&e&&(t.j41(0,"div",18),t.Z7z(1,ko,11,12,"div",20,oo),t.k0s()),2&e){const n=t.XpG(2);t.R7$(),t.Dyx(n.rows)}}function wo(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",19)(1,"gamma-pagination",25),t.bIt("indexChange",function(i){t.eBV(n);const s=t.XpG(4);return t.Njj(s.loadList(i))}),t.k0s(),t.j41(2,"app-actions-dropdown",26)(3,"gamma-button",27),t.EFF(4),t.nI1(5,"transloco"),t.k0s()()()}if(2&e){const n=t.XpG(2),o=t.XpG(2);t.R7$(),t.Y8G("currentPage",o.currentPage)("pageCount",o.getPageCount(n.total,o.pageSize)),t.R7$(),t.Y8G("hasContent",!0)("actionsDropdownItems",o.buildPageSizeActions(o.pageSize)),t.R7$(),t.Y8G("iconRight","gamma::icon-small-arrow-down"),t.R7$(),t.SpI(" ",t.i5U(5,6,"funds.table.pageSize.label",t.eq3(9,eo,o.pageSize))," ")}}function $o(e,a){if(1&e&&t.DNE(0,_o,1,23,"app-table-desktop",17)(1,Ro,3,0,"div",18)(2,wo,6,11,"div",19),2&e){const n=t.XpG(),o=t.XpG(),i=t.XpG();t.vxM(o===i.EBreakpoint.DESKTOP_LARGE?0:1),t.R7$(2),t.vxM(n.total>0?2:-1)}}function Io(e,a){if(1&e&&t.DNE(0,$o,3,2),2&e){const n=t.XpG(2);t.vxM(n.loading?-1:0)}}function Do(e,a){1&e&&(t.nrm(0,"gamma-empty-state",10),t.nI1(1,"transloco")),2&e&&t.Y8G("imageUrl","/assets/images/empty-default-image.svg")("description",t.bMT(1,2,"funds.table.myOperations.empty"))}function Ao(e,a){if(1&e&&(t.DNE(0,ao,1,0,"ng-template",null,0,t.C5r)(2,io,1,0,"ng-template",null,1,t.C5r)(4,ro,1,0,"ng-template",null,2,t.C5r)(6,so,1,0,"ng-template",null,3,t.C5r)(8,co,3,4,"ng-template",null,4,t.C5r)(10,po,1,1,"ng-template",null,5,t.C5r)(12,mo,4,8,"ng-template",null,6,t.C5r)(14,uo,1,1,"ng-template",null,7,t.C5r),t.j41(16,"gamma-scrollbar",8),t.DNE(17,Io,1,1),t.nI1(18,"async"),t.k0s(),t.nrm(19,"gamma-loader",9),t.DNE(20,Do,2,4,"gamma-empty-state",10)),2&e){let n;const o=t.XpG();t.R7$(16),t.Y8G("hidden",!0),t.R7$(),t.vxM((n=t.bMT(18,4,o.operations$))?17:-1,n),t.R7$(2),t.Y8G("loader",o.loading),t.R7$(),t.vxM(o.isEmpty&&!o.loading?20:-1)}}class lt extends ot{constructor(){super(...arguments),this.EBreakpoint=M.r,this.breakpoint$=(0,t.WQX)(p.$n),this.userOperationsFacade=(0,t.WQX)(Ke),this.store=(0,t.WQX)(D.t),this.binarDetailFacade=(0,t.WQX)(It.u),this.isEmpty=!1,this.loading=!1,this.state=this.store.state("userOperations"),this.operations$=this.state.select$(a=>a)}fetchPage(a){this.state.value.total||(this.loading=!0),this.userOperationsFacade.getList(this.pageSize,a).pipe((0,h.j)(()=>{this.loading=!1,this.isEmpty=!this.state.value.total})).subscribe()}processLink(a){const n=a.href.split("/"),o=Number(n[n.length-1]);this.binarDetailFacade.showPartnerDialog(o)}replacedText(a){return a.replace(/# (\d+)/g,'<a href="/direct/team/binar/$1"># $1</a>')}static{this.\u0275fac=(()=>{let a;return function(o){return(a||(a=t.xGo(lt)))(o||lt)}})()}static{this.\u0275cmp=t.VBU({type:lt,selectors:[["app-my-operations-table"]],features:[t.Vt3],decls:2,vars:3,consts:[["tableHeadDateCreated",""],["tableHeadBalanceBefore",""],["tableHeadAmount",""],["tableHeadDescription",""],["tableValueDateCreated",""],["tableValueBalanceBefore",""],["tableValueAmount",""],["tableValueDescription",""],[1,"my-operations",3,"hidden"],[1,"col-12","lg:col-10",3,"loader"],[1,"pb-48",3,"imageUrl","description"],["key","funds.table.myOperations.date.title"],["key","funds.table.myOperations.balanceBefore.title"],["key","funds.table.myOperations.amount.title"],["key","funds.table.myOperations.description.title"],[3,"strong","color"],[3,"replaceLinks","innerHTML"],[3,"rows","options","headTemplates","bodyTemplates"],[1,"table-card__wrapper"],[1,"my-operations__footer"],[1,"table-card"],[1,"table-card__row"],[1,"table-card__cell"],[4,"ngTemplateOutlet"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"my-operations__pagination",3,"indexChange","currentPage","pageCount"],[1,"my-operations__page-size",3,"hasContent","actionsDropdownItems"],["appearance","outline-button","size","m",3,"iconRight"]],template:function(n,o){if(1&n&&(t.DNE(0,Ao,21,6),t.nI1(1,"async")),2&n){let i;t.vxM((i=t.bMT(1,1,o.breakpoint$))?0:-1,i)}},dependencies:[K.K,A.Jj,A.vh,g.Kj,r.BU,Rt.j,kt.i,A.T3,wt,r.GY,r.Nm,r.vj,r.VU,r.os,Mt.c,r.Qp],styles:[".my-operations[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.my-operations__pagination[_ngcontent-%COMP%]{display:flex;margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacer-16);margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%] .my-operations__pagination[_ngcontent-%COMP%]{flex:1 1 auto;margin-top:0}.table-card__wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.table-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--grey-200);border-radius:var(--border-radius-500);background-color:var(--white)}.table-card__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer-16);padding:var(--spacer-8) var(--spacer-16) var(--spacer-24) var(--spacer-16)}.table-card__row[_ngcontent-%COMP%]:first-of-type{border-bottom:1px solid var(--grey-200);padding:var(--spacer-24) var(--spacer-16)}.table-card__cell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:var(--spacer-4)}",".table-card__row[_ngcontent-%COMP%]{align-items:flex-start}"],changeDetection:0})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[String]),(0,f.Sn)("design:returntype",String)],lt.prototype,"replacedText",null);var Fo=l(5159),So=l(5763);let Eo=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(So.l);super(n),this.profileApi=(0,t.WQX)($t.i),this.userPvHistoryState=n}getList(n,o){return this.profileApi.getPvHistoryList({max:n,offset:n*o}).pipe((0,u.M)(i=>{this.set("rows",i.rows),this.set("total",i.total)}))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Ut=function(e){return e.CLIENT="CLIENT",e.PARTNER="PARTNER",e}(Ut||{});const Qt=()=>({width:"20%"}),Po=()=>({width:"60%"}),St=(e,a,n)=>[e,a,n],ht=(e,a)=>[e,a],jo=e=>[e],Go=e=>({count:e});function Bo(e,a){1&e&&t.nrm(0,"app-table-head-text",9)}function Oo(e,a){1&e&&t.nrm(0,"app-table-head-text",10)}function No(e,a){1&e&&t.nrm(0,"app-table-head-text",11)}function Lo(e,a){if(1&e&&(t.j41(0,"gamma-typo-100"),t.EFF(1),t.nI1(2,"date"),t.k0s()),2&e){const n=a.data;t.R7$(),t.SpI(" ",t.i5U(2,1,n.dateCreated,"HH:mm dd.MM.yyyy")," ")}}function Xo(e,a){if(1&e){const n=t.RV6();t.j41(0,"span")(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s(),t.nrm(4,"br"),t.j41(5,"gamma-typo-100",12),t.bIt("replaceLinks",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.processLink(i))}),t.k0s()()}if(2&e){const n=a.data,o=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,3,"funds.table.pvAccrualHistory.initiator.type."+n.initiator.type)," "),t.R7$(3),t.Y8G("strong",!0)("innerHTML",o.getInitiator(n.initiator),t.npT)}}function Wo(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-typo-100",13),t.bIt("replaceLinks",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.processLink(i))}),t.k0s()}if(2&e){const n=a.data,o=t.XpG(2);t.Y8G("innerHTML",n.description+" "+o.getInitiatorLink(n.initiator),t.npT)}}function Yo(e,a){if(1&e&&t.nrm(0,"app-table-desktop",14),2&e){const n=t.XpG(2);t.XpG();const o=t.sdS(1),i=t.sdS(3),s=t.sdS(5),_=t.sdS(7),S=t.sdS(9),E=t.sdS(11);t.Y8G("rows",n.rows)("options",t.sMw(7,St,t.lJ4(4,Qt),t.lJ4(5,Qt),t.lJ4(6,Po)))("headTemplates",t.sMw(11,St,o,i,s))("bodyTemplates",t.sMw(15,St,_,S,E))}}function Vo(e,a){if(1&e&&t.nrm(0,"app-table-mobile",15),2&e){const n=t.XpG(2);t.XpG();const o=t.sdS(1),i=t.sdS(3),s=t.sdS(5),_=t.sdS(7),S=t.sdS(9),E=t.sdS(11);t.Y8G("rows",n.rows)("headTemplates",t.l_i(9,ht,t.l_i(3,ht,o,_),t.l_i(6,ht,i,S)))("bodyTemplates",t.eq3(15,jo,t.l_i(12,ht,s,E)))}}function Uo(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",16)(1,"gamma-pagination",17),t.bIt("indexChange",function(i){t.eBV(n);const s=t.XpG(4);return t.Njj(s.loadList(i))}),t.k0s(),t.j41(2,"app-actions-dropdown",18)(3,"gamma-button",19),t.EFF(4),t.nI1(5,"transloco"),t.k0s()()()}if(2&e){const n=t.XpG(2),o=t.XpG(2);t.R7$(),t.Y8G("currentPage",o.currentPage)("pageCount",o.getPageCount(n.total,o.pageSize)),t.R7$(),t.Y8G("hasContent",!0)("actionsDropdownItems",o.buildPageSizeActions(o.pageSize)),t.R7$(),t.Y8G("iconRight","gamma::icon-small-arrow-down"),t.R7$(),t.SpI(" ",t.i5U(5,6,"funds.table.pageSize.label",t.eq3(9,Go,o.pageSize))," ")}}function Qo(e,a){if(1&e&&t.DNE(0,Yo,1,19,"app-table-desktop",14)(1,Vo,1,17,"app-table-mobile",15)(2,Uo,6,11,"div",16),2&e){const n=t.XpG(),o=t.XpG(),i=t.XpG();t.vxM(o===i.EBreakpoint.DESKTOP_LARGE?0:-1),t.R7$(),t.vxM(o!==i.EBreakpoint.DESKTOP_LARGE?1:-1),t.R7$(),t.vxM(n.total>0?2:-1)}}function Ho(e,a){if(1&e&&(t.j41(0,"gamma-scrollbar",6),t.DNE(1,Qo,3,3),t.k0s()),2&e){const n=t.XpG(2);t.Y8G("hidden",!0),t.R7$(),t.vxM(n.loading?-1:1)}}function zo(e,a){1&e&&(t.nrm(0,"gamma-empty-state",8),t.nI1(1,"transloco")),2&e&&t.Y8G("imageUrl","/assets/images/empty-default-image.svg")("description",t.bMT(1,2,"funds.table.pvAccrualHistory.empty"))}function Jo(e,a){if(1&e&&(t.DNE(0,Bo,1,0,"ng-template",null,0,t.C5r)(2,Oo,1,0,"ng-template",null,1,t.C5r)(4,No,1,0,"ng-template",null,2,t.C5r)(6,Lo,3,4,"ng-template",null,3,t.C5r)(8,Xo,6,5,"ng-template",null,4,t.C5r)(10,Wo,1,1,"ng-template",null,5,t.C5r)(12,Ho,2,2,"gamma-scrollbar",6),t.nI1(13,"async"),t.nrm(14,"gamma-loader",7),t.DNE(15,zo,2,4,"gamma-empty-state",8)),2&e){let n;const o=t.XpG();t.R7$(12),t.vxM((n=t.bMT(13,3,o.pvHistory$))?12:-1,n),t.R7$(2),t.Y8G("loader",o.loading),t.R7$(),t.vxM(o.isEmpty&&!o.loading?15:-1)}}class it extends ot{constructor(){super(...arguments),this.breakpoint$=(0,t.WQX)(p.$n),this.userPvHistoryFacade=(0,t.WQX)(Eo),this.store=(0,t.WQX)(D.t),this.binarDetailFacade=(0,t.WQX)(It.u),this.EBreakpoint=M.r,this.EPrincipalType=Ut,this.isEmpty=!1,this.loading=!1,this.state=this.store.state("userPvHistory"),this.pvHistory$=this.state.select$(a=>
1a)}fetchPage(a){this.state.value.total||(this.loading=!0),this.userPvHistoryFacade.getList(this.pageSize,a).pipe((0,h.j)(()=>{this.loading=!1,this.isEmpty=!this.state.value.total})).subscribe()}processLink(a){const n=a.href.split("/"),o=Number(n[n.length-1]);this.binarDetailFacade.showPartnerDialog(o)}getInitiator(a){return a.type===this.EPrincipalType.PARTNER?`<a href="/direct/team/binar/${a.backofficeId}">${a?.fullName}</a>`:a?.fullName}getInitiatorLink(a){return a.type===this.EPrincipalType.PARTNER?`<a href="/direct/team/binar/${a.backofficeId}">partner # ${a.backofficeId}</a>`:""}static{this.\u0275fac=(()=>{let a;return function(o){return(a||(a=t.xGo(it)))(o||it)}})()}static{this.\u0275cmp=t.VBU({type:it,selectors:[["app-my-pv-history-table"]],features:[t.Vt3],decls:2,vars:3,consts:[["tableHeadDateCreated",""],["tableHeadInitiator",""],["tableHeadDescription",""],["tableValueDateCreated",""],["tableValueInitiator",""],["tableValueDescription",""],["scrollbar","",1,"my-operations",3,"hidden"],[1,"col-12","lg:col-10",3,"loader"],[1,"pb-48",3,"imageUrl","description"],["key","funds.table.pvAccrualHistory.date.title"],["key","funds.table.pvAccrualHistory.initiator.title"],["key","funds.table.pvAccrualHistory.description.title"],[3,"replaceLinks","strong","innerHTML"],[3,"replaceLinks","innerHTML"],[3,"rows","options","headTemplates","bodyTemplates"],[3,"rows","headTemplates","bodyTemplates"],[1,"my-operations__footer"],[1,"my-operations__pagination",3,"indexChange","currentPage","pageCount"],[1,"my-operations__page-size",3,"hasContent","actionsDropdownItems"],["appearance","outline-button","size","m",3,"iconRight"]],template:function(n,o){if(1&n&&(t.DNE(0,Jo,16,5),t.nI1(1,"async")),2&n){let i;t.vxM((i=t.bMT(1,1,o.breakpoint$))?0:-1,i)}},dependencies:[g.Kj,A.Jj,A.vh,Rt.j,kt.i,Fo.K,wt,r.os,r.VU,r.Nm,r.GY,r.vj,Mt.c,r.Qp],styles:[".my-operations[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.my-operations__pagination[_ngcontent-%COMP%]{display:flex;margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacer-16);margin-top:var(--spacer-16)}.my-operations__footer[_ngcontent-%COMP%] .my-operations__pagination[_ngcontent-%COMP%]{flex:1 1 auto;margin-top:0}.table-card__wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.table-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--grey-200);border-radius:var(--border-radius-500);background-color:var(--white)}.table-card__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer-16);padding:var(--spacer-8) var(--spacer-16) var(--spacer-24) var(--spacer-16)}.table-card__row[_ngcontent-%COMP%]:first-of-type{border-bottom:1px solid var(--grey-200);padding:var(--spacer-24) var(--spacer-16)}.table-card__cell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:var(--spacer-4)}"],changeDetection:0})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],it.prototype,"getInitiator",null),(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],it.prototype,"getInitiatorLink",null);var ut=l(1498);function Ko(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-link-block",3),t.bIt("changeItem",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.onChangeItem(i))}),t.k0s()}if(2&e){const n=t.XpG(2);t.Y8G("items",n.items)}}function Zo(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-select-dialog",4),t.bIt("selectItem",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.onChangeItem(i))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}if(2&e){const n=t.XpG(2);t.Y8G("items",n.items)("selectControl",n.selectControl),t.R7$(),t.SpI(" ",t.bMT(2,3,"team.filter.level.placeholder")," ")}}function qo(e,a){if(1&e&&(t.j41(0,"div",0),t.DNE(1,Ko,1,1,"gamma-link-block",1)(2,Zo,3,5,"app-select-dialog",2),t.j41(3,"div"),t.nrm(4,"router-outlet"),t.k0s()()),2&e){const n=a,o=t.XpG();t.R7$(),t.vxM(n!==o.EBreakpoint.MOBILE?1:-1),t.R7$(),t.vxM(n===o.EBreakpoint.MOBILE?2:-1)}}let ta=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.translocoService=(0,t.WQX)(g.JO),this.router=(0,t.WQX)(x.Ix),this.EBreakpoint=M.r,this.items=[],this.selectControl=new c.MJ}ngOnInit(){this.items=[{key:"operation",label:this.translocoService.selectTranslate("funds.table.myOperations.title"),route:["/direct/funds/operation"]},{key:"waiting",label:this.translocoService.selectTranslate("funds.table.waitingForModeration.title"),route:["/direct/funds/waiting"]},{key:"history",label:this.translocoService.selectTranslate("funds.table.pvAccrualHistory.title"),route:["/direct/funds/history"]}];const n=this.items.find(o=>this.router.url.includes(o.key));this.onChangeItem(n)}onChangeItem(n){this.selectControl.setValue(n)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-client-tables"]],decls:2,vars:3,consts:[[1,"client-tables"],[3,"items"],[3,"items","selectControl"],[3,"changeItem","items"],[3,"selectItem","items","selectControl"]],template:function(o,i){if(1&o&&(t.DNE(0,qo,5,2,"div",0),t.nI1(1,"async")),2&o){let s;t.vxM((s=t.bMT(1,1,i.breakpoint$))?0:-1,s)}},dependencies:[g.Kj,A.Jj,Tt.iI,x.n3,Yt.a,r.Hj],styles:[".client-tables[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}"],changeDetection:0})}}return e})();var rt=l(8625),na=l(9030),Ct=l(5964),yt=l(6354),ea=l(7786);const Ht=e=>{const[a,n=""]=Number(e.toPrecision(15)).toString().split(".");return+`${a}.${n.slice(0,2)}`},zt=(e,a,n)=>(0,na.v)(()=>{let o=!1;const i=(s,_,S,E)=>s.valueChanges.pipe((0,Ct.p)(()=>!o),(0,yt.T)(Y=>null===Y?null:Ht(S(Y))),(0,Ct.p)(Y=>Y!==_.value),(0,u.M)(Y=>{o=!0,_.setValue(Y,{emitEvent:E}),o=!1}));return(0,ea.h)(i(e,a,s=>s*n,!1),i(a,e,s=>s/n,!0))});var ia=l(360);const ra=["content"],sa=e=>({0:e});function ca(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-dialog-layout")(1,"section",1),t.nrm(2,"gamma-typo-100",2),t.nI1(3,"appNumberFormat"),t.nI1(4,"transloco"),t.nI1(5,"transloco"),t.j41(6,"div",3)(7,"gamma-typo-100"),t.EFF(8),t.k0s(),t.j41(9,"gamma-typo-100",4),t.EFF(10),t.k0s()()(),t.j41(11,"gamma-dialog-footer")(12,"div",5)(13,"gamma-button",6),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.confirmHandler())}),t.EFF(14),t.nI1(15,"transloco"),t.k0s()()()()}if(2&e){const n=t.XpG();t.R7$(2),t.Y8G("block",!0)("innerHTML",t.i5U(5,10,"funds.transfer.partner.pay.confirm",t.eq3(15,sa,t.bMT(3,6,n.amount())+" "+t.bMT(4,8,"common.ye"))),t.npT),t.R7$(6),t.SpI(" ",n.recipient()," "),t.R7$(),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",n.backofficeIdText()," "),t.R7$(4),t.SpI(" ",t.bMT(15,13,"common.transfer")," ")}}let Et=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.dialogsService=(0,t.WQX)(L.wX),this.content=(0,t.ebz)("content"),this.confirm=(0,t.CGW)(),this.closeModal$=new B.B,this.recipient=(0,t.vPA)(""),this.backofficeId=(0,t.vPA)(null),this.amount=(0,t.vPA)(null),this.backofficeIdText=(0,t.EWP)(()=>`id ${this.backofficeId()}`)}show(n){this.recipient.set(n.recipient),this.backofficeId.set(n.backofficeId),this.amount.set(n.amount),this.dialogsService.open(this.content(),{appearance:"mobile-small"}).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}confirmHandler(){this.confirm.emit(),this.hide()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-confirm-transfer-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,ra,5),2&o&&t.NyB()},outputs:{confirm:"confirm"},decls:2,vars:0,consts:[["content",""],[1,"flex-dir-column","gap-5","py-8"],[1,"mb-4","pr-32",3,"block","innerHTML"],[1,"flex","justify-between","align-center","gap-5"],[1,"transfer__id","text-nowrap",3,"strong"],[1,"flex-reverse","gap-3"],[3,"click"]],template:function(o,i){1&o&&t.DNE(0,ca,16,17,"ng-template",null,0,t.C5r)},dependencies:[g.Kj,K.K,r.Qp,r.UA,r.vj,r.Z_],styles:[".pr-32[_ngcontent-%COMP%]{padding-right:var(--spacer-32)}.transfer__id[_ngcontent-%COMP%]{color:var(--color-backoffice-300)}"],changeDetection:0})}}return e})();const la=["content"];function pa(e,a){1&e&&(t.nrm(0,"gamma-input-number",8),t.nI1(1,"gammaCurrency"),t.nI1(2,"gammaCurrency")),2&e&&t.Y8G("postfix",t.bMT(1,2,"RUB"))("placeholder",t.bMT(2,4,"RUB"))}function da(e,a){if(1&e&&(t.j41(0,"div",9)(1,"gamma-button",10),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()),2&e){const n=t.XpG(3);t.R7$(),t.Y8G("block",a!==n.EBreakpoint.DESKTOP_LARGE)("disabled",n.form.invali
1d||n.submitLoading())("showLoader",n.submitLoading()||n.loadingRecipient()),t.R7$(),t.SpI(" ",t.bMT(3,4,"common.button.continue")," ")}}function ma(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",3),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showConfirm())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header")(3,"div")(4,"gamma-typo-100",4),t.EFF(5),t.nI1(6,"transloco"),t.k0s()(),t.j41(7,"div")(8,"gamma-typo-100",5),t.EFF(9),t.nI1(10,"transloco"),t.k0s()()(),t.j41(11,"section"),t.nrm(12,"gamma-input",6),t.nI1(13,"transloco"),t.nrm(14,"gamma-input-number",7),t.nI1(15,"transloco"),t.nI1(16,"transloco"),t.nI1(17,"transloco"),t.DNE(18,pa,3,6,"gamma-input-number",8),t.k0s(),t.j41(19,"gamma-dialog-footer"),t.DNE(20,da,4,6,"div",9),t.nI1(21,"async"),t.k0s()()()}if(2&e){let n;const o=t.XpG(2);t.Y8G("formGroup",o.form),t.R7$(4),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(6,10,"funds.transfer.partner.title")," "),t.R7$(4),t.SpI(" ",t.bMT(10,12,"funds.transfer.partner.description")," "),t.R7$(3),t.Y8G("label",t.bMT(13,14,"bills.searchPartner.dialog.id.label")),t.R7$(2),t.Y8G("label",t.bMT(15,16,"funds.withdrawal.payoutWithdrawalDialog.field.amount"))("postfix",t.bMT(16,18,"common.ye"))("placeholder",t.bMT(17,20,"common.ye")),t.R7$(4),t.vxM(o.checkBalanceRub(a)?18:-1),t.R7$(2),t.vxM((n=t.bMT(21,22,o.breakpoint$))?20:-1,n)}}function ua(e,a){if(1&e&&(t.DNE(0,ma,22,24,"gamma-form",2),t.nI1(1,"async")),2&e){let n;const o=t.XpG();t.vxM((n=t.bMT(1,1,o.profile$))?0:-1,n)}}class st{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.dialogsService=(0,t.WQX)(L.wX),this.payoutFacade=(0,t.WQX)($),this.store=(0,t.WQX)(D.t),this.translocoService=(0,t.WQX)(g.JO),this.alertService=(0,t.WQX)(r.Nx),this.formErrorService=(0,t.WQX)(rt._),this.profileFacade=(0,t.WQX)(ut.E),this.EBreakpoint=M.r,this.content=(0,t.ebz)("content"),this.confirmTransferDialog=(0,t.ebz)(Et),this.payoutInfo=(0,t.hFB)(void 0),this.form=new c.gE({backofficeId:new c.MJ(null,[c.k0.required,
1c.k0.minLength(6),c.k0.maxLength(7),ia.x]),amount:new c.MJ(null,[c.k0.required,c.k0.min(1),c.k0.max(1e6)]),amountRub:new c.MJ(null,[c.k0.min(1)])}),this.loadingRecipient=(0,t.vPA)(!1),this.payoutCurrency=(0,t.hFB)(void 0),this.submitLoading=(0,t.vPA)(!1),this.profile$=this.store.state("profile").select$(a=>a.profile),this.closeModal$=new B.B,this.destroy$=new B.B}onTransfer(){if(this.submitLoading())return;const{amount:a,backofficeId:n}=this.form.value;this.submitLoading.set(!0),this.payoutFacade.transferToPartner({backofficeId:n,amount:a}).pipe((0,u.M)(()=>{this.hide(),this.profileFacade.getProfile().subscribe(),this.payoutFacade.getPayoutInfo({amount:null}).subscribe(),this.alertService.open(this.translocoService.translate("funds.transfer.partner.success"),{appearance:"success"}).subscribe()}),(0,X.W)(o=>(this.formErrorService.display(o,this.form),(0,V.$)(()=>o))),(0,h.j)(()=>{this.submitLoading.set(!1)})).subscribe()}get backofficeId(){return this.form.get("backofficeId").value}get amount(){return this.form.get("amount").value}show(){this.dialogsService.open(this.content(),{appearance:"mobile-small"}).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset(),this.destroy$.next()}}),this.setupCurrencySync()}hide(){this.closeModal$.next()}checkBalanceRub(a){return a.balances.find(n=>"RUB"===n.currency)}setupCurrencySync(){const a=this.checkBalanceRub(this.store.state("profile").value.profile);a&&zt(this.form.controls.amount,this.form.controls.amountRub,a.rate).pipe((0,G.Q)(this.destroy$)).subscribe()}showConfirm(){this.loadingRecipient.set(!0),this.payoutFacade.getRecipient(this.backofficeId).pipe((0,u.M)(a=>{this.loadingRecipient.set(!1),this.confirmTransferDialog().show({recipient:a.fullName,backofficeId:this.backofficeId,amount:this.amount})}),(0,X.W)(a=>{this.loadingRecipient.set(!1);const n="error.notFound"===a.error?.errorCode?this.translocoService.translate("funds.transfer.partner.error.recipientNotFound"):a.error?.message;return this.alertService.open(n,{appearance:"error"}).subscribe(),(0,V.$)(()=>a)})).subscribe()}static{this.\u0275fac=function(n){return new(n||st)}}static{this.\u0275cmp=t.VBU({type:st,selectors:[["app-transfer-to-partner-dialog"]],viewQuery:function(n,o){1&n&&(t.wEZ(o.content,la,5),t.wEZ(o.confirmTransferDialog,Et,5)),2&n&&t.NyB(2)},inputs:{payoutInfo:[1,"payoutInfo"],payoutCurrency:[1,"payoutCurrency"]},decls:3,vars:0,consts:[["content",""],[3,"confirm"],[3,"formGroup"],[3,"submitEvent","formGroup"],[3,"strong"],["color","grey-500"],["formControlName","backofficeId",3,"label"],["formControlName","amount",1,"mt-16",3,"label","postfix","placeholder"],["formControlName","amountRub",1,"mt-16",3,"postfix","placeholder"],[1,"flex","justify-end"],["type","submit",3,"block","disabled","showLoader"]],template:function(n,o){if(1&n){const i=t.RV6();t.DNE(0,ua,2,3,"ng-template",null,0,t.C5r),t.j41(2,"app-confirm-transfer-dialog",1),t.bIt("confirm",function(){return t.eBV(i),t.Njj(o.onTransfer())}),t.k0s()}},dependencies:[A.Jj,g.Kj,c.X1,c.BC,c.cb,c.j4,c.JD,r.BU,Et,r.Qp,r.Z_,r.BP,r.UA,r.vj,r.Sj,r.xh,r.n9],styles:[".cards-footer__total[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);justify-content:space-between}"],changeDetection:0})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],st.prototype,"checkBalanceRub",null);const _a=()=>["/direct/funds/agent-reports"];let Jt=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-unsigned-reports-notification"]],decls:4,vars:7,consts:[[3,"routerLink"],["status","warning",3,"size"],["color","color-alert-text",1,"text-nowrap",3,"strong","innerHTML"]],template:function(o,i){1&o&&(t.j41(0,"a",0)(1,"gamma-notification",1),t.nrm(2,"gamma-typo-50",2),t.nI1(3,"transloco"),t.k0s()()),2&o&&(t.Y8G("routerLink",t.lJ4(6,_a)),t.R7$(),t.Y8G("size","s"),t.R7$(),t.Y8G("strong",!0)("innerHTML",t.bMT(3,4,"agent.reports.needSignedAct.warning"),t.npT))},dependencies:[g.Kj,c.X1,Tt.Wk,r.zP,r.b$],encapsulation:2,changeDetection:0})}}return e})();var Pt=l(9196),ga=l(5311);let fa=(()=>{class e{constructor(){this.router=(0,t.WQX)(x.Ix),this.profile=(0,t.hFB)(void 0)}goToAgentReports(){this.router.navigate([b.ij,v.FUNDS_ROUTE,v.AGENT_REPORTS_ROUTE])}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-agent-report-banner"]],inputs:{profile:[1,"profile"]},decls:10,vars:7,consts:[[1,"card__outline","flex-dir-column","gap-2","cursor-pointer",3,"click"],[1,"flex","justify-between","align-center","gap-5"],["color","grey-500"],["src","gamma::icon-small-arrow-right",1,"button-icon"],[3,"strong"]],template:function(o,i){1&o&&(t.j41(0,"div",0),t.bIt("click",function(){return i.goToAgentReports()}),t.j41(1,"div",1)(2,"gamma-typo-50",2),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"div"),t.nrm(6,"gamma-svg",3),t.k0s()(),t.j41(7,"gamma-typo-100",4),t.EFF(8),t.nI1(9,"transloco"),t.k0s()()),2&o&&(t.R
17$(3),t.SpI(" ",t.bMT(4,3,"agent.reports.title")," "),t.R7$(4),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(9,5,"common.acts")," "))},dependencies:[r.b$,r.vj,r.dx,g.Kj,c.X1],styles:[".button-icon[_ngcontent-%COMP%]{--app-icon-color: var(--color-backoffice-300)}"],changeDetection:0})}}return e})();const ha=[[["","rate",""]],[["","action",""]],"*"],Ca=["[rate]","[action]","*"];function ya(e,a){if(1&e&&(t.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"gamma-typo-50",5),t.EFF(5),t.k0s()(),t.SdG(6),t.k0s(),t.j41(7,"div",6)(8,"gamma-typo-500",7),t.EFF(9),t.nI1(10,"appNumberFormat"),t.k0s(),t.j41(11,"div"),t.SdG(12,1),t.k0s()()(),t.SdG(13,2),t.k0s()),2&e){const n=t.XpG();t.AVh("_horizontal",a===n.EBreakpoint.DESKTOP_LARGE&&n.horizontalView()),t.R7$(4),t.Y8G("strong",!0)("color","color-warning-text"),t.R7$(),t.SpI(" ",n.currency()," "),t.R7$(4),t.SpI(" ",t.bMT(10,6,n.amount())," ")}}let Kt=(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.EBreakpoint=M.r,this.currency=(0,t.hFB)(void 0),this.amount=(0,t.hFB)(void 0),this.horizontalView=(0,t.hFB)(void 0)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-funds-balance-wrapper"]],inputs:{currency:[1,"currency"],amount:[1,"amount"],horizontalView:[1,"horizontalView"]},ngContentSelectors:Ca,decls:2,vars:3,consts:[[1,"card__outline","funds-balance-wrapper",3,"_horizontal"],[1,"card__outline","funds-balance-wrapper"],[1,"funds-balance-item"],[1,"funds-currency-wrapper"],[1,"funds-currency-value"],[3,"strong","color"],[1,"funds-currency-amount"],[1,"funds-currency-amount__value"]],template:function(o,i){if(1&o&&(t.NAR(ha),t.DNE(0,ya,14,8,"div",0),t.nI1(1,"async")),2&o){let s;t.vxM((s=t.bMT(1,1,i.breakpoint$))?0:-1,s)}},dependencies:[K.K,A.Jj,r.b$,r.wn],styles:["[_nghost-%COMP%]{flex:1}.funds-balance-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;flex-direction:column;gap:var(--spacer-8);min-width:212px;min-height:217px;height:100%}.funds-balance-wrapper._horizontal[_ngcontent-%COMP%]{flex-wrap:nowrap;flex-direction:row;gap:var(--spacer-32)}.funds-balance-wrapper._horizontal[_ngcontent-%COMP%] .funds-balance-item[_ngcontent-%COMP%]{width:45%;justify-content:space-between}.funds-balance-wrapper._horizontal[_ngcontent-%COMP%] .funds-currency-amount[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;padding:0;gap:var(--spacer-16)}.funds-balance-item[_ngcontent-%COMP%]{display:flex;flex-direction:column}.funds-currency-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:var(--spacer-32);justify-content:space-between}.funds-currency-value[_ngcontent-%COMP%]{display:flex;padding:var(--spacer-4) var(--spacer-10);justify-content:center;align-items:center;border-radius:var(--border-radius-300);border:1px solid var(--color-warning-300);background:var(--color-warning-200)}.funds-currency-amount[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--spacer-8);justify-content:space-between;align-items:center;padding:var(--spacer-20) 0}@media (max-width: 1023px){.funds-balance-wrapper[_ngcontent-%COMP%]{flex-wrap:nowrap;min-width:auto;min-height:auto}.funds-currency-amount[_ngcontent-%COMP%]{flex-wrap:wrap}.funds-currency-amount__value[_ngcontent-%COMP%]{min-width:40%}}"],changeDetection:0})}}return e})();var z=function(e){return e.CARD="CARD",e.ACCOUNT_BANK="ACCOUNT_BANK",e}(z||{});let Ta=(()=>{class e{constructor(){this.cardNumber=(0,t.hFB)(void 0)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-card-mask"]],inputs:{cardNumber:[1,"cardNumber"]},decls:6,vars:1,consts:[[1,"card-mask"],["src","/assets/images/card-mask.svg","width","28px","height","4px"]],template:function(o,i){1&o&&(t.j41(0,"div",0),t.nrm(1,"img",1)(2,"img",1)(3,"img",1),t.j41(4,"gamma-typo-100"),t.EFF(5),t.k0s()()),2&o&&(t.R
17$(5),t.JRh(i.cardNumber()))},dependencies:[r.vj],styles:[".card-mask[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:var(--spacer-16);min-height:20px}"],changeDetection:0})}}return e})();function xa(e,a){if(1&e&&(t.j41(0,"div",1),t.nrm(1,"gamma-svg",2),t.k0s(),t.j41(2,"div",3),t.nrm(3,"app-card-mask",4),t.j41(4,"gamma-typo-50",5),t.EFF(5),t.nI1(6,"transloco"),t.k0s()()),2&e){const n=t.XpG();t.R7$(3),t.Y8G("cardNumber",n.cardNumber()),t.R7$(2),t.SpI(" ",t.bMT(6,2,"funds.receiving.card.number")," ")}}function Ma(e,a){if(1&e&&(t.j41(0,"div",1),t.nrm(1,"gamma-svg",6),t.k0s(),t.j41(2,"div",3)(3,"gamma-typo-50",7),t.EFF(4),t.k0s(),t.j41(5,"gamma-typo-50"),t.EFF(6),t.k0s(),t.j41(7,"gamma-typo-50",5),t.EFF(8),t.nI1(9,"transloco"),t.k0s()()),2&e){const n=t.XpG();t.R7$(3),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",n.accountBankTitle()," "),t.R7$(2),t.JRh(n.accountBankNumber()),t.R7$(2),t.SpI(" ",t.bMT(9,4,"funds.receiving.accountBank.number")," ")}}let Zt=(()=>{class e{constructor(){this.EMethodReceivingFunds=z,this.type=(0,t.hFB)(void 0),this.cardNumber=(0,t.hFB)(void 0),this.accountBankTitle=(0,t.hFB)(void 0),this.accountBankNumber=(0,t.hFB)(void 0)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-method-receiving-funds-cell"]],inputs:{type:[1,"type"],cardNumber:[1,"cardNumber"],accountBankTitle:[1,"accountBankTitle"],accountBankNumber:[1,"accountBankNumber"]},decls:3,vars:1,consts:[[1,"card","funds-container"],[1,"funds-icon"],["src","gamma::icon-medium-creditcard"],[1,"funds-content"],[3,"cardNumber"],["color","grey-500"],["src","gamma::icon-medium-bank"],[1,"mb-2",3,"strong"]],template:function(o,i){if(1&o&&(t.j41(0,"section",0),t.DNE(1,xa,7,4)(2,Ma,10,6),t.k0s()),2&o){let s;t.R7$(),t.vxM((s=i.type())===i.EMethodReceivingFunds.CARD?1:s===i.EMethodReceivingFunds.ACCOUNT_BANK?2:-1)}},dependencies:[g.Kj,Ta,r.dx,r.b$],styles:[".funds-container[_ngcontent-%COMP%]{min-height:87px;display:flex;padding:var(--spacer-16) var(--spacer-16) var(--spacer-20);gap:var(--spacer-8);cursor:pointer}.funds-icon[_ngcontent-%COMP%]{--app-icon-color: var(--color-backoffice-300);width:40px;min-width:40px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:var(--border-radius-300);background:var(--opacity-backoffice-100)}.funds-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-2)}"],changeDetection:0})}}return e})(),qt=(()=>{class e{constructor(){this.imgSrc=(0,t.hFB)(void 0),this.description=(0,t.hFB)(void 0),this.actionText=(0,t.hFB)(void 0),this.addAction=(0,t.CGW)()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-method-receiving-funds-empty"]],inputs:{imgSrc:[1,"imgSrc"],description:[1,"description"],actionText:[1,"actionText"]},outputs:{addAction:"addAction"},decls:6,vars:4,consts:[[1,"container-empty"],["alt","method receiving funds",1,"empty-image",3,"src"],["color","grey-500"],["type","button","appearance","ghost-button",3,"click","iconLeft"]],template:function(o,i){1&o&&(t.j41(0,"div",0),t.nrm(1,"img",1),t.j41(2,"gamma-typo-50",2),t.EFF(3),t.k0s(),t.j41(4,"gamma-button",3),t.bIt("click",function(){return i.addAction.emit()}
1),t.EFF(5),t.k0s()()),2&o&&(t.R7$(),t.Y8G("src",i.imgSrc(),t.B4B),t.R7$(2),t.JRh(i.description()),t.R7$(),t.Y8G("iconLeft","gamma::icon-medium-plus"),t.R7$(),t.SpI(" ",i.actionText()," "))},dependencies:[r.b$,r.Qp],styles:[".container-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;text-align:center;gap:var(--spacer-4)}.empty-image[_ngcontent-%COMP%]{display:block;width:60px;height:60px}"],changeDetection:0})}}return e})();const ka=["*",[["","empty-section",""]]],Ra=["*","[empty-section]"];function wa(e,a){if(1&e){const n=t.RV6();t.j41(0,"section",1)(1,"div",2)(2,"div",3)(3,"gamma-typo-100"),t.EFF(4),t.k0s(),t.j41(5,"gamma-badge",4),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.countClick.emit())}),t.k0s()(),t.j41(6,"div")(7,"gamma-button",5),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.addAction.emit())}),t.EFF(8),t.nI1(9,"transloco"),t.k0s()()(),t.j41(10,"div"),t.SdG(11),t.k0s()()}if(2&e){const n=t.XpG();t.R7$(4),t.JRh(n.title()),t.R7$(),t.Y8G("size","s")("value",n.totalCount().toString())("color","color-backoffice-300")("textColor","white"),t.R7$(2),t.Y8G("iconLeft","gamma::icon-medium-plus"),t.R7$(),t.SpI(" ",t.bMT(9,7,"common.add")," ")}}function $a(e,a){1&e&&(t.j41(0,"section",1),t.SdG(1,1),t.k0s())}let tn=(()=>{class e{constructor(){this.EInternalCurrency=H.oy,this.title=(0,t.hFB)(void 0),this.totalCount=t.hFB.required(),this.showLoader=(0,t.hFB)(!1),this.addAction=(0,t.CGW)(),this.countClick=(0,t.CGW)()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-method-receiving-funds-wrapper"]],inputs:{title:[1,"title"],totalCount:[1,"totalCount"],showLoader:[1,"showLoader"]},outputs:{addAction:"addAction",countClick:"countClick"},ngContentSelectors:Ra,decls:4,vars:4,consts:[[3,"loader","overlay"],[1,"wrapper"],[1,"flex","justify-between","align-center"],[1,"flex","align-center","gap-3"],[3,"click","size","value","color","textColor"],["size","m","type","button","appearance","ghost-button",3,"click","iconLeft"]],template:function(o,i){1&o&&(t.NAR(ka),t.qex(0),t.j41(1,"gamma-loader",0),t.DNE(2,wa,12,9,"section",1)(3,$a,2,0,"section",1),t.k0s(),t.bVm()),2&o&&(t.R
17$(),t.Y8G("loader",i.showLoader())("overlay",!0),t.R7$(),t.vxM(i.totalCount()>0?2:-1),t.R7$(),t.vxM(0===i.totalCount()?3:-1))},dependencies:[g.Kj,r.nS,r.Qp,r.VU,r.vj],styles:["[_nghost-%COMP%]{flex:1}.wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;border:1px solid var(--grey-200);border-radius:var(--border-radius-300);background-color:var(--grey-100);gap:var(--spacer-10);padding:var(--spacer-16)}"],changeDetection:0})}}return e})();var nn=l(152),en=l(3294),jt=l(983);const on=(e,a)=>n=>n.value>e?{maxBalance:a}:null;var Ia=l(615);let bt=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(Ia.K);super(n),this.payoutApi=(0,t.WQX)(R),this.alertService=(0,t.WQX)(r.Nx),this.translocoService=(0,t.WQX)(g.JO),this.accountsState=n}getAccountsList(){return this.set("loading",!0),this.payoutApi.getAccounts().pipe((0,u.M)(n=>{this.set("rows",n)}),(0,h.j)(()=>{this.set("loading",!1)}))}addAccount(n){return this.payoutApi.postAccount(n).pipe((0,u.M)(()=>{this.alertService.open(this.translocoService.translate("funds.account.notification.create"),{appearance:"success"}).subscribe()}))}editAccount(n,o){return this.payoutApi.putAccount(n,o).pipe((0,u.M)(()=>{this.alertService.open(this.translocoService.translate("funds.account.notification.edit"),{appearance:"success"}).subscribe()}))}deleteAccount(n){return this.payoutApi.deleteAccount(n).pipe((0,u.M)(()=>{const o=this.accountsState.value.rows.filter(i=>i.id!==n);this.set("rows",o),this.alertService.open(this.translocoService.translate("funds.account.notification.deleted"),{appearance:"success"}).subscribe()}),(0,X.W)(o=>(this.alertService.open(o.error?.message,{appearance:"error"}).subscribe(),(0,V.$)(()=>o))))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Da=["content"];function Aa(e,a){1&e&&t.eu8(0)}function Fa(e,a){1&e&&(t.j41(0,"gamma-notification",11)(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()),2&e&&(t.Y8G("status","error"),t.R7$(2),t.SpI(" ",t.bMT(3,2,"funds.withdrawal.payoutWithdrawalDialog.accountBank.emptyState.title")," "))}function Sa(e,a){if(1&e&&t.nrm(0,"gamma-radio-list",12),2&e){const n=t.XpG();t.XpG(2);const o=t.sdS(3);t.Y8G("itemContent",o)("items",n)}}function Ea(e,a){if(1&e&&(t.j41(0,"section"),t.DNE(1,Aa,1,0,"ng-container",10)(2,Fa,4,4,"ng-template",null,2,t.C5r)(4,Sa,1,2,"ng-template",null,3,t.C5r),t.k0s()),2&e){const n=t.sdS(3),o=t.sdS(5);t.R7$(),t.Y8G("ngTemplateOutlet",a.length?o:n)}}function Pa(e,a){1&e&&t.nrm(0,"gamma-loader",8),2&e&&t.Y8G("loader",!0)}function ja(e,a){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=a;t.R7$(),t.Lme(" ( ",t.bMT(2,2,n.amount)," ",t.bMT(3,4,n.currency)," ) ")}}function Ga(e,a){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=a;t.R7$(),t.Lme(" ( ",t.bMT(2,2,n.amount)," ",t.bMT(3,4,n.currency)," ) ")}}function Ba(e,a){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.k0s()),2&e){const n=a;t.R7$(),t.Lme(" ( ",t.bMT(2,2,n.amount)," ",t.bMT(3,4,n.currency)," ) ")}}function Oa(e,a){if(1&e&&(t.j41(0,"gamma-typo-300"),t.EFF(1),t.nI1(2,"appNumberFormat"),t.nI1(3,"gammaCurrency"),t.DNE(4,Ba,4,6,"span"),t.k0s()),2&e){let n;const o=a,i=t.XpG(4);t.R7$(),t.Lme(" ",t.bMT(2,3,o)," ",t.bMT(3,5,i.balanceRubFormatName)," "),t.R7$(3),t.vxM((n=i.convertCUToRub(o))?4:-1,n)}}function Na(e,a){if(1&e&&(t.j41(0,"div",15)(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"gamma-typo-100"),t.EFF(5),t.nI1(6,"appNumberFormat"),t.nI1(7,"gammaCurrency"),t.DNE(8,ja,4,6,"span"),t.k0s()(),t.j41(9,"div",15)(10,"gamma-typo-100"),t.EFF(11),t.nI1(12,"transloco"),t.k0s(),t.j41(13,"gamma-typo-100"),t.EFF(14),t.nI1(15,"appNumberFormat"),t.nI1(16,"gammaCurrency"),t.DNE(17,Ga,4,6,"span"),t.k0s()(),t.j41(18,"div",16)(19,"gamma-typo-300"),t.EFF(20),t.nI1(21,"transloco"),t.k0s(),t.DNE(22,Oa,5,7,"gamma-typo-300"),t.k0s()),2&e){let n,o,i;const s=t.XpG(),_=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,10,"funds.withdrawal.payoutWithdrawalDialog.amount")," "),t.R7$(3),t.Lme(" ",t.bMT(6,12,_.amount)," ",t.bMT(7,14,_.balanceRubFormatName)," "),t.R7$(3),t.vxM((n=_.convertCUToRub(_.amount))?8:-1,n),t.R7$(3),t.SpI(" ",t.bMT(12,16,"funds.withdrawal.payoutWithdrawalDialog.commission")," "),t.R7$(3),t.Lme(" ",t.bMT(15,18,s.commission)," ",t.bMT(16,20,_.balanceRubFormatName)," "),t.R7$(3),t.vxM((o=_.convertCUToRub(s.commission))?17:-1,o),t.R7$(3),t.SpI(" ",t.bMT(21,22,"funds.withdrawal.payoutWithdrawalDialog.total")," "),t.R7$(2),t.vxM((i=_.sumWithCommission(_.amount,s.commission))?22:-1,i)}}function La(e,a){if(1&e&&(t.j41(0,"div",9)(1,"div"),t.DNE(2,Na,23,24),t.nI1(3,"async"),t.k0s(),t.j41(4,"div",13)(5,"gamma-button",14),t.EFF(6),t.nI1(7,"transloco"),t.k0s()()()),2&e){let n;const o=t.XpG(2);t.R7$(2),t.vxM((n=t.bMT(3,4,o.profile$))?2:-1,n),t.R7$(3),t.Y8G("disabled",o.form.invali
1d||o.submitLoading)("showLoader",o.submitLoading),t.R7$(),t.SpI(" ",t.bMT(7,6,"funds.withdrawal.payoutWithdrawalDialog.action")," ")}}function Xa(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",4),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.submit())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header")(3,"gamma-typo-300"),t.EFF(4),t.nI1(5,"transloco"),t.k0s()(),t.j41(6,"div",5)(7,"gamma-notification",6),t.nrm(8,"gamma-typo-50",7),t.nI1(9,"transloco"),t.k0s()(),t.DNE(10,Ea,6,1,"section"),t.nI1(11,"async"),t.DNE(12,Pa,1,1,"gamma-loader",8),t.j41(13,"gamma-dialog-footer"),t.DNE(14,La,8,8,"div",9),t.nI1(15,"async"),t.k0s()()()}if(2&e){let n,o;const i=t.XpG();t.Y8G("formGroup",i.form),t.R7$(4),t.SpI(" ",t.bMT(5,7,"funds.withdrawal.payoutWithdrawalDialog.accountBank.title")," "),t.R7$(4),t.Y8G("strong",!0)("innerHTML",t.bMT(9,9,"funds.payout.warning.takeUpDays"),t.npT),t.R7$(2),t.vxM((n=t.bMT(11,11,!i.loading&&i.accounts$))?10:-1,n),t.R7$(2),t.vxM(i.loading?12:-1),t.R7$(2),t.vxM((o=t.bMT(15,13,i.bankAccountsCommission$))?14:-1,o)}}function Wa(e,a){if(1&e&&(t.j41(0,"div",17)(1,"gamma-typo-100",18),t.EFF(2),t.k0s(),t.j41(3,"gamma-typo-100",19),t.EFF(4),t.k0s()()),2&e){const n=a.$implicit;t.R7$(),t.Y8G("initialLH",!0)("strong",!0)("block",!0),t.R7$(),t.SpI(" ",n.name," "),t.R7$(),t.Y8G("initialLH",!0)("block",!0),t.R7$(),t.SpI(" ",n.bankAccountNumber," ")}}class tt{constructor(){this.accountsFacade=(0,t.WQX)(bt),this.payoutFacade=(0,t.WQX)($),this.profileFacade=(0,t.WQX)(ut.E),this.store=(0,t.WQX)(D.t),this.dialogsService=(0,t.WQX)(L.wX),this.translocoService=(0,t.WQX)(g.JO),this.alertService=(0,t.WQX)(r.Nx),this.formErrorService=(0,t.WQX)(rt._),this.content=(0,t.ebz)("content"),this.loading=!1,this.submitLoading=!1,this.balanceRubFormatName="",this.profile$=this.store.state("profile").select$(a=>a.profile),this.accounts$=this.store.state("accounts").select$(a=>a.rows),this.bankAccountsCommission$=this.store.state("payoutInfo").select$(a=>a.bankAccounts),this.form=new c.gE({accountBank:new c.MJ(null,[c.k0.required])}),this.closeModal$=new B.B}show(a){this.amount=a,this.loading=!0;const n=this.checkBalanceRub(this.store.state("profile").value.profile);this.balanceRubFormatName=n?n.formatName:"",this.accountsFacade.getAccountsList().pipe((0,h.j)(()=>{this.loading=!1})).subscribe(),this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset()}})}hide(){this.closeModal$.next()}checkBalanceRub(a){return a.balances.find(n=>"RUB"===n.currency)}sumWithCommission(a,n){return Number((a+n).toFixed(2))}convertCUToRub(a=0){const n=this.store.state("profile").select(i=>i.profile),o=this.checkBalanceRub(n);return{amount:Ht(a*o.rate),currency:o.currency}}submit(){const{accountBank:a}=this.form.value;this.submitLoading=!0,this.payoutFacade.postPayoutBankAccount(a.id,this.amount).pipe((0,u.M)(()=>{this.hide(),this.profileFacade.getProfile().subscribe(),this.payoutFacade.getPayoutInfo({amount:null}).subscribe(),this.alertService.open(this.translocoService.translate("funds.withdrawal.payoutWithdrawalDialog.notification.success"),{appearance:"success"}).subscribe()}),(0,X.W)(n=>(this.formErrorService.display(n,this.form),(0,V.$)(()=>n))),(0,h.j)(()=>{this.submitLoading=!1})).subscribe()}static{this.\u0275fac=function(n){return new(n||tt)}}static{this.\u0275cmp=t.VBU({type:tt,selectors:[["app-payout-withdrawal-amount-select-bank-account-dialog"]],viewQuery:function(n,o){1&n&&t.wEZ(o.content,Da,5),2&n&&t.NyB()},decls:4,vars:0,consts:[["content",""],["accountBankContent",""],["emptyList",""],["cardsList",""],[3,"submitEvent","formGroup"],[1,"mb-24"],["status","warning"],["color","color-alert-text",3,"strong","innerHTML"],[1,"col-12","lg:col-10",3,"loader"],[1,"cards-footer"],[4,"ngTemplateOutlet"],[3,"status"],["formControlName","accountBank",3,"itemContent","items"],[1,"cards-footer__action"],["type","submit",3,"disabled","showLoader"],[1,"cards-footer__total","mb-4"],[1,"cards-footer__total"],[1,"cards__item"],[1,"mb-8",3,"initialLH","strong","block"],[3,"initialLH","block"]],template:function(n,o){1&n&&t.DNE(0,Xa,16,15,"ng-template",null,0,t.C5r)(2,Wa,5,7,"ng-template",null,1,t.C5r)},dependencies:[A.Jj,g.Kj,A.T3,c.X1,c.BC,c.cb,c.j4,c.JD,K.K,r.BU,r.lP,r.UA,r.BP,r.Z_,r.zP,r.vj,r.VU,r.xh,r.Qp,r.Py,r.b$],styles:[".cards__item[_ngcontent-%COMP%]{width:100%;position:relative}.cards__item__icon[_ngcontent-%COMP%]{cursor:pointer;--app-icon-color: var(--grey-500)}.cards__item__action[_ngcontent-%COMP%]{width:32px;height:32px;position:absolute;top:50%;right:0;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.cards-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.cards-footer__total[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);justify-content:space-between}.cards-footer__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"]})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],tt.prototype,"checkBalanceRub",null),(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Number,Number]),(0,f.Sn)("design:returntype",void 0)],tt.prototype,"sumWithCommission",
1null),(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],tt.prototype,"convertCUToRub",null);var Ya=l(2781);let vt=(()=>{class e extends d.a{constructor(){const n=(0,t.WQX)(Ya.p);super(n),this.payoutApi=(0,t.WQX)(R),this.alertService=(0,t.WQX)(r.Nx),this.translocoService=(0,t.WQX)(g.JO),this.cardsState=n}getCardsList(){return this.set("loading",!0),this.payoutApi.getCards().pipe((0,u.M)(n=>{this.set("rows",n)}),(0,h.j)(()=>{this.set("loading",!1)}))}addCard(n){return this.payoutApi.postCard(n)}deleteCard(n,o){return this.payoutApi.deleteCard(n,o).pipe((0,u.M)(()=>{const i=this.cardsState.value.rows.filter(s=>s.id!==n&&s.numberTail!==o);this.set("rows",i),this.alertService.open(this.translocoService.translate("funds.cards.notification.deleted"),{appearance:"success"}).subscribe()}),(0,X.W)(i=>(this.alertService.open(i.error?.message,{appearance:"error"}).subscribe(),(0,V.$)(()=>i))))}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Va=["content"];function Ua(e,a){1&e&&t.eu8(0)}function Qa(e,a){1&e&&(t.j41(0,"gamma-notification",11)(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()),2&e&&(t.Y8G("status","error"),t.R7$(2),t.SpI(" ",t.bMT(3,2,"funds.withdrawal.payoutWithdrawalDialog.emptyState.title")," "))}function Ha(e,a){if(1&e&&t.nrm(0,"gamma-radio-list",12),2&e){const n=t.XpG();t.XpG(2);const o=t.sdS(3);t.Y8G("itemContent",o)("items",n)}}function za(e,a){if(1&e&&(t.j41(0,"section"),t.DNE(1,Ua,1,0,"ng-container",10)(2,Qa,4,4,"ng-template",null,2,t.C5r)(4,Ha,1,2,"ng-template",null,3,t.C5r),t.k0s()),2&e){const n=t.sdS(3),o=t.sdS(5);t.R7$(),t.Y8G("ngTemplateOutlet",a.length?o:n)}}function Ja(e,a){1&e&&t.nrm(0,"gamma-loader",8),2&e&&t.Y8G("loader",!0)}function Ka(e,a){if(1&e&&(t.j41(0,"div",15)(1,"gamma-typo-100"),t.EFF(2),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"gamma-typo-100"),t.EFF(5),t.nI1(6,"appNumberFormat"),t.nI1(7,"gammaCurrency"),t.k0s()(),t.j41(8,"div",15)(9,"gamma-typo-100"),t.EFF(10),t.nI1(11,"transloco"),t.k0s(),t.j41(12,"gamma-typo-100"),t.EFF(13),t.nI1(14,"appNumberFormat"),t.nI1(15,"gammaCurrency"),t.k0s()(),t.j41(16,"div",16)(17,"gamma-typo-300"),t.EFF(18),t.nI1(19,"transloco"),t.k0s(),t.j41(20,"gamma-typo-300"),t.EFF(21),t.nI1(22,"appNumberFormat"),t.nI1(23,"gammaCurrency"),t.k0s()()),2&e){const n=t.XpG(),o=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,9,"funds.withdrawal.payoutWithdrawalDialog.amount")," "),t.R7$(3),t.Lme(" ",t.bMT(6,11,o.amount)," ",t.bMT(7,13,o.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(11,15,"funds.withdrawal.payoutWithdrawalDialog.commission")," "),t.R7$(3),t.Lme(" ",t.bMT(14,17,n.commission)," ",t.bMT(15,19,o.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(19,21,"funds.withdrawal.payoutWithdrawalDialog.total")," "),t.R7$(3),t.Lme(" ",t.bMT(22,23,+(o.amount+n.commission).toFixed(2))," ",t.bMT(23,25,o.payoutCurrency())," ")}}function Za(e,a){if(1&e&&(t.j41(0,"div",9)(1,"div"),t.DNE(2,Ka,24,27),t.nI1(3,"async"),t.k0s(),t.j41(4,"div",13)(5,"gamma-button",14),t.EFF(6),t.nI1(7,"transloco"),t.k0s()()()),2&e){let n;const o=t.XpG(2);t.R7$(2),t.vxM((n=t.bMT(3,4,o.profile$))?2:-1,n),t.R7$(3),t.Y8G("disabled",o.form.invalid||o.submitLoading)("showLoader",o.submitLoading),t.R7$(),t.SpI(" ",t.bMT(7,6,"funds.withdrawal.payoutWithdrawalDialog.action")," ")}}function qa(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",4),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.submit())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header")(3,"gamma-typo-300"),t.EFF(4),t.nI1(5,"transloco"),t.k0s()(),t.j41(6,"div",5)(7,"gamma-notification",6),t.nrm(8,"gamma-typo-50",7),t.nI1(9,"transloco"),t.k0s()(),t.DNE(10,za,6,1,"section"),t.nI1(11,"async"),t.DNE(12,Ja,1,1,"gamma-loader",8),t.j41(13,"gamma-dialog-footer"),t.DNE(14,Za,8,8,"div",9),t.nI1(15,"async"),t.k0s()()()}if(2&e){let n,o;const i=t.XpG();t.Y8G("formGroup",i.form),t.R7$(4),t.SpI(" ",t.bMT(5,7,"funds.withdrawal.payoutWithdrawalDialog.title")," "),t.R7$(4),t.Y8G("strong",!0)("innerHTML",t.bMT(9,9,"funds.cards.linkingCardDialog.warning"),t.npT),t.R7$(2),t.vxM((n=t.bMT(11,11,
1!i.loading&&i.cards$))?10:-1,n),t.R7$(2),t.vxM(i.loading?12:-1),t.R7$(2),t.vxM((o=t.bMT(15,13,i.payoutInfo$))?14:-1,o)}}function ti(e,a){if(1&e&&(t.j41(0,"div",17)(1,"gamma-typo-100",18),t.EFF(2),t.k0s()()),2&e){const n=a.$implicit;t.R7$(),t.Y8G("initialLH",!0),t.R7$(),t.JRh(n.numberMasked)}}let Gt=(()=>{class e{constructor(){this.cardsFacade=(0,t.WQX)(vt),this.payoutFacade=(0,t.WQX)($),this.profileFacade=(0,t.WQX)(ut.E),this.store=(0,t.WQX)(D.t),this.dialogsService=(0,t.WQX)(L.wX),this.translocoService=(0,t.WQX)(g.JO),this.alertService=(0,t.WQX)(r.Nx),this.formErrorService=(0,t.WQX)(rt._),this.payoutCurrency=(0,t.hFB)(void 0),this.content=(0,t.ebz)("content"),this.loading=!1,this.submitLoading=!1,this.profile$=this.store.state("profile").select$(n=>n.profile),this.cards$=this.store.state("cards").select$(n=>n.rows),this.payoutInfo$=this.store.state("payoutInfo").select$(n=>n.info),this.form=new c.gE({card:new c.MJ(null,[c.k0.required])}),this.closeModal$=new B.B}show(n){this.amount=n,this.loading=!0,this.cardsFacade.getCardsList().pipe((0,h.j)(()=>{this.loading=!1})).subscribe(),this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset()}})}hide(){this.closeModal$.next()}submit(){const{card:n}=this.form.value;this.submitLoading=!0,this.payoutFacade.postPayout({cardNumberTail:n.numberTail,amount:this.amount}).pipe((0,u.M)(()=>{this.hide(),this.profileFacade.getProfile().subscribe(),this.payoutFacade.getPayoutInfo({amount:null}).subscribe(),this.alertService.open(this.translocoService.translate("funds.withdrawal.payoutWithdrawalDialog.notification.success"),{appearance:"success"}).subscribe()}),(0,X.W)(o=>(this.formErrorService.display(o,this.form),(0,V.$)(()=>o))),(0,h.j)(()=>{this.submitLoading=!1})).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-payout-withdrawal-amount-select-card-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,Va,5),2&o&&t.NyB()},inputs:{payoutCurrency:[1,"payoutCurrency"]},decls:4,vars:0,consts:[["content",""],["cardNumberContent",""],["emptyList",""],["cardsList",""],[3,"submitEvent","formGroup"],[1,"mb-24"],["status","warning"],["color","color-alert-text",3,"strong","innerHTML"],[1,"col-12","lg:col-10",3,"loader"],[1,"cards-footer"],[4,"ngTemplateOutlet"],[3,"status"],["formControlName","card",3,"itemContent","items"],[1,"cards-footer__action"],["type","submit",3,"disabled","showLoader"],[1,"cards-footer__total","mb-4"],[1,"cards-footer__total"],[1,"cards__item"],[3,"initialLH"]],template:function(o,i){1&o&&t.DNE(0,qa,16,15,"ng-template",null,0,t.C5r)(2,ti,3,2,"ng-template",null,1,t.C5r)},dependencies:[A.Jj,g.Kj,A.T3,c.X1,c.BC,c.cb,c.j4,c.JD,K.K,r.BU,r.lP,r.UA,r.BP,r.zP,r.vj,r.b$,r.Py,r.VU,r.xh,r.Qp,r.Z_],styles:[".cards__item[_ngcontent-%COMP%]{width:100%;position:relative}.cards__item__icon[_ngcontent-%COMP%]{cursor:pointer;--app-icon-color: var(--grey-500)}.cards__item__action[_ngcontent-%COMP%]{width:32px;height:32px;position:absolute;top:50%;right:0;display:flex;align-items:center;justify-content:center;transform:translateY(-50%)}.cards-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.cards-footer__total[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);justify-content:space-between}.cards-footer__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"]})}}return e})();const ni=["content"];function ei(e,a){1&e&&(t.j41(0,"gamma-typo-300"),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"funds.withdrawal.payoutWithdrawalDialog.title")," "))}function oi(e,a){1&e&&(t.j41(0,"gamma-typo-300"),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"funds.withdrawal.payoutWithdrawalDialog.accountBank.title")," "))}function ai(e,a){if(1&e&&(t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header"),t.DNE(2,ei,3,3,"gamma-typo-300")(3,oi,3,3,"gamma-typo-300"),t.k0s(),t.j41(4,"gamma-notification",2),t.nrm(5,"gamma-typo-100",3),t.nI1(6,"transloco"),t.k0s()()),2&e){const n=t.XpG(2);t.R7$(2),t.vxM(n.type()===n.EMethodReceivingFunds.CARD?2:-1),t.R7$(),t.vxM(n.type()===n.EMethodReceivingFunds.ACCOUNT_BANK?3:-1),t.R7$(2),t.Y8G("innerHTML",t.bMT(6,3,"funds.payout.unavailable"),t.npT)}}function ii(e,a){1&e&&(t.j41(0,"gamma-typo-300"),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"funds.withdrawal.payoutWithdrawalDialog.title")," "))}function ri(e,a){1&e&&(t.j41(0,"gamma-typo-300"),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"funds.withdrawal.payoutWithdrawalDialog.accountBank.title")," "))}function si(e,a){1&e&&(t.nrm(0,"gamma-input-number",12),t.nI1(1,"gammaCurrency"),t.nI1(2,"gammaCurrency")),2&e&&t.Y8G("postfix",t.bMT(1,2,"RUB"))("placeholder",t.bMT(2,4,"RUB"))}function ci(e,a){if(1&e&&(t.j41(0,"section"),t.nrm(1,"gamma-input-number",11),t.nI1(2,"transloco"),t.nI1(3,"gammaCurrency"),t.nI1(4,"gammaCurrency"),t.DNE(5,si,3,6,"gamma-input-number",12),t.k0s()),2&e){const n=t.XpG(),o=t.XpG(3);t.R7$(),t.Y8G("label",t.bMT(2,4,"funds.withdrawal.payoutWithdrawalDialog.field.amount"))("postfix",t.bMT(3,6,n.currentCurrencyRepr))("placeholder",t.bMT(4,8,n.currentCurrencyRepr)),t.R7$(4),t.vxM(o.checkBalanceRub(n)?5:-1)}}function li(e,a){if(1&e&&(t.j41(0,"div",13)(1,"gamma-notification",2),t.nrm(2,"gamma-typo-50",14),t.nI1(3,"transloco"),t.k0s()(),t.nrm(4,"gamma-input-number",11),t.nI1(5,"transloco"),t.nI1(6,"gammaCurrency"),t.nI1(7,"gammaCurrency")),2&e){const n=t.XpG(5);t.R7$(2),t.Y8G("strong",!0)("innerHTML",t.bMT(3,5,"funds.cards.linkingCardDialog.warning"),t.npT),t.R7$(2),t.Y8G("label",t.bMT(5,7,"funds.withdrawal.payoutWithdrawalDialog.field.amount"))("postfix",t.bMT(6,9,n.EInternalCurrency.USD))("placeholder",t.bMT(7,11,n.EInternalCurrency.USD))}}function pi(e,a){if(1&e&&(t.j41(0,"div",13)(1,"gamma-notification",2),t.nrm(2,"gamma-typo-50",3),t.nI1(3,"transloco"),t.k0s()(),t.j41(4,"div",13)(5,"gamma-notification",15),t.nrm(6,"gamma-typo-50",16),t.nI1(7,"transloco"),t.k0s()(),t.nrm(8,"gamma-input-number",11),t.nI1(9,"transloco"),t.nI1(10,"gammaCurrency"),t.nI1(11,"gammaCurrency"),t.nrm(12,"gamma-input-number",12),t.nI1(13,"gammaCurrency"),t.nI1(14,"gammaCurrency")),2&e){const n=t.XpG(5);t.R7$(2),t.Y8G("innerHTML",t.bMT(3,7,"funds.payout.warning.takeUpDays"),t.npT),t.R7$(4),t.Y8G("innerHTML",t.bMT(7,9,"funds.payout.info.bankSchedule"),t.npT),t.R7$(2),t.Y8G("label",t.bMT(9,11,"funds.withdrawal.payoutWithdrawalDialog.field.amount"))("postfix",t.bMT(10,13,n.balanceRubFormatName))("placeholder",t.bMT(11,15,n.balanceRubFormatName)),t.R7$(4),t.Y8G("postfix",t.bMT(13,17,n.EInternalCurrency.RUB))("placeholder",t.bMT(14,19,n.EInternalCurrency.RUB))}}function di(e,a){if(1&e&&(t.j41(0,"section"),t.DNE(1,li,8,13)(2,pi,15,21),t.k0s()),2&e){const n=t.XpG(4);t.R7$(),t.vxM(n.type()===n.EMethodReceivingFunds.CARD?1:-1),t.R7$(),t.vxM(n.type()===n.EMethodReceivingFunds.ACCOUNT_BANK?2:-1)}}function mi(e,a){1&e&&t.nrm(0,"gamma-loader",6),2&e&&t.Y8G("loader",!0)}function ui(e,a){1&e&&t.nrm(0,"gamma-loader",8),2&e&&t.Y8G("loader",!0)}function _i(e,a){if(1&e&&(t.j41(0,"div")(1,"div",17)(2,"gamma-typo-100"),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100"),t.EFF(6),t.nI1(7,"appNumberFormat"),t.nI1(8,"gammaCurrency"),t.k0s()(),t.j41(9,"div",17)(10,"gamma-typo-100"),t.EFF(11),t.nI1(12,"transloco"),t.k0s(),t.j41(13,"gamma-typo-100"),t.EFF(14),t.nI1(15,"appNumberFormat"),t.nI1(16,"gammaCurrency"),t.k0s()(),t.j41(17,"div",18)(18,"gamma-typo-300"),t.EFF(19),t.nI1(20,"transloco"),t.k0s(),t.j41(21,"gamma-typo-300"),t.EFF(22),t.nI1(23,"appNumberFormat"),t.nI1(24,"gammaCurrency"),t.k0s()()()),2&e){const n=t.XpG(4);t.R7$(3),t.SpI(" ",t.bMT(4,9,"funds.withdrawal.payoutWithdrawalDialog.amount")," "),t.R7$(3),t.Lme(" ",t.bMT(7,11,n.form.value.amount)," ",t.bMT(8,13,n.displayCurrency)," "),t.R7$(5),t.SpI(" ",t.bMT(12,15,"funds.withdrawal.payoutWithdrawalDialog.commission")," "),t.R7$(3),t.Lme(" ",t.bMT(15,17,n.commissionInfo.commission)," ",t.bMT(16,19,n.displayCurrency)," "),t.R7$(5),t.SpI(" ",t.bMT(20,21,"common.payment.total")," "),t.R7$(3),t.Lme(" ",t.bMT(23,23,n.totalAmount)," ",t.bMT(24,25,n.displayCurrency)," ")}}function gi(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",5),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.onWithdraw())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header"),t.DNE(3,ii,3,3,"gamma-typo-300")(4,ri,3,3,"gamma-typo-300"),t.k0s(),t.DNE(5,ci,6,10,"section")(6,di,3,2,"section")(7,mi,1,1,"gamma-loader",6),t.j41(8,"gamma-dialog-footer")(9,"div",7),t.DNE(10,ui,1,1,"gamma-loader",8)(11,_i,25,27,"div"),t.j41(12,"div",9)(13,"gamma-button",10),t.EFF(14),t.nI1(15,"transloco"),t.k0s()()()()()()}if(2&e){const n=a,o=t.XpG(3);t.Y8G("formGroup",o.form),t.R7$(3),t.vxM(o.type()===o.EMethodReceivingFunds.CARD?3:-1),t.R7$(),t.vxM(o.type()===o.EMethodReceivingFunds.ACCOUNT_BANK?4:-1),t.R7$(),t.vxM(n.bankAccountAvailable||o.loading?-1:5),t.R7$(),t.vxM(n.bankAccountAvailable&&!o.loading?6:-1),t.R7$(),t.vxM(o.loading?7:-1),t.R7$(3),t.vxM(o.commissionLoading?10:-1),t.R7$(),t.vxM(!o.commissionInfo||o.commissionLoading||o.loading?-1:11),t.R7$(2),t.Y8G("disabled",o.form.invali
1d||o.submitLoading||!o.commissionInfo||o.commissionLoading)("showLoader",o.submitLoading),t.R7$(),t.SpI(" ",t.bMT(15,11,"funds.withdrawal.payoutWithdrawalDialog.action")," ")}}function fi(e,a){if(1&e&&(t.DNE(0,gi,16,13,"gamma-form",4),t.nI1(1,"async")),2&e){let n;const o=t.XpG(2);t.vxM((n=t.bMT(1,1,o.profile$))?0:-1,n)}}function hi(e,a){if(1&e&&t.DNE(0,ai,7,5,"gamma-dialog-layout")(1,fi,2,3),2&e){const n=t.XpG();t.vxM(n.isPayoutUnavailable?0:1)}}class q{constructor(){this.payoutFacade=(0,t.WQX)($),this.dialogsService=(0,t.WQX)(L.wX),this.formErrorService=(0,t.WQX)(rt._),this.store=(0,t.WQX)(D.t),this.translocoService=(0,t.WQX)(g.JO),this.EMethodReceivingFunds=z,this.EInternalCurrency=H.oy,this.type=(0,t.hFB)(void 0),this.payoutCurrency=(0,t.hFB)(void 0),this.maxBalance=(0,t.hFB)(void 0),this.content=(0,t.ebz)("content"),this.payoutWithdrawalAmountSelectCardDialogComponent=(0,t.ebz)(Gt),this.payoutWithdrawalAmountSelectBankAccountDialog=(0,t.ebz)(tt),this.loading=!1,this.submitLoading=!1,this.isPayoutUnavailable=!1,this.balanceRubFormatName="",this.commissionInfo=null,this.commissionLoading=!1,this.displayCurrency="",this.profile$=this.store.state("profile").select$(a=>
1a.profile),this.baseAmountValidators=[c.k0.required,c.k0.min(1)],this.form=new c.gE({amount:new c.MJ(null,this.baseAmountValidators),amountRub:new c.MJ(null,[c.k0.min(1)])}),this.closeModal$=new B.B,this.destroy$=new B.B}get totalAmount(){return Math.round(100*((this.form.value.amount||0)+(this.commissionInfo?.commission||0)))/100}show(){this.loading=!0,this.commissionInfo=null,this.isPayoutUnavailable=!1===this.store.state("payoutInfo").value.info?.payoutAllowedForCountry;const a=this.store.state("profile").value.profile;switch(this.type()){case z.CARD:this.displayCurrency=a?.bankAccountAvailable?H.oy.USD:a?.currentCurrencyRepr||"",this.loadPayoutInfoByCard().pipe((0,u.M)(n=>{this.form.controls.amount.addValidators(c.k0.max(n.maxAmount)),this.form.controls.amount.updateValueAndValidity()})).subscribe();break;case z.ACCOUNT_BANK:{const n=this.checkBalanceRub(a);this.balanceRubFormatName=n?n.formatName:"",this.displayCurrency=this.balanceRubFormatName||H.oy.RUB,this.loadPayoutInfoByBankAccount().pipe((0,u.M)(o=>{this.form.controls.amount.addValidators(c.k0.max(o.maxAmount)),this.form.controls.amount.updateValueAndValidity()})).subscribe();break}}this.dialogsService.open(this.content(),{appearance:"mobile-small"}).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset(),this.commissionInfo=null,this.destroy$.next()}}),this.setupAmountWatcher(),this.setupCurrencySync()}hide(){this.closeModal$.next()}onWithdraw(){if(this.submitLoading)return;const{amount:a}=this.form.value;switch(this.submitLoading=!0,this.type()){case z.CARD:this.loadPayoutInfoByCard(a).pipe((0,u.M)(()=>{this.hide(),this.payoutWithdrawalAmountSelectCardDialogComponent().show(a)})).subscribe();break;case z.ACCOUNT_BANK:this.loadPayoutInfoByBankAccount(a).pipe((0,u.M)(()=>{this.hide(),this.payoutWithdrawalAmountSelectBankAccountDialog().show(a)})).subscribe()}}checkBalanceRub(a){return a.balances.find(n=>"RUB"===n.currency)}setupCurrencySync(){const a=this.checkBalanceRub(this.store.state("profile").value.profile);a&&zt(this.form.controls.amount,this.form.controls.amountRub,a.rate).pipe((0,G.Q)(this.destroy$)).subscribe()}setupAmountWatcher(){this.form.controls.amount.valueChanges.pipe((0,nn.B)(600),(0,en.F)(),(0,u.M)(a=>{(!a||a<=0)&&(this.commissionInfo=null,this.commissionLoading=!1)}),(0,Ct.p)(a=>a>0),(0,u.M)(()=>{this.commissionLoading=!0}),(0,I.n)(a=>{switch(this.type()){case z.CARD:return this.payoutFacade.getPayoutInfo({amount:a}).pipe((0,X.W)(()=>(this.commissionInfo=null,this.commissionLoading=!1,jt.w)));case z.ACCOUNT_BANK:return this.payoutFacade.getCommissionBankAccount({amount:a}).pipe((0,X.W)(()=>(this.commissionInfo=null,this.commissionLoading=!1,jt.w)));default:return jt.w}}),(0,u.M)(a=>{if(this.commissionInfo=a,a){const n=Math.round(100*(this.maxBalance()-a.commission))/100,o=[...this.baseAmountValidators,on(n,this.translocoService.translate("funds.withdrawal.payoutWithdrawalDialog.error.maxBalance"))];a.maxAmount&&o.push(c.k0.max(a.maxAmount)),this.form.controls.amount.setValidators(o),this.form.controls.amount.updateValueAndValidity({emitEvent:!1})}this.commissionLoading=!1}),(0,G.Q)(this.destroy$)).subscribe()}loadPayoutInfoByBankAccount(a=1){return this.payoutFacade.getCommissionBankAccount({amount:a}).pipe((0,X.W)(n=>(this.form=this.formErrorService.display(n,this.form),(0,V.$)(()=>n))),(0,h.j)(()=>{this.loading=!1,this.submitLoading=!1}))}loadPayoutInfoByCard(a=1){return this.payoutFacade.getPayoutInfo({amount:a}).pipe((0,X.W)(n=>(this.form=this.formErrorService.display(n,this.form),(0,V.$)(()=>n))),(0,h.j)(()=>{this.loading=!1,this.submitLoading=!1}))}static{this.\u0275fac=function(n){return new(n||q)}}static{this.\u0275cmp=t.VBU({type:q,selectors:[["app-payout-withdrawal-amount-dialog"]],viewQuery:function(n,o){1&n&&(t.wEZ(o.content,ni,5),t.wEZ(o.payoutWithdrawalAmountSelectCardDialogComponent,Gt,5),t.wEZ(o.payoutWithdrawalAmountSelectBankAccountDialog,tt,5)),2&n&&t.NyB(3)},inputs:{type:[1,"type"],payoutCurrency:[1,"payoutCurrency"],maxBalance:[1,"maxBalance"]},decls:4,vars:1,consts:[["content",""],[3,"payoutCurrency"],["status","warning"],["color","color-alert-text",3,"innerHTML"],[3,"formGroup"],[3,"submitEvent","formGroup"],[1,"col-12","lg:col-10",3,"loader"],[1,"withdrawal-amount-footer"],[3,"loader"],[1,"withdrawal-amount-footer__action"],["type","submit",3,"disabled","showLoader"],["formControlName","amount",3,"label","postfix","placeholder"],["formControlName","amountRub",1,"mt-16",3,"postfix","placeholder"],[1,"mb-24"],["color","color-alert-text",3,"strong","innerHTML"],["status","info"],[3,"innerHTML"],[1,"withdrawal-amount-footer__total","mb-8"],[1,"withdrawal-amount-footer__total"]],template:function(n,o){1&n&&(t.DNE(0,hi,2,1,"ng-template",null,0,t.C5r),t.nrm(2,"app-payout-withdrawal-amount-select-card-dialog",1)(3,"app-payout-withdrawal-amount-select-bank-account-dialog")),2&n&&(t.R7$(2),t.Y8G("payoutCurrency",o.payoutCurrency()))},dependencies:[A.Jj,g.Kj,c.X1,c.BC,c.cb,c.j4,c.JD,K.K,r.BU,Gt,tt,r.UA,r.BP,r.Z_,r.b$,r.vj,r.Py,r.xh,r.n9,r.VU,r.zP,r.Qp],styles:[".withdrawal-amount-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.withdrawal-amount-footer__total[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);justify-content:space-between}.withdrawal-amount-footer__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"]})}}(0,f.Cg)([U.PE,(0,f.Sn)("design:type",Function),(0,f.Sn)("design:paramtypes",[Object]),(0,f.Sn)("design:returntype",void 0)],q.prototype,"checkBalanceRub",null);const yi=["content"];function bi(e,a){if(1&e&&(t.nrm(0,"gamma-input-maskito",9),t.nI1(1,"transloco")),2&e){const n=t.XpG(2);t.Y8G("maskitoOptions",n.numberMaskOptions)("label",t.bMT(1,2,"connect.requisites.kpp"))}}function vi(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",1),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.onAddAccount())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header")(3,"gamma-typo-300"),t.EFF(4),t.nI1(5,"transloco"),t.k0s()(),t.j41(6,"section")(7,"div",2),t.nrm(8,"gamma-input",3),t.nI1(9,"transloco"),t.k0s(),t.j41(10,"div",2),t.nrm(11,"gamma-input",4),t.nI1(12,"transloco"),t.k0s(),t.j41(13,"div",2),t.nrm(14,"gamma-input-maskito",5),t.nI1(15,"transloco"),t.k0s(),t.j41(16,"div",2),t.nrm(17,"gamma-input",6),t.nI1(18,"transloco"),t.k0s(),t.j41(19,"div",2),t.nrm(20,"gamma-input-maskito",7),t.nI1(21,"transloco"),t.k0s(),t.j41(22,"div",8),t.DNE(23,bi,2,4,"gamma-input-maskito",9),t.nrm(24,"gamma-input-maskito",10),t.nI1(25,"transloco"),t.k0s()(),t.j41(26,"gamma-dialog-footer")(27,"div",11)(28,"gamma-button",12),t.EFF(29),t.nI1(30,"transloco"),t.k0s()()()()()}if(2&e){const n=t.XpG();t.Y8G("formGroup",n.form),t.R7$(4),t.SpI(" ",t.bMT(5,15,n.title())," "),t.R7$(4),t.Y8G("label",t.bMT(9,17,"funds.add.account.dialog.name")),t.R7$(3),t.Y8G("readonly",!0)("label",t.bMT(12,19,"dashboard.counterparty.dialog.input.inn")),t.R7$(3),t.Y8G("maskitoOptions",n.numberMaskOptions)("label",t.bMT(15,21,"funds.add.current.account")),t.R7$(3),t.Y8G("label",t.bMT(18,23,"funds.add.account.dialog.bank")),t.R7$(3),t.Y8G("maskitoOptions",n.numberMaskOptions)("label",t.bMT(21,25,"funds.add.account.dialog.correspondent")),t.R7$(3),t.vxM(n.form.get("kpp")?23:-1),t.R7$(),t.Y8G("maskitoOptions",n.numberMaskOptions)("label",t.bMT(25,27,"funds.add.account.dialog.bik")),t.R7$(4),t.Y8G("disabled",n.form.invali
1d||n.loading()),t.R7$(),t.SpI(" ",t.bMT(30,29,"common.save")," ")}}let pt=(()=>{class e{constructor(){this.route=(0,t.WQX)(x.nX),this.dialogsService=(0,t.WQX)(L.wX),this.accountsFacade=(0,t.WQX)(bt),this.formErrorService=(0,t.WQX)(rt._),this.alertService=(0,t.WQX)(r.Nx),this.translocoService=(0,t.WQX)(g.JO),this.store=(0,t.WQX)(D.t),this.content=t.ebz.required("content"),this.account=(0,t.vPA)(null),this.numberMaskOptions={mask:/^[0-9]+$/},this.form=new c.gE({name:new c.MJ("",[c.k0.required]),bankAccountNumber:new c.MJ("",[c.k0.required,c.k0.minLength(20),c.k0.maxLength(20),e=>{if(!e.parent)return null;const a=e.value,n=e.parent.get("inn")?.value||e.parent.parent?.get("company.inn")?.value;if(!a||!n)return null;const o=/^\d{12}$/.test(n),i=/^\d{10}$/.test(n),s=/^40802\d{15}$/.test(a),_=/^40702\d{15}$/.test(a);return o&&!s?{invalidIPBankAccount:!0}:i&&!_?{invalidOOOBankAccount:!0}:null}]),corAccount:new c.MJ("",[c.k0.required,c.k0.minLength(20),c.k0.maxLength(20)]),inn:new c.MJ(""),bankName:new c.MJ("",[c.k0.required]),bankIdentificationCode:new c.MJ("",[c.k0.required,
1c.k0.minLength(9),c.k0.maxLength(9)]),kpp:new c.MJ("",[c.k0.required,c.k0.minLength(9),c.k0.maxLength(9)])}),this.loading=(0,t.vPA)(!1),this.innInfo=(0,gt.ot)(this.store.state("innInfo").select$(n=>n.info)),this.closeModal$=new B.B,this.title=(0,t.EWP)(()=>this.account()?"funds.edit.account.dialog.title":"funds.add.account.dialog.title"),this.isIndividualEntrepreneur=(0,t.EWP)(()=>this.innInfo()?.type===y.n.INDIVIDUAL)}updateKppValidators(){this.isIndividualEntrepreneur()&&this.form.get("kpp")&&this.form.removeControl("kpp"),!this.isIndividualEntrepreneur()&&!this.form.get("kpp")&&this.form.addControl("kpp",new c.MJ("",[c.k0.required,c.k0.minLength(9),c.k0.maxLength(9)])),this.form.updateValueAndValidity()}onAddAccount(){this.loading.set(!0);const{inn:n,...o}=this.form.value;(0,P.of)({}).pipe((0,I.n)(()=>{const i=this.account();return i?this.accountsFacade.editAccount(o,i.id):this.accountsFacade.addAccount(o)})).pipe((0,u.M)(()=>{this.hide(),this.getAccounts(),this.loading.set(!1)}),(0,X.W)(i=>(this.formErrorService.display(i,this.form),this.loading.set(!1),(0,V.$)(()=>i)))).subscribe()}show(n){n?(this.account.set(n),this.form.patchValue(n)):this.form.get("inn").setValue(this.innInfo()?.inn),this.updateKppValidators(),this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset(),this.account.set(null)}})}hide(){this.form.reset(),this.closeModal$.next()}getAccounts(){this.accountsFacade.getAccountsList().subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-add-current-account-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,yi,5),2&o&&t.NyB()},decls:2,vars:0,consts:[["content",""],[3,"submitEvent","formGroup"],[1,"mb-16"],["formControlName","name",3,"label"],["formControlName","inn",3,"readonly","label"],["formControlName","bankAccountNumber",3,"maskitoOptions","label"],["formControlName","bankName",3,"label"],["formControlName","corAccount",3,"maskitoOptions","label"],[1,"mb-16","account__mobile-column"],["formControlName","kpp",1,"account__field",3,"maskitoOptions","label"],["formControlName","bankIdentificationCode",1,"account__field",3,"maskitoOptions","label"],[1,"flex-reverse"],["type","submit",3,"disabled"]],template:function(o,i){1&o&&t.DNE(0,vi,31,31,"ng-template",null,0,t.C5r)},dependencies:[g.Kj,r.Qp,r.Z_,r.BP,r.UA,r.Py,r.Sj,r.Ch,r.xh,c.X1,c.BC,c.cb,c.j4,c.JD],styles:[".account__field[_ngcontent-%COMP%]{flex:1}.account__mobile-column[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:var(--spacer-16)}@media screen and (max-width: 767px){.account__mobile-column[_ngcontent-%COMP%]{flex-direction:column}}"],changeDetection:0})}}return e})();var Ti=l(6048);const xi=["content"];function Mi(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-form",1),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.onAddCard())}),t.j41(1,"gamma-dialog-layout")(2,"gamma-dialog-header")(3,"gamma-typo-300"),t.EFF(4),t.nI1(5,"transloco"),t.k0s()(),t.j41(6,"div",2)(7,"gamma-notification",3),t.nrm(8,"gamma-typo-50",4),t.nI1(9,"transloco"),t.k0s(),t.nrm(10,"gamma-typo-100",5),t.nI1(11,"transloco"),t.nrm(12,"gamma-input",6),t.nI1(13,"transloco"),t.k0s(),t.j41(14,"gamma-dialog-footer")(15,"div",7)(16,"gamma-button",8),t.EFF(17),t.nI1(18,"transloco"),t.k0s()()()()()}if(2&e){const n=t.XpG();t.Y8G("formGroup",n.form),t.R7$(4),t.JRh(t.bMT(5,9,"funds.cards.linkingCardDialog.title")),t.R7$(4),t.Y8G("strong",!0)("innerHTML",t.bMT(9,11,"funds.cards.linkingCardDialog.warning"),t.npT),t.R7$(2),t.Y8G("innerHTML",t.bMT(11,13,"funds.cards.linkingCardDialog.description"),t.npT),t.R7$(2),t.Y8G("label",t.bMT(13,15,"funds.cards.linkingCardDialog.field.numberTail")),t.R7$(4),t.Y8G("disabled",n.form.invalid||n.addCardLoading())("showLoader",n.addCardLoading()),t.R7$(),t.SpI(" ",t.bMT(18,17,"funds.cards.linkingCardDialog.action")," ")}}let Bt=(()=>{class e{constructor(){this.route=(0,t.WQX)(x.nX),this.dialogsService=(0,t.WQX)(L.wX),this.cardsFacade=(0,t.WQX)(vt),this.formErrorService=(0,t.WQX)(rt._),this.platformLocation=(0,t.WQX)(Ti.Vw),this.alertService=(0,t.WQX)(r.Nx),this.translocoService=(0,t.WQX)(g.JO),this.content=(0,t.ebz)("content"),this.addCardLoading=(0,t.vPA)(!1),this.form=new c.gE({cardNumberTail:new c.MJ("",[c.k0.required])}),this.closeModal$=new B.B}onAddCard(){this.addCardLoading.set(!0);const{cardNumberTail:n}=this.form.value,o=window.location.origin+this.platformLocation.pathname;this.cardsFacade.addCard({cardNumberTail:n,urls:{successUrl:o+`?${Pt.d.ADD_PAYOUT_CARD}=success`,declineUrl:o+`?${Pt.d.ADD_PAYOUT_CARD}=error`}}).pipe((0,u.M)(i=>{this.addCardLoading.set(!1),window.location.href=i}),(0,X.W)(i=>(this.addCardLoading.set(!1),409===i.status?(this.alertService.open(this.translocoService.translate("funds.cards.notification.conflict"),{appearance:"error"}).subscribe(),(0,P.of)()):(this.formErrorService.display(i,this.form),(0,V.$)(()=>i))))).subscribe()}
1show(){this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset()}})}hide(){this.form.reset(),this.closeModal$.next()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-linking-card-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,xi,5),2&o&&t.NyB()},decls:2,vars:0,consts:[["content",""],[3,"submitEvent","formGroup"],[1,"linking-card__content"],["status","warning"],["color","color-alert-text",3,"strong","innerHTML"],[3,"innerHTML"],["formControlName","cardNumberTail",3,"label"],[1,"linking-card__action"],["type","submit",3,"disabled","showLoader"]],template:function(o,i){1&o&&t.DNE(0,Mi,19,19,"ng-template",null,0,t.C5r)},dependencies:[r.UA,r.BP,r.Z_,r.vj,r.Qp,r.xh,r.Sj,r.zP,r.Py,r.b$,g.Kj,c.X1,c.BC,c.cb,c.j4,c.JD],styles:[".linking-card__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.linking-card__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0})}}return e})();const ki=["content"];function Ri(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.j41(5,"gamma-typo-100"),t.EFF(6),t.nI1(7,"transloco"),t.k0s(),t.j41(8,"gamma-dialog-footer")(9,"div",1)(10,"gamma-button",2),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.openLinkingCardDialog())}),t.EFF(11),t.nI1(12,"transloco"),t.k0s()()()()}2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,3,"funds.cards.linkingCardNotificationDialog.title")," "),t.R7$(3),t.SpI(" ",t.bMT(7,5,"funds.cards.linkingCardNotificationDialog.description")," "),t.R7$(5),t.SpI(" ",t.bMT(12,7,"funds.cards.linkingCardNotificationDialog.action")," "))}let _t=(()=>{class e{constructor(){this.dialogsService=(0,t.WQX)(L.wX),this.content=(0,t.ebz)("content"),this.linkingCardDialogComponent=(0,t.ebz)(Bt),this.closeModal$=new B.B}openLinkingCardDialog(){this.hide(),setTimeout(()=>{this.linkingCardDialogComponent().show()})}show(){this.dialogsService.open(this.content(),{appearance:"mobile-small"}).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-linking-card-notification-dialog"]],viewQuery:function(o,i){1&o&&(t.wEZ(i.content,ki,5),t.wEZ(i.linkingCardDialogComponent,Bt,5)),2&o&&t.NyB(2)},decls:3,vars:0,consts:[["content",""],[1,"linking-card-notification__action"],[3,"click"]],template:function(o,i){1&o&&(t.DNE(0,Ri,13,9,"ng-template",null,0,t.C5r),t.nrm(2,"app-linking-card-dialog"))},dependencies:[r.UA,r.BP,r.Z_,r.vj,r.Qp,g.Kj,Bt,r.Py],styles:[".linking-card-notification__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0})}}return e})();const wi=(e,a)=>a.label;function $i(e,a){if(1&e&&(t.j41(0,"div",6)(1,"gamma-typo-100",7),t.EFF(2),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"gamma-typo-100",8),t.EFF(5),t.k0s()()),2&e){const n=t.XpG().$implicit;t.R7$(2),t.SpI("",t.bMT(3,2,n.label),":"),t.R7$(3),t.SpI(" ",n.value," ")}}function Ii(e,a){1&e&&t.DNE(0,$i,6,4,"div",6),2&e&&t.vxM(a.$implicit.value?0:-1)}function Di(e,a){1&e&&t.nrm(0,"gamma-svg",9)}function Ai(e,a){1&e&&t.nrm(0,"gamma-svg",10)}let Fi=(()=>{class e{constructor(){this.store=(0,t.WQX)(D.t),this.translocoService=(0,t.WQX)(g.JO),this.account=(0,t.hFB)(void 0),this.deleteAction=(0,t.CGW)(),this.editAccount=(0,t.CGW)(),this.innInfo=(0,gt.ot)(this.store.state("innInfo").select$(n=>n.info)),this.accountInfo=(0,t.EWP)(()=>{const n=this.account(),o=this.getDenomination(this.innInfo());return[{label:"funds.add.current.account",value:n.bankAccountNumber},{label:"funds.add.account.dialog.bank.name",value:n.bankName},{label:"funds.add.account.dialog.correspondent",value:n.corAccount},{label:"connect.requisites.kpp",value:n.kpp},{label:"funds.add.account.dialog.bik",value:n.bankIdentificationCode},{label:"funds.add.account.dialog.denomination",value:o},{label:"dashboard.counterparty.dialog.input.inn",value:n.inn}]})}onShowPromptDeleteAccount(n){this.deleteAction.emit(n)}onEdinAccount(n){this.editAccount.emit(n)}getDenomination(n){return n?n.type===y.n.INDIVIDUAL?`${this.translocoService.translate("dashboard.counterparty.dialog.type.ip")} ${n.surname} ${n.name}${n.patronymic?" "+n.patronymic:""}`:n.organizationName:""}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-linked-accounts-list-item"]],inputs:{account:[1,"account"]},outputs:{deleteAction:"deleteAction",editAccount:"editAccount"},decls:11,vars:7,consts:[["iconEdit",""],["iconDelete",""],[3,"title","borders","noPadding"],["body","",1,"linked-accounts__accordion-item"],[1,"linked-accounts__action"],[3,"click","appearance","icon"],[1,"accordion-item__row"],["color","grey-500"],["color","grey-800",1,"text-right"],["src","gamma::icon-small-edit",1,"linked-accounts__icon"],["src","gamma::icon-small-trashbin",1,"linked-accounts__icon"]],template:function(o,i){if(1&o){const s=t.RV6();t.j41(0,"gamma-accordion",2)(1,"div",3),t.Z7z(2,Ii,1,1,null,null,wi),t.j41(4,"div",4)(5,"gamma-button",5),t.bIt("click",function(){return t.eBV(s),t.Njj(i.onEdinAccount(i.account()))}),t.k0s(),t.j41(6,"gamma-button",5),t.bIt("click",function(){return t.eBV(s),t.Njj(i.onShowPromptDeleteAccount(i.account()))}),t.k0s()()()(),t.DNE(7,Di,1,0,"ng-template",null,0,t.C5r)(9,Ai,1,0,"ng-template",null,1,t.C5r)}if(2&o){const s=t.sdS(8),_=t.sdS(10);t.Y8G("title",i.account().name)("borders",null)("noPadding",!0),t.R7$(2),t.Dyx(i.accountInfo()),t.R7$(3),t.Y8G("appearance","ghost-button")("icon",s),t.R7$(),t.Y8G("appearance","ghost-button")("icon",_)}},dependencies:[g.Kj,r.Mj,r.Qp,r.dx,r.vj],styles:[".accordion-item__row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:var(--spacer-4);gap:var(--spacer-16)}.accordion-item__row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.linked-accounts__action[_ngcontent-%COMP%]{margin-top:var(--spacer-8);display:flex;flex-direction:row;align-items:center;justify-content:flex-end;
1gap:var(--spacer-8)}.linked-accounts__action[_ngcontent-%COMP%] gamma-button[_ngcontent-%COMP%]{width:auto}.linked-accounts__icon[_ngcontent-%COMP%]{--app-icon-color: var(--grey-500)}"],changeDetection:0})}}return e})();const Si=["content"];function Ei(e,a){if(1&e){const n=t.RV6();t.j41(0,"div",2)(1,"app-linked-accounts-list-item",3),t.bIt("deleteAction",function(i){t.eBV(n);const s=t.XpG(3);return t.Njj(s.onShowPromptDeleteAccount(i))})("editAccount",function(i){t.eBV(n);const s=t.XpG(3);return t.Njj(s.onEdinAccount(i))}),t.k0s()()}if(2&e){const n=a.$implicit;t.R7$(),t.Y8G("account",n)}}function Pi(e,a){1&e&&(t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.j41(5,"div",1),t.Z7z(6,Ei,2,1,"div",2,t.fX1),t.k0s()()),2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"funds.cards.linkedAccountDialog.title")," "),t.R7$(3),t.Dyx(a))}function ji(e,a){if(1&e&&(t.DNE(0,Pi,8,3,"gamma-dialog-layout"),t.nI1(1,"async")),2&e){let n;const o=t.XpG();t.vxM((n=t.bMT(1,1,o.accounts$))?0:-1,n)}}let Ot=(()=>{class e{constructor(){this.dialogsService=(0,t.WQX)(L.wX),this.store=(0,t.WQX)(D.t),this.MAX_ACCOUNT_COUNT=10,this.content=(0,t.ebz)("content"),this.linkingCardNotificationDialogComponent=(0,t.ebz)(_t),this.addCurrentAccountDialog=(0,t.ebz)(pt),this.deleteAction=(0,t.CGW)(),this.stateAccounts=this.store.state("accounts"),this.accounts$=this.stateAccounts.select$(n=>n.rows),this.closeModal$=new B.B}show(){this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}onShowPromptDeleteAccount(n){this.deleteAction.emit(n)}onEdinAccount(n){this.addCurrentAccountDialog().show(n)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-linked-accounts-list-dialog"]],viewQuery:function(o,i){1&o&&(t.wEZ(i.content,Si,5),t.wEZ(i.linkingCardNotificationDialogComponent,_t,5),t.wEZ(i.addCurrentAccountDialog,pt,5)),2&o&&t.NyB(3)},outputs:{deleteAction:"deleteAction"},decls:3,vars:0,consts:[["content",""],[1,"linked-accounts__list"],[1,"linked-accounts__item"],[3,"deleteAction","editAccount","account"]],template:function(o,i){1&o&&(t.DNE(0,ji,2,3,"ng-template",null,0,t.C5r),t.nrm(2,"app-add-current-account-dialog"))},dependencies:[g.Kj,A.Jj,Fi,pt,r.BP,r.UA,r.Py],styles:[".linked-accounts__list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.linked-accounts__item[_ngcontent-%COMP%]{padding-bottom:var(--spacer-12);margin-bottom:var(--spacer-4);border-bottom:1px solid var(--grey-200)}.linked-accounts__item[_ngcontent-%COMP%]:last-child{border-bottom:none;margin-bottom:0}"],changeDetection:0})}}return e})();var Nt=l(6039);let Gi=(()=>{class e{constructor(){this.innInfo=(0,t.hFB)(void 0),this.dashboardSelectCounterpartyTypeDialog=(0,t.ebz)(Nt.A)}openVerification(){this.dashboardSelectCounterpartyTypeDialog().show()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-verification-partner-empty"]],viewQuery:function(o,i){1&o&&t.wEZ(i.dashboardSelectCounterpartyTypeDialog,Nt.A,5),2&o&&t.NyB()},inputs:{innInfo:[1,"innInfo"]},decls:11,vars:8,consts:[[1,"container-empty"],[1,"verify-icon"],["src","gamma::icon-medium-bank"],["color","grey-500",1,"verify-text",3,"block"],["type","button","appearance","ghost-button",3,"click"],[3,"innInfo"]],template:function(o,i){1&o&&(t.j41(0,"div",0)(1,"div",1),t.nrm(2,"gamma-svg",2),t.k0s(),t.j41(3,"div")(4,"gamma-typo-50",3),t.EFF(5),t.nI1(6,"transloco"),t.k0s(),t.j41(7,"gamma-button",4),t.bIt("click",function(){return i.openVerification()}),t.EFF(8),t.nI1(9,"transloco"),t.k0s()()(),t.nrm(10,"app-dashboard-select-counterparty-dialog",5)),2&o&&(t.R
17$(4),t.Y8G("block",!0),t.R7$(),t.SpI(" ",t.bMT(6,4,"funds.verification.accountBank.empty")," "),t.R7$(3),t.SpI(" ",t.bMT(9,6,"funds.verification.accountBank.empty.btn")," "),t.R7$(2),t.Y8G("innInfo",i.innInfo()))},dependencies:[g.Kj,Nt.A,r.Qp,r.dx,r.b$],styles:[".container-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;text-align:center;gap:var(--spacer-16);padding:var(--spacer-8)}.verify-icon[_ngcontent-%COMP%]{--app-icon-color: var(--grey-500);display:flex;justify-content:center;align-items:center;width:40px;height:40px;border-radius:var(--border-radius-300);background:var(--opacity-grey-60)}.verify-text[_ngcontent-%COMP%]{width:240px}"],changeDetection:0})}}return e})();function Bi(e,a){if(1&e&&(t.j41(0,"gamma-typo-50",3),t.EFF(1),t.k0s()),2&e){const n=t.XpG(3);t.Y8G("color","grey-500"),t.R7$(),t.E5c(" 1 ",n.balance().formatName," = ",n.balance().rate," ",n.balance().currency," ")}}function Oi(e,a){1&e&&t.nrm(0,"app-unsigned-reports-notification")}function Ni(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-button",14),t.nI1(1,"async"),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3),s=t.XpG();return t.Njj(s.withdrawalOfFunds(i))}),t.EFF(2),t.nI1(3,"transloco"),t.k0s()}if(2&e){const n=t.XpG(3),o=t.XpG();t.Y8G("disabled",0===n.length||t.bMT(1,2,o.disabledPayout$)),t.R7$(2),t.SpI(" ",t.bMT(3,4,"funds.title.action.withdrawalOfFunds")," ")}}function Li(e,a){if(1&e&&(t.j41(0,"div"),t.nI1(1,"async"),t.DNE(2,Oi,1,0,"app-unsigned-reports-notification"),t.nI1(3,"async"),t.DNE(4,Ni,4,6,"gamma-button",13),t.nI1(5,"async"),t.k0s()),2&e){const n=t.XpG(3);t.AVh("hidden",t.bMT(1,4,n.checkSignLoading$)),t.R7$(2),t.vxM(t.bMT(3,6,n.hasUnsignedReports$)?2:-1),t.R7$(2),t.vxM(!1===t.bMT(5,8,n.hasUnsignedReports$)?4:-1)}}function Xi(e,a){1&e&&(t.j41(0,"div",6)(1,"gamma-notification",15)(2,"gamma-typo-50",16),t.EFF(3),t.nI1(4,"transloco"),t.k0s()()()),2&e&&(t.R7$(),t.Y8G("size","s"),t.R7$(),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(4,3,"common.verification.profile")," "))}function Wi(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-method-receiving-funds-cell",17),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.showLinkedAccounts())}),t.k0s()}if(2&e){const n=t.XpG(2),o=t.XpG();t.Y8G("type",o.EMethodReceivingFunds.ACCOUNT_BANK)("accountBankTitle",n[0].name)("accountBankNumber",n[0].bankAccountNumber)}}function Yi(e,a){if(1&e&&t.nrm(0,"app-verification-partner-empty",10),2&e){const n=t.XpG();t.Y8G("innInfo",n)}}function Vi(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-method-receiving-funds-empty",18),t.nI1(1,"transloco"),t.nI1(2,"transloco"),t.bIt("addAction",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.addAccountDialog())}),t.k0s()}2&e&&t.Y8G("imgSrc","/assets/images/funds/empty-file-small.png")("description",t.bMT(1,3,"funds.receiving.accountBank.empty"))("actionText",t.bMT(2,5,"funds.receiving.accountBank.add"))}function Ui(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-funds-balance-wrapper",2),t.DNE(1,Bi,2,4,"gamma-typo-50",3),t.j41(2,"div",4),t.DNE(3,Li,6,10,"div",5)(4,Xi,5,5,"div",6),t.k0s(),t.j41(5,"app-method-receiving-funds-wrapper",7),t.nI1(6,"transloco"),t.nI1(7,"async"),t.bIt("addAction",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.addAccountDialog())})("countClick",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showLinkedAccounts())}),t.DNE(8,Wi,1,3,"app-method-receiving-funds-cell",8),t.j41(9,"div",9),t.DNE(10,Yi,1,1,"app-verification-partner-empty",10)(11,Vi,3,7,"app-method-receiving-funds-empty",11),t.k0s()()(),t.nrm(12,"app-add-current-account-dialog"),t.j41(13,"app-linked-accounts-list-dialog",12),t.bIt("deleteAction",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.onShowPromptDeleteAccount(i))}),t.k0s()}if(2&e){let n;const o=a,i=t.XpG(),s=t.XpG();t.Y8G("currency",s.balance().formatName)("amount",s.balance().amount)("horizontalView",1===s.profile().balances.length),t.R7$(),t.vxM(s.balance().rate>1?1:-1),t.R7$(2),t.vxM(o.status===s.EInnStatus.SET?3:-1),t.R7$(),t.vxM(o.status===s.EInnStatus.NOT_SET?4:-1),t.R7$(),t.Y8G("title",t.bMT(6,11,"funds.receiving.accountBank"))("totalCount",i.length)("showLoader",t.bMT(7,13,s.accountsLoading$)),t.R7$(3),t.vxM(i.length>0?8:-1),t.R7$(2),t.vxM((n=o.status)===s.EInnStatus.NOT_SET?10:11)}}function Qi(e,a){if(1&e&&(t.DNE(0,Ui,14,15),t.nI1(1,"async")),2&e){let n;const o=t.XpG();t.vxM((n=t.bMT(1,1,o.innInfo$))?0:-1,n)}}let Hi=(()=>{class e{constructor(){this.store=(0,t.WQX)(D.t),this.accountsFacade=(0,t.WQX)(bt),this.storageService=(0,t.WQX)(et.n),this.EMethodReceivingFunds=z,this.EInnStatus=y.F,this.addCurrentAccountDialog=(0,t.ebz)(pt),this.notificationDialog=(0,t.ebz)(r.jr),this.linkedAccountsListDialog=(0,t.ebz)(Ot),this.payoutWithdrawalAmountDialogComponent=(0,t.ebz)(q),this.balance=t.hFB.required(),this.profile=(0,t.hFB)(void 0),this.accounts$=this.store.state("accounts").select$(n=>n.rows),this.accountsLoading$=this.store.state("accounts").select$(n=>n.loading),this.innInfo$=this.store.state("innInfo").select$(n=>n.info),this.disabledPayout$=this.store.state("payoutInfo").select$(n=>n.info).pipe((0,yt.T)(n=>!n||!n.rubPayoutAvailable)),this.checkSignLoading$=this.store.state("agentReports").select$(n=>n.checkSignLoading),this.hasUnsignedReports$=this.store.state("agentReports").select$(n=>n.hasUnsigned)}addAccountDialog(){this.addCurrentAccountDialog().show()}showLinkedAccounts(){this.linkedAccountsListDialog().show()}onShowPromptDeleteAccount(n){this.deletedAccountId=n.id,this.notificationDialog().show()}onDeleteAccount(){this.notificationDialog().hide(),this.accountsFacade.deleteAccount(this.deletedAccountId).pipe((0,h.j)(()=>{0===this.store.state("accounts").select(o=>o.rows).length&&this.linkedAccountsListDialog().hide(),this.deletedAccountId=null})).subscribe()}withdrawalOfFunds(n){n.length&&this.payoutWithdrawalAmountDialogComponent().show()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-balance-with-account-bank"]],viewQuery:function(o,i){1&o&&(t.wEZ(i.addCurrentAccountDialog,pt,5),t.wEZ(i.notificationDialog,r.jr,5),t.wEZ(i.linkedAccountsListDialog,Ot,5),t.wEZ(i.payoutWithdrawalAmountDialogComponent,q,5)),2&o&&t.NyB(4)},inputs:{balance:[1,"balance"],profile:[1,"profile"]},decls:8,vars:18,consts:[["actionButtonAppearance","destructive-button",3,"actionOutput","title","text","cancelButtonText","actionButtonText"],[3,"type","payoutCurrency","maxBalance"],[3,"currency","amount","horizontalView"],["rate","",3,"color"],["action",""],[3,"hidden"],[1,"flex"],[3,"addAction","countClick","title","totalCount","showLoader"],[3,"type","accountBankTitle","accountBankNumber"],["empty-section",""],[3,"innInfo"],[3,"imgSrc","description","actionText"],[3,"deleteAction"],[3,"disabled"],[3,"click","disabled"],["status","warning",3,"size"],["color","color-alert-text",1,"text-nowrap",3,"strong"],[3,"click","type","accountBankTitle","accountBankNumber"],[3,"addAction","imgSrc","description","actionText"]],template:function(o,i){if(1&o&&(t.DNE(0,Qi,2,3),t.nI1(1,"async"),t.j41(2,"gamma-notification-dialog",0),t.nI1(3,"transloco"),t.nI1(4,"transloco"),t.nI1(5,"transloco"),t.nI1(6,"transloco"),t.bIt("actionOutput",function(){return i.onDeleteAccount()}),t.k0s(),t.nrm(7,"app-payout-withdrawal-amount-dialog",1)),2&o){let s;t.vxM((s=t.bMT(1,8,i.accounts$))?0:-1,s),t.R7$(2),t.Y8G("title",t.bMT(3,10,"funds.linkedAccount.notificationDialog.title"))("text",t.bMT(4,12,"funds.linkedAccount.notificationDialog.text"))("cancelButtonText",t.bMT(5,14,"common.button.cancel"))("actionButtonText",t.bMT(6,16,"dashboard.linkedPaymentCard.notificationDialog.actionButtonText")),t.R7$(5),t.Y8G("type",i.EMethodReceivingFunds.ACCOUNT_BANK)("payoutCurrency",i.balance().formatName)("maxBalance",i.balance().amount)}},dependencies:[A.Jj,g.Kj,c.X1,r.jr,Kt,tn,Zt,qt,Ot,q,r.Qp,r.zP,r.b$,Gi,Jt,pt],styles:["[_nghost-%COMP%]{flex:1}"],changeDetection:0})}}return e})();var zi=l(7643),Ji=l(9370);const Ki=["content"];function Zi(e,a){1&e&&(t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.j41(5,"gamma-notification",1),t.nrm(6,"gamma-typo-100",2),t.nI1(7,"transloco"),t.k0s()()),2&e&&(t.R7$(3),t.SpI(" ",t.bMT(4,2,"funds.withdrawal.payoutWithdrawalDialog.title")," "),t.R7$(3),t.Y8G("innerHTML",t.bMT(7,4,"funds.payout.unavailable"),t.npT))}function qi(e,a){1&e&&t.nrm(0,"gamma-loader",10),2&e&&t.Y8G("loader",!0)}function tr(e,a){if(1&e&&(t.j41(0,"div")(1,"div",20)(2,"gamma-typo-100"),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100"),t.EFF(6),t.nI1(7,"appNumberFormat"),t.nI1(8,"gammaCurrency"),t.k0s()(),t.j41(9,"div",20)(10,"gamma-typo-100"),t.EFF(11),t.nI1(12,"transloco"),t.k0s(),t.j41(13,"gamma-typo-100"),t.EFF(14),t.nI1(15,"appNumberFormat"),t.nI1(16,"gammaCurrency"),t.k0s()(),t.j41(17,"div",21)(18,"gamma-typo-300"),t.EFF(19),t.nI1(20,"transloco"),t.k0s(),t.j41(21,"gamma-typo-300"),t.EFF(22),t.nI1(23,"appNumberFormat"),t.nI1(24,"gammaCurrency"),t.k0s()()()),2&e){const n=t.XpG(3);t.R7$(3),t.SpI(" ",t.bMT(4,9,"funds.withdrawal.payoutWithdrawalDialog.amount")," "),t.R7$(3),t.Lme(" ",t.bMT(7,11,n.form.value.amount)," ",t.bMT(8,13,n.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(12,15,"funds.withdrawal.payoutWithdrawalDialog.commission")," "),t.R7$(3),t.Lme(" ",t.bMT(15,17,a.commission)," ",t.bMT(16,19,n.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(20,21,"common.payment.total")," "),t.R7$(3),t.Lme(" ",t.bMT(23,23,n.totalAmount)," ",t.bMT(24,25,n.payoutCurrency())," ")}}function nr(e,a){if(1&e&&(t.j41(0,"div")(1,"div",20)(2,"gamma-typo-100"),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.j41(5,"gamma-typo-100"),t.EFF(6),t.nI1(7,"appNumberFormat"),t.nI1(8,"gammaCurrency"),t.k0s()(),t.j41(9,"div",20)(10,"gamma-typo-100"),t.EFF(11),t.nI1(12,"transloco"),t.k0s(),t.j41(13,"gamma-typo-100"),t.EFF(14),t.nI1(15,"appNumberFormat"),t.nI1(16,"gammaCurrency"),t.k0s()(),t.j41(17,"div",21)(18,"gamma-typo-300"),t.EFF(19),t.nI1(20,"transloco"),t.k0s(),t.j41(21,"gamma-typo-300"),t.EFF(22),t.nI1(23,"appNumberFormat"),t.nI1(24,"gammaCurrency"),t.k0s()()()),2&e){const n=t.XpG(3);t.R7$(3),t.SpI(" ",t.bMT(4,9,"funds.withdrawal.payoutWithdrawalDialog.amount")," "),t.R7$(3),t.Lme(" ",t.bMT(7,11,n.form.value.amount)," ",t.bMT(8,13,n.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(12,15,"funds.withdrawal.payoutWithdrawalDialog.commission")," "),t.R7$(3),t.Lme(" ",t.bMT(15,17,a.commission)," ",t.bMT(16,19,n.payoutCurrency())," "),t.R7$(5),t.SpI(" ",t.bMT(20,21,"common.payment.total")," "),t.R7$(3),t.Lme(" ",t.bMT(23,23,n.totalAmount)," ",t.bMT(24,25,n.payoutCurrency())," ")}}function er(e,a){if(1&e){const n=t.RV6();t.j41(0,"div")(1,"gamma-form",3),t.bIt("submitEvent",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.onNext())}),t.j41(2,"gamma-dialog-layout")(3,"gamma-dialog-header")(4,"gamma-typo-300"),t.EFF(5),t.nI1(6,"transloco"),t.k0s()(),t.j41(7,"section",4),t.nrm(8,"gamma-input-number",5),t.nI1(9,"transloco"),t.nI1(10,"gammaCurrency"),t.nI1(11,"gammaCurrency"),t.j41(12,"div",6),t.nrm(13,"gamma-input-maskito",7),t.nI1(14,"transloco"),t.nrm(15,"gamma-input-maskito",8),t.nI1(16,"transloco"),t.k0s(),t.j41(17,"gamma-input",9),t.nI1(18,"transloco"),t.bIt("focusedChange",function(i){t.eBV(n);const s=t.XpG(2);return t.Njj(s.translite(i))}),t.k0s()(),t.DNE(19,qi,1,1,"gamma-loader",10),t.j41(20,"gamma-notification",11),t.nrm(21,"gamma-typo-100",12),t.nI1(22,"transloco"),t.k0s(),t.j41(23,"gamma-dialog-footer")(24,"div",13),t.DNE(25,tr,25,27,"div"),t.j41(26,"div",14)(27,"gamma-button",15),t.EFF(28),t.nI1(29,"transloco"),t.k0s()()()()()()(),t.j41(30,"div")(31,"gamma-dialog-layout")(32,"gamma-dialog-header")(33,"gamma-typo-300"),t.EFF(34),t.nI1(35,"transloco"),t.k0s()(),t.j41(36,"section",16)(37,"div",17)(38,"gamma-typo-100"),t.EFF(39),t.nI1(40,"transloco"),t.k0s(),t.j41(41,"gamma-typo-100",18),t.EFF(42),t.k0s()(),t.j41(43,"div",17)(44,"gamma-typo-100"),t.EFF(45),t.nI1(46,"transloco"),t.k0s(),t.j41(47,"gamma-typo-100",18),t.EFF(48),t.k0s()(),t.j41(49,"div",17)(50,"gamma-typo-100"),t.EFF(51),t.nI1(52,"transloco"),t.k0s(),t.j41(53,"gamma-typo-100",18),t.EFF(54),t.k0s()()(),t.j41(55,"gamma-dialog-footer")(56,"div",13),t.DNE(57,nr,25,27,"div"),t.j41(58,"div",14)(59,"gamma-button",19),t.bIt("click",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.onWithdraw())}),t.EFF(60),t.nI1(61,"transloco"),t.k0s()()()()()()}if(2&e){let n,o;const i=t.XpG(2);t.AVh("hidden","form"!==i.step()),t.R7$(),t.Y8G("formGroup",i.form),t.R7$(4),t.SpI(" ",t.bMT(6,34,"funds.withdrawal.payoutWithdrawalDialog.title")," "),t.R7$(3),t.Y8G("label",t.bMT(9,36,"funds.withdrawal.payoutWithdrawalDialog.field.amount"))("postfix",t.bMT(10,38,i.payoutCurrency()))("placeholder",t.bMT(11,40,i.payoutCurrency())),t.R7$(5),t.Y8G("label",t.bMT(14,42,"funds.withdrawal.directCard.field.pan"))("maskitoOptions",i.cardMaskOptions),t.R7$(2),t.Y8G("label",t.bMT(16,44,"funds.withdrawal.directCard.field.expiry"))("maskitoOptions",i.expiryMaskOptions),t.R7$(2),t.Y8G("label",t.bMT(18,46,"funds.withdrawal.directCard.field.holder")),t.R7$(2),t.vxM(i.loading()?19:-1),t.R7$(2),t.Y8G("innerHTML",t.bMT(22,48,"funds.withdrawal.directCard.disclaimer"),t.npT),t.R7$(4),t.vxM((n=!i.loading()&&i.commissionInfo())?25:-1,n),t.R7$(2),t.Y8G("disabled",i.form.invali
1d||i.loading()||!i.commissionInfo())("showLoader",i.loading()),t.R7$(),t.SpI(" ",t.bMT(29,50,"funds.withdrawal.directCard.action.next")," "),t.R7$(2),t.AVh("hidden","confirm"!==i.step()),t.R7$(4),t.SpI(" ",t.bMT(35,52,"funds.withdrawal.payoutWithdrawalDialog.title")," "),t.R7$(5),t.SpI(" ",t.bMT(40,54,"funds.withdrawal.directCard.field.pan")," "),t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",i.cleanPan," "),t.R7$(3),t.SpI(" ",t.bMT(46,56,"funds.withdrawal.directCard.field.expiry")," "),t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",i.form.value.expiry," "),t.R7$(3),t.SpI(" ",t.bMT(52,58,"funds.withdrawal.directCard.field.holder")," "),t.R7$(2),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",i.form.value.holder," "),t.R7$(3),t.vxM((o=!i.loading()&&i.commissionInfo())?57:-1,o),t.R7$(2),t.Y8G("disabled",i.submitLoading())("showLoader",i.submitLoading()),t.R7$(),t.SpI(" ",t.bMT(61,60,"funds.withdrawal.payoutWithdrawalDialog.action")," ")}}function or(e,a){if(1&e&&t.DNE(0,Zi,8,6,"gamma-dialog-layout")(1,er,62,62),2&e){const n=t.XpG();t.vxM(n.isPayoutUnavailable()?0:1)}}const ir=e=>{const a=e.value??"";if(!a)return null;const n=/^(\d{2})\/(\d{2})$/.exec(a);if(!n)return{cardExpiry:!0};const o=Number(n[1]);return o>=1&&o<=12?null:{cardExpiry:!0}};let Lt=(()=>{class e{constructor(){this.payoutFacade=(0,t.WQX)($),this.profileFacade=(0,t.WQX)(ut.E),this.dialogsService=(0,t.WQX)(L.wX),this.alertService=(0,t.WQX)(r.Nx),this.translocoService=(0,t.WQX)(g.JO),this.formErrorService=(0,t.WQX)(rt._),this.payoutCurrency=(0,t.hFB)(void 0),this.maxBalance=(0,t.hFB)(void 0),this.content=(0,t.ebz)("content"),this.step=(0,t.vPA)("form"),this.loading=(0,t.vPA)(!1),this.submitLoading=(0,t.vPA)(!1),this.isPayoutUnavailable=(0,t.vPA)(!1),this.commissionInfo=(0,t.vPA)(null),this.baseAmountValidators=[c.k0.required,
1c.k0.min(1)],this.form=new c.gE({amount:new c.MJ(null,[c.k0.required,c.k0.min(1)]),pan:new c.MJ("",[c.k0.required,c.k0.pattern(/^\d{4}\s\d{4}\s\d{4}\s\d{4}$/)]),expiry:new c.MJ("",[c.k0.required,ir]),holder:new c.MJ("",[c.k0.required,c.k0.minLength(2),c.k0.maxLength(50)])}),this.cardMaskOptions={mask:[/\d/,/\d/,/\d/,/\d/," ",/\d/,/\d/,/\d/,/\d/," ",/\d/,/\d/,/\d/,/\d/," ",/\d/,/\d/,/\d/,/\d/]},this.expiryMaskOptions={mask:[/\d/,/\d/,"/",/\d/,/\d/]},this.closeModal$=new B.B,this.destroy$=new B.B}show(){this.step.set("form"),this.commissionInfo.set(null);const n=this.payoutFacade.select(o=>o.info);this.isPayoutUnavailable.set(!1===n?.payoutAllowedForCountry),n?.maxAmount&&this.form.controls.amount.setValidators([...this.baseAmountValidators,c.k0.max(n.maxAmount)]),this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe({complete:()=>{this.form.reset(),this.commissionInfo.set(null),this.step.set("form"),this.destroy$.next()}}),this.form.controls.amount.valueChanges.pipe((0,nn.B)(600),(0,en.F)(),(0,u.M)(o=>{o||this.commissionInfo.set(null)}),(0,Ct.p)(o=>!!o),(0,u.M)(()=>{this.loading.set(!0)}),(0,I.n)(o=>this.payoutFacade.getPayoutInfo({amount:o}).pipe((0,X.W)(()=>(this.commissionInfo.set(null),this.loading.set(!1),[])))),(0,u.M)(o=>{if(this.commissionInfo.set(o),o){const i=Math.round(100*(this.maxBalance()-o.commission))/100,s=[...this.baseAmountValidators,on(i,this.translocoService.translate("funds.withdrawal.payoutWithdrawalDialog.error.maxBalance"))];o.maxAmount&&s.push(c.k0.max(o.maxAmount)),this.form.controls.amount.setValidators(s),this.form.controls.amount.updateValueAndValidity({emitEvent:!1})}this.loading.set(!1)}),(0,G.Q)(this.destroy$)).subscribe()}hide(){this.closeModal$.next()}onNext(){this.step.set("confirm")}onWithdraw(){if(this.submitLoading())return;const{amount:n,pan:o,holder:i,expiry:s}=this.form.value,[_,S]=s.split("/").map(Number);this.submitLoading.set(!0),this.payoutFacade.postDirectCardPayout({pan:o.replace(/\s/g,""),holder:i,amount:n,month:_,year:2e3+S}).pipe((0,u.M)(()=>{this.hide(),this.profileFacade.getProfile().subscribe(),this.payoutFacade.getPayoutInfo({amount:null}).subscribe(),this.alertService.open(this.translocoService.translate("funds.withdrawal.payoutWithdrawalDialog.notification.success"),{appearance:"success"}).subscribe()}),(0,X.W)(E=>(this.step.set("form"),this.formErrorService.display(this.remapExpiryErrors(E),this.form),(0,V.$)(()=>E))),(0,h.j)(()=>{this.submitLoading.set(!1)})).subscribe()}remapExpiryErrors(n){const o=n.error,i=o?.errors;if(!i?.length)return n;const s=new Set,_=i.reduce((S,E)=>{const Y="month"===E.field||"year"===E.field?"expiry":E.field,at=`${Y}|${E.message}`;return s.has(at)||(s.add(at),S.push({...E,field:Y})),S},[]);return new zi.yz({status:n.status,error:{...o,errors:_}})}translite(n){if(n)return;const o=this.form.controls.holder,i=o.value?.trim()??"";o.setValue(i&&(0,Ji.F)(i).toUpperCase())}get totalAmount(){return Math.round(100*((this.form.value.amount||0)+(this.commissionInfo()?.commission||0)))/100}get cleanPan(){return this.form.value.pan||""}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-payout-direct-card-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,Ki,5),2&o&&t.NyB()},inputs:{payoutCurrency:[1,"payoutCurrency"],maxBalance:[1,"maxBalance"]},decls:2,vars:0,consts:[["content",""],["status","warning"],["color","color-alert-text",3,"innerHTML"],[3,"submitEvent","formGroup"],[1,"direct-card__fields"],["formControlName","amount",3,"label","postfix","placeholder"],[1,"direct-card__row","mt-16"],["formControlName","pan",1,"direct-card__row-pan",3,"label","maskitoOptions"],["formControlName","expiry",1,"direct-card__row-expiry",3,"label","maskitoOptions"],["formControlName","holder",1,"mt-16",3,"focusedChange","label"],[1,"col-12","lg:col-10",3,"loader"],["status","error",1,"direct-card__disclaimer"],["color","color-danger-text",3,"innerHTML"],[1,"direct-card-footer"],[1,"direct-card-footer__action"],["type","submit",3,"disabled","showLoader"],[1,"direct-card__confirm"],[1,"direct-card__confirm-row"],[3,"strong"],[3,"click","disabled","showLoader"],[1,"direct-card-footer__total","mb-8"],[1,"direct-card-footer__total"]],template:function(o,i){1&o&&t.DNE(0,or,2,1,"ng-template",null,0,t.C5r)},dependencies:[g.Kj,c.X1,c.BC,c.cb,c.j4,c.JD,K.K,r.BU,r.UA,r.BP,r.Z_,r.vj,r.Py,r.xh,r.n9,r.Sj,r.Ch,r.VU,r.zP,r.Qp],styles:[".direct-card__fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:var(--spacer-16)}.direct-card__row[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16)}.direct-card__row-pan[_ngcontent-%COMP%]{flex:2 1 0;min-width:0}.direct-card__row-expiry[_ngcontent-%COMP%]{flex:1 1 0;min-width:0}.direct-card__confirm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-24)}.direct-card__confirm-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.direct-card-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-16)}.direct-card-footer__total[_ngcontent-%COMP%]{display:flex;gap:var(--spacer-16);justify-content:space-between}.direct-card-footer__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.direct-card__disclaimer[_ngcontent-%COMP%]{margin-top:var(--spacer-16)}.hidden[_ngcontent-%COMP%]{display:none}@media screen and (max-width: 767px){.direct-card__row[_ngcontent-%COMP%]{flex-direction:column}.direct-card-footer__action[_ngcontent-%COMP%] gamma-button[_ngcontent-%COMP%]{display:block;width:100%}}"],changeDetection:0})}}return e})();const rr=["content"],sr=e=>({country:e});function cr(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.nrm(5,"gamma-typo-100",1),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.j41(8,"gamma-dialog-footer")(9,"div",2)(10,"gamma-button",3),t.bIt("click",function(){t.eBV(n);const i=t.XpG();return t.Njj(i.hide())}),t.EFF(11),t.nI1(12,"transloco"),t.k0s()()()()}if(2&e){const n=t.XpG();t.R7$(3),t.SpI(" ",t.bMT(4,3,"funds.payout.cardRestriction.title")," "),t.R7$(2),t.Y8G("innerHTML",t.i5U(7,7,"funds.payout.cardRestriction.text",t.eq3(12,sr,t.bMT(6,5,n.countryNameKey))),t.npT),t.R7$(6),t.SpI(" ",t.bMT(12,10,"licenses.implementThroughCurrentAccount.dialog.action")," ")}}let Xt=(()=>{class e{constructor(n){this.dialogsService=n,this.closeModal$=new B.B}show(n){this.countryNameKey=`funds.payout.cardRestriction.country.${n}`,this.dialogsService.open(this.content,{appearance:"mobile-small"}).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}static{this.\u0275fac=function(o){return new(o||e)(t.rXU(L.wX))}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-card-payout-restriction-dialog"]],viewQuery:function(o,i){if(1&o&&t.GBs(rr,5),2&o){let s;t.mGM(s=t.lsd())&&(i.content=s.first)}},decls:2,vars:0,consts:[["content",""],[3,"innerHTML"],[1,"card-payout-restriction__action"],[3,"click"]],template:function(o,i){1&o&&t.DNE(0,cr,13,14,"ng-template",null,0,t.C5r)},dependencies:[r.UA,r.BP,r.Z_,r.vj,r.Py,r.Qp,g.Kj],styles:[".card-payout-restriction__action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"]})}}return e})();const lr=["content"];function pr(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-svg",6),t.bIt("click",function(){t.eBV(n);const i=t.XpG().$implicit,s=t.XpG(2);
1return t.Njj(s.onShowPromptDeleteCard(i))}),t.k0s()}}function dr(e,a){1&e&&t.nrm(0,"gamma-loader",5),2&e&&t.Y8G("size","s")("loader",!0)}function mr(e,a){if(1&e&&(t.j41(0,"div",2)(1,"gamma-typo-100"),t.EFF(2),t.k0s(),t.j41(3,"div",3),t.DNE(4,pr,1,0,"gamma-svg",4)(5,dr,1,2,"gamma-loader",5),t.k0s()()),2&e){const n=a.$implicit,o=t.XpG(2);t.R7$(2),t.JRh(n.numberMasked),t.R7$(2),t.vxM(o.deletedCardId!==n.id?4:-1),t.R7$(),t.vxM(o.deletedCardId===n.id?5:-1)}}function ur(e,a){if(1&e&&(t.j41(0,"gamma-dialog-layout")(1,"gamma-dialog-header")(2,"gamma-typo-300"),t.EFF(3),t.nI1(4,"transloco"),t.k0s()(),t.j41(5,"div",1),t.Z7z(6,mr,6,3,"div",2,t.fX1),t.nI1(8,"async"),t.k0s()()),2&e){const n=t.XpG();t.R7$(3),t.SpI(" ",t.bMT(4,1,"funds.cards.linkedCardsDialog.title")," "),t.R7$(3),t.Dyx(t.bMT(8,3,n.cards$))}}let Wt=(()=>{class e{constructor(){this.dialogsService=(0,t.WQX)(L.wX),this.store=(0,t.WQX)(D.t),this.content=(0,t.ebz)("content"),this.deleteAction=(0,t.CGW)(),this.stateCards=this.store.state("cards"),this.cards$=this.stateCards.select$(n=>n.rows),this.closeModal$=new B.B}show(){this.dialogsService.open(this.content()).pipe((0,G.Q)(this.closeModal$)).subscribe()}hide(){this.closeModal$.next()}onShowPromptDeleteCard(n){this.deleteAction.emit(n)}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-linked-cards-list-dialog"]],viewQuery:function(o,i){1&o&&t.wEZ(i.content,lr,5),2&o&&t.NyB()},outputs:{deleteAction:"deleteAction"},decls:2,vars:0,consts:[["content",""],[1,"linked-cards__list"],[1,"linked-cards__item"],[1,"linked-cards__item__action"],["src","gamma::icon-small-trashbin",1,"linked-cards__item__icon"],[3,"size","loader"],["src","gamma::icon-small-trashbin",1,"linked-cards__item__icon",3,"click"]],template:function(o,i){1&o&&t.DNE(0,ur,9,5,"ng-template",null,0,t.C5r)},dependencies:[r.UA,r.BP,r.vj,g.Kj,A.Jj,r.VU,r.dx,r.Py],styles:[".linked-cards__list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.linked-cards__item[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:var(--spacer-16) var(--spacer-6);align-items:center;justify-content:space-between}.linked-cards__item[_ngcontent-%COMP%]:hover{background:#f2fcf2}.linked-cards__item__icon[_ngcontent-%COMP%]{cursor:pointer;--app-icon-color: var(--grey-500)}.linked-cards__item__action[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;align-items:center;justify-content:center}.linked-cards__item__footer-action[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}"],changeDetection:0})}}return e})();function _r(e,a){if(1&e&&(t.j41(0,"gamma-typo-50",5),t.EFF(1),t.k0s()),2&e){const n=t.XpG(2);t.Y8G("color","grey-500"),t.R7$(),t.E5c(" 1 ",n.balance().formatName," = ",n.balance().rate," ",n.balance().currency," ")}}function gr(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-button",10),t.nI1(1,"async"),t.nI1(2,"async"),t.bIt("click",function(){t.eBV(n);const i=t.XpG(),s=t.XpG();return t.Njj(s.withdrawalOfFunds(i))}),t.EFF(3),t.nI1(4,"transloco"),t.k0s()}if(2&e){const n=t.XpG(),o=t.XpG();t.Y8G("disabled",!t.bMT(1,2,o.directCardAvailable$)&&0===n.length||t.bMT(2,4,o.disabledPayout$)),t.R7$(3),t.SpI(" ",t.bMT(4,6,"funds.title.action.withdrawalOfFunds")," ")}}function fr(e,a){1&e&&(t.j41(0,"gamma-notification",8)(1,"gamma-typo-50",11),t.EFF(2),t.nI1(3,"transloco"),t.k0s()()),2&e&&(t.Y8G("size","s"),t.R7$(),t.Y8G("strong",!0),t.R7$(),t.SpI(" ",t.bMT(3,3,"funds.payout.warning.restriction")," "))}function hr(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-method-receiving-funds-cell",15),t.bIt("click",function(){t.eBV(n);const i=t.XpG(3);return t.Njj(i.showLinkedCards())}),t.k0s()}if(2&e){const n=t.XpG(2),o=t.XpG();t.Y8G("type",o.EMethodReceivingFunds.CARD)("cardNumber",n[0].numberTail)}}function Cr(e,a){if(1&e){const n=t.RV6();t.j41(0,"app-method-receiving-funds-wrapper",12),t.nI1(1,"transloco"),t.nI1(2,"async"),t.bIt("addAction",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showAddLinkCard())})("countClick",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showLinkedCards())}),t.DNE(3,hr,1,2,"app-method-receiving-funds-cell",13),t.j41(4,"app-method-receiving-funds-empty",14),t.nI1(5,"transloco"),t.nI1(6,"transloco"),t.bIt("addAction",function(){t.eBV(n);const i=t.XpG(2);return t.Njj(i.showAddLinkCard())}),t.k0s()()}if(2&e){const n=t.XpG(),o=t.XpG();t.Y8G("title",t.bMT(1,7,"funds.receiving.card"))("totalCount",n.length)("showLoader",t.bMT(2,9,o.cardsLoading$)),t.R7$(3),t.vxM(n.length>0?3:-1),t.R7$(),t.Y8G("imgSrc","/assets/images/funds/plastic-credit-card-small.png")("description",t.bMT(5,11,"funds.cards.emptyState.title"))("actionText",t.bMT(6,13,"funds.receiving.card.add"))}}function yr(e,a){if(1&e&&(t.j41(0,"app-funds-balance-wrapper",0),t.DNE(1,_r,2,4,"gamma-typo-50",5),t.j41(2,"div",6),t.DNE(3,gr,5,8,"gamma-button",7)(4,fr,4,5,"gamma-notification",8),t.k0s(),t.DNE(5,Cr,7,15,"app-method-receiving-funds-wrapper",9),t.nI1(6,"async"),t.k0s()),2&e){const n=t.XpG();t.Y8G("currency",n.balance().formatName)("amount",n.balance().amount)("horizontalView",1===n.profile().balances.length),t.R7$(),t.vxM(n.balance().rate>1?1:-1),t.R7$(2),t.vxM(n.showWithdrawal()&&n.balance().currency===n.EInternalCurrency.USD?3:-1),t.R7$(),t.vxM(n.balance().currency===n.EInternalCurrency.RUB?4:-1),t.R7$(),t.vxM(n.showWithdrawal()&&!t.bMT(6,7,n.directCardAvailable$)?5:-1)}}let br=(()=>{class e{constructor(){this.store=(0,t.WQX)(D.t),this.cardsFacade=(0,t.WQX)(vt),this.EMethodReceivingFunds=z,this.EInternalCurrency=H.oy,this.balance=t.hFB.required(),this.cardPayoutRe
1strictedCountries=["KZ","MD"],this.profile=(0,t.hFB)(void 0),this.showWithdrawal=(0,t.hFB)(void 0),this.linkedCardsListDialog=(0,t.ebz)(Wt),this.linkingCardNotificationDialogComponent=(0,t.ebz)(_t),this.notificationDialog=(0,t.ebz)(r.jr),this.payoutWithdrawalAmountDialogComponent=(0,t.ebz)(q),this.payoutDirectCardDialogComponent=(0,t.ebz)(Lt),this.cardPayoutRestrictionDialog=(0,t.ebz)(Xt),this.cards$=this.store.state("cards").select$(n=>n.rows),this.cardsLoading$=this.store.state("cards").select$(n=>n.loading),this.disabledPayout$=this.store.state("payoutInfo").select$(n=>n.info).pipe((0,yt.T)(n=>{if(!n)return!0;switch(this.balance().currency){case H.oy.RUB:return!n.rubPayoutAvailable;case H.oy.USD:return!n.usdPayoutAvailable;default:return!0}})),this.directCardAvailable$=this.store.state("payoutInfo").select$(n=>n.info).pipe((0,yt.T)(n=>!!n?.directCardAvailable)),this.deleteCardLoading=!1,this.tempDeleteCard=null}showLinkedCards(){this.linkedCardsListDialog().show()}showAddLinkCard(){this.linkingCardNotificationDialogComponent().show()}onShowPromptDeleteCard(n){this.tempDeleteCard=n,this.notificationDialog().show()}onDeleteCard(){this.deleteCardLoading=!0,this.notificationDialog().hide();const{id:n,numberTail:o}=this.tempDeleteCard;this.cardsFacade.deleteCard(n,o).pipe((0,h.j)(()=>{0===this.store.state("cards").select(s=>s.rows).length&&this.linkedCardsListDialog().hide(),this.tempDeleteCard=null,this.deleteCardLoading=!1})).subscribe()}withdrawalOfFunds(n){const o=this.profile()?.country;o&&this.cardPayoutRestrictedCountries.includes(o)?this.cardPayoutRestrictionDialog().show(o):this.store.state("payoutInfo").select(s=>s.info)?.directCardAvailable?this.payoutDirectCardDialogComponent().show():n.length&&this.payoutWithdrawalAmountDialogComponent().show()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-balance-with-card"]],viewQuery:function(o,i){1&o&&(t.wEZ(i.linkedCardsListDialog,Wt,5),t.wEZ(i.linkingCardNotificationDialogComponent,_t,5),t.wEZ(i.notificationDialog,r.jr,5),t.wEZ(i.payoutWithdrawalAmountDialogComponent,q,5),t.wEZ(i.payoutDirectCardDialogComponent,Lt,5),t.wEZ(i.cardPayoutRestrictionDialog,Xt,5)),2&o&&t.NyB(6)},inputs:{balance:[1,"balance"],profile:[1,"profile"],showWithdrawal:[1,"showWithdrawal"]},decls:12,vars:20,consts:[[3,"currency","amount","horizontalView"],[3,"deleteAction"],["actionButtonAppearance","destructive-button",3,"actionOutput","title","text","cancelButtonText","actionButtonText"],[3,"type","payoutCurrency","maxBalance"],[3,"payoutCurrency","maxBalance"],["rate","",3,"color"],["action",""],[3,"disabled"],["status","warning",3,"size"],[3,"title","totalCount","showLoader"],[3,"click","disabled"],["color","color-alert-text",3,"strong"],[3,"addAction","countClick","title","totalCount","showLoader"],[3,"type","cardNumber"],["empty-section","",3,"addAction","imgSrc","description","actionText"],[3,"click","type","cardNumber"]],template:function(o,i){if(1&o&&(t.DNE(0,yr,7,9,"app-funds-balance-wrapper",0),t.nI1(1,"async"),t.nrm(2,"app-linking-card-notification-dialog"),t.j41(3,"app-linked-cards-list-dialog",1),t.bIt("deleteAction",function(_){return i.onShowPromptDeleteCard(_)}),t.k0s(),t.j41(4,"gamma-notification-dialog",2),t.nI1(5,"transloco"),t.nI1(6,"transloco"),t.nI1(7,"transloco"),t.nI1(8,"transloco"),t.bIt("actionOutput",function(){return i.onDeleteCard()}),t.k0s(),t.nrm(9,"app-payout-withdrawal-amount-dialog",3)(10,"app-payout-direct-card-dialog",4)(11,"app-card-payout-restriction-dialog")),2&o){let s;t.vxM((s=t.bMT(1,10,i.cards$))?0:-1,s),t.R7$(4),t.Y8G("title",t.bMT(5,12,"dashboard.linkedPaymentCard.notificationDialog.title"))("text",t.bMT(6,14,"dashboard.linkedPaymentCard.notificationDialog.text"))("cancelButtonText",t.bMT(7,16,"common.button.cancel"))("actionButtonText",t.bMT(8,18,"dashboard.linkedPaymentCard.notificationDialog.actionButtonText")),t.R7$(5),t.Y8G("type",i.EMethodReceivingFunds.CARD)("payoutCurrency",i.balance().formatName)("maxBalance",i.balance().amount),t.R7$(),t.Y8G("payoutCurrency",i.balance().formatName)("maxBalance",i.balance().amount)}},dependencies:[g.Kj,A.Jj,Kt,tn,Zt,qt,_t,Wt,Xt,Lt,q,r.Qp,r.jr,r.zP,r.b$],styles:["[_nghost-%COMP%]{flex:1}"],changeDetection:0})}}return e})();function vr(e,a){if(1&e&&(t.j41(0,"div",0)(1,"div",1)(2,"gamma-typo-100",2),t.EFF(3),t.nI1(4,"transloco"),t.k0s(),t.nrm(5,"gamma-svg",3),t.nI1(6,"transloco"),t.k0s(),t.j41(7,"gamma-typo-100",4),t.EFF(8),t.nI1(9,"appNumberFormat"),t.nI1(10,"gammaCurrency"),t.k0s()()),2&e){const n=t.XpG();t.R7$(2),t.Y8G("color","grey-500"),t.R7$(),t.SpI(" ",t.bMT(4,11,"funds.potential.title")," "),t.R7$(2),t.Y8G("guiHint",t.bMT(6,13,"funds.potential.hint"))("guiHintAppearance","dar
1k")("guiHintDirection","right")("guiHintShowDelay",0),t.R7$(2),t.Y8G("color","grey-500")("strong",!0)("block",!0),t.R7$(),t.Lme(" ",t.bMT(9,15,n.profile().potentialBalance)," ",t.bMT(10,17,n.profile().currentCurrencyRepr)," ")}}let Tr=(()=>{class e{constructor(){this.profile=t.hFB.required()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-potential-balance"]],inputs:{profile:[1,"profile"]},decls:1,vars:1,consts:[[1,"funds-potential"],[1,"flex","justify-between"],[3,"color"],["src","gamma::icon-small-question",3,"guiHint","guiHintAppearance","guiHintDirection","guiHintShowDelay"],[3,"color","strong","block"]],template:function(o,i){1&o&&t.DNE(0,vr,11,19,"div",0),2&o&&t.vxM(i.profile()?0:-1)},dependencies:[g.Kj,c.X1,K.K,r.BU,r.vj,r.dx,r._X],styles:[".funds-potential[_ngcontent-%COMP%]{display:block;padding:var(--spacer-24);border-radius:var(--border-radius-300);background:var(--grey-200)}"],changeDetection:0})}}return e})();function xr(e,a){if(1&e&&t.nrm(0,"app-balance-with-account-bank",3),2&e){const n=t.XpG().$implicit,o=t.XpG();t.Y8G("profile",o.profile())("balance",n)}}function Mr(e,a){if(1&e&&t.nrm(0,"app-balance-with-card",4),2&e){const n=t.XpG().$implicit,o=t.XpG();t.Y8G("profile",o.profile())("balance",n)("showWithdrawal",!0)}}function kr(e,a){if(1&e&&t.DNE(0,xr,1,2,"app-balance-with-account-bank",3)(1,Mr,1,3,"app-balance-with-card",4),2&e){const n=a.$implicit,o=t.XpG();t.vxM(o.profile().bankAccountAvailable&&n.currency===o.EInternalCurrency.RUB?0:-1),t.R7$(),t.vxM(n.currency===o.EInternalCurrency.USD?1:-1)}}function Rr(e,a){if(1&e&&t.nrm(0,"app-agent-report-banner",2),2&e){const n=t.XpG();t.Y8G("profile",n.profile())}}let wr=(()=>{class e{constructor(){this.store=(0,t.WQX)(D.t),this.cardsFacade=(0,t.WQX)(vt),this.accountsFacade=(0,t.WQX)(bt),this.innFacade=(0,t.WQX)(J.y),this.callbackPaymentHookService=(0,t.WQX)(Pt.w),this.agentReportsFacade=(0,t.WQX)(j.F),this.destroyRef=(0,t.WQX)(t.abz),this.pusherEventsService=(0,t.WQX)(ga.W),this.EInternalCurrency=H.oy,this.profile=t.hFB.required(),this.reportsEnabled$=this.store.state("innInfo").select$(n=>n.info?.status===y.F.SET&&this.profile().bankAccountAvailable),this.hasUnsignedReports$=this.store.state("agentReports").select$(n=>n.hasUnsigned),this.totalIncome$=this.store.state("agentReports").select$(n=>n.totalIncome)}ngOnInit(){this.fetchCardsList(),this.fetchAccountBankList(),this.subscribeToPusherEvents()}subscribeToPusherEvents(){this.pusherEventsService.onUsdPayoutCardChanged.pipe((0,gt.pQ)(this.destroyRef)).subscribe(()=>{this.fetchCardsList()})}fetchCardsList(){this.profile().balances.find(o=>o.currency===H.oy.USD)&&this.cardsFacade.getCardsList().subscribe()}fetchAccountBankList(){this.profile().balances.find(o=>o.currency===H.oy.RUB)&&(0,k.p)([this.innFacade.getInnInfo(),this.accountsFacade.getAccountsList(),this.agentReportsFacade.getReportSignCheck()]).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-partner-balances"]],inputs:{profile:[1,"profile"]},decls:9,vars:10,consts:[[1,"funds-balances"],[1,"funds-info-extra","flex-dir-column","gap-5"],[3,"profile"],[3,"profile","balance"],[3,"profile","balance","showWithdrawal"]],template:function(o,i){1&o&&(t.j41(0,"div",0),t.Z7z(1,kr,2,2,null,null,t.fX1),t.k0s(),t.j41(3,"div",1),t.DNE(4,Rr,1,1,"app-agent-report-banner",2),t.nI1(5,"async"),t.nI1(6,"async"),t.nI1(7,"async"),t.nrm(8,"app-potential-balance",2),t.k0s()),2&o&&(t.R
17$(),t.Dyx(i.profile().balances),t.R7$(2),t.AVh("_small",i.profile().balances.length>1),t.R7$(),t.vxM(t.bMT(5,4,i.reportsEnabled$)||t.bMT(6,6,i.hasUnsignedReports$)||t.bMT(7,8,i.totalIncome$)>0?4:-1),t.R7$(4),t.Y8G("profile",i.profile()))},dependencies:[A.Jj,Hi,br,fa,Tr],styles:[".funds-balances[_ngcontent-%COMP%]{display:flex;flex:1;flex-direction:row;gap:var(--spacer-16)}.funds-info-extra[_ngcontent-%COMP%]{min-width:33.3%}.funds-info-extra._small[_ngcontent-%COMP%]{min-width:25%}@media screen and (max-width: 1023px){.funds-balances[_ngcontent-%COMP%]{flex-direction:column}.funds-info-extra[_ngcontent-%COMP%]{width:100%}}"],changeDetection:0})}}return e})();function $r(e,a){1&e&&t.eu8(0)}function Ir(e,a){if(1&e&&t.DNE(0,$r,1,0,"ng-container",6),2&e){t.XpG(2);const n=t.sdS(12);t.Y8G("ngTemplateOutlet",n)}}function Dr(e,a){if(1&e&&t.DNE(0,Ir,1,1,"ng-container"),2&e){const n=t.XpG();t.vxM(a!==n.EBreakpoint.DESKTOP_LARGE?0:-1)}}function Ar(e,a){1&e&&t.nrm(0,"app-unsigned-reports-notification")}function Fr(e,a){if(1&e){const n=t.RV6();t.j41(0,"gamma-button",9),t.bIt("click",function(){t.eBV(n);const i=t.XpG(4);return t.Njj(i.transferToPartner())}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}2&e&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"common.transfer")," "))}function Sr(e,a){if(1&e&&(t.DNE(0,Ar,1,0,"app-unsigned-reports-notification"),t.nI1(1,"async"),t.DNE(2,Fr,3,3,"gamma-button")),2&e){const n=t.XpG(3);t.vxM(t.bMT(1,1,n.hasUnsignedReports$)?0:2)}}function Er(e,a){if(1&e&&(t.j41(0,"div",7),t.DNE(1,Sr,3,3),t.nI1(2,"async"),t.k0s()),2&e){let n;const o=t.XpG(2);t.R7$(),t.vxM(null!=(n=t.bMT(2,1,o.payoutInfo$))&&n.transferAvailable?1:-1)}}function Pr(e,a){if(1&e&&(t.DNE(0,Er,3,3,"div",7),t.nI1(1,"async"),t.nrm(2,"app-transfer-to-partner-dialog",8),t.nI1(3,"async")),2&e){let n;const o=t.XpG();t.vxM((n=t.bMT(1,2,o.profile$))?0:-1,n),t.R7$(2),t.Y8G("payoutInfo",t.bMT(3,4,o.payoutInfo$))}}const Gr=[{path:v.AGENT_REPORTS_ROUTE,component:ve,canActivate:[T],data:{title:"agent.reports.title"}},{path:`${v.AGENT_REPORTS_ROUTE}/:reportId`,component:Te.y,canActivate:[T],data:{title:"agent.reports.title",modalType:"report"}},{path:"",component:(()=>{class e{constructor(){this.breakpoint$=(0,t.WQX)(p.$n),this.profileFacade=(0,t.WQX)(ut.E),this.payoutFacade=(0,t.WQX)($),this.store=(0,t.WQX)(D.t),this.EBreakpoint=M.r,this.transferSearchPartnerDialog=(0,t.ebz)(st),this.payoutInfo$=this.store.state("payoutInfo").select$(n=>n.info),this.profile$=this.store.state("profile").select$(n=>n.profile),this.hasUnsignedReports$=this.store.state("agentReports").select$(n=>n.hasUnsigned)}ngOnInit(){this.fetchPayoutInfo(),this.profileFacade.getProfile().subscribe()}transferToPartner(){this.transferSearchPartnerDialog().show()}fetchPayoutInfo(){this.payoutFacade.getPayoutInfo({amount:null}).subscribe()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=t.VBU({type:e,selectors:[["app-funds"]],viewQuery:function(o,i){1&o&&t.wEZ(i.transferSearchPartnerDialog,st,5),2&o&&t.NyB()},decls:13,vars:10,consts:[["actions",""],["header-section",""],[3,"title","templateActions"],["content-section","",1,"content-section"],[1,"funds-info-wrapper"],[1,"funds-info",3,"profile"],[4,"ngTemplateOutlet"],[1,"funds-title-actions"],[3,"payoutInfo"],[3,"click"]],template:function(o,i){if(1&o&&(t.j41(0,"app-page-layout")(1,"section",1),t.nrm(2,"app-page-header",2),t.nI1(3,"transloco"),t.k0s(),t.j41(4,"section",3)(5,"div",4),t.nrm(6,"app-partner-balances",5),t.nI1(7,"async"),t.DNE(8,Dr,1,1),t.nI1(9,"async"),t.k0s(),t.nrm(10,"app-client-tables"),t.k0s()(),t.DNE(11,Pr,4,6,"ng-template",null,0,t.C5r)),2&o){let s;const _=t.sdS(12);t.R7$(2),t.Y8G("title",t.bMT(3,4,"funds.title.main"))("templateActions",_),t.R7$(4),t.Y8G("profile",t.bMT(7,6,i.profile$)),t.R7$(2),t.vxM((s=t.bMT(9,8,i.breakpoint$))?8:-1,s)}},dependencies:[A.Jj,g.Kj,A.T3,c.X1,W.J,N.y,wr,ta,st,Jt,r.Qp],styles:["[_nghost-%COMP%]{width:100%;min-height:100vh}.funds-info-wrapper[_ngcontent-%COMP%]{width:100%}.funds-info[_ngcontent-%COMP%]{width:100%;display:flex;gap:var(--spacer-16)}.content-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer-48)}.funds-title-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:var(--spacer-10);justify-content:flex-end}@media screen and (max-width: 1023px){.funds-info[_ngcontent-%COMP%]{flex-direction:column}.funds-info-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;flex-direction:row;gap:var(--spacer-16)}.funds-title-actions[_ngcontent-%COMP%]{width:100%;flex-direction:column;padding:var(--spacer-8) 0}.content-section[_ngcontent-%COMP%]{gap:0}}"],changeDetection:0})}}return e})(),canActivate:[m.P],children:[{path:"",redirectTo:"operation",pathMatch:"full"},{path:"operation",component:lt,data:{title:"funds.title"}},{path:"waiting",component:ct,data:{title:"funds.title"}},{path:"history",component:it,data:{title:"funds.title"}}]}]},902:function(nt){nt.exports=function(){"use strict";var O={year:0,month:1,day:2,hour:3,minute:4,second:5},l={};return function(t,Q,I){var P,k=function(y,x,b){void 0===b&&(b={});var d=new Date(y);return function(C,R){void 0===R&&(R={});var w=R.timeZoneName||"short",$=C+"|"+w,F=l[$];return F||(F=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:w}),l[$]=F),F}(x,b).formatToParts(d)},u=function(y,x){for(var b=k(y,x),d=[],v=0;v<b.length;v+=1){var C=b[v],$=O[C.type];$>=0&&(d[$]=parseInt(C.value,10))}var F=d[3],p=+y;return(I.utc(d[0]+"-"+d[1]+"-"+d[2]+" "+(24===F?0:F)+":"+d[4]+":"+d[5]+":000").valueOf()-(p-=p%1e3))/6e4},j=Q.prototype;j.tz=function(y,x){void 0===y&&(y=P);
1var b,d=this.utcOffset(),v=this.toDate(),C=v.toLocaleString("en-US",{timeZone:y}),R=Math.round((v-new Date(C))/1e3/60),w=15*-Math.round(v.getTimezoneOffset()/15)-R;if(Number(w)){if(b=I(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(w,!0),x){var $=b.utcOffset();b=b.add(d-$,"minute")}}else b=this.utcOffset(0,x);return b.$x.$timezone=y,b},j.offsetName=function(y){var x=this.$x.$timezone||I.tz.guess(),b=k(this.valueOf(),x,{timeZoneName:y}).find(function(d){return"timezonename"===d.type.toLowerCase()});return b&&b.value};var J=j.startOf;j.startOf=function(y,x){if(!this.$x||!this.$x.$timezone)return J.call(this,y,x);var b=I(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return J.call(b,y,x).tz(this.$x.$timezone,!0)},I.tz=function(y,x,b){var d=b&&x,v=b||x||P,C=u(+I(),v);if("string"!=typeof y)return I(y).tz(v);var R=function(T,m,p){var r=T-60*m*1e3,h=u(r,p);if(m===h)return[r,m];var M=u(r-=60*(h-m)*1e3,p);return h===M?[r,h]:[T-60*Math.min(h,M)*1e3,Math.max(h,M)]}(I.utc(y,d).valueOf(),C,v),$=R[1],F=I(R[0]).utcOffset($);return F.$x.$timezone=v,F},I.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},I.tz.setDefault=function(y){P=y}}}()},1248:(nt,O,l)=>{"use strict";l.d(O,{V:()=>b});var t=l(7374),I=l(7543),k=l(902),j=l(5859),y=l(6952),x=l(1360);t.extend(j),t.extend(k),t.extend(I);let b=(()=>{class d{calculateTimeRemaining(C){const R=t().tz(t.tz.guess(),!0);let $=t(C).tz(t.tz.guess(),!0).diff(R);$<0&&($=0);const F=(0,y.Ds)($);return{days:F.days.toString(),hours:this.formatTimeUnit(F.hours),minutes:this.formatTimeUnit(F.minutes),seconds:this.formatTimeUnit(F.seconds),difference:$}}isExpirationDate(C,R){if(!C)return!0;const w=t().tz(t.tz.guess());return t.tz(C,t.tz.guess()).diff(w,"days")<=R}formatTimeUnit(C){return C<10?`0${C}`:`${C}`}calculateSignNextAttempt(C){const R=(0,y.Ds)(C);return{minutes:this.formatTimeUnit(R.minutes),seconds:this.formatTimeUnit(R.seconds)}}static{this.\u0275fac=function(R){return new(R||d)}}static{this.\u0275prov=x.jDH({token:d,factory:d.\u0275fac,providedIn:"root"})}}return d})()},5859:function(nt){nt.exports=function(){"use strict";var O="minute",l=/[+-]\d\d(?::?\d\d)?/g,t=/([+-]|\d\d)/g;return function(Q,I,P){var k=I.prototype;P.utc=function(d){return new I({date:d,utc:!0,args:arguments})},k.utc=function(d){var v=P(this.toDate(),{locale:this.$L,utc:!0});return d?v.add(this.utcOffset(),O):v},k.local=function(){return P(this.toDate(),{locale:this.$L,utc:!1})};var u=k.parse;k.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),u.call(this,d)};var j=k.init;k.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else j.call(this)};var J=k.utcOffset;k.utcOffset=function(d,v){var C=this.$utils().u;if(C(d))return this.$u?0:C(this.$offset)?J.call(this):this.$offset;if("string"==typeof d&&null===(d=function(F){void 0===F&&(F="");var T=F.match(l);if(!T)return null;var m=(""+T[0]).match(t)||["-",0,0],r=60*+m[1]+ +m[2];return 0===r?0:"+"===m[0]?r:-r}(d)))return this;var R=Math.abs(d)<=16?60*d:d,w=this;if(v)return w.$offset=R,w.$u=0===d,w;if(0!==d){var $=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(w=this.local().add(R+$,O)).$offset=R,w.$x.$localOffset=$}else w=this.utc();return w};var y=k.format;k.format=function(d){return y.call(this,d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":""))},k.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},k.isUTC=function(){return!!this.$u},k.toISOString=function(){return this.toDate().toISOString()},k.toString=function(){return this.toDate().toUTCString()};var x=k.toDate;k.toDate=function(d){return"s"===d&&this.$offset?P(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var b=k.diff;k.diff=function(d,v,C){if(d&&this.$u===d.$u)return b.call(this,d,v,C);var R=this.local(),w=P(d).local();return b.call(R,w,v,C)}}}()},7543:function(nt){nt.exports=function(){"use strict";var O,l,t=1e3,Q=6e4,I=36e5,P=864e5,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
1|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,j=2628e6,J=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,y={years:u,months:j,days:P,hours:I,minutes:Q,seconds:t,milliseconds:1,weeks:6048e5},x=function(T){return T instanceof $},b=function(T,m,p){return new $(T,p,m.$l)},d=function(T){return l.p(T)+"s"},v=function(T){return T<0},C=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},w=function(T,m){return T?v(T)?{negative:!0,format:""+R(T)+m}:{negative:!1,format:""+T+m}:{negative:!1,format:""}},$=function(){function T(p,r,h){var M=this;if(this.$d={},this.$l=h,void 0===p&&(this.$ms=0,this.parseFromMilliseconds()),r)return b(p*y[d(r)],this);if("number"==typeof p)return this.$ms=p,this.parseFromMilliseconds(),this;if("object"==typeof p)return Object.keys(p).forEach(function(D){M.$d[d(D)]=p[D]}),this.calMilliseconds(),this;if("string"==typeof p){var N=p.match(J);if(N){var W=N.slice(2).map(function(D){return null!=D?Number(D):0});return this.$d.years=W[0],this.$d.months=W[1],this.$d.weeks=W[2],this.$d.days=W[3],this.$d.hours=W[4],this.$d.minutes=W[5],this.$d.seconds=W[6],this.calMilliseconds(),this}}return this}var m=T.prototype;return m.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(r,h){return r+(p.$d[h]||0)*y[h]},0)},m.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=C(p/u),this.$d.months=C((p%=u)/j),this.$d.days=C((p%=j)/P),this.$d.hours=C((p%=P)/I),this.$d.minutes=C((p%=I)/Q),this.$d.seconds=C((p%=Q)/t),this.$d.milliseconds=p%=t},m.toISOString=function(){var p=w(this.$d.years,"Y"),r=w(this.$d.months,"M"),h=+this.$d.days||0;this.$d.weeks&&(h+=7*this.$d.weeks);var M=w(h,"D"),N=w(this.$d.hours,"H"),W=w(this.$d.minutes,"M"),D=this.$d.seconds||0;this.$d.milliseconds&&(D+=this.$d.milliseconds/1e3,D=Math.round(1e3*D)/1e3);var L=w(D,"S"),g=(p.negative||r.negative||M.negative||N.negative||W.negative||L.negative?"-":"")+"P"+p.format+r.format+M.format+(N.format||W.format||L.format?"T":"")+N.format+W.format+L.format;return"P"===g||"-P"===g?"P0D":g},m.toJSON=function(){return this.toISOString()},m.format=function(p){var r=p||"YYYY-MM-DDTHH:mm:ss",h={Y:this.$d.years,YY:l.s(this.$d.years,2,"0"),YYYY:l.s(this.$d.years,4,"0"),M:this.$d.months,MM:l.s(this.$d.months,2,"0"),D:this.$d.days,DD:l.s(this.$d.days,2,"0"),H:this.$d.hours,HH:l.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:l.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:l.s(this.$d.seconds,2,"0"),SSS:l.s(this.$d.milliseconds,3,"0")};return r.replace(k,function(M,N){return N||String(h[M])})},m.as=function(p){return this.$ms/y[d(p)]},m.get=function(p){var r=this.$ms,h=d(p);return"milliseconds"===h?r%=1e3:r="weeks"===h?C(r/y[h]):this.$d[h],r||0},m.add=function(p,r,h){var M;return M=r?p*y[d(r)]:x(p)?p.$ms:b(p,this).$ms,b(this.$ms+M*(h?-1:1),this)},m.subtract=function(p,r){return this.add(p,r,!0)},m.locale=function(p){var r=this.clone();return r.$l=p,r},m.clone=function(){return b(this.$ms,this)},m.humanize=function(p){return O().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},m.valueOf=function(){return this.asMilliseconds()},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},T}(),F=function(T,m,p){return T.add(m.years()*p,"y").add(m.months()*p,"M").add(m.days()*p,"d").add(m.hours()*p,"h").add(m.minutes()*p,"m").add(m.seconds()*p,"s").add(m.milliseconds()*p,"ms")};return function(T,m,p){O=p,l=p().$utils(),p.duration=function(M,N){var W=p.locale();return b(M,{$l:W},N)},p.isDuration=x;var r=m.prototype.add,h=m.prototype.subtract;m.prototype.add=function(M,N){return x(M)?F(this,M,1):r.bind(this)(M,N)},m.prototype.subtract=function(M,N){return x(M)?F(this,M,-1):h.bind(this)(M,N)}}}()},9370:(nt,O,l)=>{"use strict";l.d(O,{F:()=>Q});const t={\u0430:"a",\u0431:"b",\u0432:"v",\u0433:"g",\u0434:"d",\u0435:"e",\u0451:"e",\u0436:"zh",\u0437:"z",\u0438:"i",\u0439:"i",\u043a:"k",\u043b:"l",\u043c:"m",\u043d:"n",\u043e:"o",\u043f:"p",\u0440:"r",\u0441:"s",\u0442:"t",\u0443:"u",\u0444:"f",\u0445:"kh",\u0446:"tc",\u0447:"ch",\u0448:"sh",\u0449:"shch",\u044a:"",\u044b:"y",\u044c:"",\u044d:"e",\u044e:"iu",\u044f:"ya"},Q=function(I){return I.replace(/([\u0430-\u044f\u0451])/gi,function(P){const k=P.toLowerCase(),u=t[k];return typeof u>"u"?P:k===P?u:u.substring(0,1).toUpperCase()+u.substring(1)})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.