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