/** * resources/js/term-tooltip.js */ import * as bootstrap from "bootstrap"; (function () { "use strict"; // ── 缓存层 ──────────────────────────────────────────────────────── const cache = {}; async function fetchTerm(id) { if (cache[id]) return cache[id]; const res = await fetch(`/api/v2/terms/${id}`); if (!res.ok) throw new Error(`fetchTerm ${id} failed: ${res.status}`); const json = await res.json(); cache[id] = json.data; return json.data; } // ── 设备判断 ────────────────────────────────────────────────────── const isMobile = () => window.innerWidth < 768; // ── Skeleton 模板 ───────────────────────────────────────────────── function buildSkeletonContent() { return `