(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.Thepeer={},s.Vue))})(this,function(s,e){"use strict";const a="https://cdn.thepeer.co/v1/chain.js";function d(){const c=e.ref({loaded:!1,error:!1}),t=()=>{c.value={loaded:!0,error:!1}},r=()=>{c.value={loaded:!0,error:!0}};return e.watchEffect(()=>{const o=document.getElementById("thepeer_script");if(o&&o.getAttribute("src"))return t();const n=document.createElement("script");return n.id="thepeer_script",n.src=a,n.async=!0,n.addEventListener("load",t),n.addEventListener("complete",t),n.addEventListener("error",r),document.body.appendChild(n),()=>{n.removeEventListener("load",t),n.removeEventListener("complete",t),n.removeEventListener("error",r)}}),c}const i=c=>{const t="Unable to load Thepeer's Direct Charge Modal",r=d();e.watchEffect(()=>{if(r.value.error)throw new Error(t);if(r.value.loaded){const o=window.Thepeer&&window.Thepeer.DirectCharge(e.toValue(c));return o.setup(),o.open()}})},u=c=>{const t="Unable to load Thepeer's Send Modal",r=d();e.watchEffect(()=>{if(r.value.error)throw new Error(t);if(r.value.loaded){const o=window.Thepeer&&window.Thepeer.Send(e.toValue(c));return o.setup(),o.open()}})},l=c=>{const t="Unable to load Thepeer's Checkout Modal",r=d();e.watchEffect(()=>{if(r.value.error)throw new Error(t);if(r.value.loaded){const o=window.Thepeer&&window.Thepeer.Checkout(e.toValue(c));return o.setup(),o.open()}})};s.useCheckout=l,s.useDirectCharge=i,s.useSend=u,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});