@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 2.08 kB
JavaScript
import{createElement as e}from"../../external/preact/dist/preact.js";import{UIElement as t}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(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){s(e,t,r[t])})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}class p extends t{get isValid(){return!!this.state.isValid}formatData(){const{data:e={}}=this.state,{billingAddress:t,shopperEmail:r,firstName:n,lastName:i,socialSecurityNumber:s=""}=e;return a({paymentMethod:{type:this.type}},t&&{billingAddress:t},r&&{shopperEmail:r},n&&i&&{shopperName:{firstName:n,lastName:i}},s&&{socialSecurityNumber:o(s)})}componentToRender(){return this.props.reference?e(n,c(a({ref:this.handleRef,icon:this.icon},this.props),{onActionHandled:this.onActionHandled})):e(r,c(a({setComponentRef:this.handleRef},this.props),{onChange:this.setState,payButton:this.payButton}))}constructor(...e){super(...e),s(this,"handleRef",e=>{this.componentRef=e})}}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