(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["2d2172ed"],{c648:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.hasBalance?a("q-collapsible",{staticClass:"q-pb-md q-pt-md",attrs:{label:t.collapsibleTitle,sublabel:t.collapsibleSublabel,group:"paymentMethods",icon:"far fa-wallet","collapse-icon":"expand_more",opened:!1},on:{show:function(e){t.$emit("show")}}},[a("q-card",{attrs:{flat:""}},[a("q-card-title",[a("b",[t._v(t._s(t.$t("text.payment.wallet.title")))])]),a("q-card-separator"),t.getUser.pinVerified?a("q-card-main",{staticClass:"q-pl-none q-pr-none"},[a("div",{staticClass:"row q-mb-lg"},[a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.cartAmount",{balance:t.paymentAmountFormatted}),expression:"$t(\n            'text.payment.wallet.history.cartAmount',\n            { balance: paymentAmountFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}),a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.taxAmount",{tax:t.convenienceFeeFormatted}),expression:"$t(\n            'text.payment.wallet.history.taxAmount',\n            { tax: convenienceFeeFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}),a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.yourBalance",{balance:t.walletBalanceFormatted}),expression:"$t(\n            'text.payment.wallet.history.yourBalance',\n            { balance: walletBalanceFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}),a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.bonusDiscount",{bonus:t.walletBonusFormatted}),expression:"$t(\n            'text.payment.wallet.history.bonusDiscount',\n            { bonus: walletBonusFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}),t.cartDeliveryFee>0?a("div",{staticClass:"col-12 q-pt-sm q-pb-sm"},[t._v("\n          "+t._s(t.$t("label.deliveryFee"))+" ("+t._s(t.$t("label.delivery.methods."+t.cartDeliveryMethod))+"): "),a("b",[t._v(t._s(t.formatMoney(t.cartDeliveryFee)))])]):t._e(),t.hasPixPayment||t.hasCreditCardPayment?t.hasCreditCardPayment?a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.creditCardAmount",{balance:t.creditCardAmountFormatted}),expression:"$t(\n            'text.payment.wallet.history.creditCardAmount',\n            { balance: creditCardAmountFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}):t.hasPixPayment?a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.pixAmount",{balance:t.pixAmountFormatted}),expression:"$t(\n            'text.payment.wallet.history.pixAmount',\n            { balance: pixAmountFormatted }\n          )"}],staticClass:"col-12 q-pt-sm q-pb-sm"}):t._e():a("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.$t("text.payment.wallet.history.balancePostBuy",{balance:t.availablePostBuy}),expression:"$t(\n            'text.payment.wallet.history.balancePostBuy',\n            { balance: availablePostBuy }\n          )"}],staticClass:"col-12 q-pt-sm"}),t.hasPixPayment||t.hasCreditCardPayment?t._e():a("div",{staticClass:"col-12",class:t.$q.platform.is.mobile?"q-pt-lg":"text-right"},[a("q-btn",{class:t.$q.platform.is.mobile?"full-width":"",attrs:{color:t.SET_COLOR_BUTTON.primary,loading:t.loading,icon:"fas fa-dollar-sign"},on:{click:function(e){t.$emit("payment")}}},[a("div",{staticClass:"q-pl-md"},[t._v("\n              "+t._s(t.$t("text.payment.wallet.history.useWalletBalance"))+"\n            ")])])],1)]),t.hasCreditCardPayment?a("credit-card-payment",{attrs:{"payment-response":t.paymentResponse,opened:!0,"status-modal":t.statusModal,"card-installments":t.cardInstallments,"is-microform":t.isMicroform,"is-current":t.isCurrent,advertisement:t.advertisement,"risk-management-configured":t.riskManagementConfigured},on:{"form-data":function(e){t.$emit("form-data",e)},"try-again":function(e){t.$emit("try-again",e)},payment:function(e){t.$emit("payment")}}}):t._e(),t.hasPixPayment?a("pix-payment",{attrs:{"payment-response":t.paymentResponse,opened:!0,"status-modal":t.statusModal,"pix-data":t.pixData,"is-current":t.isCurrent},on:{payment:function(e){t.$emit("payment")},success:function(e){t.$emit("pix-success")},fail:function(e){t.$emit("pix-error")}}}):t._e()],1):a("q-card-main",[a("q-alert",{attrs:{type:"positive",icon:"fal fa-usd-circle",actions:[{label:"Pagar com saldo",icon:"done",handler:t.togglePinModal}]}},[a("b",[t._v(t._s(t.$t("text.payment.wallet.history.youHaveFunds")))])]),a("pin-modal",{attrs:{"save-local":!1},on:{userLoggedIn:t.validPin,"close-dialog":t.togglePinModal},model:{value:t.openPinModal,callback:function(e){t.openPinModal=e},expression:"openPinModal"}})],1)],1)],1):t._e()},i=[];n._withStripped=!0;a("96cf");var r=a("c973"),l=a.n(r),s=(a("7514"),a("3156")),o=a.n(s),c=a("2f62"),m=a("e9fb"),u=a("f2e0"),d={name:"WalletPayment",components:{PinModal:function(){return Promise.all([a.e("vuelidate"),a.e("2d0ba4f6")]).then(a.bind(null,"3751"))},CreditCardPayment:function(){return Promise.all([a.e("2d0dacf8"),a.e("2d0cbac7"),a.e("068af89b"),a.e("2d23778f")]).then(a.bind(null,"faec"))},PixPayment:function(){return Promise.all([a.e("core-js"),a.e("babel"),a.e("qrious"),a.e("vue-qrious"),a.e("505be1c8")]).then(a.bind(null,"ee5c"))}},props:{paymentType:{type:String,required:!0},walletPaymentData:{type:Array,required:!0},statusModal:{type:Object,required:!0},isMicroform:{required:!0,type:Boolean},isCurrent:{required:!1,default:!1,type:Boolean},isThreeDsEnabled:{required:!1,default:!1,type:Boolean},pixData:{type:Object,required:!1,default:function(){return{}}},advertisement:{type:Object,required:!1,default:null},riskManagementConfigured:{type:Boolean,required:!1,default:!1}},data:function(){return{loading:!1,openPinModal:!1,paymentResponse:u["i"]}},computed:o()({},Object(c["c"])("authentication",["getUser","isLogged","userAuthenticationData"]),Object(c["c"])("wallet",["hasBalance","balance"]),Object(c["c"])("ticketShoppingCart",["cartConvenienceFee","cartDeliveryFee","cartTotal","walletPaymentChannel","cartDeliveryMethod"]),{collapsibleTitle:function(){switch(this.paymentType){case u["t"]:return this.$t("text.payment.wallet.history.useWalletPlusPix");case u["s"]:return this.$t("text.payment.wallet.history.useWalletPlusCredit");case u["r"]:return this.$t("text.payment.wallet.history.useWalletBalance");default:throw new Error("Payment not recognized")}},collapsibleSublabel:function(){var t=this.$t("text.payment.wallet.history.youHaveFunds");return this.paymentType===u["s"]&&this.isThreeDsEnabled&&!this.SET_IS_T4F&&(t+="<br/>".concat(this.$t("field.payment.creditCard.sublabelDetails"))),t},cardInstallments:function(){var t=this.walletPaymentData.find(function(t){return t.type===u["d"]})||null;return t&&t.installments?t.installments:[]},walletBalance:function(){return this.balance},walletBalanceFormatted:function(){return this.balance.toFixed(2)},walletBonusFormatted:function(){return parseFloat(this.getBonusAmount()).toFixed(2)},paymentAmountFormatted:function(){return(this.cartTotal-this.cartDeliveryFee).toFixed(2)},convenienceFeeFormatted:function(){return this.cartConvenienceFee.toFixed(2)},hasCreditCardPayment:function(){return void 0!==this.walletPaymentData.find(function(t){return t.type===u["d"]})},hasPixPayment:function(){return void 0!==this.walletPaymentData.find(function(t){return t.type===u["k"]})},availableBalance:function(){var t=this.cardInstallments.length>0&&this.cardInstallments[0].amount>0;return!t&&0===this.cartDeliveryFee},availablePostBuy:function(){return(this.balance-this.cartTotal).toFixed(2)},creditCardAmountFormatted:function(){return this.getCreditCardAmountFormatted().toFixed(2)},pixAmountFormatted:function(){var t=this.walletPaymentData.find(function(t){return t.type===u["k"]});return t.amount.toFixed(2)}}),beforeMount:function(){this.validPin()},methods:o()({},Object(c["b"])("authentication",["setPinVerified","authenticationToken"]),Object(c["b"])("wallet",["getWalletBalance"]),Object(c["b"])("user",["setUserToken","getUserData"]),{togglePinModal:function(){this.openPinModal=!this.openPinModal},validPin:function(){var t=l()(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:this.isLogged&&(this.setUserToken(this.userAuthenticationData.token),this.setPinVerified(!0),this.getWalletBalance()),this.getUserData().then(function(){e.togglePinModal()});case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),getBonusAmount:function(){var t=this.walletPaymentData.find(function(t){return t.type===u["r"]});return t.bonus},getCreditCardAmountFormatted:function(){return this.cardInstallments[0]&&this.cardInstallments[0].amount?this.cardInstallments[0].amount:0},formatMoney:function(t){return t>0?Object(m["a"])(t,this.SET_LANGUAGE,this.SET_MONEY):this.$t("label.freeSale")}})},p=d,y=a("2877"),h=Object(y["a"])(p,n,i,!1,null,null,null);h.options.__file="Wallet.vue";e["default"]=h.exports}}]);
//# sourceMappingURL=2d2172ed.31ee3d9c.2024-10-22T18:36:13.257Z.js.map