UNPKG

@wix/cli

Version:

CLI tool for building Wix sites and applications

114 lines (113 loc) 4.07 kB
import { createRequire as _createRequire } from 'node:module'; const require = _createRequire(import.meta.url); import { Qp } from "./chunk-HVUWKADU.js"; import "./chunk-A4SLQB4K.js"; import "./chunk-TQF2C25T.js"; import "./chunk-MZDJNQLB.js"; import "./chunk-QNHANFRW.js"; import { init_esm_shims } from "./chunk-EXLZF52D.js"; // ../../node_modules/@wix/zero-config-implementation/dist/index-BsFTHTaQ.js init_esm_shims(); function h(r, a) { for (var i = 0; i < a.length; i++) { const o = a[i]; if (typeof o != "string" && !Array.isArray(o)) { for (const c in o) if (c !== "default" && !(c in r)) { const n = Object.getOwnPropertyDescriptor(o, c); n && Object.defineProperty(r, c, n.get ? n : { enumerable: true, get: () => o[c] }); } } } return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" })); } var g; var v; function E() { return v || (v = 1, g = function() { var r = document.getSelection(); if (!r.rangeCount) return function() { }; for (var a = document.activeElement, i = [], o = 0; o < r.rangeCount; o++) i.push(r.getRangeAt(o)); switch (a.tagName.toUpperCase()) { // .toUpperCase handles XHTML case "INPUT": case "TEXTAREA": a.blur(); break; default: a = null; break; } return r.removeAllRanges(), function() { r.type === "Caret" && r.removeAllRanges(), r.rangeCount || i.forEach(function(c) { r.addRange(c); }), a && a.focus(); }; }), g; } var y; var C; function T() { if (C) return y; C = 1; var r = E(), a = { "text/plain": "Text", "text/html": "Url", default: "Text" }, i = "Copy to clipboard: #{key}, Enter"; function o(n) { var t = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C"; return n.replace(/#{\s*key\s*}/g, t); } function c(n, t) { var s, m, b, d, u, e, f = false; t || (t = {}), s = t.debug || false; try { b = r(), d = document.createRange(), u = document.getSelection(), e = document.createElement("span"), e.textContent = n, e.ariaHidden = "true", e.style.all = "unset", e.style.position = "fixed", e.style.top = 0, e.style.clip = "rect(0, 0, 0, 0)", e.style.whiteSpace = "pre", e.style.webkitUserSelect = "text", e.style.MozUserSelect = "text", e.style.msUserSelect = "text", e.style.userSelect = "text", e.addEventListener("copy", function(l) { if (l.stopPropagation(), t.format) if (l.preventDefault(), typeof l.clipboardData > "u") { s && console.warn("unable to use e.clipboardData"), s && console.warn("trying IE specific stuff"), window.clipboardData.clearData(); var p = a[t.format] || a.default; window.clipboardData.setData(p, n); } else l.clipboardData.clearData(), l.clipboardData.setData(t.format, n); t.onCopy && (l.preventDefault(), t.onCopy(l.clipboardData)); }), document.body.appendChild(e), d.selectNodeContents(e), u.addRange(d); var D = document.execCommand("copy"); if (!D) throw new Error("copy command was unsuccessful"); f = true; } catch (l) { s && console.error("unable to copy using execCommand: ", l), s && console.warn("trying IE specific stuff"); try { window.clipboardData.setData(t.format || "text", n), t.onCopy && t.onCopy(window.clipboardData), f = true; } catch (p) { s && console.error("unable to copy using clipboardData: ", p), s && console.error("falling back to prompt"), m = o("message" in t ? t.message : i), window.prompt(m, n); } } finally { u && (typeof u.removeRange == "function" ? u.removeRange(d) : u.removeAllRanges()), e && document.body.removeChild(e), b(); } return f; } return y = c, y; } var w = T(); var R = /* @__PURE__ */ Qp(w); var A = /* @__PURE__ */ h({ __proto__: null, default: R }, [w]); export { A as i }; //# sourceMappingURL=index-BsFTHTaQ-TJEGLQ63.js.map