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) 1.39 kB
import{optionallyFilterUpiSubTxVariants as t,filterUnsupportedPaymentMethod as e,filterPresent as n,filterAvailable as o}from"./filters.js";import{getComponentConfiguration as r}from"./getComponentConfiguration.js";import i from"../../components-name-map.js";function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){p(t,e,n[e])})}return t}function a(t){return"isStoredPaymentMethod"in t&&!0===t.isStoredPaymentMethod}const m=(p,m,u,f)=>{const c=t(p).filter(e).map(t=>{const e=r(t.type,m,a(t)),n=f.getComponent(t.type);if(!n)return console.warn(`\nDropin: You support the payment method '${t.type}' but this component has not been configured. Make sure to import the Class '${i(t.type)}' and then pass it in the Dropin's 'paymentMethodComponents' config property if you wish to offer this payment method.`),null;const o=s({},a(t)?{storedPaymentMethodId:t.storedPaymentMethodId}:{paymentMethodId:t._id},u),p=s({},o,e);return new n(f,p)}).filter(n);return o(c)};export{m as default}; //# sourceMappingURL=createElements.js.map