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AS,EAAsB,OAC/B,EAAY,EAAsB,UAClC,EAAU,EAAsB,QAEpC,GAAI,KAAK,MAAM,OAAQ,CACnB,IAAI,EAAU,CACV,IAAK,EACL,WAAY,EACZ,UAAW,EACX,SAAU,EACV,MAAO,EACP,OAAQ,EACR,UAAW,EACX,UAAW,EACX,QAAS,EACT,QAAS,GAEO,gBAAgB,KAAK,GAC3B,mBAClB,CACJ,GACD,CACC,IAAK,SACL,MAAO,WACH,IAAI,EAAS,KAET,EAAc,KAAK,MACnB,EAAY,EAAY,UACxB,EAAO,EAAY,KACvB,OAAqB,OAAgB,QAAE,cAAc,SAAU,CAC3D,UAAW,EACX,QAAS,WACL,OAAO,EAAO,cAClB,GACD,GAAQ,MACf,KAGG,CACX,CAhHkC,GAkHlC,QAAiB,QAAI","file":"/npm/react-remita-inline@1.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/react-remita-inline@1.1.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n    value: true\r\n});\r\nexports[\"default\"] = void 0;\r\n\r\nvar _react = _interopRequireWildcard(require(\"react\"));\r\n\r\nfunction _getRequireWildcardCache() {\r\n    if (typeof WeakMap !== \"function\") return null;\r\n    var cache = new WeakMap();\r\n    _getRequireWildcardCache = function _getRequireWildcardCache() {\r\n        return cache;\r\n    };\r\n    return cache;\r\n}\r\n\r\nfunction _interopRequireWildcard(obj) {\r\n    if (obj && obj.__esModule) {\r\n        return obj;\r\n    }\r\n    if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\r\n        return {\r\n            \"default\": obj\r\n        };\r\n    }\r\n    var cache = _getRequireWildcardCache();\r\n    if (cache && cache.has(obj)) {\r\n        return cache.get(obj);\r\n    }\r\n    var newObj = {};\r\n    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\r\n    for (var key in obj) {\r\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\r\n            if (desc && (desc.get || desc.set)) {\r\n                Object.defineProperty(newObj, key, desc);\r\n            } else {\r\n                newObj[key] = obj[key];\r\n            }\r\n        }\r\n    }\r\n    newObj[\"default\"] = obj;\r\n    if (cache) {\r\n        cache.set(obj, newObj);\r\n    }\r\n    return newObj;\r\n}\r\n\r\nfunction _typeof(obj) {\r\n    \"@babel/helpers - typeof\";\r\n    if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\r\n        _typeof = function _typeof(obj) {\r\n            return typeof obj;\r\n        };\r\n    } else {\r\n        _typeof = function _typeof(obj) {\r\n            return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\r\n        };\r\n    }\r\n    return _typeof(obj);\r\n}\r\n\r\nfunction _classCallCheck(instance, Constructor) {\r\n    if (!(instance instanceof Constructor)) {\r\n        throw new TypeError(\"Cannot call a class as a function\");\r\n    }\r\n}\r\n\r\nfunction _defineProperties(target, props) {\r\n    for (var i = 0; i < props.length; i++) {\r\n        var descriptor = props[i];\r\n        descriptor.enumerable = descriptor.enumerable || false;\r\n        descriptor.configurable = true;\r\n        if (\"value\" in descriptor) descriptor.writable = true;\r\n        Object.defineProperty(target, descriptor.key, descriptor);\r\n    }\r\n}\r\n\r\nfunction _createClass(Constructor, protoProps, staticProps) {\r\n    if (protoProps) _defineProperties(Constructor.prototype, protoProps);\r\n    if (staticProps) _defineProperties(Constructor, staticProps);\r\n    return Constructor;\r\n}\r\n\r\nfunction _inherits(subClass, superClass) {\r\n    if (typeof superClass !== \"function\" && superClass !== null) {\r\n        throw new TypeError(\"Super expression must either be null or a function\");\r\n    }\r\n    subClass.prototype = Object.create(superClass && superClass.prototype, {\r\n        constructor: {\r\n            value: subClass,\r\n            writable: true,\r\n            configurable: true\r\n        }\r\n    });\r\n    if (superClass) _setPrototypeOf(subClass, superClass);\r\n}\r\n\r\nfunction _setPrototypeOf(o, p) {\r\n    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\r\n        o.__proto__ = p;\r\n        return o;\r\n    };\r\n    return _setPrototypeOf(o, p);\r\n}\r\n\r\nfunction _createSuper(Derived) {\r\n    var hasNativeReflectConstruct = _isNativeReflectConstruct();\r\n    return function _createSuperInternal() {\r\n        var Super = _getPrototypeOf(Derived),\r\n            result;\r\n        if (hasNativeReflectConstruct) {\r\n            var NewTarget = _getPrototypeOf(this).constructor;\r\n            result = Reflect.construct(Super, arguments, NewTarget);\r\n        } else {\r\n            result = Super.apply(this, arguments);\r\n        }\r\n        return _possibleConstructorReturn(this, result);\r\n    };\r\n}\r\n\r\nfunction _possibleConstructorReturn(self, call) {\r\n    if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\r\n        return call;\r\n    }\r\n    return _assertThisInitialized(self);\r\n}\r\n\r\nfunction _assertThisInitialized(self) {\r\n    if (self === void 0) {\r\n        throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\r\n    }\r\n    return self;\r\n}\r\n\r\nfunction _isNativeReflectConstruct() {\r\n    if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\r\n    if (Reflect.construct.sham) return false;\r\n    if (typeof Proxy === \"function\") return true;\r\n    try {\r\n        Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\r\n        return true;\r\n    } catch (e) {\r\n        return false;\r\n    }\r\n}\r\n\r\nfunction _getPrototypeOf(o) {\r\n    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\r\n        return o.__proto__ || Object.getPrototypeOf(o);\r\n    };\r\n    return _getPrototypeOf(o);\r\n}\r\n\r\nvar cachedScripts = [];\r\n\r\nvar RemitaPayment = /*#__PURE__*/ function (_Component) {\r\n    _inherits(RemitaPayment, _Component);\r\n\r\n    var _super = _createSuper(RemitaPayment);\r\n\r\n    function RemitaPayment(props) {\r\n        var _this;\r\n\r\n        _classCallCheck(this, RemitaPayment);\r\n\r\n        _this = _super.call(this, props);\r\n        _this.state = {\r\n            loaded: false,\r\n            error: false\r\n        };\r\n        return _this;\r\n    }\r\n\r\n    _createClass(RemitaPayment, [{\r\n        key: \"componentDidMount\",\r\n        value: function componentDidMount() {\r\n            var _this2 = this;\r\n\r\n            var live = this.props.live;\r\n            var script;\r\n            var src = !live ? \"https://demo.remita.net/payment/v1/remita-pay-inline.bundle.js\" : \"https://login.remita.net/payment/v1/remita-pay-inline.bundle.js\";\r\n\r\n            if (cachedScripts.includes(src)) {\r\n                this.setState({\r\n                    loaded: true,\r\n                    error: false\r\n                });\r\n            } else {\r\n                cachedScripts.push(src);\r\n                script = document.createElement(\"script\");\r\n                script.src = src;\r\n                script.async = true;\r\n\r\n                var onScriptLoad = function onScriptLoad() {\r\n                    _this2.setState({\r\n                        loaded: true,\r\n                        error: false\r\n                    });\r\n                };\r\n\r\n                var onScriptError = function onScriptError() {\r\n                    var index = cachedScripts.indexOf(src);\r\n                    if (index >= 0) cachedScripts.splice(index, 1);\r\n                    script.remove();\r\n\r\n                    _this2.setState({\r\n                        loaded: true,\r\n                        error: true\r\n                    });\r\n                };\r\n\r\n                script.addEventListener(\"load\", onScriptLoad);\r\n                script.addEventListener(\"complete\", onScriptLoad);\r\n                script.addEventListener(\"error\", onScriptError);\r\n                document.body.appendChild(script);\r\n            }\r\n        }\r\n    }, {\r\n        key: \"startPayment\",\r\n        value: function startPayment() {\r\n            var _this$props$remitaDat = this.props.remitaData,\r\n                onSuccess = _this$props$remitaDat.onSuccess,\r\n                onClose = _this$props$remitaDat.onClose,\r\n                key = _this$props$remitaDat.key,\r\n                customerId = _this$props$remitaDat.customerId,\r\n                firstName = _this$props$remitaDat.firstName,\r\n                lastName = _this$props$remitaDat.lastName,\r\n                email = _this$props$remitaDat.email,\r\n                amount = _this$props$remitaDat.amount,\r\n                narration = _this$props$remitaDat.narration,\r\n                onError = _this$props$remitaDat.onError;\r\n\r\n            if (this.state.loaded) {\r\n                var payload = {\r\n                    key: key,\r\n                    customerId: customerId,\r\n                    firstName: firstName,\r\n                    lastName: lastName,\r\n                    email: email,\r\n                    amount: amount,\r\n                    narration: narration,\r\n                    onSuccess: onSuccess,\r\n                    onError: onError,\r\n                    onClose: onClose\r\n                };\r\n                var paymentEngine = RmPaymentEngine.init(payload);\r\n                paymentEngine.showPaymentWidget();\r\n            }\r\n        }\r\n    }, {\r\n        key: \"render\",\r\n        value: function render() {\r\n            var _this3 = this;\r\n\r\n            var _this$props = this.props,\r\n                className = _this$props.className,\r\n                text = _this$props.text;\r\n            return /*#__PURE__*/ _react[\"default\"].createElement(\"button\", {\r\n                className: className,\r\n                onClick: function onClick() {\r\n                    return _this3.startPayment();\r\n                }\r\n            }, text || \"Pay\");\r\n        }\r\n    }]);\r\n\r\n    return RemitaPayment;\r\n}(_react.Component);\r\n\r\nexports[\"default\"] = RemitaPayment;"]}