import { C as t, u as a, b as s } from "../.chunks/forms-BAUgA7Ct.es.js";
async function r(o, e = !1) {
  let i = !1;
  return navigator.clipboard && (await navigator.clipboard.writeText(o), i = !0, e && t.notice(a().Common.Copied_to_clipboard + "", "info")), i;
}
async function l(o) {
  let e = !1;
  s() || (e = await r(o));
  const i = '<a href="' + o + '" target="_blank">' + o + "</a>", n = a().Common.Copied_to_clipboard + `:
` + i;
  if (e)
    t.notice(n, "info");
  else {
    if (!navigator.clipboard) {
      t.notice(a().Common.Cannot_copied_to_clipboard + `:
` + a().Common.Copy_guest_link_manually + `
` + i, "error");
      return;
    }
    const c = {
      onclick: () => r(o).then(() => t.notice(n, "info")),
      default: a().Common.Copy + "",
      class: "copy"
    };
    await t.notice(a().Common.Guest_link_created + `
` + i, "info", { buttonProps: c });
  }
}
export {
  l as guestLinkToClipboard,
  r as setClipboard
};
//# sourceMappingURL=clipboard.js.map
