MCPcopy
hub / github.com/vercel/next.js / qr

Function qr

packages/next/src/compiled/@vercel/og/index.edge.js:18262–18285  ·  view source on GitHub ↗
({ id: e, width: t, height: n, left: r, top: i }, { image: o, size: s, position: a, repeat: u2 }, f, l2)

Source from the content-addressed store, hash-verified

18260 }).filter((o) => o !== null) : [r, i]).map((o, s) => eo(o, [t, n][s]));
18261}
18262async function qr({ id: e, width: t, height: n, left: r, top: i }, { image: o, size: s, position: a, repeat: u2 }, f, l2) {
18263 u2 = u2 || "repeat", l2 = l2 || "background";
18264 let p = u2 === "repeat-x" || u2 === "repeat", h2 = u2 === "repeat-y" || u2 === "repeat", m2 = s && (s === "cover" || s === "contain" || s === "auto" || s.includes("auto")), b = o.startsWith("linear-gradient(") || o.startsWith("repeating-linear-gradient(") || o.startsWith("radial-gradient(") || o.startsWith("repeating-radial-gradient("), y = m2 && b ? [t, n] : m2 ? [0, 0] : Zi(s, { x: t, y: n, defaultX: t, defaultY: n }), T = Zi(a, { x: t, y: n, defaultX: 0, defaultY: 0 });
18265 if (o.startsWith("linear-gradient(") || o.startsWith("repeating-linear-gradient("))
18266 return eu({ id: e, width: t, height: n, repeatX: p, repeatY: h2 }, o, y, T, f, l2);
18267 if (o.startsWith("radial-gradient(") || o.startsWith("repeating-radial-gradient("))
18268 return ru({ id: e, width: t, height: n, repeatX: p, repeatY: h2 }, o, y, T, f, l2);
18269 if (o.startsWith("url(")) {
18270 let [k, P2, w2] = await xr(o.slice(4, -1)), S2, O;
18271 if (m2) {
18272 let [I, F] = Wd(s, t, n, P2, w2);
18273 S2 = I, O = F;
18274 } else {
18275 let I = Zi(s, { x: t, y: n, defaultX: 0, defaultY: 0 });
18276 S2 = l2 === "mask" ? P2 || I[0] : I[0] || P2, O = l2 === "mask" ? w2 || I[1] : I[1] || w2;
18277 }
18278 return [`satori_bi${e}`, M("pattern", { id: `satori_bi${e}`, patternContentUnits: "userSpaceOnUse", patternUnits: "userSpaceOnUse", x: T[0] + r, y: T[1] + i, width: p ? S2 : "100%", height: h2 ? O : "100%" }, M("image", { x: 0, y: 0, width: S2, height: O, preserveAspectRatio: "none", href: k }))];
18279 }
18280 if (index_esm_default(o)) {
18281 let k = index_esm_default(o), [P2, w2, S2, O] = k.values, F = `rgba(${P2},${w2},${S2},${O !== void 0 ? O : 1})`;
18282 return [`satori_bi${e}`, M("pattern", { id: `satori_bi${e}`, patternContentUnits: "userSpaceOnUse", patternUnits: "userSpaceOnUse", x: r, y: i, width: t, height: n }, M("rect", { x: 0, y: 0, width: t, height: n, fill: F }))];
18283 }
18284 throw new Error(`Invalid background image: "${o}"`);
18285}
18286function Fd([e, t]) {
18287 return Math.round(e * 1e3) === 0 && Math.round(t * 1e3) === 0 ? 0 : Math.round(e * t / Math.sqrt(e * e + t * t) * 1e3) / 1e3;
18288}

Callers 15

noFunction · 0.70
zrFunction · 0.70
baseKeysFunction · 0.50
lazyValueFunction · 0.50
baseInRangeFunction · 0.50
baseIntersectionFunction · 0.50
baseSortedIndexByFunction · 0.50
createRoundFunction · 0.50
getViewFunction · 0.50
mergeDataFunction · 0.50
reorderFunction · 0.50
findLastIndexFunction · 0.50

Calls 9

WdFunction · 0.85
includesMethod · 0.80
startsWithMethod · 0.80
ZiFunction · 0.70
euFunction · 0.70
ruFunction · 0.70
xrFunction · 0.70
MFunction · 0.70
sliceMethod · 0.45

Tested by

no test coverage detected