(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["505be1c8","2d0dacf8","2d0cbac7","068af89b"],{"07d4":function(t,e,n){},"4b58":function(t,e,n){"use strict";n("96cf");var a=n("c973"),i=n.n(a),o=(n("6762"),n("3156")),r=n.n(o),s=n("2f62");e["a"]={components:{TextCheckoutDiscountCoupon:function(){return n.e("1711605c").then(n.bind(null,"10c5"))}},computed:r()({},Object(s["c"])("authentication",["authenticationToken"])),methods:r()({},Object(s["b"])("ticketShoppingCart",["addCouponCode"]),Object(s["b"])("user",["logoutUser"]),{applyCoupon:function(t){var e=this,n=this.$t("alert.discount.success");this.addCouponCode({couponCode:t,token:this.authenticationToken}).then(function(){e.$emit("couponApplied",t),e.$q.notify({message:n,timeout:3e3,color:"positive",icon:"check_circle",position:"bottom"})}).catch(function(t){return e.toastError(t)})},isCouponMaxUsedErrorMessage:function(t){var e=["error.coupon.couponMaxUsed","error.coupon.couponMaxUsedByEvent","error.coupon.couponMaxUsedTicketUnavailable"];return e.includes(t)},clearCoupon:function(){var t=i()(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.dialogServerError(this.$t(e));case 2:this.logoutUser(),this.$router.go();case 4:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()})}},"609c":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("q-list",{staticClass:"q-mb-md",attrs:{"no-border":""}},t._l(t.instructions,function(e,a){return n("q-item",{key:a,staticClass:"q-pl-xl"},[n("q-item-main",[t._v(t._s(a+1+". "+e))])],1)}))},i=[];a._withStripped=!0;var o={name:"PaymentMethodInstructions",props:{instructions:{type:Array,required:!1,default:function(){return[]}},color:{type:String,default:"green-7"}}},r=o,s=n("2877"),c=Object(s["a"])(r,a,i,!1,null,null,null);c.options.__file="paymentMethodInstructions.vue";e["a"]=c.exports},"6cd9":function(t,e,n){"use strict";var a=n("e9fb");e["a"]={filters:{money:function(t,e,n){return Object(a["a"])(t,e,n)}}}},"93cf":function(t,e,n){"use strict";var a=n("3156"),i=n.n(a),o=n("2f62");e["a"]={components:{TextCheckoutDiscountCoupon:function(){return n.e("1711605c").then(n.bind(null,"10c5"))},TextCheckoutDiscountResume:function(){return n.e("2d0c8624").then(n.bind(null,"553a"))}},computed:i()({},Object(o["c"])("ticketShoppingCart",["cartDiscount","cartDiscountDetails"]))}},a0fb:function(t,e,n){"use strict";n("a481");var a=n("3156"),i=n.n(a),o=n("2f62"),r=n("6cd9"),s=n("93cf"),c=n("4b58"),u=n("57d5");e["a"]={components:{ModalStatusPaymentSuccess:function(){return Promise.all([n.e("2d0d2bce"),n.e("2d0b2b76"),n.e("732d318f")]).then(n.bind(null,"cdd6"))},ModalStatusPaymentError:function(){return Promise.all([n.e("2d0d2bce"),n.e("2d0b2b76"),n.e("82540552")]).then(n.bind(null,"21bc"))},ModalStatusPaymentWaitingValidation:function(){return Promise.all([n.e("2d0b2b76"),n.e("38a4d7bd")]).then(n.bind(null,"7146"))}},mixins:[r["a"],s["a"],c["a"]],props:{paymentResponse:{type:Object,required:!0},opened:{type:Boolean,required:!1,default:!1},statusModal:{type:Object,required:!0},isCurrent:{type:Boolean,required:!1,default:!1}},computed:i()({},Object(o["c"])("ticketShoppingCart",["cartFinalTotal","cartOrderCode","loading"]),Object(o["c"])("user",["orderBuyerInfo"]),{canDownloadPdf:function(){return!this.SET_IS.marketPlace||!this.SET_MARKETPLACE.behavior.systemOnly},routeParams:function(){return{orderCode:this.cartOrderCode,token:this.orderBuyerInfo.token,customer_code:this.orderBuyerInfo.customer_code}}}),methods:i()({},Object(o["b"])("ticketSale",["clearCoupon"]),{goToResume:function(){this.clearCoupon(),this.$router.replace({name:u["t"],params:this.routeParams,query:this.$route.query})},waitingValidationAction:function(){this.statusModal.data.waitingValidationAction&&"function"===typeof this.statusModal.data.waitingValidationAction&&this.statusModal.data.waitingValidationAction()}})}},a8a2:function(t,e,n){"use strict";var a=n("07d4"),i=n.n(a);i.a},cdc2:function(t,e,n){t.exports=n.p+"img/logo_pix_icon.d8702867.png"},de76:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("q-btn",{staticClass:"q-mx-md q-mb-md",attrs:{loading:t.isLoading,size:"md",color:"primary"},on:{click:t.checkPayment}},[t._v("\n  "+t._s(t.$t("button.alreadyPaid"))+"\n")])},i=[];a._withStripped=!0;n("6762"),n("2fdb"),n("96cf");var o=n("c973"),r=n.n(o),s=n("3156"),c=n.n(s),u=n("2f62"),l=n("f2e0"),d={name:"CheckPaymentButton",props:{code:{type:String,required:!0,default:null}},data:function(){return{isLoading:!1}},methods:c()({},Object(u["b"])("ticketShoppingCart",["checkAsyncPayment"]),{checkPayment:function(){var t=r()(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.$emit("stop-check-counter"),t.next=3,this.checkTransactionIsPaid();case 3:e=t.sent,e||(this.$emit("start-check-counter"),this.$q.notify({message:this.$t("alert.checkPaymentWaiting.message"),detail:this.$t("alert.checkPaymentWaiting.detail"),color:"warning",icon:"warning",timeout:5e3}));case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),checkTransactionIsPaid:function(){var t=r()(regeneratorRuntime.mark(function t(){var e,n;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,e=!1,t.prev=2,t.next=5,this.checkAsyncPayment(this.code);case 5:n=t.sent,n.payment_status===l["p"]&&(this.$emit("success"),e=!0),[l["q"],l["o"]].includes(n.payment_status)&&this.$emit("fail"),t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](2),this.$emit("fail");case 13:return this.isLoading=!1,t.abrupt("return",e);case 15:case"end":return t.stop()}},t,this,[[2,10]])}));return function(){return t.apply(this,arguments)}}()})},p=d,h=n("2877"),m=Object(h["a"])(p,a,i,!1,null,null,null);m.options.__file="checkPayment.vue";e["a"]=m.exports},ee5c:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"justify-start row"},[n("div",{staticClass:"col-md-6 col-sm-12 col-lg-6"},[n("pix-instructions",{attrs:{instructions:t.$q.platform.is.mobile?t.$t("text.payment.pixmobile.instructions"):t.$t("text.payment.pix.instructions")}})],1),n("div",{staticClass:"col-xs-12 col-sm-12 col-md-6 col-lg-6 xs-hide sm-hide"},[n("img",{staticStyle:{width:"300px"},attrs:{src:t.logo.description,alt:"pix"}})])]),n("div",{staticClass:"col-md-12 col-sm-12"},[n("div",{staticClass:"row justify-start"},[n("div",{staticClass:"col-md-6 col-sm-12 col-xs-12"},[n("text-checkout-discount-coupon",{attrs:{discount:t.cartDiscount},on:{couponApplied:t.applyCoupon}}),n("text-checkout-discount-resume",{attrs:{language:t.SET_LANGUAGE,currency:t.SET_MONEY,"discount-items":t.cartDiscountDetails,discount:t.cartDiscount,color:t.SET_COLOR.primary}}),n("q-field",{staticClass:"full-width",attrs:{"data-test":t.CypressTarget("Buttons")}},[n("q-btn",{directives:[{name:"track-click",rawName:"v-track-click:button",value:{category:"Pagamento",label:"Pix"},expression:"{category: 'Pagamento', label: 'Pix'}",arg:"button"}],staticClass:"full-width",attrs:{"data-test":t.CypressTarget("Pay"),color:t.SET_COLOR_BUTTON.primary,"text-color":t.SET_COLOR_BUTTON.text.primary,loading:t.loading,rounded:""},on:{click:function(e){!t.loading&&t.$emit("payment")}}},[t._v("\n            "+t._s(t.$t("button.pay"))+" - "+t._s(t._f("money")(t.cartFinalTotal,t.SET_LANGUAGE,t.SET_MONEY))+"\n          ")])],1)],1)])]),n("q-modal",{ref:"paymentModal",attrs:{"no-esc-dismiss":"","no-backdrop-dismiss":"",maximized:this.$q.platform.is.mobile},on:{show:t.startCheckCounter,hide:t.clear},model:{value:t.openModal,callback:function(e){t.openModal=e},expression:"openModal"}},[n("q-modal-layout",{attrs:{id:"modal-fixed-size","footer-class":"text-center","footer-style":{boxShadow:"none",paddingBottom:"10px"}}},[n("template",{slot:"header"},[n("q-toolbar",[n("q-toolbar-title",[t._v("\n            "+t._s(t.$t("dialog.payment.wallet.pix.title"))+"\n          ")]),n("q-btn",{attrs:{flat:"",dense:"",round:"",icon:"close"},on:{click:t.cancelPayment}})],1)],1),n("div",{staticClass:"row fit justify-center items-center content-center"},[t.showLoading?n("div",{staticClass:"col-12 text-center"},[n("p",{staticClass:"q-pt-md"},[t._v("\n            "+t._s(t.isShowTextVisible?t.$t("dialog.payment.wallet.pix.timeout"):t.$t("dialog.payment.wallet.pix.loading"))+"\n          ")]),n("div",{staticClass:"q-pa-md"},[t.isShowTextVisible?n("q-progress",{staticStyle:{height:"10px","border-radius":"50px"},attrs:{color:"red-10",animate:"",percentage:t.percentage}}):n("q-progress",{staticStyle:{height:"5px","border-radius":"50px"},attrs:{color:t.SET_COLOR.primary,animate:"",indeterminate:""}})],1)]):t._e(),t.isShowTextVisible?n("div",{staticClass:"col-12 text-center"},[t._v("\n          "+t._s(t.showText)+"\n        ")]):t._e(),n("div",{staticClass:"col-12 text-center"},[n("vue-qrious",{attrs:{value:t.pixData.qrCode,size:t.qrCodeSize}})],1),n("input",{staticStyle:{"margin-bottom":"20px",border:"none",outline:"none","text-align":"center"},attrs:{id:"codigoPix",readonly:""},domProps:{value:t.pixData.qrCode}})]),n("template",{slot:"footer"},[n("div",{staticClass:"q-px-md"},[n("check-payment-button",{attrs:{code:t.pixData.code},on:{"stop-check-counter":t.clearCheckCounter,"start-check-counter":t.startCheckCounter,success:t.checkPaymentSuccess,fail:t.checkPaymentFail}}),n("q-btn",{staticClass:"q-mx-md q-mb-md",attrs:{color:"green-14",size:"md"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.copyPixCode(e)}}},[t._v("\n            "+t._s(t.$t("dialog.payment.wallet.pix.button"))+"\n            "),n("q-tooltip",{attrs:{anchor:"top middle",delay:2e3}},[t._v("\n              Copiado!\n            ")])],1)],1)])],2)],1),t.statusModal.error&&t.isCurrent?n("modal-status-payment-error",{attrs:{title:t.$t("modal.checkout.status.errorPix.title"),message:t.$t("modal.checkout.status.errorPix.msg"),color:t.SET_COLOR.paymentStatus.danger},model:{value:t.statusModal.error,callback:function(e){t.$set(t.statusModal,"error",e)},expression:"statusModal.error"}},[n("q-btn",{directives:[{name:"track-click",rawName:"v-track-click:button",value:{category:"Pagamento",label:"Erro - Pix"},expression:"{category: 'Pagamento', label: 'Erro - Pix'}",arg:"button"},{name:"close-overlay",rawName:"v-close-overlay"}],attrs:{slot:"buttons","data-test":t.CypressTarget("Retry"),label:t.$t("button.tryAnotherPaymentMethod"),color:"red-10"},on:{click:function(e){t.$emit("try-again",e)}},slot:"buttons"})],1):t._e(),t.statusModal.success&&t.isCurrent?n("modal-status-payment-success",{attrs:{advertisement:t.advertisement,color:t.SET_COLOR.paymentStatus.success},model:{value:t.statusModal.success,callback:function(e){t.$set(t.statusModal,"success",e)},expression:"statusModal.success"}},[t.canDownloadPdf?n("q-btn",{directives:[{name:"track-click",rawName:"v-track-click:button",value:{category:"Navegação",label:"Pagamento -> Resumo da Compra"},expression:"{category: 'Navegação', label: 'Pagamento -> Resumo da Compra'}",arg:"button"}],attrs:{slot:"buttons","data-test":t.CypressTarget("GoNextScreen"),label:t.$t("button.viewPurchase"),color:"green-10",rounded:""},on:{click:t.goToResume},slot:"buttons"}):t._e()],1):t._e()],1)},i=[];a._withStripped=!0;n("6762"),n("2fdb"),n("6b54"),n("f576");var o=n("80fd"),r=n.n(o),s=(n("96cf"),n("c973")),c=n.n(s),u=n("3156"),l=n.n(u),d=n("f490"),p=n("2f62"),h=n("dcf9"),m=n.n(h),f=n("cdc2"),y=n.n(f),g=n("f2e0"),b=n("a0fb"),v=n("609c"),x=n("de76"),k=n("b296"),C={name:"PixPaymentMethod",components:{PixInstructions:v["a"],VueQrious:k["a"],CheckPaymentButton:x["a"]},mixins:[b["a"]],props:{pixData:{type:Object,required:!0},advertisement:{type:Object,required:!1,default:null}},data:function(){return{openModal:!1,showLoading:!1,intervalCheck:void 0,timerInterval:void 0,qrCodeSize:200,totalSeconds:0,showText:"",diffInSeconds:0,isDiffSetted:!1,isTimerSetted:!1}},computed:l()({},Object(p["c"])("ticketShoppingCart",["cartDiscount","cartDiscountDetails","getCartExpireIn"]),{logo:function(){return{top:m.a,description:y.a}},percentage:function(){var t=0===this.diffInSeconds?100:Math.ceil(100*(this.diffInSeconds/this.totalSeconds-1)*-1);return 100-t},isShowTextVisible:function(){return""!==this.showText}}),watch:{pixData:{handler:function(t){return t.start&&(this.openModal=!0,this.isTimerSetted||(this.timerInterval=window.setInterval(this.makeTimer,1e3),this.isTimerSetted=!0)),this.openModal=t.start,!0},deep:!0}},mounted:function(){this.isDiffSetted=!1},destroyed:function(){this.clear()},methods:l()({},Object(p["b"])("ticketShoppingCart",["checkOrderPayment","cancelWalletPayment"]),{getSecondsDiff:function(t,e){return d["d"].getDateDiff(e,t,"seconds")},startCheckCounter:function(){this.checkoutCheckerTimer()},clearCheckCounter:function(){window.clearInterval(this.intervalCheck),this.intervalCheck=void 0},checkoutCheckerTimer:function(){var t=c()(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:this.showLoading=!0,this.intervalCheck=window.setInterval(this.checkOrder,15e3);case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),checkPaymentSuccess:function(){this.$emit("success"),this.clear()},checkPaymentFail:function(){this.$emit("fail"),this.clear()},clear:function(){window.clearInterval(this.intervalCheck),window.clearInterval(this.timerInterval),this.intervalCheck=void 0,this.timerInterval=void 0,this.showLoading=!1,this.totalSeconds=0,this.diffInSeconds=0,this.isDiffSetted=!1,this.isTimerSetted=!1,this.showText="",this.$refs.paymentModal&&this.$refs.paymentModal.hide()},cancelPayment:function(){var t=c()(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.cancelWalletPayment(this.pixData.code);case 2:this.openModal=!1;case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),copyPixCode:function(){var t=document.querySelector("#codigoPix");t.setAttribute("type","text"),t.select(),t=document.execCommand("copy")},makeTimer:function(){if(!this.isDiffSetted){var t=300,e=30,n=this.getSecondsDiff(new Date,new Date(this.getCartExpireIn));this.diffInSeconds=n<t+e?n-e:t,this.totalSeconds=this.diffInSeconds,this.isDiffSetted=!0}this.diffInSeconds-=1,this.diffInSeconds<=0&&this.clear();var a=r()(this.diffInSeconds/60),i=this.diffInSeconds-60*a;this.showText="".concat(a.toString().padStart(2,"0"),":").concat(i.toString().padStart(2,"0"))},checkOrder:function(){var t=c()(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!this.pixData.code){t.next=14;break}return t.prev=1,t.next=4,this.checkOrderPayment(this.pixData.code);case 4:e=t.sent,e===g["p"]?(this.$emit("success"),this.clear()):[g["q"],g["o"]].includes(e)&&(this.$emit("fail"),this.clear()),t.next=12;break;case 8:t.prev=8,t.t0=t["catch"](1),this.$emit("fail"),this.clear();case 12:t.next=15;break;case 14:this.clear();case 15:case"end":return t.stop()}},t,this,[[1,8]])}));return function(){return t.apply(this,arguments)}}()})},w=C,S=(n("a8a2"),n("2877")),P=Object(S["a"])(w,a,i,!1,null,null,null);P.options.__file="Pix.vue";e["default"]=P.exports}}]);
//# sourceMappingURL=505be1c8.f0b99c44.2024-10-22T18:36:13.257Z.js.map