UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

3 lines (2 loc) 2.1 kB
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/BoletoInput/BoletoInput.js";import{cleanCPFCNPJ as o}from"../internal/SocialSecurityNumberBrazil/utils.js";import n from"./components/BoletoVoucherResult/BoletoVoucherResult.js";import{TxVariants as i}from"../tx-variants.js";function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.forEach(function(e){s(t,e,r[e])})}return t}function c(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e}(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}class p extends e{get isValid(){return!!this.state.isValid}formatData(){const{data:t={}}=this.state,{billingAddress:e,shopperEmail:r,firstName:n,lastName:i,socialSecurityNumber:s=""}=t;return a({paymentMethod:{type:this.type}},e&&{billingAddress:e},r&&{shopperEmail:r},n&&i&&{shopperName:{firstName:n,lastName:i}},s&&{socialSecurityNumber:o(s)})}componentToRender(){return this.props.reference?t(n,c(a({ref:this.handleRef,icon:this.icon},this.props),{onActionHandled:this.onActionHandled})):t(r,c(a({setComponentRef:this.handleRef},this.props),{onChange:this.setState,onSubmit:this.submit,payButton:this.payButton}))}constructor(...t){super(...t),s(this,"handleRef",t=>{this.componentRef=t})}}s(p,"type",i.boletobancario),s(p,"txVariants",[i.boletobancario,i.boletobancario_itau,i.boletobancario_santander,i.primeiropay_boleto]);export{p as BoletoElement,p as default}; //# sourceMappingURL=Boleto.js.map