1import{aK as p,b5 as _,bF as d,aL as s,aM as n,bu as m,b3 as a,bh as h,co as u,a$ as c,b2 as C,b1 as y,bl as f,cg as b,bG as w,cb as k,b_ as Q,bA as S,bH as g,aO as M,b6 as T}from"./Bgs6eNSj.js";import{t as q}from"./ZuS3-68E.js";import{Q as I}from"./Chl7atzd.js";import{M as v}from"./B02RDZv0.js";import{A}from"./BemyJt8v.js";import"./BS3a-M1C.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b9d9b3e1-ab74-4644-a96d-8fafaf9b8111",e._sentryDebugIdIdentifier="sentry-dbid-b9d9b3e1-ab74-4644-a96d-8fafaf9b8111")}catch{}})();class B extends A{getLogName(){return"PaymentQrSocket"}async getClientKey(){return"payment-qr-result"}async handleMessage(t){if(this.onMessageCallbacks.length)for(const i of this.onMessageCallbacks)i(t)}}const D={name:"TabPaymentQr",mixins:[v],components:{GButton:_,QrcodeVue:I},data(){return{Side:q,ButtonView:T,checkingPayment:!1,obPaymentQrSocket:null,successPayment:!1,isPaymentFailed:{status:!1,text:""}}},computed:{...g(b,["qrId","qrUrl"]),...g(M,["getIsLoggedIn"]),isMobile(){return this.$screen.width<640}},methods:{...k(S,["closeModal"]),...k(Q,["completeOnline"]),onClickClose(){this.clearData(),this.closeModal()},onClickCheck(){this.checkingPayment=!0,this.checkPayment()},redirectAfterPayment(e){this.completeOnline(e)},async waitPayment(){this.obPaymentQrSocket&&this.obPaymentQrSocket.destroy(),this.obPaymentQrSocket=new B,w().public.debug&&console.log(`PAYMENT SOCKET OPEN ID ${this.qrId}`),await this.obPaymentQrSocket.setIdentifier(this.qrId),this.obPaymentQrSocket.addOnMessageCallback(t=>{t.success&&(this.closeModal(),this.successPayment=!0,this.redirectAfterPayment(t),this.obPaymentQrSocket.destroy())})},async checkPayment(){const{checkPaymentQr:e}=b(),t=await e();t&&t.success?(this.successPayment=!0,this.clearData(),this.redirectAfterPayment(t),this.checkingPayment=!1,this.closeModal()):(this.checkingPayment=!1,this.isPaymentFailed.status=!0),t&&!t.success&&(this.isPaymentFailed.text=t.error_message)},clearData(){this.qrId=null,this.qrUrl=null}},watch:{getQrUrl(e){e!==0&&this.waitPayment()}},mounted(){this.waitPayment(),this.isMobile&&this.getQrUrl&&window.open(this.getQrUrl,"_blank")},beforeUnmount(){this.obPaymentQrSocket&&this.obPaymentQrSocket.destroy(),this.successPayment||this.checkPayment(),this.clearData()}},V={key:0},E={key:0,class:"modal-qr__image skeleton-image"},N=["href"],U={class:"modal-qr__description"},F={key:2,class:"modal-qr__error"};function O(e,t,i,G,o,r){const P=d("QrcodeVue"),l=d("GButton");return s(),n("div",null,[(s(),m(u,{defer:"",to:e.teleportToTitle},[r.isMobile?h("",!0):(s(),n("span",V,a(e.$t("scanTheQrCodeThroughTheBankApp")),1))],8,["to"])),r.isMobile?(s(),n("a",{key:1,href:e.qrUrl,target:"_blank",class:"modal-qr__button modal-qr__button_go-payment"},a(e.$t("pay")),9,N)):(s(),n("div",E,[c(P,{value:e.qrUrl,size:180,background:"transparent",foreground:"var(--mono-900)","render-as":"svg"},null,8,["value"])])),C("p",U,a(e.$t("toEnsureThatThePaymentWasSuccessfulDoNotCloseTheWindowAheadOfTime")),1),o.isPaymentFailed.status?(s(),n("p",F,a(o.isPaymentFailed.text),1)):h("",!0),(s(),m(u,{defer:"",to:e.teleportToFooter},[c(l,{view:o.ButtonView.PRIMARY,loading:o.checkingPayment,class:"modal-qr__check-payment skeleton",onClick:r.onClickCheck},{default:y(()=>[f(a(e.$t("checkPayment")),1)]),_:1},8,["view","loading","onClick"]),c(l,{view:o.ButtonView.CLEAR,onClick:r.onClickClose},{default:y(()=>[f(a(e.$t("changePaymentType")),1)]),_:1},8,["view","onClick"])],8,["to"]))])}const Y=p(D,[["render",O],["__scopeId","data-v-ea76a57c"]]);export{Y as default};
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.