@malga-checkout-full/core
Version:
Core components for Malga Checkout Full
1 lines • 24.8 kB
JavaScript
import{r as a,c as o,h as c,F as t,H as e}from"./p-dc9e50be.js";import{Z as l}from"./p-a24853cf.js";import{s as r,a as n}from"./p-d5eacf76.js";import{c as s,s as i}from"./p-e69718a5.js";import{s as m,a as g,M as u}from"./p-28f41417.js";import"./p-a0ceaf8b.js";import{c as d,g as h}from"./p-9ceae180.js";import"./p-3e8ff66b.js";import"./p-2a19115a.js";import"./p-b28f21d9.js";var p;!function(a){a.ACTIVE="active",a.FAILED="failed",a.PENDING="pending"}(p||(p={}));const{state:k,onChange:f}=s({cards:[],hasCards:!1});f("cards",(a=>{k.hasCards=a.filter((a=>a.status!==p.FAILED)).length>0}));const y=class{constructor(c){a(this,c),this.paymentFail=o(this,"paymentFail",7),this.paymentMethods=["credit","pix","boleto","drip"],this.handlePaymentChange=a=>{r.selectedPaymentMethod=a},this.showCurrentPaymentMethod=a=>this.paymentMethods.includes(a)}renderCreditCardLabel(){return l(k.hasCards?"paymentMethods.card.newCardTitle":"paymentMethods.card.title",i.locale)}render(){return c(e,{class:{"malga-payments__container":!0}},c("section",{class:{"malga-payments__content":!0}},this.showCurrentPaymentMethod("credit")&&c(t,null,i.transactionConfig.customerId&&c("malga-payments-credit-saved-cards",null),c("checkout-radio-field",{fullWidth:!0,label:this.renderCreditCardLabel(),value:"credit",isChecked:"credit"===r.selectedPaymentMethod,onClicked:()=>this.handlePaymentChange("credit")}),"credit"===r.selectedPaymentMethod&&c("malga-payments-credit",null)),this.showCurrentPaymentMethod("boleto")&&c(t,null,c("checkout-radio-field",{fullWidth:!0,label:l("paymentMethods.boleto.title",i.locale),value:"boleto",isChecked:"boleto"===r.selectedPaymentMethod,onClicked:()=>this.handlePaymentChange("boleto")}),"boleto"===r.selectedPaymentMethod&&c("malga-payments-boleto",null)),this.showCurrentPaymentMethod("pix")&&c(t,null,c("checkout-radio-field",{fullWidth:!0,label:l("paymentMethods.pix.title",i.locale),value:"pix",endIcon:"pix",isChecked:"pix"===r.selectedPaymentMethod,onClicked:()=>this.handlePaymentChange("pix")}),"pix"===r.selectedPaymentMethod&&c("malga-payments-pix",{onPixPaymentFailed:({detail:{error:a}})=>this.paymentFail.emit({error:a})})),this.showCurrentPaymentMethod("nupay")&&c(t,null,c("checkout-radio-field",{fullWidth:!0,label:l("paymentMethods.nupay.title",i.locale),value:"nupay",endIcon:"nubank",isChecked:"nupay"===r.selectedPaymentMethod,onClicked:()=>this.handlePaymentChange("nupay")}),"nupay"===r.selectedPaymentMethod&&c("malga-payments-nupay",null)),this.showCurrentPaymentMethod("drip")&&c(t,null,c("checkout-radio-field",{fullWidth:!0,label:l("paymentMethods.drip.title",i.locale),value:"drip",endIcon:"drip",isChecked:"drip"===r.selectedPaymentMethod,onClicked:()=>this.handlePaymentChange("drip")}),c("malga-payments-drip",null))))}};y.style='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); :root{--malga-checkout-color-page-background:#eef2f6;--malga-checkout-color-brand-accent-light:#79DBD4;--malga-checkout-color-brand-accent-normal:#39BFAD;--malga-checkout-color-brand-clean:#C3F4EF;--malga-checkout-color-brand-light:#79DBD4;--malga-checkout-color-brand-normal:#39BFAD;--malga-checkout-color-brand-middle:#2FAC9B;--malga-checkout-color-brand-dark:#147F70;--malga-checkout-color-grey-light:#666666;--malga-checkout-color-grey-normal:#4D4D4D;--malga-checkout-color-grey-middle:#333333;--malga-checkout-color-grey-dark:#1A1A1A;--malga-checkout-color-grey-darkness:#000000;--malga-checkout-color-accent-light:#ffffff;--malga-checkout-color-accent-normal:#F1F1F1;--malga-checkout-color-accent-middle:#CBCBCB;--malga-checkout-color-warning-light:#FFF8E6;--malga-checkout-color-warning-normal:#F9DF8D;--malga-checkout-color-warning-middle:#FFA400;--malga-checkout-color-warning-dark:#ED3A3D;--malga-checkout-color-modal-success:#00AE42;--malga-checkout-color-modal-error:#ED3A3D;--malga-checkout-color-modal-neutral:#4D4D4D;--malga-checkout-color-disabled:#F9F9F9;--malga-checkout-color-modal-action-button-error:#000000;--malga-checkout-color-modal-action-button-error-hover:#333333;--malga-checkout-color-modal-action-button-success:#000000;--malga-checkout-color-modal-action-button-success-hover:#333333;--malga-checkout-color-modal-action-button-success-font-color:#ffffff;--malga-checkout-color-modal-action-button-error-font-color:#ffffff;--malga-checkout-typography-family:"Inter", sans-serif;--malga-checkout-spacing-xxs:4px;--malga-checkout-spacing-xs:8px;--malga-checkout-spacing-sm:16px;--malga-checkout-spacing-default:24px;--malga-checkout-spacing-md:32px;--malga-checkout-spacing-lg:48px;--malga-checkout-spacing-xlg:64px;--malga-checkout-spacing-xxlg:96px;--malga-checkout-size-min-width:250px;--malga-checkout-border-radius-default:4px;--malga-checkout-border-radius-md:6px;--malga-checkout-border-radius-lg:20px;--malga-checkout-transition-slow:0.3s;--malga-checkout-transition-default:0.5s}.malga-payments__container{display:flex;width:100%;margin-left:auto;margin-right:auto}.malga-payments__content{display:flex;flex-direction:column;width:100%}.malga-payments__content>checkout-radio-field{margin-bottom:calc( var(--malga-checkout-spacing-xxs) + var(--malga-checkout-spacing-xs) )}.malga-payments__content>malga-payments-boleto>checkout-manual-payment,.malga-payments__content>malga-payments-pix>checkout-manual-payment{margin-bottom:var(--malga-checkout-spacing-sm)}.malga-payments__content>malga-payments-boleto>checkout-manual-payment>checkout-typography,.malga-payments__content>malga-payments-pix>checkout-manual-payment>checkout-typography{padding:0px var(--malga-checkout-spacing-sm)}';const b=class{constructor(o){a(this,o),this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})},this.handleSuccessModalButtonClicked=()=>{i.dialogConfig.successRedirectUrl&&location.assign(i.dialogConfig.successRedirectUrl),this.handleShowDialog({open:!1})}}render(){return c(e,null,c("checkout-manual-payment",{fullWidth:!0,locale:i.locale,paymentMethod:"boleto"}),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,isSession:!!i.sessionId,hasSuccessRedirectUrl:!!i.dialogConfig.successRedirectUrl,currency:i.transactionConfig.currency,mode:m.configs.mode,open:m.configs.open,amount:m.configs.amount,paymentCode:m.configs.paymentCode,paymentImageUrl:m.configs.paymentImageUrl,expirationDate:m.configs.expirationDate,errorDescription:m.configs.errorMessage,actionButtonLabel:i.dialogConfig.actionButtonLabel,boletoWaitingPaymentMessage:i.dialogConfig.boletoWaitingPaymentMessage,successActionButtonLabel:i.dialogConfig.successActionButtonLabel,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onSuccessButtonClicked:this.handleSuccessModalButtonClicked,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};b.style="";const x=class{constructor(o){a(this,o),this.currentFieldFocused="cardNumber",this.currentCardMask="",this.currentTypeCard="",this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.handleSetFocusedField=a=>{this.currentFieldFocused=a},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})},this.handleSuccessModalButtonClicked=()=>{i.dialogConfig.successRedirectUrl&&location.assign(i.dialogConfig.successRedirectUrl),this.handleShowDialog({open:!1})}}render(){return c(e,{class:{"malga-payments-credit__container":!0}},i.paymentMethods.credit.showCreditCard&&c("checkout-credit-card",{locale:i.locale,focused:this.currentFieldFocused,cvv:n.form.cvv,expiry:n.form.expirationDate,name:n.form.name,number:n.form.cardNumber,mask:this.currentCardMask,issuer:this.currentTypeCard}),c("malga-payments-credit-form",{onCurrentFieldChange:({detail:{field:a}})=>this.handleSetFocusedField(a),onCardMaskChange:({detail:{mask:a,type:o}})=>{this.currentCardMask=a,this.currentTypeCard=o}}),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,isSession:!!i.sessionId,hasSuccessRedirectUrl:!!i.dialogConfig.successRedirectUrl,currency:i.transactionConfig.currency,mode:m.configs.mode,open:m.configs.open,amount:m.configs.amount,errorDescription:m.configs.errorMessage,actionButtonLabel:i.dialogConfig.actionButtonLabel,successActionButtonLabel:i.dialogConfig.successActionButtonLabel,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onSuccessButtonClicked:this.handleSuccessModalButtonClicked,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};x.style='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); :root{--malga-checkout-color-page-background:#eef2f6;--malga-checkout-color-brand-accent-light:#79DBD4;--malga-checkout-color-brand-accent-normal:#39BFAD;--malga-checkout-color-brand-clean:#C3F4EF;--malga-checkout-color-brand-light:#79DBD4;--malga-checkout-color-brand-normal:#39BFAD;--malga-checkout-color-brand-middle:#2FAC9B;--malga-checkout-color-brand-dark:#147F70;--malga-checkout-color-grey-light:#666666;--malga-checkout-color-grey-normal:#4D4D4D;--malga-checkout-color-grey-middle:#333333;--malga-checkout-color-grey-dark:#1A1A1A;--malga-checkout-color-grey-darkness:#000000;--malga-checkout-color-accent-light:#ffffff;--malga-checkout-color-accent-normal:#F1F1F1;--malga-checkout-color-accent-middle:#CBCBCB;--malga-checkout-color-warning-light:#FFF8E6;--malga-checkout-color-warning-normal:#F9DF8D;--malga-checkout-color-warning-middle:#FFA400;--malga-checkout-color-warning-dark:#ED3A3D;--malga-checkout-color-modal-success:#00AE42;--malga-checkout-color-modal-error:#ED3A3D;--malga-checkout-color-modal-neutral:#4D4D4D;--malga-checkout-color-disabled:#F9F9F9;--malga-checkout-color-modal-action-button-error:#000000;--malga-checkout-color-modal-action-button-error-hover:#333333;--malga-checkout-color-modal-action-button-success:#000000;--malga-checkout-color-modal-action-button-success-hover:#333333;--malga-checkout-color-modal-action-button-success-font-color:#ffffff;--malga-checkout-color-modal-action-button-error-font-color:#ffffff;--malga-checkout-typography-family:"Inter", sans-serif;--malga-checkout-spacing-xxs:4px;--malga-checkout-spacing-xs:8px;--malga-checkout-spacing-sm:16px;--malga-checkout-spacing-default:24px;--malga-checkout-spacing-md:32px;--malga-checkout-spacing-lg:48px;--malga-checkout-spacing-xlg:64px;--malga-checkout-spacing-xxlg:96px;--malga-checkout-size-min-width:250px;--malga-checkout-border-radius-default:4px;--malga-checkout-border-radius-md:6px;--malga-checkout-border-radius-lg:20px;--malga-checkout-transition-slow:0.3s;--malga-checkout-transition-default:0.5s}.malga-payments-credit__container{padding:var(--malga-checkout-spacing-sm)}';class F{constructor(){this.customerCards=new g}async listSavedCards(){try{const a=await this.customerCards.list(i.transactionConfig.customerId);k.cards=a.data}catch(a){k.cards=[]}}}const D=class{constructor(o){a(this,o),this.handleSelectCard=(a,o)=>{r.selectedPaymentMethod=a,r.cardId=o},this.handleCvvChange=a=>{r.cvv=a.target.value.trim()},this.handleInstallmentsChange=a=>{r.installments=a.target.value},this.renderInstallmentOptions=()=>Array.from({length:i.paymentMethods.credit.installments.quantity}).map(((a,o)=>{const c=o+1;return{label:`${c}x ${d(i.transactionConfig.amount/c,i.transactionConfig.currency)}, ${l("common.total",i.locale)} ${d(i.transactionConfig.amount,i.transactionConfig.currency)}`,value:c}})),this.fetchSavedCards=()=>{(new F).listSavedCards()},this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})},this.handleSuccessModalButtonClicked=()=>{i.dialogConfig.successRedirectUrl&&location.assign(i.dialogConfig.successRedirectUrl),this.handleShowDialog({open:!1})}}componentWillLoad(){this.fetchSavedCards()}renderSavedCards(){return k.cards.filter((a=>"failed"!==a.status)).map(((a,o)=>{var t,e,n;const s=`credit-${o}`,m=r.selectedPaymentMethod===s,g=r.cvv.trim().length&&r.cvv.trim().length<3,u="none"===r.installments;return c("div",{class:{"malga-payments-credit-saved-cards__card":!0}},c("checkout-radio-field",{fullWidth:!0,label:`${l("paymentMethods.card.savedCards.card",i.locale)} ${a.last4digits}`,value:s,endIcon:h(a.first6digits),isChecked:m,onClicked:()=>this.handleSelectCard(s,a.id)}),m&&c("div",{class:{"malga-payments-credit-saved-cards__content":!0}},c("checkout-typography",{variation:"field",color:"dark",content:l("paymentMethods.card.savedCards.fields.cvv.description",i.locale)}),c("div",{class:{"malga-payments-credit-saved-cards__cvv-container":!0}},c("checkout-text-field",{fullWidth:!0,name:"cvv",label:l("paymentMethods.card.savedCards.fields.cvv.label",i.locale),mask:"9999",value:r.cvv,onChanged:this.handleCvvChange,inputmode:"numeric",hasValidation:g,hasError:g}),!!g&&c("checkout-error-message",{message:l("paymentMethods.card.savedCards.fields.cvv.errorMessage",i.locale)})),(null===(n=null===(e=null===(t=i.paymentMethods)||void 0===t?void 0:t.credit)||void 0===e?void 0:e.installments)||void 0===n?void 0:n.show)&&c("div",null,c("checkout-select-field",{fullWidth:!0,name:"installments",label:l("paymentMethods.card.savedCards.fields.installments.label",i.locale),value:r.installments,onChanged:this.handleInstallmentsChange,options:this.renderInstallmentOptions(),hasError:u}),!!u&&c("checkout-error-message",{message:l("paymentMethods.card.savedCards.fields.installments.errorMessage",i.locale)}))))}))}render(){return c(e,{class:{"malga-payments-credit-saved-cards__container":!0}},this.renderSavedCards(),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,currency:i.transactionConfig.currency,mode:m.configs.mode,open:m.configs.open,amount:m.configs.amount,errorDescription:m.configs.errorMessage,actionButtonLabel:i.dialogConfig.actionButtonLabel,successActionButtonLabel:i.dialogConfig.successActionButtonLabel,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onSuccessButtonClicked:this.handleSuccessModalButtonClicked,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};D.style='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); :root{--malga-checkout-color-page-background:#eef2f6;--malga-checkout-color-brand-accent-light:#79DBD4;--malga-checkout-color-brand-accent-normal:#39BFAD;--malga-checkout-color-brand-clean:#C3F4EF;--malga-checkout-color-brand-light:#79DBD4;--malga-checkout-color-brand-normal:#39BFAD;--malga-checkout-color-brand-middle:#2FAC9B;--malga-checkout-color-brand-dark:#147F70;--malga-checkout-color-grey-light:#666666;--malga-checkout-color-grey-normal:#4D4D4D;--malga-checkout-color-grey-middle:#333333;--malga-checkout-color-grey-dark:#1A1A1A;--malga-checkout-color-grey-darkness:#000000;--malga-checkout-color-accent-light:#ffffff;--malga-checkout-color-accent-normal:#F1F1F1;--malga-checkout-color-accent-middle:#CBCBCB;--malga-checkout-color-warning-light:#FFF8E6;--malga-checkout-color-warning-normal:#F9DF8D;--malga-checkout-color-warning-middle:#FFA400;--malga-checkout-color-warning-dark:#ED3A3D;--malga-checkout-color-modal-success:#00AE42;--malga-checkout-color-modal-error:#ED3A3D;--malga-checkout-color-modal-neutral:#4D4D4D;--malga-checkout-color-disabled:#F9F9F9;--malga-checkout-color-modal-action-button-error:#000000;--malga-checkout-color-modal-action-button-error-hover:#333333;--malga-checkout-color-modal-action-button-success:#000000;--malga-checkout-color-modal-action-button-success-hover:#333333;--malga-checkout-color-modal-action-button-success-font-color:#ffffff;--malga-checkout-color-modal-action-button-error-font-color:#ffffff;--malga-checkout-typography-family:"Inter", sans-serif;--malga-checkout-spacing-xxs:4px;--malga-checkout-spacing-xs:8px;--malga-checkout-spacing-sm:16px;--malga-checkout-spacing-default:24px;--malga-checkout-spacing-md:32px;--malga-checkout-spacing-lg:48px;--malga-checkout-spacing-xlg:64px;--malga-checkout-spacing-xxlg:96px;--malga-checkout-size-min-width:250px;--malga-checkout-border-radius-default:4px;--malga-checkout-border-radius-md:6px;--malga-checkout-border-radius-lg:20px;--malga-checkout-transition-slow:0.3s;--malga-checkout-transition-default:0.5s}.malga-payments-credit-saved-cards__container{display:block}.malga-payments-credit-saved-cards__card{margin-bottom:calc( var(--malga-checkout-spacing-xxs) + var(--malga-checkout-spacing-xs) )}.malga-payments-credit-saved-cards__card{margin-bottom:calc( var(--malga-checkout-spacing-xxs) + var(--malga-checkout-spacing-xs) )}.malga-payments-credit-saved-cards__content{display:flex;flex-direction:column;padding:var(--malga-checkout-spacing-sm)}.malga-payments-credit-saved-cards__content>checkout-typography>p{font-weight:400;margin-bottom:var(--malga-checkout-spacing-default)}.malga-payments-credit-saved-cards__cvv-container{margin-bottom:8px}';const v=class{constructor(o){a(this,o),this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})}}render(){return c(e,{class:{"malga-payments-drip__container":!0,"malga-payments-drip__container--selected":"drip"===r.selectedPaymentMethod}},c("malga-payments-drip-content",null),!!r.paymentUrl&&c("malga-payments-drip-iframe",null),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,isSession:!!i.sessionId,mode:m.configs.mode,open:m.configs.open,errorDescription:m.configs.errorMessage,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};v.style='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); :root{--malga-checkout-color-page-background:#eef2f6;--malga-checkout-color-brand-accent-light:#79DBD4;--malga-checkout-color-brand-accent-normal:#39BFAD;--malga-checkout-color-brand-clean:#C3F4EF;--malga-checkout-color-brand-light:#79DBD4;--malga-checkout-color-brand-normal:#39BFAD;--malga-checkout-color-brand-middle:#2FAC9B;--malga-checkout-color-brand-dark:#147F70;--malga-checkout-color-grey-light:#666666;--malga-checkout-color-grey-normal:#4D4D4D;--malga-checkout-color-grey-middle:#333333;--malga-checkout-color-grey-dark:#1A1A1A;--malga-checkout-color-grey-darkness:#000000;--malga-checkout-color-accent-light:#ffffff;--malga-checkout-color-accent-normal:#F1F1F1;--malga-checkout-color-accent-middle:#CBCBCB;--malga-checkout-color-warning-light:#FFF8E6;--malga-checkout-color-warning-normal:#F9DF8D;--malga-checkout-color-warning-middle:#FFA400;--malga-checkout-color-warning-dark:#ED3A3D;--malga-checkout-color-modal-success:#00AE42;--malga-checkout-color-modal-error:#ED3A3D;--malga-checkout-color-modal-neutral:#4D4D4D;--malga-checkout-color-disabled:#F9F9F9;--malga-checkout-color-modal-action-button-error:#000000;--malga-checkout-color-modal-action-button-error-hover:#333333;--malga-checkout-color-modal-action-button-success:#000000;--malga-checkout-color-modal-action-button-success-hover:#333333;--malga-checkout-color-modal-action-button-success-font-color:#ffffff;--malga-checkout-color-modal-action-button-error-font-color:#ffffff;--malga-checkout-typography-family:"Inter", sans-serif;--malga-checkout-spacing-xxs:4px;--malga-checkout-spacing-xs:8px;--malga-checkout-spacing-sm:16px;--malga-checkout-spacing-default:24px;--malga-checkout-spacing-md:32px;--malga-checkout-spacing-lg:48px;--malga-checkout-spacing-xlg:64px;--malga-checkout-spacing-xxlg:96px;--malga-checkout-size-min-width:250px;--malga-checkout-border-radius-default:4px;--malga-checkout-border-radius-md:6px;--malga-checkout-border-radius-lg:20px;--malga-checkout-transition-slow:0.3s;--malga-checkout-transition-default:0.5s}.malga-payments-drip__container{display:none;padding:0 var(--malga-checkout-spacing-sm)}.malga-payments-drip__container--selected{display:block}';const C=class{constructor(o){a(this,o),this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})}}render(){return c(e,{class:{"malga-payments-nupay__container":!0}},c("malga-payments-nupay-content",null),!!r.paymentUrl&&c("malga-payments-nupay-iframe",null),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,isSession:!!i.sessionId,mode:m.configs.mode,open:m.configs.open,amount:m.configs.amount,errorDescription:m.configs.errorMessage,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};C.style='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); :root{--malga-checkout-color-page-background:#eef2f6;--malga-checkout-color-brand-accent-light:#79DBD4;--malga-checkout-color-brand-accent-normal:#39BFAD;--malga-checkout-color-brand-clean:#C3F4EF;--malga-checkout-color-brand-light:#79DBD4;--malga-checkout-color-brand-normal:#39BFAD;--malga-checkout-color-brand-middle:#2FAC9B;--malga-checkout-color-brand-dark:#147F70;--malga-checkout-color-grey-light:#666666;--malga-checkout-color-grey-normal:#4D4D4D;--malga-checkout-color-grey-middle:#333333;--malga-checkout-color-grey-dark:#1A1A1A;--malga-checkout-color-grey-darkness:#000000;--malga-checkout-color-accent-light:#ffffff;--malga-checkout-color-accent-normal:#F1F1F1;--malga-checkout-color-accent-middle:#CBCBCB;--malga-checkout-color-warning-light:#FFF8E6;--malga-checkout-color-warning-normal:#F9DF8D;--malga-checkout-color-warning-middle:#FFA400;--malga-checkout-color-warning-dark:#ED3A3D;--malga-checkout-color-modal-success:#00AE42;--malga-checkout-color-modal-error:#ED3A3D;--malga-checkout-color-modal-neutral:#4D4D4D;--malga-checkout-color-disabled:#F9F9F9;--malga-checkout-color-modal-action-button-error:#000000;--malga-checkout-color-modal-action-button-error-hover:#333333;--malga-checkout-color-modal-action-button-success:#000000;--malga-checkout-color-modal-action-button-success-hover:#333333;--malga-checkout-color-modal-action-button-success-font-color:#ffffff;--malga-checkout-color-modal-action-button-error-font-color:#ffffff;--malga-checkout-typography-family:"Inter", sans-serif;--malga-checkout-spacing-xxs:4px;--malga-checkout-spacing-xs:8px;--malga-checkout-spacing-sm:16px;--malga-checkout-spacing-default:24px;--malga-checkout-spacing-md:32px;--malga-checkout-spacing-lg:48px;--malga-checkout-spacing-xlg:64px;--malga-checkout-spacing-xxlg:96px;--malga-checkout-size-min-width:250px;--malga-checkout-border-radius-default:4px;--malga-checkout-border-radius-md:6px;--malga-checkout-border-radius-lg:20px;--malga-checkout-transition-slow:0.3s;--malga-checkout-transition-default:0.5s}.malga-payments-nupay__container{display:block;padding:0 var(--malga-checkout-spacing-sm) var(--malga-checkout-spacing-sm) var(--malga-checkout-spacing-sm)}';const _=class{constructor(c){a(this,c),this.pixPaymentFailed=o(this,"pixPaymentFailed",7),this.handleShowDialog=a=>{m.configs=Object.assign(Object.assign({},m.configs),a)},this.checkIfPixIsPaid=async()=>{if(i.sessionId)return;const a=new u({data:i.paymentMethods.pix,onShowDialog:this.handleShowDialog,onPaymentFailed:a=>this.pixPaymentFailed.emit({error:a})});await a.findCharge(r.chargeId)},this.handleErrorModalButtonClicked=()=>{this.handleShowDialog({open:!1})},this.handleSuccessModalButtonClicked=()=>{i.dialogConfig.successRedirectUrl&&location.assign(i.dialogConfig.successRedirectUrl),this.handleShowDialog({open:!1})}}render(){return c(e,null,c("checkout-manual-payment",{fullWidth:!0,locale:i.locale,paymentMethod:"pix"}),i.dialogConfig.show&&m.configs.open&&c("checkout-modal",{locale:i.locale,isSession:!!i.sessionId,hasSuccessRedirectUrl:!!i.dialogConfig.successRedirectUrl,currency:i.transactionConfig.currency,mode:m.configs.mode,open:m.configs.open,amount:m.configs.amount,paymentCode:m.configs.paymentCode,paymentImageUrl:m.configs.paymentImageUrl,expirationDate:m.configs.expirationDate,expirationTime:m.configs.expirationTime,errorTitle:m.configs.errorTitle,errorDescription:m.configs.errorMessage,successDescription:m.configs.successMessage,actionButtonLabel:i.dialogConfig.actionButtonLabel,pixImportantMessages:i.dialogConfig.pixImportantMessages,pixWaitingPaymentMessage:i.dialogConfig.pixWaitingPaymentMessage,pixFilledProgressBarColor:i.dialogConfig.pixFilledProgressBarColor,pixEmptyProgressBarColor:i.dialogConfig.pixEmptyProgressBarColor,successActionButtonLabel:i.dialogConfig.successActionButtonLabel,errorActionButtonLabel:i.dialogConfig.errorActionButtonLabel,onPixCountdownIsFinished:this.checkIfPixIsPaid,onSuccessButtonClicked:this.handleSuccessModalButtonClicked,onErrorButtonClicked:this.handleErrorModalButtonClicked}))}};_.style="";export{y as malga_payments,b as malga_payments_boleto,x as malga_payments_credit,D as malga_payments_credit_saved_cards,v as malga_payments_drip,C as malga_payments_nupay,_ as malga_payments_pix}