1 line
40 KiB
JavaScript
1 line
40 KiB
JavaScript
|
import { b as _s, c as zs, s as Ns, g as qs } from "./setting-utils.CmAt4it9.js"; const Ne = new MutationObserver(Gn); function Gn() { Ne.disconnect(); let t = Array.from(document.querySelectorAll("pre")); for (let e of t) { if ("DIV" === e.parentElement?.nodeName && e.parentElement?.classList.contains("code-block")) continue; let t = document.createElement("div"); t.className = "relative code-block"; let n = document.createElement("button"); n.className = "copy-btn btn-regular-dark absolute active:scale-90 h-8 w-8 top-2 right-2 opacity-75 text-sm p-1.5 rounded-lg transition-all ease-in-out", e.setAttribute("tabindex", "0"), e.parentNode && e.parentNode.insertBefore(t, e); let o, s = '<svg class="copy-btn-icon copy-icon" xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px"><path d="M368.37-237.37q-34.48 0-58.74-24.26-24.26-24.26-24.26-58.74v-474.26q0-34.48 24.26-58.74 24.26-24.26 58.74-24.26h378.26q34.48 0 58.74 24.26 24.26 24.26 24.26 58.74v474.26q0 34.48-24.26 58.74-24.26 24.26-58.74 24.26H368.37Zm0-83h378.26v-474.26H368.37v474.26Zm-155 238q-34.48 0-58.74-24.26-24.26-24.26-24.26-58.74v-515.76q0-17.45 11.96-29.48 11.97-12.02 29.33-12.02t29.54 12.02q12.17 12.03 12.17 29.48v515.76h419.76q17.45 0 29.48 11.96 12.02 11.97 12.02 29.33t-12.02 29.54q-12.03 12.17-29.48 12.17H213.37Zm155-238v-474.26 474.26Z"/></svg>', r = '<svg class="copy-btn-icon success-icon" xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px"><path d="m389-377.13 294.7-294.7q12.58-12.67 29.52-12.67 16.93 0 29.61 12.67 12.67 12.68 12.67 29.53 0 16.86-12.28 29.14L419.07-288.41q-12.59 12.67-29.52 12.67-16.94 0-29.62-12.67L217.41-430.93q-12.67-12.68-12.79-29.45-.12-16.77 12.55-29.45 12.68-12.67 29.62-12.67 16.93 0 29.28 12.67L389-377.13Z"/></svg>'; n.innerHTML = `<div>${s} ${r}</div>\n `, t.appendChild(e), t.appendChild(n), n.addEventListener("click", (async () => { o && clearTimeout(o); let t = e?.querySelector("code")?.innerText; await navigator.clipboard.writeText(t), n.classList.add("success"), o = setTimeout((() => { n.classList.remove("success") }), 1e3) })) } Ne.observe(document.body, { childList: !0, subtree: !0 }) } Ne.observe(document.body, { childList: !0, subtree: !0 }), document.addEventListener("DOMContentLoaded", Gn); const ht = (t, e) => { const { o: n, i: o, u: s } = t; let r, c = n; const i = (t, e) => { const n = c, i = t, l = e || (o ? !o(n, i) : n !== i); return (l || s) && (c = i, r = n), [c, l, r] }; return [e ? t => i(e(c, r), t) : i, t => [c, !!t, r]] }, Un = typeof window < "u" && typeof document < "u", ft = Un ? window : {}, Wn = Math.max, Vs = Math.min, qe = Math.round, ye = Math.abs, xn = Math.sign, Zn = ft.cancelAnimationFrame, on = ft.requestAnimationFrame, ve = ft.setTimeout, Ve = ft.clearTimeout, Ce = t => typeof ft[t] < "u" ? ft[t] : void 0, Fs = Ce("MutationObserver"), En = Ce("IntersectionObserver"), be = Ce("ResizeObserver"), Fe = Ce("ScrollTimeline"), Kn = Un && Node.ELEMENT_NODE, { toString: Xo, hasOwnProperty: Re } = Object.prototype, Oe = t => void 0 === t, cn = t => null === t, Ot = t => "number" == typeof t, $e = t => "string" == typeof t, Xn = t => "boolean" == typeof t, wt = t => "function" == typeof t, $t = t => Array.isArray(t), ee = t => "object" == typeof t && !$t(t) && !cn(t), Le = t => { const e = !!t && t.length, n = Ot(e) && e > -1 && e % 1 == 0; return !!($t(t) || !wt(t) && n) && (!(e > 0 && ee(t)) || e - 1 in t) }, we = t => { if (!t || !ee(t)) return !1; let e; const n = "constructor", o = t[n], s = o && o.prototype, r = Re.call(t, n), c = s && Re.call(s, "isPrototypeOf"); if (o && !r && !c) return !1; for (e in t); return Oe(e) || Re.call(t, e) }, Se = t => { const e = HTMLElement; return !!t && (e ? t instanceof e : t.nodeType === Kn) }, Te = t => { const e = Element; return !!t && (e ? t instanceof e : t.nodeType === Kn) }; function Z(t, e) { if (Le(t)) for (let n = 0; n < t.length && !1 !== e(t[n], n, t); n++); else t && Z(Object.keys(t), (n => e(t[n], n, t))); return t } const rn = (t, e) => t.indexOf(e) >= 0, At = (t, e) => t.co
|