import { defineComponent as x, useBrowserLocation as h, ref as y, useClipboard as k, useShare as C, computed as b, openBlock as o, createElementBlock as n, createBaseVNode as s, renderSlot as S, createVNode as c, withCtx as g, unref as e, toDisplayString as w, createCommentVNode as d } from "./composables-108ad332.js";
import { QrShow as $, UiLayer as B } from "./components.js";
const L = { class: "flex" }, N = /* @__PURE__ */ s("div", { class: "i-ion-share-outline" }, null, -1), V = { class: "flex flex-col items-center mb-4" }, Q = { class: "text-md mx-4 my-2 break-all max-w-420px" }, j = { class: "flex text-lg mt-2" }, A = {
  key: 0,
  class: "button text-lg font-normal items-center"
}, D = {
  key: 0,
  class: "ml-2"
}, E = {
  key: 1,
  class: "ml-2"
}, U = {
  key: 1,
  class: "button text-lg font-normal items-center"
}, q = /* @__PURE__ */ s("div", { class: "ml-2" }, "Send", -1), I = /* @__PURE__ */ x({
  __name: "QrShare",
  setup(z) {
    const r = h(), l = y(!1), { text: F, copy: u, copied: m, isSupported: p } = k(), { share: f, isSupported: v } = C(), a = b(() => r.value.href + r.value.search);
    return (_, t) => (o(), n("div", L, [
      s("button", {
        class: "button p-4 transition shadow-lg flex items-center justify-center",
        onClick: t[0] || (t[0] = (i) => l.value = !l.value)
      }, [
        N,
        S(_.$slots, "default")
      ]),
      c(e(B), {
        class: "text-center",
        open: l.value,
        onClose: t[3] || (t[3] = (i) => l.value = !1)
      }, {
        default: g(() => [
          c(e($), {
            class: "max-w-full",
            data: e(a)
          }, null, 8, ["data"]),
          s("div", V, [
            s("div", Q, w(e(a)), 1),
            s("div", j, [
              e(p) ? (o(), n("button", A, [
                s("div", {
                  class: "i-la-copy",
                  onClick: t[1] || (t[1] = (i) => e(u)(e(a)))
                }),
                e(m) ? (o(), n("div", D, "Copied!")) : (o(), n("div", E, "Copy"))
              ])) : d("", !0),
              e(v) ? (o(), n("button", U, [
                s("div", {
                  class: "i-la-share",
                  onClick: t[2] || (t[2] = (i) => e(f)({ title: "Look at this", text: "A gun-vue page", url: e(a) }))
                }),
                q
              ])) : d("", !0)
            ])
          ])
        ]),
        _: 1
      }, 8, ["open"])
    ]));
  }
});
export {
  I as default
};
//# sourceMappingURL=QrShare-5a3bda02.js.map
