(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["771bf25e"],{d864f: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("q-collapsible",{staticClass:"q-pb-md",attrs:{"data-test":t.CypressTarget("CreditCard"),label:t.$t("field.payment.creditCard.method"),sublabel:t.creditCardSubLabel,opened:t.opened,group:"paymentMethods",icon:"far fa-credit-card","collapse-icon":"expand_more"},on:{show:function(e){t.$emit("show")}}},[n("div",{staticClass:"row justify-start gutter-sm",attrs:{"data-test":t.CypressTarget("CreditCardForm")}},[n("div",{staticClass:"col-xs-12 col-md-6 col-lg-6 col-xl-5"},[n("form-payment-method-credit-card",{attrs:{id:"CardForm",installments:t.paymentInstallmentsFixed,"card-brand-select":t.cardBrandSelect,color:t.SET_COLOR.primary},on:{input:t.updateCreditCard}}),n("div",{staticClass:"col-12"},[n("q-field",{attrs:{"data-test":t.CypressTarget("BillingAddressField")}},[n("q-checkbox",{attrs:{"data-test":t.CypressTarget("Checkbox"),color:t.SET_COLOR.primary,label:t.$t("label.differentBillingInformation")},model:{value:t.sameBilling,callback:function(e){t.sameBilling=e},expression:"sameBilling"}})],1)],1),t.sameBilling?t._e():n("div",{staticClass:"col-xs-12"},[n(t.billingFormComponent,t._b({ref:"billingForm",tag:"component",on:{input:t.updateBilling}},"component",{color:t.SET_COLOR.primary},!1))],1)],1),n("div",{staticClass:"col-xs-12 col-md-6 col-lg-6 col-xl-5 q-mb-md xs-hide sm-hide"},[n("plugin-payments-visual-credit-card",{attrs:{"form-selector":"#CardForm","name-selector":".CardForm-Name input","number-selector":".CardForm-Number input","cvc-selector":".CardForm-CVC input","expiry-selector":".CardForm-ValidDate input"}})],1)]),n("div",{staticClass:"row justify-start"},[n("div",{staticClass:"col-xs-12 col-md-6"},[t.discountAvailable?n("q-field",[n("text-checkout-discount-coupon",{attrs:{discount:t.discount},on:{couponApplied:function(e){t.$emit("applyDiscount")}}})],1):t._e(),n("q-field",[n("text-checkout-discount-resume",{attrs:{language:t.SET_LANGUAGE,currency:t.SET_MONEY,"discount-items":t.discountItems,discount:t.discount}})],1),n("q-field",{attrs:{"data-test":t.CypressTarget("Buttons")}},[n("q-btn",{staticClass:"full-width",attrs:{color:t.SET_COLOR_BUTTON.primary,"text-color":t.SET_COLOR_BUTTON.text.primary,loading:t.loading,disable:t.loading,"data-test":t.CypressTarget("Pay")},on:{click:function(e){t.$emit("payment")}}},[t._v("\n          "+t._s(t.$t("button.pay"))+" - "+t._s(t._f("money")(t.finalTotal,t.SET_LANGUAGE,t.SET_MONEY))+"\n        ")])],1)],1)]),t.statusModal.error?n("modal-status-payment-error",{attrs:{title:t.$t("modal.checkout.status.error.title"),message:t.$t("modal.checkout.status.error.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:"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?n("modal-status-payment-success",{attrs:{message:t.successMessage,color:t.SET_COLOR.paymentStatus.success},model:{value:t.statusModal.success,callback:function(e){t.$set(t.statusModal,"success",e)},expression:"statusModal.success"}},[t.nextPageButton?n("q-btn",{attrs:{slot:"buttons","data-test":t.CypressTarget("GoNextScreen"),label:t.nextPage,color:"green-10"},on:{click:function(e){t.$emit("success")}},slot:"buttons"}):t._e()],1):t._e()],1)},s=[];a._withStripped=!0;var i=n("3156"),l=n.n(i),r=n("ad54"),o=n.n(r),d=(n("7514"),n("c5f6"),n("6cd9")),c=n("e9fb"),u={name:"CreditCartPaymentMethod",components:{FormPaymentMethodCreditCard:function(){return Promise.all([n.e("vuelidate"),n.e("payment"),n.e("qj"),n.e("0efd9d48")]).then(n.bind(null,"d3a9"))},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"))},PluginPaymentsVisualCreditCard:function(){return n.e("771c94b7").then(n.bind(null,"33f7"))},TextCheckoutDiscountCoupon:function(){return n.e("1711605c").then(n.bind(null,"10c5"))},TextCheckoutDiscountResume:function(){return n.e("2d0c8624").then(n.bind(null,"553a"))}},mixins:[d["a"]],props:{paymentResponse:{type:Object,required:!0},opened:{type:Boolean,required:!1,default:!1},statusModal:{type:Object,required:!0},cartFinalTotal:{type:Number,require:!0,default:0},paymentInstallments:{type:Array,required:!0},cardBrandSelect:{type:Boolean,required:!1,default:!1},discount:{type:Number,require:!1,default:0},discountItems:{type:Array,required:!1,default:function(){return[]}},nextPageButton:{type:Boolean,required:!1,default:!0},nextPageButtonText:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1}},data:function(){return{sameBilling:!0,creditCard:{number:"",holderName:"",cvc:"",validDate:"",installments:1,expiry:{month:0,year:0}},billing:{}}},computed:{maxInstallment:{get:function(){return this.paymentInstallments.length>0?this.paymentInstallments[this.paymentInstallments.length-1].installments:1},cache:!1},billingFormComponent:function(){return"pt-br"!==this.SET_LANGUAGE?function(){return Promise.all([n.e("vuelidate"),n.e("2d2084aa")]).then(n.bind(null,"a3bd"))}:function(){return Promise.all([n.e("vuelidate"),n.e("2d0af66b"),n.e("2d0db7d6"),n.e("48f9b984"),n.e("2d0c26cd")]).then(n.bind(null,"49f8"))}},discountAvailable:function(){return this.discountItems.length>0&&this.discount},nextPage:function(){return this.nextPageButtonText?this.nextPageButtonText:this.$t("button.viewPurchase")},paymentInstallmentsFixed:{get:function(){var t=this;return this.paymentInstallments.length>0?this.paymentInstallments.map(function(e){var n=parseFloat(e.amount).toFixed(2),a=Object(c["a"])(n,t.SET_LANGUAGE,t.SET_MONEY);return{amount:n,installments:e.installments,label:"".concat(e.installments,"x ").concat(a),stamp:a,value:e.installments}}):[]},cache:!1},finalTotal:function(){var t=this,e=this.paymentInstallments.find(function(e){return e.installments===t.creditCard.installments});return 1===this.creditCard.installments?this.cartFinalTotal:e.installments*e.amount},successMessage:function(){return this.nextPageButton?"".concat(this.$t("modal.checkout.status.success.msg")).concat(this.$t("modal.checkout.status.success.printDownload")):null}},watch:{sameBilling:{handler:function(t){t&&this.emitEvent()},immediate:!0},creditCard:{handler:function(){this.emitEvent()},immediate:!0,deep:!0},billing:{handler:function(){this.emitEvent()},immediate:!0,deep:!0}},methods:{updateCreditCard:function(t){this.creditCard=t},updateBilling:function(t){this.sameBilling||(this.billing=t)},emitEvent:function(){var t=JSON.parse(o()(l()({},this.creditCard)));this.sameBilling||(t.billing=JSON.parse(o()(this.billing))),this.$emit("form-data",t)},creditCardSublabel:function(){var t=this.maxInstallment,e=this.$t("field.payment.creditCard.sublabel",{times:t}),n=this.$t("field.payment.creditCard.subLabelWithoutInstallment");return t>1?e:n}}},m=u,p=n("2877"),b=Object(p["a"])(m,a,s,!1,null,null,null);b.options.__file="creditCard.vue";e["default"]=b.exports}}]);
//# sourceMappingURL=771bf25e.c094cdcc.2024-10-22T18:36:13.257Z.js.map