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a,QAAS,4GAChE,SAAS,KAAK,MAAM,SAAW,EAAE,GACjB,KAJC,UAAU,OAAS,QAAsB,IAAjB,UAAU,GAAmB,UAAU,GAAK,GAKzF,CACF,SAES,4CAA6C","file":"/npm/flw-ts@1.0.9/dist/flw-ts.esm.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/flw-ts@1.0.9/dist/flw-ts.esm.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import Vue from 'vue';\n\nvar script = Vue.extend({\n  name: \"FlutterwavePayButton\",\n  props: {\n    public_key: {\n      type: String\n    },\n    tx_ref: {\n      type: [String, Number]\n    },\n    amount: {\n      type: [String, Number],\n      required: true\n    },\n    currency: {\n      type: String,\n      default: \"NGN\"\n    },\n    country: {\n      type: String,\n      default: \"NG\"\n    },\n    payment_options: {\n      type: String\n    },\n    payment_plan: {\n      type: [String, Number]\n    },\n    subaccounts: {\n      type: Array\n    },\n    integrity_hash: {\n      type: [String, Number]\n    },\n    redirect_url: {\n      type: String\n    },\n    meta: {\n      type: Object\n    },\n    authorization: {\n      type: String\n    },\n    customer: {\n      type: Object\n    },\n    customizations: {\n      type: Object\n    },\n    callback: {\n      type: Function\n    },\n    onclose: {\n      type: Function\n    }\n  },\n  methods: {\n    showPaymentModal() {\n      let paymentParams = {\n        tx_ref: this.tx_ref,\n        amount: this.amount,\n        currency: this.currency,\n        country: this.country,\n        payment_options: this.payment_options,\n        payment_plan: this.payment_plan,\n        subaccounts: this.subaccounts,\n        integrity_hash: this.integrity_hash,\n        redirect_url: this.redirect_url,\n        meta: this.meta,\n        authorization: this.authorization,\n        customer: this.customer,\n        customizations: this.customizations,\n        callback: response => this.callback(response),\n        onclose: () => this.onclose()\n      };\n\n      if (this.public_key) {\n        paymentParams.public_key = this.public_key;\n      }\n\n      this.$payWithFlutterwave(paymentParams);\n    }\n\n  }\n});\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n    if (typeof shadowMode !== 'boolean') {\r\n        createInjectorSSR = createInjector;\r\n        createInjector = shadowMode;\r\n        shadowMode = false;\r\n    }\r\n    // Vue.extend constructor export interop.\r\n    const options = typeof script === 'function' ? script.options : script;\r\n    // render functions\r\n    if (template && template.render) {\r\n        options.render = template.render;\r\n        options.staticRenderFns = template.staticRenderFns;\r\n        options._compiled = true;\r\n        // functional template\r\n        if (isFunctionalTemplate) {\r\n            options.functional = true;\r\n        }\r\n    }\r\n    // scopedId\r\n    if (scopeId) {\r\n        options._scopeId = scopeId;\r\n    }\r\n    let hook;\r\n    if (moduleIdentifier) {\r\n        // server build\r\n        hook = function (context) {\r\n            // 2.3 injection\r\n            context =\r\n                context || // cached call\r\n                    (this.$vnode && this.$vnode.ssrContext) || // stateful\r\n                    (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional\r\n            // 2.2 with runInNewContext: true\r\n            if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n                context = __VUE_SSR_CONTEXT__;\r\n            }\r\n            // inject component styles\r\n            if (style) {\r\n                style.call(this, createInjectorSSR(context));\r\n            }\r\n            // register component module identifier for async chunk inference\r\n            if (context && context._registeredComponents) {\r\n                context._registeredComponents.add(moduleIdentifier);\r\n            }\r\n        };\r\n        // used by ssr in case component is cached and beforeCreate\r\n        // never gets called\r\n        options._ssrRegister = hook;\r\n    }\r\n    else if (style) {\r\n        hook = shadowMode\r\n            ? function (context) {\r\n                style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\r\n            }\r\n            : function (context) {\r\n                style.call(this, createInjector(context));\r\n            };\r\n    }\r\n    if (hook) {\r\n        if (options.functional) {\r\n            // register for functional component in vue file\r\n            const originalRender = options.render;\r\n            options.render = function renderWithStyleInjection(h, context) {\r\n                hook.call(context);\r\n                return originalRender(h, context);\r\n            };\r\n        }\r\n        else {\r\n            // inject component registration as beforeCreate hook\r\n            const existing = options.beforeCreate;\r\n            options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n        }\r\n    }\r\n    return script;\r\n}\n\n/* script */\nconst __vue_script__ = script;\n/* template */\n\nvar __vue_render__ = function () {\n  var _vm = this;\n\n  var _h = _vm.$createElement;\n\n  var _c = _vm._self._c || _h;\n\n  return _c('button', {\n    on: {\n      \"click\": _vm.showPaymentModal\n    }\n  }, [_vm._t(\"default\")], 2);\n};\n\nvar __vue_staticRenderFns__ = [];\n/* style */\n\nconst __vue_inject_styles__ = undefined;\n/* scoped */\n\nconst __vue_scope_id__ = undefined;\n/* module identifier */\n\nconst __vue_module_identifier__ = undefined;\n/* functional template */\n\nconst __vue_is_functional_template__ = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nconst __vue_component__ = /*#__PURE__*/normalizeComponent({\n  render: __vue_render__,\n  staticRenderFns: __vue_staticRenderFns__\n}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);\n\nvar __vue_component__$1 = __vue_component__;\n\n/* eslint-disable import/prefer-default-export */\n\nvar components = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  FlutterwavePayButton: __vue_component__$1\n});\n\n// Import vue components\n\nconst install = function installFlwTs(Vue, _ref) {\n  let {\n    publicKey = \"\"\n  } = _ref;\n  Object.entries(components).forEach(_ref2 => {\n    let [componentName, component] = _ref2;\n    Vue.component(componentName, component);\n  });\n  Vue.mixin({\n    mounted() {\n      const inlineSdk = \"https://checkout.flutterwave.com/v3.js\";\n      const script = document.createElement(\"script\");\n      script.src = inlineSdk;\n\n      if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n        document.body.appendChild(script);\n      }\n    },\n\n    methods: {\n      payWithFlutterwave(paymentParams) {\n        let payData = { ...paymentParams,\n          public_key: paymentParams.public_key || publicKey,\n          callback: response => {\n            // trackApi({\n            //   paymentData: payData,\n            //   response: response,\n            //   responseTime: 1000,\n            // });\n            paymentParams.callback(response);\n          }\n        };\n        window.FlutterwaveCheckout(payData);\n      },\n\n      asyncPayWithFlutterwave(paymentData) {\n        return new Promise(function (resolve) {\n          let payData = { ...paymentData,\n            public_key: paymentData.public_key || publicKey,\n            callback: $event => {\n              // trackApi({\n              //   paymentData: payData,\n              //   response: $event,\n              //   responseTime: 1000,\n              // });\n              resolve($event);\n            },\n            onclose: () => resolve(\"closed\")\n          };\n          window.FlutterwaveCheckout(payData);\n        });\n      },\n\n      closePaymentModal() {\n        let waitDuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n        setTimeout(() => {\n          document.getElementsByName(\"checkout\")[0].setAttribute(\"style\", \"position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;\");\n          document.body.style.overflow = \"\"; // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n        }, waitDuration * 1000);\n      }\n\n    }\n  });\n\n  Vue.prototype.$payWithFlutterwave = function (paymentParams) {\n    let payData = { ...paymentParams,\n      public_key: paymentParams.public_key || publicKey,\n      callback: response => {\n        // trackApi({\n        //   paymentData: payData,\n        //   response: response,\n        //   responseTime: 1000,\n        // });\n        paymentParams.callback(response);\n      }\n    };\n    window.FlutterwaveCheckout(payData);\n  };\n\n  Vue.prototype.$asyncPayWithFlutterwave = function (paymentData) {\n    return new Promise(function (resolve) {\n      let payData = { ...paymentData,\n        public_key: paymentData.public_key || publicKey,\n        callback: $event => {\n          // trackApi({\n          //   paymentData: payData,\n          //   response: $event,\n          //   responseTime: 1000,\n          // });\n          resolve($event);\n        },\n        onclose: () => resolve(\"closed\")\n      };\n      window.FlutterwaveCheckout(payData);\n    });\n  };\n\n  Vue.prototype.$closePaymentModal = function () {\n    let waitDuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n    setTimeout(() => {\n      document.getElementsByName(\"checkout\")[0].setAttribute(\"style\", \"position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;\");\n      document.body.style.overflow = \"\"; // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n    }, waitDuration * 1000);\n  };\n}; // Create module definition for Vue.use()\n\nexport { __vue_component__$1 as FlutterwavePayButton, install as default };\n"]}