{"m":{"core/lazy.js":[[],"// Lazy modules (SPEC F814 / F815 loading architecture). ONE entry for everything that is not part of the first\n// load: route views, vendored libraries (marked, purify, qrcode, confetti) and the chart module.\n//\n//   lazy('qrcode')            → Promise<module>   (cached; a failed load is forgotten, so calling again retries)\n//   viewLoader('login')       → () => lazy('view:login')   (what core/routes.js puts on every route)\n//   registerLazy({ name: () => Promise<module> })\n//\n// This file holds no import() itself. The loaders are registered by the entry module:\n//   app.js       registers core/lazy-loaders.js — one literal dynamic import() per name (the normal path);\n//   app.full.js  registers modules it imported statically (the single-bundle fallback for engines without import()).\n// So code that needs a lazy module never writes import() — it calls lazy(name), and works in both entries.\n\nconst loaders = new Map();\nconst pending = new Map();\n\n/** Add (or replace) loaders: {name: () => Promise<module>}. Replacing a loader forgets its cached module. */\nexport function registerLazy(map) {\n  for (const [name, loader] of Object.entries(map || {})) {\n    if (typeof loader !== 'function') throw new TypeError(`lazy loader for \"${name}\" must be a function`);\n    loaders.set(name, loader);\n    pending.delete(name);\n  }\n}\n\nexport function hasLazy(name) {\n  return loaders.has(name);\n}\n\nexport function lazyNames() {\n  return [...loaders.keys()];\n}\n\n/** Load a registered module once. Rejects for an unknown name; a rejected load is not cached. */\nexport function lazy(name) {\n  const cached = pending.get(name);\n  if (cached) return cached;\n  const loader = loaders.get(name);\n  if (!loader) return Promise.reject(new Error(`unknown lazy module \"${name}\"`));\n  let promise;\n  try {\n    promise = Promise.resolve(loader());\n  } catch (err) {\n    return Promise.reject(err);\n  }\n  pending.set(name, promise);\n  promise.catch(() => { if (pending.get(name) === promise) pending.delete(name); });\n  return promise;\n}\n\nexport const VIEW_PREFIX = 'view:';\n\n/** The lazy loader of a view module (../views/<name>.js): what a route's `load` is. */\nexport function viewLoader(name) {\n  return () => lazy(VIEW_PREFIX + name);\n}\n\n/** Tests only: forget every loader and cached module. */\nexport function resetLazy() {\n  loaders.clear();\n  pending.clear();\n}\n"],"core/lazy-loaders.js":[[],"// The ONLY file of the theme that contains dynamic import() (tests/js/lychee-loading.test.mjs enforces it).\n// One literal specifier per lazy module, so that\n//  - engines without import() never parse this file (app.full.js does not import it),\n//  - a publish step can rewrite the specifiers to content-hashed file names and list them for preloading\n//    (docs/deploy/split-edge.md「用户端资源文件名与缓存」).\n// Names: `view:<name>` for route views (core/routes.js), bare names for libraries (see core/lazy.js).\nexport const LAZY_LOADERS = {\n  'view:login': () => window.__lyImport('views/login.js'),\n  'view:register': () => window.__lyImport('views/register.js'),\n  'view:forgetpassword': () => window.__lyImport('views/forgetpassword.js'),\n  'view:dashboard': () => window.__lyImport('views/dashboard.js'),\n  'view:plan': () => window.__lyImport('views/plan.js'),\n  'view:plan-detail': () => window.__lyImport('views/plan-detail.js'),\n  'view:order': () => window.__lyImport('views/order.js'),\n  'view:order-detail': () => window.__lyImport('views/order-detail.js'),\n  'view:ticket': () => window.__lyImport('views/ticket.js'),\n  'view:ticket-detail': () => window.__lyImport('views/ticket-detail.js'),\n  'view:invite': () => window.__lyImport('views/invite.js'),\n  'view:profile': () => window.__lyImport('views/profile.js'),\n  'view:knowledge': () => window.__lyImport('views/knowledge.js'),\n  'view:knowledge-detail': () => window.__lyImport('views/knowledge-detail.js'),\n  'view:node': () => window.__lyImport('views/node.js'),\n  'view:traffic': () => window.__lyImport('views/traffic.js'),\n  'view:components': () => window.__lyImport('views/components.js'),\n  'view:not-found': () => window.__lyImport('views/not-found.js'),\n  marked: () => window.__lyImport('vendor/marked.js'),\n  purify: () => window.__lyImport('vendor/purify.js'),\n  qrcode: () => window.__lyImport('vendor/qrcode.js'),\n  confetti: () => window.__lyImport('vendor/confetti.js'),\n  chart: () => window.__lyImport('ui/chart.js'),\n};\n"],"core/router.js":[[],"// Hash router (F107). Pure functions on top, the DOM-bound Router class at the bottom. No globals at import time,\n// so node --test can exercise every function directly.\n\n/** \"a=1&b=x%20y\" → {a:'1', b:'x y'}; a repeated key keeps its last value; malformed escapes are kept as-is. */\nexport function parseQuery(qs) {\n  const out = {};\n  const text = String(qs || '').replace(/^\\?/, '');\n  if (!text) return out;\n  for (const part of text.split('&')) {\n    if (!part) continue;\n    const eq = part.indexOf('=');\n    const key = safeDecode(eq === -1 ? part : part.slice(0, eq));\n    const value = eq === -1 ? '' : safeDecode(part.slice(eq + 1));\n    if (key) out[key] = value;\n  }\n  return out;\n}\n\nfunction safeDecode(text) {\n  try {\n    return decodeURIComponent(String(text).replace(/\\+/g, ' '));\n  } catch (e) {\n    return String(text);\n  }\n}\n\n/** {a:'1'} → \"a=1\" (null / undefined / '' skipped). */\nexport function stringifyQuery(query) {\n  return Object.keys(query || {})\n    .filter((k) => query[k] !== null && query[k] !== undefined && query[k] !== '')\n    .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(String(query[k]))}`)\n    .join('&');\n}\n\n/** \"#/plan/3?x=1\" → {path:'/plan/3', query:{x:'1'}, search:'x=1'}. Empty hash → path '/'. Trailing slash dropped. */\nexport function parseHash(hash) {\n  let text = String(hash || '').replace(/^#/, '');\n  const q = text.indexOf('?');\n  const search = q === -1 ? '' : text.slice(q + 1);\n  text = q === -1 ? text : text.slice(0, q);\n  let path = '/' + text.replace(/^\\/+/, '');\n  if (path.length > 1) path = path.replace(/\\/+$/, '');\n  return { path, query: parseQuery(search), search };\n}\n\n/** '/plan/:id' → {regex, keys:['id']}. A param matches one non-empty segment. */\nexport function compile(pattern) {\n  const keys = [];\n  const source = String(pattern)\n    .split('/')\n    .map((seg) => {\n      if (seg.startsWith(':')) {\n        keys.push(seg.slice(1));\n        return '([^/]+)';\n      }\n      return seg.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n    })\n    .join('/');\n  return { regex: new RegExp(`^${source}$`), keys };\n}\n\n/** Route table entries {name, path, view, auth?, guestOnly?, title?} → same entries with a compiled matcher. */\nexport function createRoutes(table) {\n  return table.map((route) => ({ ...route, ...compile(route.path) }));\n}\n\n/** First route matching path → {route, params} (params URI-decoded), or null. */\nexport function match(routes, path) {\n  for (const route of routes) {\n    const m = route.regex.exec(path);\n    if (!m) continue;\n    const params = {};\n    route.keys.forEach((key, i) => { params[key] = safeDecode(m[i + 1]); });\n    return { route, params };\n  }\n  return null;\n}\n\n/** Only an in-app path (\"/order/ABC?x=1\") is a valid return target; anything else (//host, http:, \\\\) is ignored. */\nexport function safeRedirect(value) {\n  if (typeof value !== 'string' || value.length > 512) return null;\n  if (value.charAt(0) !== '/' || value.charAt(1) === '/' || value.charAt(1) === '\\\\') return null;\n  if (/[\\u0000-\\u001f]/.test(value)) return null;\n  return value;\n}\n\n/**\n * Return target after logging in: safeRedirect(), plus the bare form the back end puts in quick-login links\n * (\"dashboard\", \"order/ABC\"): a first segment of letters / digits / _ / - cannot be a scheme or a host, so it is\n * read as an in-app path.\n */\nexport function returnTarget(value) {\n  const safe = safeRedirect(value);\n  if (safe) return safe;\n  if (typeof value === 'string' && /^[A-Za-z0-9_-]+(?:[/?][^\\s\\\\]*)?$/.test(value)) return safeRedirect(`/${value}`);\n  return null;\n}\n\nexport function loginRedirect(path, search, loginPath = '/login') {\n  const target = search ? `${path}?${search}` : path;\n  return `${loginPath}?${stringifyQuery({ redirect: target })}`;\n}\n\n/**\n * What to show for a hash:\n *  {type:'redirect', to}                                   (guard decisions, the bare \"/\")\n *  {type:'view', route, params, query, path}              (matched; unknown paths → the notFound route)\n * Protected routes (auth: true) need a login; guest-only routes (login, register, …) send a logged-in visitor to\n * ?redirect= (when safe) or the home route. Public routes (auth false, guestOnly false) are open to both.\n */\nexport function resolve(routes, hash, { loggedIn = false, home = '/dashboard', loginPath = '/login', notFound = null, dev = false } = {}) {\n  const { path, query, search } = parseHash(hash);\n  if (path === '/') return { type: 'redirect', to: loggedIn ? home : loginPath };\n  const found = match(routes, path);\n  if (!found || (found.route.devOnly && !dev)) {\n    return { type: 'view', route: notFound, params: {}, query, path, notFound: true };\n  }\n  const { route, params } = found;\n  if (route.auth && !loggedIn) return { type: 'redirect', to: loginRedirect(path, search, loginPath) };\n  if (route.guestOnly && loggedIn) return { type: 'redirect', to: returnTarget(query.redirect) || home };\n  return { type: 'view', route, params, query, path };\n}\n\n/**\n * Browser router: listens to hashchange, resolves, lazy-loads the view module and swaps views.\n *  - Redirects use location.replace, so Back never lands on a guard redirect.\n *  - Navigation is \"last one wins\": a slow view import that finishes after a newer navigation is dropped.\n *  - The previous view's context is disposed (timers, listeners, requests) before the next one mounts.\n */\nexport class Router {\n  /**\n   * @param {{routes, notFound, outlet, loadView:(name, route)=>Promise<{mount}>, isLoggedIn:()=>boolean,\n   *          createContext:(info)=>object, onError?:(err, info)=>void, onChange?:(info)=>void, win?:Window}} options\n   */\n  constructor(options) {\n    this.options = options;\n    this.win = options.win || window;\n    this.current = null;\n    this.context = null;\n    this.seq = 0;\n    this.onHashChange = () => this.render();\n  }\n\n  start() {\n    this.win.addEventListener('hashchange', this.onHashChange);\n    return this.render();\n  }\n\n  stop() {\n    this.win.removeEventListener('hashchange', this.onHashChange);\n    this.teardown();\n  }\n\n  /** Go to an in-app path (\"/plan/3?period=month\"). */\n  navigate(to, { replace = false } = {}) {\n    const hash = '#' + to;\n    if (this.win.location.hash === hash) return this.render();\n    if (replace) this.win.location.replace(hash);\n    else this.win.location.hash = hash;\n    return undefined;\n  }\n\n  teardown() {\n    if (this.context) {\n      try { this.context.dispose(); } catch (e) { /* a broken unmount must not block navigation */ }\n    }\n    this.context = null;\n  }\n\n  async render() {\n    const seq = ++this.seq;\n    const { routes, notFound, outlet, loadView, isLoggedIn, createContext, dev = false } = this.options;\n    const result = resolve(routes, this.win.location.hash, { loggedIn: !!isLoggedIn(), notFound, dev });\n    if (result.type === 'redirect') {\n      this.win.location.replace('#' + result.to);\n      return result;\n    }\n    // The route has changed now. Told at once — before the view's code is loaded and before its mount (which usually\n    // waits for data) is awaited: the shell's highlight, title and layout follow the click together with the page\n    // skeleton instead of lagging behind by a network round trip, and a view that finishes mounting after a newer\n    // navigation has nothing left to report (it used to put the shell back into its own route's layout).\n    if (this.options.onChange) this.options.onChange(result);\n    let mod;\n    try {\n      const loading = loadView(result.route.view, result.route);\n      // SPEC F815: a view whose code is not loaded yet gets a skeleton of its page at once (no blank outlet while the\n      // chunk travels); a loaded one resolves in the same tick and draws its own content / skeleton\n      if (this.options.onPending && loading && typeof loading.then === 'function') {\n        let settled = false;\n        loading.then(() => { settled = true; }, () => { settled = true; });\n        await Promise.resolve();\n        await Promise.resolve();\n        if (!settled && seq === this.seq) { this.teardown(); this.options.onPending(result); }\n      }\n      mod = await loading;\n    } catch (err) {\n      if (seq !== this.seq) return null;\n      this.teardown();\n      if (this.options.onError) this.options.onError(err, result);\n      return result;\n    }\n    if (seq !== this.seq) return null; // a newer navigation took over\n    this.teardown();\n    outlet.replaceChildren();\n    const ctx = createContext(result);\n    this.context = ctx;\n    this.current = result;\n    let unmount;\n    try {\n      unmount = await mod.mount(outlet, ctx);\n    } catch (err) {\n      if (seq !== this.seq) return null;\n      if (this.options.onError) this.options.onError(err, result);\n    }\n    if (seq !== this.seq) {\n      // a newer navigation took over while this view was still mounting (e.g. signing in before the login view's own\n      // requests came back): that navigation owns the outlet and has disposed this context — run the late unmount\n      if (typeof unmount === 'function') {\n        try { unmount(); } catch (e) { /* a broken unmount must not block navigation */ }\n      }\n      return null;\n    }\n    if (typeof unmount === 'function') ctx.onCleanup(unmount);\n    return result;\n  }\n}\n"],"core/prefetch.js":[[],"// Code prefetch (SPEC F815 item 3): when the pointer rests on / a finger touches a navigation link, the target route's\n// code starts loading; once the browser is idle after the first page, the code of the sidebar's first 4 routes is\n// loaded one at a time. Only code — a view module does nothing at import time, so no user data is requested. Nothing\n// is prefetched in data-saver mode (navigator.connection.saveData). Pure scheduling; main.js wires it to the page.\n\nexport const IDLE_ROUTES = 4;\n\n/**\n * createPrefetcher({ load(view) → Promise, viewOf(hash) → view name | null, saveData() → bool,\n *   idle(fn) → schedules fn when the browser is idle })\n *  .intent(href)        hover / touch on a link to href (\"#/plan\")\n *  .idle(views)         after the first page: prefetch views one per idle callback\n *  .done                Set of views already requested (each is loaded at most once)\n */\nexport function createPrefetcher({ load, viewOf, saveData = () => false, idle = (fn) => setTimeout(fn, 1) }) {\n  const done = new Set();\n  function prefetch(view) {\n    if (!view || done.has(view) || saveData()) return false;\n    done.add(view);\n    Promise.resolve().then(() => load(view)).catch(() => { done.delete(view); });\n    return true;\n  }\n  return {\n    done,\n    prefetch,\n    intent(href) {\n      const m = /^#(\\/[^?#]*)/.exec(String(href || ''));\n      return m ? prefetch(viewOf(`#${m[1]}`)) : false;\n    },\n    idle(views) {\n      if (saveData()) return;\n      const queue = views.filter((v) => !done.has(v));\n      const next = () => {\n        const view = queue.shift();\n        if (!view) return;\n        prefetch(view);\n        if (queue.length) idle(next);\n      };\n      if (queue.length) idle(next);\n    },\n  };\n}\n\n/** The browser's idle callback (a 2 s timeout so it does run), else a short timer. */\nexport function idleCallback(win = globalThis) {\n  return (fn) => (typeof win.requestIdleCallback === 'function' ? win.requestIdleCallback(fn, { timeout: 2000 }) : win.setTimeout(fn, 200));\n}\n\n/** Data-saver mode of the browser (Network Information API). */\nexport function saveDataMode(nav = globalThis.navigator) {\n  return Boolean(nav && nav.connection && nav.connection.saveData);\n}\n"],"core/nav.js":[[],"// Navigation model of the app shell (F128, DESIGN.md §7.5). Pure data + functions (no DOM): tested with node.\n//   ≥ 1280  264px sidebar with these groups · 768–1279 72px icon rail · < 768 bottom tab bar (TABS) + 「更多」 drawer\n// Detail routes highlight their list page (plan-detail → plan, order-detail → order, ticket-detail → ticket).\n\nexport const NAV_GROUPS = [\n  { id: 'base', title: 'nav.group.base', items: [\n    { route: 'dashboard', path: '/dashboard', title: 'route.dashboard', icon: 'layout-dashboard' },\n    { route: 'knowledge', path: '/knowledge', title: 'route.knowledge', icon: 'book-open' },\n  ] },\n  { id: 'subscription', title: 'nav.group.subscription', items: [\n    { route: 'plan', path: '/plan', title: 'route.plan', icon: 'shopping-cart' },\n    { route: 'node', path: '/node', title: 'route.node', icon: 'server' },\n  ] },\n  { id: 'finance', title: 'nav.group.finance', items: [\n    { route: 'order', path: '/order', title: 'route.order', icon: 'receipt' },\n    { route: 'invite', path: '/invite', title: 'route.invite', icon: 'gift' },\n  ] },\n  { id: 'personal', title: 'nav.group.personal', items: [\n    { route: 'profile', path: '/profile', title: 'route.profile', icon: 'user' },\n    { route: 'ticket', path: '/ticket', title: 'route.ticket', icon: 'message-square' },\n    { route: 'traffic', path: '/traffic', title: 'route.traffic', icon: 'chart-column' },\n  ] },\n];\n\nexport const NAV_ITEMS = NAV_GROUPS.flatMap((g) => g.items);\nconst byRoute = new Map(NAV_ITEMS.map((i) => [i.route, i]));\n\n/** Phone tab bar: four destinations + 「更多」 (opens the drawer with everything else). */\n// tabs carry short labels (DESIGN.md §7.5: 仪表盘 / 套餐 / 订单 / 工单 / 更多) so nothing is cut off at 375px\nexport const TABS = ['dashboard', 'plan', 'order', 'ticket'].map((r) => ({ ...byRoute.get(r), tabTitle: `nav.tab.${r}` }));\nexport const MORE_TAB = { route: '#more', title: 'nav.more', icon: 'ellipsis' };\n/** Entries of the 「更多」 drawer: every nav item that is not a tab, in sidebar order. */\nexport const MORE_ITEMS = NAV_ITEMS.filter((i) => !TABS.some((t) => t.route === i.route));\n\nconst PARENT = { 'plan-detail': 'plan', 'order-detail': 'order', 'ticket-detail': 'ticket', 'knowledge-detail': 'knowledge' };\n\n/** The nav item a route belongs to ('' when none, e.g. the 404 view). */\nexport function activeRoute(routeName) {\n  const name = PARENT[routeName] || routeName;\n  return byRoute.has(name) ? name : '';\n}\n\n/** True when the 「更多」 tab should look selected (current page lives in the drawer). */\nexport function moreActive(routeName) {\n  const a = activeRoute(routeName);\n  return !!a && MORE_ITEMS.some((i) => i.route === a);\n}\n\n/** Routes rendered without the shell: login / register / forgot password, and anything shown to a visitor. */\nexport function isBare(route, loggedIn) {\n  if (!route) return !loggedIn;\n  if (route.guestOnly) return true;\n  return !loggedIn;\n}\n\n/** Navigation form for a viewport width (DESIGN.md §7.7). */\nexport function navMode(width) {\n  if (width >= 1280) return 'sidebar';\n  if (width >= 768) return 'rail';\n  return 'tabs';\n}\n\n/** Initial for the avatar: first letter of the e-mail's local part, upper-cased ('?' when unknown). */\nexport function initialOf(email) {\n  const s = String(email || '').trim();\n  return s ? s[0].toUpperCase() : '?';\n}\n"],"core/routes.js":[["core/lazy.js"],"// Route table (F107, SPEC F34 \"路由兼容\"). Links generated by the back end (payment return URL, e-mail login, invite\n// links) must land here, so the paths follow the default theme's. `view` names a module in ../views/; `load` is its\n// lazy loader (route → loader; the module is fetched on the first visit, see core/lazy.js — this file has no\n// import() of its own, so both entries, app.js and the single-bundle app.full.js, share the table).\n// `title` is an i18n key. auth: login required; guestOnly: login / register pages (a logged-in visitor goes on).\nimport { viewLoader } from '@@lydep:0@@';\n\nexport const ROUTES = [\n  { name: 'login', path: '/login', view: 'login', title: 'route.login', guestOnly: true, load: viewLoader('login') },\n  { name: 'register', path: '/register', view: 'register', title: 'route.register', guestOnly: true, load: viewLoader('register') },\n  { name: 'forgetpassword', path: '/forgetpassword', view: 'forgetpassword', title: 'route.forgetpassword', guestOnly: true, load: viewLoader('forgetpassword') },\n  { name: 'dashboard', path: '/dashboard', view: 'dashboard', title: 'route.dashboard', auth: true, load: viewLoader('dashboard') },\n  { name: 'plan', path: '/plan', view: 'plan', title: 'route.plan', auth: true, load: viewLoader('plan') },\n  { name: 'plan-detail', path: '/plan/:id', view: 'plan-detail', title: 'route.planDetail', auth: true, load: viewLoader('plan-detail') },\n  { name: 'order', path: '/order', view: 'order', title: 'route.order', auth: true, load: viewLoader('order') },\n  { name: 'order-detail', path: '/order/:trade_no', view: 'order-detail', title: 'route.orderDetail', auth: true, load: viewLoader('order-detail') },\n  { name: 'ticket', path: '/ticket', view: 'ticket', title: 'route.ticket', auth: true, load: viewLoader('ticket') },\n  { name: 'ticket-detail', path: '/ticket/:id', view: 'ticket-detail', title: 'route.ticketDetail', auth: true, load: viewLoader('ticket-detail') },\n  { name: 'invite', path: '/invite', view: 'invite', title: 'route.invite', auth: true, load: viewLoader('invite') },\n  { name: 'profile', path: '/profile', view: 'profile', title: 'route.profile', auth: true, load: viewLoader('profile') },\n  { name: 'knowledge', path: '/knowledge', view: 'knowledge', title: 'route.knowledge', auth: true, load: viewLoader('knowledge') },\n  { name: 'knowledge-detail', path: '/knowledge/:id', view: 'knowledge-detail', title: 'route.knowledgeDetail', auth: true, load: viewLoader('knowledge-detail') },\n  { name: 'node', path: '/node', view: 'node', title: 'route.node', auth: true, load: viewLoader('node') },\n  { name: 'traffic', path: '/traffic', view: 'traffic', title: 'route.traffic', auth: true, load: viewLoader('traffic') },\n  // Component gallery (DESIGN.md §7.6): development only (config.devTools; production answers with the 404 view).\n  { name: 'components', path: '/_components', view: 'components', title: 'route.components', devOnly: true, load: viewLoader('components') },\n];\n\nexport const NOT_FOUND = { name: 'not-found', path: '', view: 'not-found', title: 'route.notFound', load: viewLoader('not-found') };\nexport const HOME = '/dashboard';\nexport const LOGIN = '/login';\n"],"core/cache.js":[[],"// Request cache layer (SPEC F815), on top of the API client (core/api.js).\n//\n//   cache.get(key, fetcher, { maxAge, swr, revalidate })   → Promise<value>\n//   cache.invalidate(prefix)                   drop every entry whose key starts with prefix (''= everything)\n//   cache.clear()                              drop everything (login / logout)\n//   cache.preload(keys, promise, { ttl })      first-screen values that arrive in one response (user/bootstrap)\n//   createRequestCache({ onUpdate(key) })      a background revalidation brought different data for key\n//\n// maxAge (ms): how long a stored value is fresh. maxAge 0 (the default) is PASS-THROUGH: the fetcher runs on every\n// call and nothing is stored — exactly what the code did before this layer existed.\n// With maxAge > 0: a fresh value is returned without a request; concurrent calls for one key share one request;\n// a stale value is refetched — or, with swr, returned at once while it is refetched in the background; with\n// revalidate, a fresh value is returned at once AND refreshed in the background (the next read gets the result).\n// A failed request is never stored. Values are returned as stored: callers must not mutate them.\n//\n// Views do not call the cache directly: they call app.api.get(), which is the API client wrapped by\n// withRequestCache() — key and policy come from the request path (core/cache-policy.js). Direct use is for the few\n// places that combine several requests into one cached value.\n\nexport function createRequestCache({ now = () => Date.now(), onUpdate = null } = {}) {\n  /** key → { value, at } */\n  const values = new Map();\n  /** key → Promise (in-flight request of a cacheable key) */\n  const inflight = new Map();\n  /** bumped by invalidate / clear: a request started before must not store its result afterwards */\n  let generation = 0;\n  /** key → { promise (resolves to the value, or undefined = not provided), until } — see preload() */\n  const primed = new Map();\n\n  function takePrimed(key) {\n    const entry = primed.get(key);\n    if (!entry) return null;\n    if (now() > entry.until) { primed.delete(key); return null; }\n    return entry;\n  }\n\n  /** background: a revalidation behind a value already shown — onUpdate(key) when it brings different data */\n  function refresh(key, fetcher, background = false) {\n    const running = inflight.get(key);\n    if (running) return running;\n    const startedIn = generation;\n    const promise = Promise.resolve().then(fetcher).then(\n      (value) => {\n        if (inflight.get(key) === promise) inflight.delete(key);\n        if (startedIn === generation) {\n          const previous = values.get(key);\n          values.set(key, { value, at: now() });\n          if (background && onUpdate && previous && !same(previous.value, value)) {\n            try { onUpdate(key, value); } catch (e) { /* a listener must not break the cache */ }\n          }\n        }\n        return value;\n      },\n      (err) => {\n        if (inflight.get(key) === promise) inflight.delete(key);\n        throw err;\n      },\n    );\n    inflight.set(key, promise);\n    return promise;\n  }\n\n  return {\n    get(key, fetcher, { maxAge = 0, swr = false, revalidate = false, revalidateAfter = 1000 } = {}) {\n      const pre = takePrimed(key);\n      if (pre) {\n        primed.delete(key); // one read per preloaded value; later reads behave as before\n        const startedIn = generation;\n        return pre.promise.then((value) => {\n          if (value === undefined) return this.get(key, fetcher, { maxAge, swr, revalidate, revalidateAfter });\n          if (maxAge > 0 && startedIn === generation && !values.has(key)) values.set(key, { value, at: now() });\n          return value;\n        });\n      }\n      if (!(maxAge > 0)) return fetcher();\n      const hit = values.get(key);\n      if (hit) {\n        const age = now() - hit.at;\n        if (age < maxAge) {\n          // revalidate: answer from memory at once and refresh in the background (SPEC F815: reuse for 60 s while\n          // revalidating) — not again within revalidateAfter ms of the stored response\n          if (revalidate && age >= revalidateAfter) refresh(key, fetcher, true).catch(() => {});\n          return Promise.resolve(hit.value);\n        }\n        if (swr) {\n          refresh(key, fetcher, true).catch(() => {}); // the stale value stays; the next call tries again\n          return Promise.resolve(hit.value);\n        }\n      }\n      return refresh(key, fetcher);\n    },\n    /**\n     * First-screen data that arrives in one response (SPEC F814 item 5, user/bootstrap): `promise` resolves to an\n     * object key → value; the first read of each of `keys` within `ttl` ms waits for it instead of sending its own\n     * request — also a pass-through read (the value is as fresh as a request made at boot); later reads behave as\n     * if nothing had been preloaded. A key the object does not\n     * provide (undefined / null: that part failed on the server) and a rejected promise fall back to the read's own\n     * request, so callers see exactly the response (or error) the original endpoint gives.\n     */\n    preload(keys, promise, { ttl = 10000 } = {}) {\n      const all = Promise.resolve(promise).then((map) => map || {}, () => ({}));\n      const until = now() + ttl;\n      for (const key of keys) {\n        primed.set(key, { until, promise: all.then((map) => (map[key] === null ? undefined : map[key])) });\n      }\n    },\n    invalidate(prefix = '') {\n      generation++;\n      for (const key of [...primed.keys()]) if (key.startsWith(prefix)) primed.delete(key);\n      for (const key of [...values.keys()]) if (key.startsWith(prefix)) values.delete(key);\n      for (const key of [...inflight.keys()]) if (key.startsWith(prefix)) inflight.delete(key);\n    },\n    clear() {\n      generation++;\n      primed.clear();\n      values.clear();\n      inflight.clear();\n    },\n    /** Tests / diagnostics. */\n    has(key) { return values.has(key); },\n    get size() { return values.size; },\n  };\n}\n\nfunction same(a, b) {\n  if (a === b) return true;\n  try { return JSON.stringify(a) === JSON.stringify(b); } catch (e) { return false; }\n}\n\n/** Cache key of a read: the path without a leading slash + the query in a stable order (\"user/order/fetch?page=2\"). */\nexport function cacheKey(path, query) {\n  const base = String(path || '').replace(/^\\/+/, '');\n  const parts = [];\n  for (const k of Object.keys(query || {}).sort()) {\n    const v = query[k];\n    if (v === null || v === undefined || v === '') continue;\n    for (const item of Array.isArray(v) ? v : [v]) parts.push(`${encodeURIComponent(k)}=${encodeURIComponent(String(item))}`);\n  }\n  return parts.length ? `${base}?${parts.join('&')}` : base;\n}\n\n/**\n * The API client with every GET routed through the cache (same interface as createApiClient's result).\n *  - policyFor(path) → {maxAge, swr}; requests with opts.download or opts.raw, or opts.cache === false, are never stored.\n *  - A cached read is shared between callers, so it is sent without the caller's AbortSignal (leaving one page must\n *    not fail the request another page waits for); pass-through reads keep the signal.\n *  - After a successful write (POST / DELETE), invalidatedBy(path) → the key prefixes to drop; after a successful\n *    GET that changes data (or reports a change), invalidatedByRead(path) → the same (such a GET is never cached).\n */\nexport function withRequestCache(api, cache, { policyFor = () => ({ maxAge: 0 }), invalidatedBy = () => [], invalidatedByRead = () => [], onRead = null } = {}) {\n  function read(path, opts = {}) {\n    // a GET that changes data on the server (or reports that it changed): drop what it invalidates once it succeeds\n    const drops = invalidatedByRead(path) || [];\n    if (drops.length) {\n      return api.request('GET', path, opts).then((result) => { for (const prefix of drops) cache.invalidate(prefix); return result; });\n    }\n    const policy = opts.cache === false || opts.download || opts.raw ? { maxAge: 0 } : (policyFor(path) || { maxAge: 0 });\n    // raw reads resolve with the whole body, not body.data: their own key space (\"raw:\" + key)\n    const key = (opts.raw ? 'raw:' : '') + cacheKey(path, opts.query);\n    if (onRead && policy.maxAge > 0) onRead(key);\n    if (!(policy.maxAge > 0)) return cache.get(key, () => api.request('GET', path, opts), { maxAge: 0 });\n    const { signal, ...shared } = opts;\n    return cache.get(key, () => api.request('GET', path, shared), policy);\n  }\n  async function write(method, path, opts) {\n    const result = await api.request(method, path, opts);\n    for (const prefix of invalidatedBy(path) || []) cache.invalidate(prefix);\n    return result;\n  }\n  const request = (method, path, opts = {}) => (String(method).toUpperCase() === 'GET' ? read(path, opts) : write(method, path, opts));\n  return {\n    request,\n    get: (path, query, opts) => request('GET', path, { ...opts, query }),\n    post: (path, body, opts) => request('POST', path, { ...opts, body: body === undefined ? {} : body }),\n    del: (path, opts) => request('DELETE', path, opts),\n    url: (path, query) => api.url(path, query),\n  };\n}\n"],"core/cache-policy.js":[[],"// Cache policy of the user front end (SPEC F815 item 1). The two tables below are the whole policy — views never pass\n// maxAge themselves.\n//\n// READS:  [path prefix, { maxAge (ms), revalidate / swr }]  — first match wins; no match = pass-through (a request).\n// WRITES: [path prefix of a POST / DELETE, [cache key prefixes dropped after it succeeds]]\n// CHANGING_READS: the same for GETs that change data or report a change (never cached themselves)\n//\n// Reads of the user's own data are reused for 60 s and revalidated in the background at the same time (the next read\n// gets the server's answer); the views render cached data at once when the user comes back to a page. Never cached:\n// polling (user/order/check), GETs that change data (user/resetSecurity, user/invite/save), passport/*, signed\n// attachment URLs, downloads, raw reads (the notice list) and the promotion centre's date-range reports.\n// Per-user data is safe to cache in memory only: main.js clears the cache whenever the login state changes (logout,\n// another account) — tests/js/lychee-cache-policy.test.mjs.\nconst REUSE = { maxAge: 60000, revalidate: true };\n\nexport const READS = [\n  ['user/info', REUSE],\n  ['user/getSubscribe', REUSE],\n  ['user/getStat', REUSE],\n  ['user/comm/config', REUSE],\n  ['guest/comm/config', REUSE],\n  ['user/plan/fetch', REUSE],\n  ['user/order/fetch', REUSE],\n  ['user/order/detail', REUSE],\n  ['user/order/getPaymentMethod', REUSE],\n  ['user/server/fetch', REUSE],\n  ['user/stat/getTrafficLog', REUSE],\n  ['user/knowledge/fetch', REUSE],\n  ['user/ticket/fetch', REUSE],\n  ['user/promotion/summary', REUSE],\n  ['user/telegram/getBotInfo', REUSE],\n  ['user/gift-card/types', REUSE],\n];\n\nconst ACCOUNT = ['user/info', 'user/getSubscribe', 'user/getStat', 'user/server/fetch'];\nexport const WRITES = [\n  // orders: a new / paid / cancelled order changes the list, the detail, the counters — and, once paid, the plan\n  ['user/order/save', ['user/order/', 'user/getStat']],\n  ['user/order/checkout', ['user/order/', ...ACCOUNT]],\n  ['user/order/cancel', ['user/order/', 'user/getStat']],\n  ['user/gift-card/redeem', ['user/order/', ...ACCOUNT]],\n  // tickets (the list, the detail and the open-ticket counter)\n  ['user/ticket/save', ['user/ticket/', 'user/getStat']],\n  ['user/ticket/reply', ['user/ticket/']],\n  ['user/ticket/close', ['user/ticket/', 'user/getStat']],\n  ['user/ticket/withdraw', ['user/ticket/', 'user/getStat', 'user/info', 'user/promotion/']],\n  ['user/ticket/attachment', ['user/ticket/']],\n  // account\n  ['user/update', ['user/info']],\n  ['user/transfer', ['user/info', 'user/promotion/']],\n  ['user/changePassword', []],\n  ['user/coupon/check', []],\n];\n\nexport const CHANGING_READS = [\n  // polled while an order is pending: when it answers, the order may have changed (paid elsewhere)\n  ['user/order/check', ['user/order/', ...ACCOUNT]],\n  // new subscription link / UUID\n  ['user/resetSecurity', ['user/getSubscribe', 'user/info', 'user/server/fetch']],\n  // creates an invite code\n  ['user/invite/save', ['user/invite/', 'user/promotion/', 'user/getStat']],\n];\n\nconst strip = (path) => String(path || '').replace(/^\\/+/, '');\n\nexport function policyFor(path, reads = READS) {\n  const p = strip(path);\n  for (const [prefix, policy] of reads) if (p.startsWith(prefix)) return policy;\n  return { maxAge: 0, swr: false };\n}\n\nexport function invalidatedBy(path, writes = WRITES) {\n  const p = strip(path);\n  const out = [];\n  for (const [prefix, drops] of writes) if (p.startsWith(prefix)) out.push(...drops);\n  return out;\n}\n\nexport function invalidatedByRead(path, reads = CHANGING_READS) {\n  return invalidatedBy(path, reads);\n}\n"],"core/view.js":[[],"// View lifecycle (F107). A view module exports `mount(el, ctx)` and may return an unmount function.\n// Everything a view schedules through its ctx is released when the router leaves the view:\n//   ctx.setTimeout / ctx.setInterval   → cleared\n//   ctx.listen(target, type, fn, opts) → removed\n//   ctx.signal                         → aborted (pass it to fetch / the API client)\n//   ctx.onCleanup(fn)                  → called (in reverse order)\n// After dispose, ctx.disposed is true and new timers / listeners are refused (late async callbacks are harmless).\n\nexport function createViewContext(info = {}, env = globalThis) {\n  const timeouts = new Set();\n  const intervals = new Set();\n  const cleanups = [];\n  const controller = typeof AbortController === 'function' ? new AbortController() : null;\n  let disposed = false;\n\n  const ctx = {\n    route: info.route || null,\n    params: info.params || {},\n    query: info.query || {},\n    path: info.path || '',\n    get disposed() { return disposed; },\n    get signal() { return controller ? controller.signal : undefined; },\n\n    setTimeout(fn, ms) {\n      if (disposed) return null;\n      const id = env.setTimeout(() => { timeouts.delete(id); if (!disposed) fn(); }, ms);\n      timeouts.add(id);\n      return id;\n    },\n    clearTimeout(id) { timeouts.delete(id); env.clearTimeout(id); },\n    setInterval(fn, ms) {\n      if (disposed) return null;\n      const id = env.setInterval(() => { if (!disposed) fn(); }, ms);\n      intervals.add(id);\n      return id;\n    },\n    clearInterval(id) { intervals.delete(id); env.clearInterval(id); },\n\n    listen(target, type, fn, options) {\n      if (disposed || !target) return () => {};\n      target.addEventListener(type, fn, options);\n      const off = () => target.removeEventListener(type, fn, options);\n      cleanups.push(off);\n      return off;\n    },\n\n    onCleanup(fn) {\n      if (typeof fn !== 'function') return;\n      if (disposed) { fn(); return; }\n      cleanups.push(fn);\n    },\n\n    /** Number of live timers / intervals / cleanups (for tests and debugging). */\n    stats() { return { timeouts: timeouts.size, intervals: intervals.size, cleanups: cleanups.length }; },\n\n    dispose() {\n      if (disposed) return;\n      disposed = true;\n      for (const id of timeouts) env.clearTimeout(id);\n      for (const id of intervals) env.clearInterval(id);\n      timeouts.clear();\n      intervals.clear();\n      if (controller) controller.abort();\n      const errors = [];\n      while (cleanups.length) {\n        try { cleanups.pop()(); } catch (e) { errors.push(e); }\n      }\n      if (errors.length) throw errors[0];\n    },\n  };\n  return ctx;\n}\n\n/** Tiny element helper: h('a', {href:'#/x', class:'ly-link'}, 'text', child…). Text is always set as text. */\nexport function h(tag, attrs, ...children) {\n  const el = document.createElement(tag);\n  for (const [key, value] of Object.entries(attrs || {})) {\n    if (value === null || value === undefined || value === false) continue;\n    if (key === 'class') el.className = value;\n    else if (key === 'text') el.textContent = value;\n    else if (key.startsWith('on') && typeof value === 'function') el.addEventListener(key.slice(2).toLowerCase(), value);\n    else el.setAttribute(key, value === true ? '' : String(value));\n  }\n  for (const child of children.flat()) {\n    if (child === null || child === undefined || child === false) continue;\n    el.append(child instanceof Node ? child : document.createTextNode(String(child)));\n  }\n  return el;\n}\n\n/**\n * Whether the visitor is in the middle of something a re-render would destroy (DESIGN.md §16.6): focus in a text\n * field, a dialog open, a field whose value differs from the rendered one, or a request in progress.\n */\nexport function isEditing(root, doc = globalThis.document) {\n  if (!root || !doc) return false;\n  const active = doc.activeElement;\n  if (active && root.contains(active) && (/^(INPUT|TEXTAREA|SELECT)$/.test(active.tagName) || active.isContentEditable)) return true;\n  if (doc.querySelector('.ly-overlay, [role=dialog], [role=alertdialog]')) return true;\n  if (root.querySelector('[aria-busy=true]:not([data-skeleton-view])')) return true;\n  for (const el of root.querySelectorAll('input, textarea')) {\n    if (el.type === 'checkbox' || el.type === 'radio' ? el.checked !== el.defaultChecked : el.value !== el.defaultValue) return true;\n  }\n  return false;\n}\n"],"core/session.js":[[],"// Login state shared with the default theme (F108): same localStorage key and the same record\n// {\"value\": \"<auth_data>\", \"time\": ms, \"expire\": ms|null}, so switching themes keeps the visitor logged in.\n// The key is injected base64-encoded (config.tokenStore) instead of being written in this source.\n\nexport function tokenKeyFrom(config = {}, decode = (s) => globalThis.atob(s)) {\n  if (config.tokenStore) {\n    try { return decode(config.tokenStore); } catch (e) { return null; }\n  }\n  return config.tokenKey || null;\n}\n\nexport function createSession({ storage, key, now = () => Date.now() }) {\n  const listeners = new Set();\n  const emit = () => listeners.forEach((fn) => { try { fn(); } catch (e) { /* ignore */ } });\n\n  function read() {\n    if (!storage || !key) return null;\n    let raw = null;\n    try { raw = storage.getItem(key); } catch (e) { return null; }\n    if (!raw) return null;\n    try {\n      const parsed = JSON.parse(raw);\n      if (parsed && typeof parsed === 'object') {\n        if (parsed.expire && Number(parsed.expire) < now()) return null;\n        return typeof parsed.value === 'string' && parsed.value ? parsed.value : null;\n      }\n      return typeof parsed === 'string' && parsed ? parsed : null;\n    } catch (e) {\n      return raw; // a bare token string\n    }\n  }\n\n  return {\n    key,\n    token: read,\n    isLoggedIn: () => !!read(),\n    /** Store auth_data as the default theme does (expire in seconds, null = no expiry). */\n    save(token, expireSeconds = null) {\n      if (!storage || !key || !token) return;\n      const t = now();\n      storage.setItem(key, JSON.stringify({ value: token, time: t, expire: expireSeconds ? t + expireSeconds * 1000 : null }));\n      emit();\n    },\n    clear() {\n      if (storage && key) { try { storage.removeItem(key); } catch (e) { /* ignore */ } }\n      emit();\n    },\n    subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); },\n  };\n}\n"],"core/i18n.js":[[],"// i18n (F108): message bundles per locale, t(key, vars) with {name} placeholders, fallback to zh-CN, then the key.\n// The choice is stored in localStorage \"ui_lang\" (shared with the server-rendered UI pages).\n\nexport const LOCALES = ['zh-CN', 'en-US'];\nexport const DEFAULT_LOCALE = 'zh-CN';\nexport const STORAGE_KEY = 'ui_lang';\n\nexport function normalizeLocale(value) {\n  if (LOCALES.includes(value)) return value;\n  const lower = String(value || '').toLowerCase();\n  if (lower.startsWith('en')) return 'en-US';\n  if (lower.startsWith('zh')) return 'zh-CN';\n  return null;\n}\n\nexport function format(text, vars) {\n  if (!vars) return text;\n  return String(text).replace(/\\{(\\w+)\\}/g, (m, name) => (Object.prototype.hasOwnProperty.call(vars, name) ? String(vars[name]) : m));\n}\n\nexport function createI18n({ bundles, locale = DEFAULT_LOCALE, storage = null }) {\n  let current = normalizeLocale(locale) || DEFAULT_LOCALE;\n  const listeners = new Set();\n  return {\n    get locale() { return current; },\n    t(key, vars) {\n      const own = bundles[current] || {};\n      const fallback = bundles[DEFAULT_LOCALE] || {};\n      const text = Object.prototype.hasOwnProperty.call(own, key) ? own[key]\n        : Object.prototype.hasOwnProperty.call(fallback, key) ? fallback[key] : key;\n      return format(text, vars);\n    },\n    setLocale(next) {\n      const value = normalizeLocale(next);\n      if (!value || value === current) return;\n      current = value;\n      if (storage) { try { storage.setItem(STORAGE_KEY, value); } catch (e) { /* ignore */ } }\n      listeners.forEach((fn) => fn(value));\n    },\n    subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); },\n  };\n}\n\n/** Saved choice, else the server's locale, else the browser's language, else Chinese. */\nexport function initialLocale({ storage, serverLocale, navigatorLanguage } = {}) {\n  let saved = null;\n  if (storage) { try { saved = storage.getItem(STORAGE_KEY); } catch (e) { saved = null; } }\n  return normalizeLocale(saved) || normalizeLocale(serverLocale) || normalizeLocale(navigatorLanguage) || DEFAULT_LOCALE;\n}\n"],"core/api.js":[[],"// API client (F108). One instance per app; base URL = the injected apiBase (SPEC F7 user_api_prefix), never a\n// hard-coded /api/... path. Every failure rejects with an ApiError the views can show directly:\n//   kind 'auth'     401, or 403 with error.code = \"unauthenticated\": login state cleared, onUnauthorized() called\n//   kind 'business' other 4xx / {\"status\":\"fail\"}: message = the server's message, fieldErrors = error (422)\n//   kind 'server'   5xx: neutral message, retryable\n//   kind 'network'  fetch failed (offline, DNS, CORS): retryable\n//   kind 'timeout'  no answer within timeoutMs: retryable\n//   kind 'parse'    2xx without valid JSON\n//   kind 'abort'    the caller's signal aborted (view left): never shown to the user\n// Non-silent failures (except auth / abort) are passed to onError (the global toast).\n\nexport class ApiError extends Error {\n  constructor(message, { kind, status = 0, body = null, fieldErrors = null } = {}) {\n    super(message);\n    this.name = 'ApiError';\n    this.kind = kind;\n    this.status = status;\n    this.body = body;\n    this.fieldErrors = fieldErrors;\n    this.retryable = kind === 'network' || kind === 'timeout' || kind === 'server';\n  }\n}\n\nexport function joinUrl(base, path, query) {\n  const url = `${String(base || '').replace(/\\/+$/, '')}/${String(path || '').replace(/^\\/+/, '')}`;\n  const parts = [];\n  for (const [k, v] of Object.entries(query || {})) {\n    if (v === null || v === undefined || v === '') continue;\n    for (const item of Array.isArray(v) ? v : [v]) {\n      parts.push(`${encodeURIComponent(Array.isArray(v) ? `${k}[]` : k)}=${encodeURIComponent(String(item))}`);\n    }\n  }\n  return parts.length ? `${url}${url.includes('?') ? '&' : '?'}${parts.join('&')}` : url;\n}\n\n/** File name from a Content-Disposition header: filename*=UTF-8'' (RFC 5987) first, then filename=\"…\". */\nexport function filenameFrom(header) {\n  const cd = String(header || '');\n  const star = /filename\\*=UTF-8''([^;]+)/i.exec(cd);\n  if (star) { try { return decodeURIComponent(star[1].trim()); } catch (e) { /* fall through */ } }\n  const plain = /filename=\"?([^\";]+)\"?/i.exec(cd);\n  return plain ? plain[1].trim() : null;\n}\n\nexport function isAuthFailure(status, body) {\n  if (status === 401) return true;\n  return status === 403 && !!body && !!body.error && body.error.code === 'unauthenticated';\n}\n\n/**\n * @param {{baseUrl:string, getToken:()=>string|null, onUnauthorized?:()=>void, onError?:(err)=>void,\n *          t?:(key)=>string, getLocale?:()=>string, fetchImpl?:typeof fetch, timeoutMs?:number,\n *          setTimer?:Function, clearTimer?:Function}} options\n */\nexport function createApiClient(options) {\n  const t = options.t || ((k) => k);\n  const fetchImpl = options.fetchImpl || ((...a) => globalThis.fetch(...a));\n  const setTimer = options.setTimer || ((fn, ms) => setTimeout(fn, ms));\n  const clearTimer = options.clearTimer || ((id) => clearTimeout(id));\n  const timeoutMs = options.timeoutMs || 30000;\n\n  function fail(err, silent) {\n    if (!silent && options.onError && err.kind !== 'auth' && err.kind !== 'abort') {\n      try { options.onError(err); } catch (e) { /* the notifier must never break a request */ }\n    }\n    throw err;\n  }\n\n  /**\n   * request('GET', 'user/info', {query, body, signal, raw, silent, anonymous, timeout, download})\n   * Resolves with body.data (or the whole body with raw:true / when there is no data key).\n   */\n  async function request(method, path, opts = {}) {\n    const token = opts.anonymous ? null : options.getToken();\n    const headers = { Accept: 'application/json' };\n    const locale = options.getLocale ? options.getLocale() : null;\n    if (locale) headers['Content-Language'] = locale;\n    if (token) headers.Authorization = token;\n    const init = { method, headers, credentials: 'same-origin' };\n    if (opts.body !== undefined) {\n      if (typeof FormData !== 'undefined' && opts.body instanceof FormData) init.body = opts.body;\n      else { headers['Content-Type'] = 'application/json'; init.body = JSON.stringify(opts.body); }\n    }\n\n    const controller = typeof AbortController === 'function' ? new AbortController() : null;\n    let timedOut = false;\n    let timer = null;\n    let onAbort = null;\n    if (controller) {\n      init.signal = controller.signal;\n      if (opts.signal) {\n        if (opts.signal.aborted) controller.abort();\n        else { onAbort = () => controller.abort(); opts.signal.addEventListener('abort', onAbort); }\n      }\n      timer = setTimer(() => { timedOut = true; controller.abort(); }, opts.timeout || timeoutMs);\n    }\n    const done = () => {\n      if (timer !== null) clearTimer(timer);\n      if (onAbort) opts.signal.removeEventListener('abort', onAbort);\n    };\n\n    let res;\n    try {\n      res = await fetchImpl(joinUrl(options.baseUrl, path, opts.query), init);\n    } catch (e) {\n      done();\n      if (timedOut) return fail(new ApiError(t('error.timeout'), { kind: 'timeout' }), opts.silent);\n      if ((opts.signal && opts.signal.aborted) || (e && e.name === 'AbortError')) return fail(new ApiError('aborted', { kind: 'abort' }), true);\n      return fail(new ApiError(t('error.network'), { kind: 'network' }), opts.silent);\n    }\n    // download: a successful non-JSON answer (CSV export) resolves with { blob, filename } instead of parsed JSON\n    if (opts.download && res.ok && !/json/i.test((res.headers && res.headers.get('content-type')) || '')) {\n      let blob = null;\n      try { blob = await res.blob(); } catch (e) { blob = null; }\n      done();\n      if (!blob) return fail(new ApiError(t('error.network'), { kind: 'network' }), opts.silent);\n      return { blob, filename: filenameFrom(res.headers.get('content-disposition')) };\n    }\n    let text = '';\n    try { text = await res.text(); } catch (e) { text = ''; }\n    done();\n    let body = null;\n    if (text) { try { body = JSON.parse(text); } catch (e) { body = null; } }\n    const status = res.status;\n\n    if (isAuthFailure(status, body)) {\n      if (options.onUnauthorized) options.onUnauthorized();\n      return fail(new ApiError(t('error.auth'), { kind: 'auth', status, body }), true);\n    }\n    // SPEC F815: the edge answers 502 / 504 when it cannot reach the origin — a network problem, not a server error\n    if (status === 502 || status === 504) {\n      return fail(new ApiError(t('error.upstream'), { kind: 'network', status, body }), opts.silent);\n    }\n    if (status >= 500) {\n      return fail(new ApiError(t('error.server'), { kind: 'server', status, body }), opts.silent);\n    }\n    const message = body && typeof body.message === 'string' && body.message ? body.message : t('error.unknown');\n    if (status >= 400 || (body && body.status === 'fail')) {\n      const fieldErrors = body && body.error && typeof body.error === 'object' && !Array.isArray(body.error) && !body.error.code ? body.error\n        : (body && body.errors) || null;\n      return fail(new ApiError(message, { kind: 'business', status, body, fieldErrors }), opts.silent);\n    }\n    if (body === null && text) return fail(new ApiError(t('error.unknown'), { kind: 'parse', status }), opts.silent);\n    if (opts.raw || !body || typeof body !== 'object' || !('data' in body)) return body;\n    return body.data;\n  }\n\n  return {\n    request,\n    get: (path, query, opts) => request('GET', path, { ...opts, query }),\n    post: (path, body, opts) => request('POST', path, { ...opts, body: body === undefined ? {} : body }),\n    del: (path, opts) => request('DELETE', path, opts),\n    url: (path, query) => joinUrl(options.baseUrl, path, query),\n  };\n}\n"],"core/store.js":[[],"// Small observable stores (F108): the logged-in user's info and the public site config. Views read from these\n// instead of re-requesting; logging out clears them.\n\nexport function createStore(initial) {\n  let value = initial;\n  const listeners = new Set();\n  return {\n    get: () => value,\n    set(next) { value = next; listeners.forEach((fn) => fn(value)); },\n    subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); },\n  };\n}\n\n/** user/info, loaded once per login (force: true to refresh). */\nexport function createUserStore(api) {\n  const store = createStore(null);\n  let pending = null;\n  return {\n    ...store,\n    async load({ force = false, signal } = {}) {\n      if (store.get() && !force) return store.get();\n      if (!pending) {\n        pending = api.get('user/info', undefined, { signal, silent: true })\n          .then((info) => { store.set(info || null); return store.get(); })\n          .finally(() => { pending = null; });\n      }\n      return pending;\n    },\n    clear() { store.set(null); },\n  };\n}\n\n/** guest/comm/config (currency symbol, registration switches, captcha), anonymous, loaded once. */\nexport function createSiteStore(api) {\n  const store = createStore(null);\n  let pending = null;\n  return {\n    ...store,\n    load() {\n      if (store.get()) return Promise.resolve(store.get());\n      if (!pending) {\n        pending = api.get('guest/comm/config', undefined, { anonymous: true, silent: true })\n          .then((cfg) => { store.set(cfg || {}); return store.get(); })\n          .catch(() => { pending = null; return {}; });\n      }\n      return pending;\n    },\n    currencySymbol() { const c = store.get(); return (c && c.currency_symbol) || '¥'; },\n  };\n}\n\n/**\n * user/comm/config (F141): currency symbol, withdraw / commission switches — needs login, loaded once per login.\n * money(cents) formats with the site currency (format.js formatMoney) once loaded, '¥' before that.\n */\nexport function createUserConfigStore(api) {\n  const store = createStore(null);\n  let pending = null;\n  return {\n    ...store,\n    load() {\n      if (store.get()) return Promise.resolve(store.get());\n      if (!pending) {\n        pending = api.get('user/comm/config', undefined, { silent: true })\n          .then((cfg) => { store.set(cfg || {}); return store.get(); })\n          .catch(() => ({}))\n          .finally(() => { pending = null; });\n      }\n      return pending;\n    },\n    currencySymbol() { const c = store.get(); return (c && c.currency_symbol) || '¥'; },\n    clear() { store.set(null); },\n  };\n}\n"],"ui/logic.js":[[],"// Pure component logic (no DOM): shared by ui/*.js and tested with node (tests/js/lychee-ui-logic.test.mjs).\n\n/**\n * Wrap an action so it cannot run twice at once: while the first call's promise is pending, further calls return\n * that same promise without invoking fn again (a loading button ignores repeat clicks). onBusy(true|false) reports\n * the state so the caller can toggle aria-busy / the spinner.\n */\nexport function guardAction(fn, onBusy = () => {}) {\n  let pending = null;\n  const run = (...args) => {\n    if (pending) return pending;\n    let result;\n    try { result = fn(...args); } catch (e) { return Promise.reject(e); }\n    if (!result || typeof result.then !== 'function') return Promise.resolve(result);\n    onBusy(true);\n    pending = Promise.resolve(result).finally(() => { pending = null; onBusy(false); });\n    return pending;\n  };\n  run.busy = () => pending !== null;\n  return run;\n}\n\n/** Next index for a radiogroup / segmented control (arrow keys wrap, Home / End jump; disabled items are skipped). */\nexport function nextIndex(current, key, count, isDisabled = () => false) {\n  if (count <= 0) return -1;\n  const enabled = [...Array(count).keys()].filter((i) => !isDisabled(i));\n  if (!enabled.length) return -1;\n  if (key === 'Home') return enabled[0];\n  if (key === 'End') return enabled[enabled.length - 1];\n  const step = key === 'ArrowRight' || key === 'ArrowDown' ? 1 : key === 'ArrowLeft' || key === 'ArrowUp' ? -1 : 0;\n  if (!step) return current;\n  for (let n = 1; n <= count; n++) {\n    const i = (((current + step * n) % count) + count) % count;\n    if (!isDisabled(i)) return i;\n  }\n  return current;\n}\n\n/** Traffic progress level (DESIGN.md §7.6): ≥ 80 % warning, ≥ 100 % danger. Missing / invalid data counts as 0 %. */\nexport function progressLevel(percent) {\n  const p = Number(percent);\n  if (!Number.isFinite(p)) return 'normal';\n  if (p >= 100) return 'danger';\n  if (p >= 80) return 'warning';\n  return 'normal';\n}\n\n/** used / total → percentage with two decimals (0 when total is 0 / missing; may exceed 100). */\nexport function percentOf(used, total) {\n  const u = Number(used); const t = Number(total);\n  if (!Number.isFinite(u) || !Number.isFinite(t) || t <= 0 || u <= 0) return 0;\n  return Math.round((u / t) * 10000) / 100;\n}\n\nlet seq = 0;\n/** Unique DOM id (label ↔ control, aria-describedby). */\nexport function uid(prefix = 'ly') { seq += 1; return `${prefix}-${seq.toString(36)}`; }\n\n/**\n * Page buttons for a pager: [1, '…', 4, 5, 6, '…', 20]. Always shows first, last, current ± 1; never more than 7 items.\n */\nexport function pageItems(current, total) {\n  const last = Math.max(1, Math.floor(total) || 1);\n  const cur = Math.min(Math.max(1, Math.floor(current) || 1), last);\n  if (last <= 7) return [...Array(last).keys()].map((i) => i + 1);\n  let start = Math.max(2, cur - 1);\n  let end = Math.min(last - 1, cur + 1);\n  if (cur <= 3) { start = 2; end = 5; }\n  if (cur >= last - 2) { start = last - 4; end = last - 1; }\n  const items = [1];\n  if (start > 2) items.push('…');\n  for (let i = start; i <= end; i++) items.push(i);\n  if (end < last - 1) items.push('…');\n  items.push(last);\n  return items;\n}\n\n/** Toast lifetime (DESIGN.md §7.6): success / info 3 s, error 6 s. */\nexport function toastDuration(type) { return type === 'error' ? 6000 : 3000; }\n\n/**\n * Pausable countdown (toast hover pause). clock = { now(), setTimeout, clearTimeout } so tests can drive time.\n */\nexport function createCountdown(ms, onDone, clock = globalThis) {\n  const now = () => (clock.now ? clock.now() : Date.now());\n  let remaining = ms;\n  let started = null;\n  let timer = null;\n  let done = false;\n  const api = {\n    start() {\n      if (done || timer !== null) return api;\n      started = now();\n      timer = clock.setTimeout(() => { timer = null; done = true; onDone(); }, remaining);\n      return api;\n    },\n    pause() {\n      if (timer === null) return api;\n      clock.clearTimeout(timer);\n      timer = null;\n      remaining = Math.max(0, remaining - (now() - started));\n      return api;\n    },\n    cancel() { if (timer !== null) clock.clearTimeout(timer); timer = null; done = true; return api; },\n    get remaining() { return timer === null ? remaining : Math.max(0, remaining - (now() - started)); },\n    get running() { return timer !== null; },\n    get done() { return done; },\n  };\n  return api;\n}\n\n/** Elements that can take keyboard focus inside a container (focus trap). Works on any object with querySelectorAll. */\nexport const FOCUSABLE = 'a[href], area[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n/** Where Tab / Shift+Tab goes inside a trap: returns the index to focus, or -1 to let the browser move on. */\nexport function trapIndex(currentIndex, count, shift) {\n  if (count <= 0) return -1;\n  if (currentIndex < 0) return shift ? count - 1 : 0;\n  if (shift && currentIndex === 0) return count - 1;\n  if (!shift && currentIndex === count - 1) return 0;\n  return -1;\n}\n"],"icons/lucide.js":[[],"// Lucide icon subset (lucide-static 0.460.0, ISC — see ./LICENSE). Generated by scripts/design/lucide-subset.mjs;\n// do not edit by hand. Each value is the inner markup of a 24×24 stroke icon; ui/icon.js wraps it in <svg>.\nexport const LUCIDE_VERSION = '0.460.0';\nexport default {\n  'bell': '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\" /><path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\" />',\n  'book-open': '<path d=\"M12 7v14\" /><path d=\"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z\" />',\n  'chart-column': '<path d=\"M3 3v16a2 2 0 0 0 2 2h16\" /><path d=\"M18 17V9\" /><path d=\"M13 17V5\" /><path d=\"M8 17v-3\" />',\n  'check': '<path d=\"M20 6 9 17l-5-5\" />',\n  'chevron-down': '<path d=\"m6 9 6 6 6-6\" />',\n  'chevron-left': '<path d=\"m15 18-6-6 6-6\" />',\n  'chevron-right': '<path d=\"m9 18 6-6-6-6\" />',\n  'circle-alert': '<circle cx=\"12\" cy=\"12\" r=\"10\" /><line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" /><line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />',\n  'circle-check': '<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m9 12 2 2 4-4\" />',\n  'circle-x': '<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m15 9-6 6\" /><path d=\"m9 9 6 6\" />',\n  'clock': '<circle cx=\"12\" cy=\"12\" r=\"10\" /><polyline points=\"12 6 12 12 16 14\" />',\n  'copy': '<rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" /><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />',\n  'credit-card': '<rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" /><line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />',\n  'download': '<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" /><polyline points=\"7 10 12 15 17 10\" /><line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\" />',\n  'ellipsis': '<circle cx=\"12\" cy=\"12\" r=\"1\" /><circle cx=\"19\" cy=\"12\" r=\"1\" /><circle cx=\"5\" cy=\"12\" r=\"1\" />',\n  'eye': '<path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" /><circle cx=\"12\" cy=\"12\" r=\"3\" />',\n  'eye-off': '<path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" /><path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" /><path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" /><path d=\"m2 2 20 20\" />',\n  'gauge': '<path d=\"m12 14 4-4\" /><path d=\"M3.34 19a10 10 0 1 1 17.32 0\" />',\n  'gem': '<path d=\"M6 3h12l4 6-10 13L2 9Z\" /><path d=\"M11 3 8 9l4 13 4-13-3-6\" /><path d=\"M2 9h20\" />',\n  'gift': '<rect x=\"3\" y=\"8\" width=\"18\" height=\"4\" rx=\"1\" /><path d=\"M12 8v13\" /><path d=\"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7\" /><path d=\"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5\" />',\n  'headset': '<path d=\"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z\" /><path d=\"M21 16v2a4 4 0 0 1-4 4h-5\" />',\n  'image-off': '<line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" /><path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" /><line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" /><line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" /><path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" /><path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />',\n  'image-plus': '<path d=\"M16 5h6\" /><path d=\"M19 2v6\" /><path d=\"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5\" /><path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" /><circle cx=\"9\" cy=\"9\" r=\"2\" />',\n  'inbox': '<polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" /><path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />',\n  'info': '<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 16v-4\" /><path d=\"M12 8h.01\" />',\n  'languages': '<path d=\"m5 8 6 6\" /><path d=\"m4 14 6-6 2-3\" /><path d=\"M2 5h12\" /><path d=\"M7 2h1\" /><path d=\"m22 22-5-10-5 10\" /><path d=\"M14 18h6\" />',\n  'layout-dashboard': '<rect width=\"7\" height=\"9\" x=\"3\" y=\"3\" rx=\"1\" /><rect width=\"7\" height=\"5\" x=\"14\" y=\"3\" rx=\"1\" /><rect width=\"7\" height=\"9\" x=\"14\" y=\"12\" rx=\"1\" /><rect width=\"7\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />',\n  'lock': '<rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" /><path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />',\n  'log-out': '<path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /><polyline points=\"16 17 21 12 16 7\" /><line x1=\"21\" x2=\"9\" y1=\"12\" y2=\"12\" />',\n  'message-square': '<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />',\n  'moon': '<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\" />',\n  'panel-left': '<rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" /><path d=\"M9 3v18\" />',\n  'qr-code': '<rect width=\"5\" height=\"5\" x=\"3\" y=\"3\" rx=\"1\" /><rect width=\"5\" height=\"5\" x=\"16\" y=\"3\" rx=\"1\" /><rect width=\"5\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" /><path d=\"M21 16h-3a2 2 0 0 0-2 2v3\" /><path d=\"M21 21v.01\" /><path d=\"M12 7v3a2 2 0 0 1-2 2H7\" /><path d=\"M3 12h.01\" /><path d=\"M12 3h.01\" /><path d=\"M12 16v.01\" /><path d=\"M16 12h1\" /><path d=\"M21 12v.01\" /><path d=\"M12 21v-1\" />',\n  'receipt': '<path d=\"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z\" /><path d=\"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8\" /><path d=\"M12 17.5v-11\" />',\n  'refresh-cw': '<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" /><path d=\"M21 3v5h-5\" /><path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" /><path d=\"M8 16H3v5\" />',\n  'rotate-ccw': '<path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" /><path d=\"M3 3v5h5\" />',\n  'search': '<circle cx=\"11\" cy=\"11\" r=\"8\" /><path d=\"m21 21-4.3-4.3\" />',\n  'search-x': '<path d=\"m13.5 8.5-5 5\" /><path d=\"m8.5 8.5 5 5\" /><circle cx=\"11\" cy=\"11\" r=\"8\" /><path d=\"m21 21-4.3-4.3\" />',\n  'send': '<path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" /><path d=\"m21.854 2.147-10.94 10.939\" />',\n  'server': '<rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" /><rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" /><line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" /><line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" />',\n  'shopping-cart': '<circle cx=\"8\" cy=\"21\" r=\"1\" /><circle cx=\"19\" cy=\"21\" r=\"1\" /><path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\" />',\n  'sun': '<circle cx=\"12\" cy=\"12\" r=\"4\" /><path d=\"M12 2v2\" /><path d=\"M12 20v2\" /><path d=\"m4.93 4.93 1.41 1.41\" /><path d=\"m17.66 17.66 1.41 1.41\" /><path d=\"M2 12h2\" /><path d=\"M20 12h2\" /><path d=\"m6.34 17.66-1.41 1.41\" /><path d=\"m19.07 4.93-1.41 1.41\" />',\n  'triangle-alert': '<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" /><path d=\"M12 9v4\" /><path d=\"M12 17h.01\" />',\n  'user': '<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" /><circle cx=\"12\" cy=\"7\" r=\"4\" />',\n  'x': '<path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />',\n};\n"],"ui/icon.js":[["icons/lucide.js"],"// Line icons (DESIGN.md §7.4): Lucide subset from ../icons/lucide.js, stroke 1.75, currentColor, 16 / 20 / 24 px.\n// The markup is a trusted static constant (never user data); the HTML parser puts it in the SVG namespace.\nimport ICONS from '@@lydep:0@@';\n\nexport function icon(name, { size = 20, label = '', className = '' } = {}) {\n  const body = ICONS[name];\n  if (!body) throw new Error(`unknown icon: ${name}`);\n  const box = document.createElement('span');\n  box.innerHTML = `<svg viewBox=\"0 0 24 24\" width=\"${size}\" height=\"${size}\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${body}</svg>`;\n  const svg = box.firstElementChild;\n  svg.setAttribute('class', `ly-icon ${className}`.trim());\n  svg.setAttribute('data-icon', name);\n  svg.setAttribute('focusable', 'false');\n  if (label) { svg.setAttribute('role', 'img'); svg.setAttribute('aria-label', label); } else svg.setAttribute('aria-hidden', 'true');\n  return svg;\n}\n\nexport const hasIcon = (name) => Object.prototype.hasOwnProperty.call(ICONS, name);\n"],"ui/text.js":[[],"// Component copy goes through the app's i18n. app.js calls configureUi({ t }) once; until then (and in tests) the\n// key itself is returned. Keys live in i18n/*.js under `ui.*`.\nlet translate = (key) => key;\nexport function configureUi({ t }) { if (typeof t === 'function') translate = t; }\nexport const tr = (key, vars) => translate(key, vars);\n"],"core/notify.js":[["ui/logic.js","ui/icon.js","ui/text.js"],"// Global toasts (F108 hook, full component F113 — DESIGN.md §7.6). Top right (phones: top centre), surface + 4px\n// semantic bar + icon + text + close button; at most 3; success / info 3 s, error 6 s; hovering or focusing a toast\n// pauses its timer. Errors use role=\"alert\", the rest role=\"status\".\nimport { toastDuration, createCountdown } from '@@lydep:0@@';\nimport { icon } from '@@lydep:1@@';\nimport { tr } from '@@lydep:2@@';\n\nconst MAX = 3;\nconst ICONS = { success: 'circle-check', error: 'circle-alert', warning: 'triangle-alert', info: 'info' };\n\nexport function createNotifier(doc = document) {\n  let region = null;\n  function ensure() {\n    if (region && region.isConnected) return region;\n    region = doc.createElement('div');\n    region.className = 'ly-toasts';\n    region.setAttribute('data-toasts', '');\n    doc.body.append(region);\n    return region;\n  }\n  function show(message, type = 'info') {\n    if (!message) return null;\n    const el = doc.createElement('div');\n    el.className = `ly-toast ly-toast--${type}`;\n    el.setAttribute('role', type === 'error' ? 'alert' : 'status');\n    el.dataset.type = type;\n    const text = doc.createElement('p');\n    text.className = 'ly-toast__text';\n    text.textContent = String(message);\n    const close = doc.createElement('button');\n    close.type = 'button';\n    close.className = 'ly-toast__close';\n    close.setAttribute('aria-label', tr('ui.close'));\n    close.append(icon('x', { size: 16 }));\n    el.append(icon(ICONS[type] || 'info', { size: 20, className: 'ly-toast__icon' }), text, close);\n\n    const remove = () => { timer.cancel(); el.classList.add('is-leaving'); setTimeout(() => el.remove(), 200); };\n    const timer = createCountdown(toastDuration(type), remove, { now: () => Date.now(), setTimeout: (f, ms) => setTimeout(f, ms), clearTimeout: (id) => clearTimeout(id) });\n    close.addEventListener('click', remove);\n    const pause = () => { timer.pause(); el.dataset.paused = 'true'; };\n    const resume = () => { if (el.matches(':hover') || el.contains(doc.activeElement)) return; timer.start(); delete el.dataset.paused; };\n    el.addEventListener('mouseenter', pause);\n    el.addEventListener('mouseleave', resume);\n    el.addEventListener('focusin', pause);\n    el.addEventListener('focusout', () => setTimeout(resume, 0));\n\n    const box = ensure();\n    box.append(el);\n    while (box.children.length > MAX) box.firstElementChild.remove();\n    timer.start();\n    return el;\n  }\n  return {\n    show,\n    success: (m) => show(m, 'success'),\n    error: (m) => show(m, 'error'),\n    warning: (m) => show(m, 'warning'),\n    info: (m) => show(m, 'info'),\n  };\n}\n"],"ui/brand.js":[["core/view.js"],"// Brand (F114, DESIGN.md §7.8). The operator's logo (theme logo_url, else the site logo setting — resolved by the\n// template into config.logo) always wins; otherwise the original 荔枝云 mark is drawn from img/logo-mark*.svg as a CSS\n// mask filled with --ly-primary, so it follows a custom primary colour and dark mode. alt / label = site name.\nimport { h } from '@@lydep:0@@';\n\nconst MARK = { 16: 'logo-mark-16.286c3eae9f.svg', 32: 'logo-mark.f13f906376.svg', 180: 'logo-mark-180.cfee6185cc.svg' };\nconst markFile = (size) => (size <= 20 ? MARK[16] : size >= 96 ? MARK[180] : MARK[32]);\n\n/**\n * brandLogo({ config, variant: 'full' | 'mark', size = 32 })\n * full = mark + the site name as real text (operators rename the site; the outlined 「荔枝云」 wordmark file is for\n * brand use outside the app).\n */\nexport function brandLogo({ config = {}, variant = 'full', size = 32 } = {}) {\n  const name = config.siteName || '';\n  if (config.logo) {\n    return h('span', { class: `ly-brand ly-brand--${variant}`, 'data-brand': 'custom' },\n      // width / height reserve the slot before the file arrives (F1058: no layout shift); CSS keeps width: auto, so\n      // the attributes only give the starting aspect ratio (a 4:1 wordmark) and the logo's own ratio wins once loaded\n      h('img', { class: 'ly-brand__img', src: config.logo, alt: name, width: String(size * 4), height: String(size), decoding: 'async' }));\n  }\n  const mark = h('span', { class: 'ly-brand__mark', style: `--ly-brand-size: ${size}px; --ly-brand-src: url(\"${config.assetBase || ''}/img/${markFile(size)}\")`, 'aria-hidden': variant === 'full' ? 'true' : null, role: variant === 'mark' ? 'img' : null, 'aria-label': variant === 'mark' ? name : null });\n  return h('span', { class: `ly-brand ly-brand--${variant}`, 'data-brand': 'theme' }, mark,\n    variant === 'full' ? h('span', { class: 'ly-brand__name' }, name) : null);\n}\n\n/**\n * Favicon (no site_icon configured): the 16px mark coloured with the current --ly-primary, as an SVG data URL on the\n * page's <link rel=\"icon\">. Re-run after the colour scheme changes. Returns the URL (or '' when not applicable).\n */\nexport async function applyThemeFavicon({ config = {}, doc = document, fetchImpl = fetch } = {}) {\n  if (!config.themeFavicon) return '';\n  const res = await fetchImpl(`${config.assetBase || ''}/img/${MARK[16]}`);\n  if (!res.ok) return '';\n  const color = getComputedStyle(doc.documentElement).getPropertyValue('--ly-primary').trim();\n  if (!/^#[0-9a-f]{6}$/i.test(color)) return '';\n  const svg = (await res.text()).replace(/currentColor/g, color);\n  const url = `data:image/svg+xml,${encodeURIComponent(svg)}`;\n  let link = doc.querySelector('link[rel~=\"icon\"]');\n  if (!link) { link = doc.createElement('link'); link.rel = 'icon'; doc.head.append(link); }\n  link.type = 'image/svg+xml';\n  link.href = url;\n  return url;\n}\n"],"ui/controls.js":[["core/view.js","ui/icon.js","ui/logic.js","ui/text.js"],"// 荔枝云 basic components, part 1 (F112, DESIGN.md §7.6): buttons, inputs / textarea, read-only input + copy, select,\n// segmented control, switch, checkbox, card, plan card, badge, progress bar. Every builder returns a DOM element;\n// text always goes through textContent. Styles: css/components.css (tokens only).\nimport { h } from '@@lydep:0@@';\nimport { icon } from '@@lydep:1@@';\nimport { guardAction, nextIndex, progressLevel, uid } from '@@lydep:2@@';\nimport { tr } from '@@lydep:3@@';\n\nconst spinner = (size = 16) => h('span', { class: 'ly-spinner', style: `--ly-spinner-size: ${size}px`, 'aria-hidden': 'true' });\n\n// ---- buttons --------------------------------------------------------------------------------------------------------\n\n/**\n * button({ label, variant: primary|secondary|text|icon|danger, icon, ariaLabel, onClick, disabled, type, block })\n * onClick may return a promise: the button then shows the loading state (same width, aria-busy, spinner) and\n * ignores further clicks until it settles.\n */\nexport function button({ label = '', variant = 'primary', icon: iconName, ariaLabel, onClick, disabled = false, type = 'button', block = false, attrs = {} } = {}) {\n  const el = h('button', {\n    type, class: `ly-button ly-button--${variant}${block ? ' ly-button--block' : ''}`,\n    'aria-label': ariaLabel || (variant === 'icon' ? label : null), title: variant === 'icon' ? (ariaLabel || label) : null, ...attrs,\n  });\n  if (iconName) el.append(icon(iconName, { size: variant === 'icon' ? 20 : 16, className: 'ly-button__icon' }));\n  if (label && variant !== 'icon') el.append(h('span', { class: 'ly-button__label' }, label));\n  setDisabled(el, disabled);\n  if (onClick) {\n    const run = guardAction((e) => onClick(e), (busy) => setButtonLoading(el, busy));\n    el.addEventListener('click', (e) => {\n      if (el.getAttribute('aria-busy') === 'true' || el.getAttribute('aria-disabled') === 'true') { e.preventDefault(); return; }\n      run(e).catch(() => {});\n    });\n  }\n  return el;\n}\n\nexport function setDisabled(el, disabled) {\n  el.disabled = !!disabled;\n  if (disabled) el.setAttribute('aria-disabled', 'true'); else el.removeAttribute('aria-disabled');\n}\n\n/** Loading state: the width is frozen, a 16px spinner appears (icon buttons: replaces the icon), aria-busy is set. */\n/** A request that takes longer than this shows the button's progress state (DESIGN.md §16.4). */\nexport const BUSY_VISIBLE_AFTER = 300;\n\nexport function setButtonLoading(el, loading) {\n  if (loading) {\n    if (el.getAttribute('aria-busy') === 'true') return;\n    if (!el.isConnected) {\n      // not laid out yet (built before being attached): measure on the next frame\n      el.dataset.loadingPending = 'true';\n      requestAnimationFrame(() => { if (el.dataset.loadingPending) { delete el.dataset.loadingPending; setButtonLoading(el, true); } });\n      return;\n    }\n    el.style.width = `${el.getBoundingClientRect().width}px`;\n    // busy at once: clicks are ignored (button() checks aria-busy), so one press = one request (SPEC F815 item 6)\n    el.setAttribute('aria-busy', 'true');\n    // the visible progress state only when the request is slow (> 300 ms, DESIGN.md §16.4): a fast one never flashes\n    const show = () => {\n      if (el.getAttribute('aria-busy') !== 'true' || el.classList.contains('is-loading')) return;\n      el.classList.add('is-loading');\n      el.prepend(spinner(el.classList.contains('ly-button--icon') ? 20 : 16));\n      // spinner before the text when it fits; a short button keeps its width and shows the spinner in place of the text\n      if (el.scrollWidth > el.clientWidth + 1) el.classList.add('is-loading--overlay');\n    };\n    el.__lyBusyTimer = setTimeout(show, BUSY_VISIBLE_AFTER);\n  } else {\n    clearTimeout(el.__lyBusyTimer);\n    delete el.dataset.loadingPending;\n    el.classList.remove('is-loading--overlay');\n    el.removeAttribute('aria-busy');\n    el.classList.remove('is-loading');\n    el.querySelector(':scope > .ly-spinner')?.remove();\n    el.style.width = '';\n  }\n}\n\n// ---- form fields ----------------------------------------------------------------------------------------------------\n\nfunction describe(field) {\n  const ids = [field.helpEl?.id, field.errorEl && !field.errorEl.hidden ? field.errorEl.id : null].filter(Boolean);\n  if (ids.length) field.control.setAttribute('aria-describedby', ids.join(' ')); else field.control.removeAttribute('aria-describedby');\n}\n\n/**\n * field({ label, name, type, value, placeholder, help, error, multiline, options:[{value,label}], required, disabled,\n *         loading, autocomplete, inputmode })  → <div class=\"ly-field\"> with .control / .setError(msg) / .setLoading(bool)\n * options → native <select>; multiline → <textarea>.\n */\nexport function field({ label, name, type = 'text', value = '', placeholder, help, error, multiline = false, options, required = false, disabled = false, loading = false, autocomplete, inputmode, rows = 4, id } = {}) {\n  const controlId = id || uid('fld');\n  let control;\n  if (options) {\n    control = h('select', { id: controlId, name, class: 'ly-input ly-select', required, disabled },\n      options.map((o) => h('option', { value: o.value, selected: String(o.value) === String(value) }, o.label)));\n  } else if (multiline) {\n    control = h('textarea', { id: controlId, name, class: 'ly-input ly-textarea', rows, placeholder, required, disabled });\n    control.value = value;\n  } else {\n    control = h('input', { id: controlId, name, type, class: 'ly-input', placeholder, required, disabled, autocomplete, inputmode });\n    control.value = value;\n  }\n  const wrap = h('div', { class: 'ly-field' },\n    h('label', { class: 'ly-field__label', for: controlId }, label),\n    h('div', { class: 'ly-field__control' }, control, options ? icon('chevron-down', { size: 16, className: 'ly-field__chevron' }) : null),\n  );\n  wrap.control = control;\n  if (help) { wrap.helpEl = h('p', { class: 'ly-field__help', id: `${controlId}-help` }, help); wrap.append(wrap.helpEl); }\n  wrap.errorEl = h('p', { class: 'ly-field__error', id: `${controlId}-error`, hidden: true });\n  wrap.append(wrap.errorEl);\n  wrap.setError = (msg) => setFieldError(wrap, msg);\n  wrap.setLoading = (on) => setFieldLoading(wrap, on);\n  if (error) wrap.setError(error);\n  if (loading) wrap.setLoading(true);\n  describe(wrap);\n  return wrap;\n}\n\n/** Error state: danger border, message under the field with an icon, aria-invalid + aria-describedby. '' clears it. */\nexport function setFieldError(wrap, message) {\n  const { control, errorEl } = wrap;\n  errorEl.replaceChildren();\n  if (message) {\n    errorEl.append(icon('circle-alert', { size: 16 }), h('span', {}, message));\n    errorEl.hidden = false;\n    control.setAttribute('aria-invalid', 'true');\n    wrap.classList.add('is-invalid');\n  } else {\n    errorEl.hidden = true;\n    control.removeAttribute('aria-invalid');\n    wrap.classList.remove('is-invalid');\n  }\n  describe(wrap);\n}\n\nexport function setFieldLoading(wrap, on) {\n  const box = wrap.querySelector('.ly-field__control');\n  box.querySelector(':scope > .ly-spinner')?.remove();\n  wrap.classList.toggle('is-loading', !!on);\n  if (on) { box.append(spinner(16)); wrap.control.setAttribute('aria-busy', 'true'); } else wrap.control.removeAttribute('aria-busy');\n}\n\n/**\n * copyField({ label, value, help, onCopied, notify }) — read-only monospace input + copy button. Focus selects all;\n * without a usable clipboard the text is selected and the user is told to copy it by hand.\n */\nexport function copyField({ label, value = '', help, notify } = {}) {\n  const wrap = field({ label, value, help });\n  const input = wrap.control;\n  input.readOnly = true;\n  input.classList.add('ly-input--readonly');\n  input.spellcheck = false;\n  input.addEventListener('focus', () => input.select());\n  const say = (msg, type) => { if (notify) notify[type](msg); };\n  const copy = button({\n    variant: 'icon', icon: 'copy', label: tr('ui.copy'),\n    onClick: async () => {\n      try {\n        if (!navigator.clipboard || !window.isSecureContext) throw new Error('clipboard unavailable');\n        await navigator.clipboard.writeText(input.value);\n        copy.replaceChildren(icon('check', { size: 20, className: 'ly-button__icon' }));\n        copy.dataset.copied = 'true';\n        setTimeout(() => { copy.replaceChildren(icon('copy', { size: 20, className: 'ly-button__icon' })); delete copy.dataset.copied; }, 1500);\n        say(tr('ui.copied'), 'success');\n      } catch (e) {\n        input.focus();\n        input.select();\n        wrap.classList.add('is-manual-copy');\n        say(tr('ui.copyManual'), 'info');\n      }\n    },\n  });\n  wrap.querySelector('.ly-field__control').append(copy);\n  wrap.classList.add('ly-field--copy');\n  wrap.copyButton = copy;\n  return wrap;\n}\n\n// ---- choice controls ------------------------------------------------------------------------------------------------\n\n/** segmented({ label, options:[{value,label,disabled}], value, onChange, disabled }) — role=radiogroup, arrow keys. */\nexport function segmented({ label, options = [], value, onChange, disabled = false } = {}) {\n  const group = h('div', { class: 'ly-segmented', role: 'radiogroup', 'aria-label': label, 'aria-disabled': disabled ? 'true' : null });\n  let current = Math.max(0, options.findIndex((o) => o.value === value));\n  const isDisabled = (i) => disabled || !!options[i].disabled;\n  const items = options.map((o, i) => h('button', {\n    type: 'button', role: 'radio', class: 'ly-segmented__item', 'data-value': o.value, disabled: isDisabled(i),\n  }, o.label));\n  const select = (i, focus) => {\n    if (i < 0 || isDisabled(i)) return;\n    const changed = i !== current;\n    current = i;\n    items.forEach((b, j) => { b.setAttribute('aria-checked', String(j === i)); b.tabIndex = j === i ? 0 : -1; });\n    if (focus) items[i].focus();\n    group.value = options[i].value;\n    if (changed && onChange) onChange(options[i].value);\n  };\n  items.forEach((b, i) => {\n    b.addEventListener('click', () => select(i, false));\n    b.addEventListener('keydown', (e) => {\n      const next = nextIndex(i, e.key, items.length, isDisabled);\n      if (next !== i && next >= 0) { e.preventDefault(); select(next, true); }\n    });\n  });\n  group.append(...items);\n  // initial state without firing onChange\n  items.forEach((b, j) => { b.setAttribute('aria-checked', String(j === current)); b.tabIndex = j === current ? 0 : -1; });\n  group.value = options[current]?.value;\n  group.select = (v) => select(options.findIndex((o) => o.value === v), false);\n  return group;\n}\n\n/**\n * tabs({ label, tabs:[{value,label}], value, onChange, panelId }) — role=tablist with roving tabindex (←/→/Home/End\n * select and focus, automatic activation). All tabs control one shared tabpanel (`panelId`, rendered by the caller):\n * the panel's aria-labelledby follows the selected tab via group.labelFor().\n */\nexport function tabs({ label, tabs: list = [], value, onChange, panelId } = {}) {\n  const group = h('div', { class: 'ly-tabs', role: 'tablist', 'aria-label': label });\n  let current = Math.max(0, list.findIndex((o) => o.value === value));\n  const ids = list.map(() => uid('tab'));\n  const items = list.map((o, i) => h('button', { type: 'button', role: 'tab', id: ids[i], class: 'ly-tabs__item', 'data-tab': o.value, 'aria-controls': panelId || null }, o.label));\n  const paint = () => items.forEach((b, j) => { b.setAttribute('aria-selected', String(j === current)); b.tabIndex = j === current ? 0 : -1; });\n  const select = (i, focus) => {\n    if (i < 0 || i >= items.length) return;\n    const changed = i !== current;\n    current = i;\n    paint();\n    if (focus) items[i].focus();\n    group.value = list[i].value;\n    if (changed && onChange) onChange(list[i].value);\n  };\n  items.forEach((b, i) => {\n    b.addEventListener('click', () => select(i, false));\n    b.addEventListener('keydown', (e) => {\n      const next = nextIndex(i, e.key, items.length);\n      if (next !== i && next >= 0) { e.preventDefault(); select(next, true); }\n    });\n  });\n  group.append(...items);\n  paint();\n  group.value = list[current]?.value;\n  group.labelFor = () => ids[current];\n  return group;\n}\n\n/**\n * switchControl({ label, checked, disabled, onChange }) — role=switch. onChange(next) may return a promise: the switch\n * shows a spinner and is disabled meanwhile; if it rejects, the switch rolls back (the caller shows the toast).\n */\nexport function switchControl({ label, checked = false, disabled = false, onChange, id = uid('sw') } = {}) {\n  const sw = h('button', { type: 'button', role: 'switch', id, class: 'ly-switch', 'aria-checked': String(!!checked), disabled },\n    h('span', { class: 'ly-switch__thumb', 'aria-hidden': 'true' }));\n  const wrap = h('div', { class: 'ly-switch-row' }, sw, h('label', { class: 'ly-switch-row__label', for: id }, label));\n  const run = guardAction(async () => {\n    const before = sw.getAttribute('aria-checked') === 'true';\n    sw.setAttribute('aria-checked', String(!before));\n    try { if (onChange) await onChange(!before); } catch (e) { sw.setAttribute('aria-checked', String(before)); throw e; }\n  }, (busy) => {\n    sw.classList.toggle('is-loading', busy);\n    sw.setAttribute('aria-busy', String(busy));\n    sw.disabled = busy || disabled;\n    sw.querySelector('.ly-switch__thumb').replaceChildren(...(busy ? [spinner(12)] : []));\n  });\n  sw.addEventListener('click', () => { run().catch(() => {}); });\n  wrap.control = sw;\n  return wrap;\n}\n\n/** checkbox({ label, checked, disabled, error, name }) */\nexport function checkbox({ label, checked = false, disabled = false, error, name, value } = {}) {\n  const input = h('input', { type: 'checkbox', class: 'ly-checkbox__input', name, value, disabled });\n  input.checked = !!checked;\n  const wrap = h('div', { class: 'ly-checkbox-field' },\n    h('label', { class: 'ly-checkbox' }, input, h('span', { class: 'ly-checkbox__box', 'aria-hidden': 'true' }, icon('check', { size: 14 })), h('span', {}, label)));\n  wrap.control = input;\n  wrap.errorEl = h('p', { class: 'ly-field__error', id: uid('cb-err'), hidden: true });\n  wrap.append(wrap.errorEl);\n  wrap.setError = (msg) => setFieldError(wrap, msg);\n  if (error) wrap.setError(error);\n  return wrap;\n}\n\n// ---- display --------------------------------------------------------------------------------------------------------\n\n/** card({ title, actions, children, onClick, href, state }) — clickable cards are buttons/links with a focus ring. */\nexport function card({ title, actions, children = [], onClick, href, className = '' } = {}) {\n  const tag = href ? 'a' : onClick ? 'button' : 'section';\n  const el = h(tag, { class: `ly-card ly-panel${onClick || href ? ' ly-panel--clickable' : ''} ${className}`.trim(), href, type: tag === 'button' ? 'button' : null });\n  if (onClick) el.addEventListener('click', onClick);\n  if (title || actions) el.append(h('div', { class: 'ly-panel__head' }, title ? h(tag === 'section' ? 'h2' : 'span', { class: 'ly-panel__title' }, title) : null, actions || null));\n  el.append(...[].concat(children).filter(Boolean));\n  return el;\n}\n\n/**\n * planCard({ name, price, unit, currency, features, cta, selected, soldOut, onSelect, badge })\n * Price is pre-formatted text (format.js); a sold-out card is 60 % opaque, labelled and its button disabled.\n */\nexport function planCard({ name, price, unit, currency = '¥', features = [], cta, selected = false, soldOut = false, onSelect, badge: badgeText } = {}) {\n  const el = h('article', { class: `ly-card ly-plan${selected ? ' is-selected' : ''}${soldOut ? ' is-sold-out' : ''}`, 'aria-label': name },\n    selected ? h('span', { class: 'ly-plan__check' }, icon('check', { size: 16 }), h('span', { class: 'ly-sr-only' }, tr('ui.selected'))) : null,\n    h('div', { class: 'ly-plan__head' },\n      h('h3', { class: 'ly-plan__name' }, name),\n      soldOut ? badge(tr('ui.soldOut'), 'neutral') : badgeText ? badge(badgeText, 'primary') : null),\n    h('p', { class: 'ly-plan__price' }, h('span', { class: 'ly-plan__currency' }, currency), h('span', { class: 'ly-plan__amount' }, price), unit ? h('span', { class: 'ly-plan__unit' }, ` / ${unit}`) : null),\n    h('ul', { class: 'ly-plan__features' }, features.map((f) => h('li', {}, icon('check', { size: 16, className: 'ly-plan__tick' }), h('span', {}, f)))),\n  );\n  el.append(button({ label: soldOut ? tr('ui.soldOut') : cta, variant: selected ? 'primary' : 'secondary', block: true, disabled: soldOut, onClick: onSelect }));\n  return el;\n}\n\n/** badge(text, tone) — tone: neutral | primary | leaf | warning | danger | info. Always text, never colour alone. */\nexport function badge(text, tone = 'neutral') {\n  return h('span', { class: `ly-badge ly-badge--${tone}` }, text);\n}\n\n/**\n * progress({ label, percent, valueText, caption }) — role=progressbar with aria-valuenow (0–100) and a visible number.\n * ≥ 80 % warning colour + text, ≥ 100 % danger colour + text (colour is never the only signal).\n */\nexport function progress({ label, percent = 0, valueText, caption } = {}) {\n  const raw = Number.isFinite(Number(percent)) ? Number(percent) : 0;\n  const level = progressLevel(raw);\n  const now = Math.min(100, Math.max(0, Math.round(raw * 100) / 100));\n  const shown = valueText || `${raw.toFixed(2)}%`;\n  const id = uid('pg');\n  return h('div', { class: `ly-progress ly-progress--${level}`, 'data-level': level },\n    h('div', { class: 'ly-progress__top' },\n      h('span', { class: 'ly-progress__label', id }, label),\n      h('span', { class: 'ly-progress__value' }, shown)),\n    h('div', { class: 'ly-progress__track', role: 'progressbar', 'aria-labelledby': id, 'aria-valuemin': '0', 'aria-valuemax': '100', 'aria-valuenow': String(now), 'aria-valuetext': shown },\n      h('span', { class: 'ly-progress__fill', style: `width: ${now}%` })),\n    level !== 'normal' || caption ? h('p', { class: 'ly-progress__caption' }, level === 'danger' ? tr('ui.progressFull') : level === 'warning' ? tr('ui.progressHigh') : caption) : null,\n  );\n}\n"],"core/route-skeleton.js":[[],"// Page skeleton kinds (SPEC F815 item 2, DESIGN.md §16.4): what the outlet shows while a route's code is still loading.\n// Four kinds shaped like the pages: cards (dashboard, plans, nodes), list (orders, tickets, traffic, invite), article\n// (knowledge), form (profile, checkout, order detail). Pure, no DOM — ui/feedback.js pageSkeleton() draws them.\n\nexport const ROUTE_SKELETONS = {\n  dashboard: 'cards', plan: 'cards', node: 'cards',\n  order: 'list', ticket: 'list', 'ticket-detail': 'list', traffic: 'list', invite: 'list', 'invite-pro': 'list',\n  knowledge: 'article', 'knowledge-detail': 'article',\n  profile: 'form', 'plan-detail': 'form', 'order-detail': 'form',\n};\n\n/** Blocks of each kind, top to bottom (class suffixes of .ly-skeleton-block--*). */\nexport const SKELETON_BLOCKS = {\n  cards: ['card', 'card', 'card'],\n  list: ['row', 'row', 'row', 'row', 'row'],\n  article: ['line', 'line', 'line-short', 'media', 'line', 'line-short'],\n  form: ['field', 'field', 'field', 'line-short'],\n};\n\nexport function skeletonKind(view) {\n  return ROUTE_SKELETONS[view] || 'list';\n}\n"],"ui/feedback.js":[["core/view.js","ui/controls.js","ui/icon.js","ui/text.js","core/route-skeleton.js"],"// 荔枝云 feedback components (F113, DESIGN.md §7.6): empty state, skeleton, error state with retry.\n// (Toasts live in core/notify.js because the app creates the notifier before any view.)\nimport { h } from '@@lydep:0@@';\nimport { button } from '@@lydep:1@@';\nimport { icon } from '@@lydep:2@@';\nimport { tr } from '@@lydep:3@@';\nimport { skeletonKind, SKELETON_BLOCKS } from '@@lydep:4@@';\n\n/**\n * emptyState({ title, body, action: { label, onClick | href }, filtered }) — 48px line icon + one sentence + one action.\n * filtered → \"no results for this filter\" wording and icon (different from \"no data yet\").\n */\nexport function emptyState({ title, body, action, filtered = false } = {}) {\n  const act = action ? (action.href\n    ? h('a', { class: 'ly-button ly-button--primary', href: action.href }, action.label)\n    : button({ label: action.label, variant: filtered ? 'secondary' : 'primary', onClick: action.onClick })) : null;\n  return h('div', { class: `ly-empty${filtered ? ' ly-empty--filtered' : ''}`, 'data-state-view': filtered ? 'filtered' : 'empty' },\n    icon(filtered ? 'search-x' : 'inbox', { size: 48, className: 'ly-empty__icon' }),\n    h('p', { class: 'ly-empty__title' }, title || tr(filtered ? 'ui.emptyFiltered' : 'ui.empty')),\n    body ? h('p', { class: 'ly-empty__body' }, body) : null,\n    act);\n}\n\n/**\n * skeleton({ lines, shape: 'text'|'card'|'table'|'list', rows }) — surface-2 blocks shaped like the content, a shimmer\n * (none with reduced motion) and only visible after --ly-skeleton-delay (100 ms) so fast responses do not flash.\n */\nexport function skeleton({ shape = 'text', lines = 3, rows = 5 } = {}) {\n  const bar = (w) => h('span', { class: 'ly-skel', style: `width: ${w}%` });\n  let inner;\n  if (shape === 'table') {\n    inner = Array.from({ length: rows }, () => h('div', { class: 'ly-skel-row' }, bar(28), bar(18), bar(22), bar(14)));\n  } else if (shape === 'card') {\n    inner = [h('span', { class: 'ly-skel ly-skel--title' }), bar(62), bar(40), h('span', { class: 'ly-skel ly-skel--block' })];\n  } else if (shape === 'list') {\n    inner = Array.from({ length: rows }, () => h('div', { class: 'ly-skel-item' }, h('span', { class: 'ly-skel ly-skel--avatar' }), h('div', { class: 'ly-skel-item__text' }, bar(70), bar(45))));\n  } else {\n    inner = Array.from({ length: lines }, (_, i) => bar(i === lines - 1 ? 60 : 100 - i * 8));\n  }\n  return h('div', { class: `ly-skeleton-box ly-skeleton-view-delay ly-skeleton-box--${shape}`, role: 'status', 'aria-busy': 'true' },\n    h('span', { class: 'ly-sr-only' }, tr('ui.loading')), ...inner);\n}\n\n/** errorState({ message, onRetry, title }) — icon + \"加载失败\" + reason (backend message) + retry (loading while it runs). */\nexport function errorState({ message, onRetry, title } = {}) {\n  // --retry (DESIGN.md §16.4): on phones the retry button spans the width; while it runs it is aria-busy\n  return h('div', { class: `ly-error-state${onRetry ? ' ly-error-state--retry' : ''}`, role: 'alert', 'data-state-view': 'error' },\n    icon('circle-alert', { size: 40, className: 'ly-error-state__icon' }),\n    h('p', { class: 'ly-error-state__title' }, title || tr('ui.loadFailed')),\n    h('p', { class: 'ly-error-state__body' }, message || tr('error.unknown')),\n    onRetry ? button({ label: tr('error.retry'), variant: 'secondary', icon: 'refresh-cw', attrs: { 'data-action': 'retry' }, onClick: onRetry }) : null);\n}\n\n/**\n * pageSkeleton({ view, title }) — the whole page while its code loads (SPEC F815, DESIGN.md §16.4): the real page\n * title (same .ly-page / .ly-page__title as the view, so the header does not move when the view replaces it) and the\n * blocks of the route's kind. data-view = the target view and aria-busy, so \"the target page is there\" from the first\n * frame; the blocks are aria-hidden and appear after --ly-skeleton-delay.\n */\nexport function pageSkeleton({ view, title } = {}) {\n  const kind = skeletonKind(view);\n  // no data-state: that belongs to the view (tests and screenshots wait for the view's own loading / success state)\n  return h('section', { class: 'ly-page', 'data-view': view, 'data-skeleton-view': kind, 'aria-busy': 'true' },\n    h('h1', { class: 'ly-page__title' }, title || ''),\n    h('div', { class: `ly-skeleton-view ly-skeleton-view--${kind}`, 'aria-hidden': 'true' },\n      ...SKELETON_BLOCKS[kind].map((b) => h('span', { class: `ly-skeleton-block ly-skeleton-block--${b}` }))),\n    h('span', { class: 'ly-sr-only', role: 'status' }, tr('ui.loading')));\n}\n"],"ui/overlay.js":[["core/view.js","ui/controls.js","ui/icon.js","ui/logic.js","ui/text.js"],"// 荔枝云 dialogs and drawers (F113, DESIGN.md §7.6). Shared behaviour:\n//   focus moves into the panel and is trapped there (Tab / Shift+Tab wrap); the rest of the page is inert;\n//   Esc and a click on the scrim close it (not while busy); afterwards focus returns to the element that opened it.\n// Dialog: centred, max 480; < 768 it slides up from the bottom at full width. Drawer: right side (400) on desktop,\n// bottom sheet (≤ 85vh, drag handle) on phones. Only opacity / transform animate (reduced motion → 0 ms via base.css).\nimport { h } from '@@lydep:0@@';\nimport { button, setButtonLoading } from '@@lydep:1@@';\nimport { icon } from '@@lydep:2@@';\nimport { FOCUSABLE, trapIndex, uid } from '@@lydep:3@@';\nimport { tr } from '@@lydep:4@@';\n\nconst stack = [];\n\nfunction focusables(panel) {\n  return [...panel.querySelectorAll(FOCUSABLE)].filter((el) => !el.closest('[inert]') && el.getClientRects().length > 0);\n}\n\nfunction setInert(on, except) {\n  for (const el of document.body.children) {\n    if (el === except || el.tagName === 'SCRIPT') continue;\n    if (on) { if (!el.hasAttribute('inert')) { el.setAttribute('inert', ''); el.dataset.lyInert = String(stack.length); } }\n    else if (el.dataset.lyInert === String(stack.length)) { el.removeAttribute('inert'); delete el.dataset.lyInert; }\n  }\n}\n\n/**\n * Open a modal surface. opts: { kind: 'dialog'|'drawer', title, body (Node | Node[] | (api) => Node), actions:\n * [{ label, variant, onClick(api) → (promise of) false to keep it open }], trigger, onClose, dismissible = true, wide }\n * Returns api { el, panel, close(), setError(msg), setBusy(bool), closed (promise) }.\n */\nexport function openOverlay(opts = {}) {\n  const { kind = 'dialog', title = '', actions = [], dismissible = true, onClose, wide = false } = opts;\n  const trigger = opts.trigger || document.activeElement;\n  const titleId = uid('dlg-title');\n  let busy = false;\n  let isClosed = false;\n  let resolveClosed;\n  const closed = new Promise((r) => { resolveClosed = r; });\n\n  const errorEl = h('p', { class: 'ly-overlay__error', role: 'alert', hidden: true });\n  const bodyEl = h('div', { class: 'ly-overlay__body' });\n  const panel = h('div', {\n    class: `ly-overlay__panel ly-overlay__panel--${kind}${wide ? ' ly-overlay__panel--wide' : ''}`,\n    role: 'dialog', 'aria-modal': 'true', 'aria-labelledby': titleId, tabindex: '-1',\n  },\n  kind === 'drawer' ? h('span', { class: 'ly-overlay__handle', 'aria-hidden': 'true' }) : null,\n  h('div', { class: 'ly-overlay__head' },\n    h('h2', { class: 'ly-overlay__title', id: titleId }, title),\n    button({ variant: 'icon', icon: 'x', label: tr('ui.close'), attrs: { 'data-action': 'close' }, onClick: () => api.close() })),\n  bodyEl, errorEl);\n  const scrim = h('div', { class: 'ly-overlay__scrim', 'aria-hidden': 'true' });\n  const root = h('div', { class: `ly-overlay ly-overlay--${kind}`, 'data-overlay': kind }, scrim, panel);\n\n  const api = {\n    el: root, panel, closed,\n    get busy() { return busy; },\n    setError(message) { errorEl.textContent = message || ''; errorEl.hidden = !message; },\n    setBusy(on) {\n      busy = !!on;\n      root.classList.toggle('is-busy', busy);\n      panel.querySelector('[data-action=close]').disabled = busy;\n    },\n    close() {\n      if (isClosed || busy) return;\n      isClosed = true;\n      document.removeEventListener('keydown', onKey, true);\n      const idx = stack.indexOf(api);\n      if (idx >= 0) stack.splice(idx, 1);\n      setInert(false, root);\n      if (!stack.length) document.documentElement.classList.remove('ly-scroll-locked');\n      root.classList.remove('is-open');\n      const done = () => { root.remove(); };\n      const dur = parseFloat(getComputedStyle(panel).transitionDuration) || 0;\n      if (dur > 0) setTimeout(done, dur * 1000 + 20); else done();\n      if (trigger && typeof trigger.focus === 'function' && trigger.isConnected) trigger.focus();\n      if (onClose) onClose();\n      resolveClosed();\n    },\n  };\n\n  const content = typeof opts.body === 'function' ? opts.body(api) : opts.body;\n  bodyEl.append(...[].concat(content || []).filter(Boolean));\n  if (actions.length) {\n    panel.append(h('div', { class: 'ly-overlay__actions' }, actions.map((a) => {\n      const btn = button({\n        label: a.label, variant: a.variant || 'secondary', attrs: a.attrs,\n        onClick: async () => {\n          if (!a.onClick) { if (!busy) api.close(); return; }\n          // SPEC F815 item 6: one press = one request — nothing else runs while an action is in flight\n          if (busy) return;\n          api.setError('');\n          api.setBusy(true);\n          setButtonLoading(btn, true);\n          let keep;\n          try { keep = await a.onClick(api); } catch (e) { setButtonLoading(btn, false); api.setBusy(false); api.setError((e && e.message) || tr('error.unknown')); return; }\n          setButtonLoading(btn, false);\n          api.setBusy(false);\n          if (keep !== false) api.close();\n        },\n      });\n      return btn;\n    })));\n  }\n\n  function onKey(e) {\n    if (stack[stack.length - 1] !== api) return;\n    if (e.key === 'Escape') {\n      e.preventDefault();\n      e.stopPropagation();\n      if (dismissible) api.close();\n      return;\n    }\n    if (e.key !== 'Tab') return;\n    const items = focusables(panel);\n    if (!items.length) { e.preventDefault(); panel.focus(); return; }\n    const at = items.indexOf(document.activeElement);\n    const next = !panel.contains(document.activeElement) ? (e.shiftKey ? items.length - 1 : 0) : trapIndex(at, items.length, e.shiftKey);\n    if (next >= 0) { e.preventDefault(); items[next].focus(); }\n  }\n\n  scrim.addEventListener('click', () => { if (dismissible) api.close(); });\n  document.body.append(root);\n  setInert(true, root);\n  stack.push(api);\n  document.documentElement.classList.add('ly-scroll-locked');\n  document.addEventListener('keydown', onKey, true);\n  // first focus: the first field / button in the body, else the panel itself\n  const first = focusables(bodyEl)[0] || panel.querySelector('.ly-overlay__actions .ly-button--primary, .ly-overlay__actions .ly-button--danger') || panel;\n  requestAnimationFrame(() => { root.classList.add('is-open'); });\n  first.focus({ preventScroll: true });\n  return api;\n}\n\nexport const openModal = (opts) => openOverlay({ ...opts, kind: 'dialog' });\nexport const openDrawer = (opts) => openOverlay({ ...opts, kind: 'drawer' });\n\n/** Close every open overlay (route change). */\nexport function closeAllOverlays() {\n  for (const o of [...stack].reverse()) { o.setBusy(false); o.close(); }\n}\n\n/** Confirmation dialog: resolves true when confirmed. danger → the confirm button is the danger variant. */\nexport function confirmDialog({ title, message, confirmLabel, cancelLabel, danger = false, trigger, onConfirm } = {}) {\n  return new Promise((resolve) => {\n    let ok = false;\n    openModal({\n      title, trigger, body: h('p', { class: 'ly-overlay__text' }, message),\n      actions: [\n        { label: cancelLabel || tr('ui.cancel'), variant: 'secondary' },\n        { label: confirmLabel || tr('ui.confirm'), variant: danger ? 'danger' : 'primary', onClick: async (api) => { if (onConfirm) await onConfirm(api); ok = true; } },\n      ],\n      onClose: () => resolve(ok),\n    });\n  });\n}\n\n"],"ui/prefs.js":[["core/view.js","ui/icon.js"],"// Language and colour-scheme switches (F129). Same controls in three places: the top bar (app pages), the top-right\n// corner of the auth pages, and the 「更多」 drawer on phones. Every instance keeps its label in sync.\nimport { h } from '@@lydep:0@@';\nimport { icon } from '@@lydep:1@@';\n\nconst OTHER = { 'zh-CN': 'en-US', 'en-US': 'zh-CN' };\nconst NATIVE = { 'zh-CN': '中文', 'en-US': 'English' };\nconst SHORT = { 'zh-CN': '中', 'en-US': 'EN' };\n\n/** Language button: shows (and switches to) the other language. variant 'icon' (top bar / corner) | 'row' (drawer). */\nexport function languageButton(app, { variant = 'icon' } = {}) {\n  const { i18n } = app;\n  const text = h('span', { class: variant === 'row' ? '' : 'ly-prefbtn__short' });\n  const btn = h('button', { type: 'button', class: variant === 'row' ? 'ly-more__item' : 'ly-iconbtn ly-prefbtn', 'data-pref': 'language' }, icon('languages', { size: 20 }), text);\n  const render = () => {\n    const target = OTHER[i18n.locale] || 'en-US';\n    text.textContent = variant === 'row' ? i18n.t('prefs.languageRow', { language: NATIVE[target] }) : SHORT[target];\n    // the visible short label (EN / 中) starts the accessible name (WCAG 2.5.3 label in name)\n    const full = i18n.t('prefs.switchLanguage', { language: NATIVE[target] });\n    btn.setAttribute('aria-label', variant === 'row' ? text.textContent : `${SHORT[target]} ${full}`);\n    btn.setAttribute('lang', i18n.locale);\n  };\n  btn.addEventListener('click', () => i18n.setLocale(OTHER[i18n.locale] || 'en-US'));\n  render();\n  const off = i18n.subscribe ? i18n.subscribe(render) : null;\n  btn.ly_dispose = () => off && off();\n  return btn;\n}\n\n/** Light / dark button: icon shows the scheme it switches to. */\nexport function schemeButton(app, { variant = 'icon' } = {}) {\n  const { scheme, i18n } = app;\n  const iconBox = h('span', { class: 'ly-prefbtn__icon', 'aria-hidden': 'true' });\n  const text = h('span', null);\n  const btn = h('button', { type: 'button', class: variant === 'row' ? 'ly-more__item' : 'ly-iconbtn', 'data-pref': 'scheme' }, iconBox, variant === 'row' ? text : null);\n  const render = () => {\n    const toDark = scheme.current !== 'dark';\n    iconBox.replaceChildren(icon(toDark ? 'moon' : 'sun', { size: 20 }));\n    const label = i18n.t(toDark ? 'prefs.toDark' : 'prefs.toLight');\n    btn.setAttribute('aria-label', label);\n    btn.dataset.scheme = scheme.current;\n    text.textContent = label;\n  };\n  btn.addEventListener('click', () => scheme.toggle());\n  render();\n  const offs = [scheme.subscribe(render), i18n.subscribe ? i18n.subscribe(render) : null];\n  btn.ly_dispose = () => offs.forEach((off) => off && off());\n  return btn;\n}\n"],"ui/shell.js":[["core/view.js","core/nav.js","ui/brand.js","ui/icon.js","ui/overlay.js","ui/logic.js","ui/prefs.js"],"// App shell (F128, DESIGN.md §7.5): sidebar (≥ 1280, 264px) / icon rail (768–1279, 72px) / bottom tab bar + 「更多」\n// drawer (< 768); top bar with the collapse button, the current page title and the user menu. Login / register /\n// forgot-password pages render bare (no shell). The navigation model lives in core/nav.js.\n//\n// createShell({ app, outlet, doc }) → { el, update(routeInfo), actions (top-bar buttons: language, scheme), moreExtras (array of\n// (api) => Node for the 「更多」 drawer), dispose() }\nimport { h } from '@@lydep:0@@';\nimport { NAV_GROUPS, TABS, MORE_TAB, MORE_ITEMS, activeRoute, moreActive, isBare, navMode, initialOf } from '@@lydep:1@@';\nimport { brandLogo } from '@@lydep:2@@';\nimport { icon } from '@@lydep:3@@';\nimport { openDrawer } from '@@lydep:4@@';\nimport { nextIndex } from '@@lydep:5@@';\nimport { languageButton, schemeButton } from '@@lydep:6@@';\n\nconst COLLAPSE_KEY = 'ly_nav_collapsed';\n\nexport function createShell({ app, outlet, doc = document, win = window }) {\n  const { t } = app.i18n;\n  const storage = (() => { try { return win.localStorage; } catch (e) { return null; } })();\n  const cleanups = [];\n  const listen = (target, type, fn, opts) => { target.addEventListener(type, fn, opts); cleanups.push(() => target.removeEventListener(type, fn, opts)); };\n  const width = () => win.innerWidth;\n  let current = null;\n  let drawer = null;\n\n  // ---- sidebar ----\n  const navLinks = [];\n  const label = (key) => h('span', { class: 'ly-nav__label', 'data-i18n': key }, t(key));\n  const groups = NAV_GROUPS.map((g) => h('div', { class: 'ly-nav__group', role: 'group', 'aria-labelledby': `ly-nav-${g.id}` },\n    h('p', { class: 'ly-nav__heading', id: `ly-nav-${g.id}`, 'data-i18n': g.title }, t(g.title)),\n    h('ul', { class: 'ly-nav__list' }, g.items.map((item) => {\n      const a = h('a', { class: 'ly-nav__item', href: `#${item.path}`, 'data-route': item.route, 'data-tip': t(item.title) }, icon(item.icon, { size: 20 }), label(item.title));\n      navLinks.push(a);\n      return h('li', null, a);\n    })),\n  ));\n  const brand = brandLogo({ config: app.config, variant: 'full', size: 32 });\n  // the brand reads as one image named after the site: the mark carries the name, the visible text is not repeated\n  const mark = brand.querySelector('.ly-brand__mark');\n  if (mark) { mark.setAttribute('role', 'img'); mark.setAttribute('aria-label', app.config.siteName || ''); mark.removeAttribute('aria-hidden'); }\n  brand.querySelector('.ly-brand__name')?.setAttribute('aria-hidden', 'true');\n  const userAvatar = h('span', { class: 'ly-avatar', 'aria-hidden': 'true' }, '?');\n  const userEmail = h('span', { class: 'ly-sidebar__email' }, '');\n  const sidebar = h('aside', { class: 'ly-sidebar', id: 'ly-sidebar' },\n    h('div', { class: 'ly-sidebar__brand' }, h('a', { class: 'ly-sidebar__home', href: '#/dashboard' }, brand)),\n    h('nav', { class: 'ly-nav', 'aria-label': t('nav.main'), 'data-i18n-label': 'nav.main' }, groups),\n    h('div', { class: 'ly-sidebar__user' }, userAvatar, userEmail),\n  );\n\n  // ---- top bar ----\n  const toggle = h('button', { type: 'button', class: 'ly-iconbtn ly-topbar__toggle', 'aria-controls': 'ly-sidebar', 'aria-expanded': 'true', 'aria-label': t('nav.toggle'), 'data-i18n-label': 'nav.toggle' }, icon('panel-left', { size: 20 }));\n  const pageTitle = h('p', { class: 'ly-topbar__title' }, '');\n  // F129: language + light / dark in the top bar, and in the top-right corner of the auth pages\n  const actions = h('div', { class: 'ly-topbar__actions' }, languageButton(app), schemeButton(app));\n  const corner = h('div', { class: 'ly-corner' }, languageButton(app), schemeButton(app));\n  const menuId = 'ly-user-menu';\n  const menuBtn = h('button', { type: 'button', class: 'ly-usermenu__btn', 'aria-haspopup': 'menu', 'aria-expanded': 'false', 'aria-controls': menuId, 'aria-label': t('nav.userMenu'), 'data-i18n-label': 'nav.userMenu' },\n    h('span', { class: 'ly-avatar ly-avatar--sm', 'aria-hidden': 'true' }, '?'), icon('chevron-down', { size: 16 }));\n  const menuItems = [\n    h('a', { class: 'ly-menu__item', role: 'menuitem', href: '#/profile', tabindex: '-1' }, icon('user', { size: 16 }), label('route.profile')),\n    h('button', { type: 'button', class: 'ly-menu__item', role: 'menuitem', tabindex: '-1', 'data-action': 'logout' }, icon('log-out', { size: 16 }), label('nav.logout')),\n  ];\n  const menu = h('div', { class: 'ly-menu', id: menuId, role: 'menu', hidden: true, 'aria-label': t('nav.userMenu') }, menuItems);\n  const userMenu = h('div', { class: 'ly-usermenu' }, menuBtn, menu);\n  const topbar = h('header', { class: 'ly-topbar' }, toggle, pageTitle, h('div', { class: 'ly-topbar__end' }, actions, userMenu));\n\n  // ---- phone tab bar ----\n  const tabLinks = TABS.map((item) => h('a', { class: 'ly-tab', href: `#${item.path}`, 'data-route': item.route }, icon(item.icon, { size: 20 }), label(item.tabTitle)));\n  const moreTab = h('button', { type: 'button', class: 'ly-tab', 'data-route': MORE_TAB.route, 'aria-haspopup': 'dialog' }, icon(MORE_TAB.icon, { size: 20 }), label(MORE_TAB.title));\n  const tabbar = h('nav', { class: 'ly-tabbar', 'aria-label': t('nav.tabs'), 'data-i18n-label': 'nav.tabs' }, tabLinks, moreTab);\n\n  outlet.classList.add('ly-shell__main');\n  const body = h('div', { class: 'ly-shell__body' }, topbar, outlet);\n  const skip = h('a', { class: 'ly-skip', href: '#ly-main', 'data-i18n': 'nav.skip' }, t('nav.skip'));\n  // start in the form the first route will most likely use (F1058: no layout shift when the first route renders) —\n  // a signed-in visitor gets the sidebar / tab bar from the first frame, a visitor the bare auth layout\n  const startBare = isBare(null, app.session.isLoggedIn());\n  const el = h('div', { class: 'ly-shell', 'data-bare': String(startBare) }, skip, corner, sidebar, body, tabbar);\n  doc.documentElement.classList.toggle('ly-has-tabbar', !startBare);\n  const loginBg = app.config.theme && app.config.theme.loginBackground;\n  // the template only lets http(s) URLs and same-site paths through; quotes / parentheses are rejected there\n  if (loginBg) { el.style.setProperty('--ly-login-bg', `url(\"${loginBg}\")`); el.dataset.loginBg = 'custom'; }\n\n  // ---- behaviour ----\n  const logout = () => { closeMenu(false); app.session.clear(); };\n  const setExpanded = () => {\n    const mode = navMode(width());\n    const collapsed = el.dataset.collapsed === 'true';\n    const expanded = el.dataset.expanded === 'true';\n    // data-rail: the sidebar shows icons only (768–1279, or ≥ 1280 collapsed); is-overlay: the rail opened over the page\n    if (mode === 'rail' || (mode === 'sidebar' && collapsed)) el.dataset.rail = ''; else delete el.dataset.rail;\n    sidebar.classList.toggle('is-overlay', mode === 'rail' && expanded);\n    const full = mode === 'sidebar' ? !collapsed : mode === 'rail' ? expanded : false;\n    toggle.setAttribute('aria-expanded', String(full));\n  };\n  if (storage?.getItem(COLLAPSE_KEY) === '1') el.dataset.collapsed = 'true';\n  const collapseRail = () => { if (el.dataset.expanded === 'true') { delete el.dataset.expanded; setExpanded(); } };\n  listen(toggle, 'click', () => {\n    if (navMode(width()) === 'sidebar') {\n      if (el.dataset.collapsed === 'true') { delete el.dataset.collapsed; storage?.removeItem(COLLAPSE_KEY); } else { el.dataset.collapsed = 'true'; storage?.setItem(COLLAPSE_KEY, '1'); }\n    } else if (el.dataset.expanded === 'true') delete el.dataset.expanded;\n    else el.dataset.expanded = 'true';\n    setExpanded();\n  });\n  listen(win, 'resize', () => { collapseRail(); setExpanded(); });\n  // the temporarily expanded rail closes on navigation, Esc and a click outside it\n  listen(doc, 'click', (e) => {\n    if (el.dataset.expanded === 'true' && !sidebar.contains(e.target) && !toggle.contains(e.target)) collapseRail();\n    if (!menu.hidden && !userMenu.contains(e.target)) closeMenu(false);\n  });\n  listen(doc, 'keydown', (e) => {\n    if (e.key !== 'Escape') return;\n    if (!menu.hidden) { closeMenu(true); return; }\n    if (el.dataset.expanded === 'true') { collapseRail(); toggle.focus(); }\n  });\n\n  function openMenu(focusIndex = 0) {\n    menu.hidden = false;\n    menuBtn.setAttribute('aria-expanded', 'true');\n    menuItems[focusIndex]?.focus();\n  }\n  function closeMenu(returnFocus) {\n    if (menu.hidden) return;\n    menu.hidden = true;\n    menuBtn.setAttribute('aria-expanded', 'false');\n    if (returnFocus) menuBtn.focus();\n  }\n  listen(menuBtn, 'click', () => (menu.hidden ? openMenu(0) : closeMenu(false)));\n  listen(menuBtn, 'keydown', (e) => {\n    if (e.key === 'ArrowDown') { e.preventDefault(); openMenu(0); }\n    if (e.key === 'ArrowUp') { e.preventDefault(); openMenu(menuItems.length - 1); }\n  });\n  listen(menu, 'keydown', (e) => {\n    const i = menuItems.indexOf(doc.activeElement);\n    if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(e.key)) {\n      e.preventDefault();\n      menuItems[nextIndex(i, e.key, menuItems.length)]?.focus();\n    } else if (e.key === 'Tab') closeMenu(false);\n  });\n  listen(menu, 'click', (e) => {\n    const item = e.target.closest('.ly-menu__item');\n    if (!item) return;\n    if (item.dataset.action === 'logout') logout(); else closeMenu(false);\n  });\n\n  setExpanded();\n  const moreExtras = [];\n  listen(moreTab, 'click', () => {\n    const prefRows = [languageButton(app, { variant: 'row' }), schemeButton(app, { variant: 'row' })];\n    const links = MORE_ITEMS.map((item) => h('a', { class: 'ly-more__item', href: `#${item.path}`, 'data-route': item.route, 'aria-current': current && activeRoute(current.route?.name) === item.route ? 'page' : null }, icon(item.icon, { size: 20 }), h('span', null, t(item.title))));\n    drawer = openDrawer({\n      title: t('nav.more'),\n      trigger: moreTab,\n      body: (api) => h('div', { class: 'ly-more' },\n        h('nav', { class: 'ly-more__list', 'aria-label': t('nav.more') }, links),\n        h('div', { class: 'ly-more__prefs' }, prefRows),\n        moreExtras.map((fn) => fn(api)),\n        h('button', { type: 'button', class: 'ly-more__item ly-more__item--danger', 'data-action': 'logout', onClick: () => { api.close(); logout(); } }, icon('log-out', { size: 20 }), h('span', null, t('nav.logout'))),\n      ),\n      onClose: () => { drawer = null; prefRows.forEach((b) => b.ly_dispose && b.ly_dispose()); },\n    });\n    for (const a of links) a.addEventListener('click', () => drawer?.close());\n  });\n\n  const unsubscribeUser = app.user?.subscribe?.((info) => {\n    const email = info?.email || '';\n    userEmail.textContent = email;\n    userEmail.title = email;\n    for (const av of el.querySelectorAll('.ly-avatar')) av.textContent = initialOf(email);\n  });\n  if (unsubscribeUser) cleanups.push(unsubscribeUser);\n  if (app.user?.get?.()) { const email = app.user.get().email || ''; userEmail.textContent = email; for (const av of el.querySelectorAll('.ly-avatar')) av.textContent = initialOf(email); }\n\n  /** Called after every route change (and after a language change re-render). */\n  function update(info) {\n    current = info;\n    const route = info?.route || null;\n    const bare = isBare(route, app.session.isLoggedIn());\n    el.dataset.bare = String(bare);\n    // F130: login / register / forgot-password sit on the configured background (default: brand gradient)\n    el.dataset.auth = String(!!(route && route.guestOnly));\n    doc.documentElement.classList.toggle('ly-has-tabbar', !bare);\n    const active = activeRoute(route?.name);\n    for (const a of [...navLinks, ...tabLinks]) {\n      if (a.dataset.route === active) a.setAttribute('aria-current', 'page'); else a.removeAttribute('aria-current');\n    }\n    moreTab.classList.toggle('is-active', moreActive(route?.name));\n    pageTitle.textContent = route ? t(route.title) : '';\n    closeMenu(false);\n    collapseRail();\n    setExpanded();\n    if (bare && drawer) drawer.close();\n  }\n\n  /** Re-translate the static labels (language switch, F129). */\n  function relabel() {\n    for (const n of el.querySelectorAll('[data-i18n]')) n.textContent = t(n.dataset.i18n);\n    for (const n of el.querySelectorAll('[data-i18n-label]')) n.setAttribute('aria-label', t(n.dataset.i18nLabel));\n    menu.setAttribute('aria-label', t('nav.userMenu'));\n    for (const a of navLinks) a.dataset.tip = t(NAV_GROUPS.flatMap((g) => g.items).find((i) => i.route === a.dataset.route).title);\n    if (current) update(current);\n  }\n\n  for (const b of [...actions.children, ...corner.children]) cleanups.push(() => b.ly_dispose && b.ly_dispose());\n  return { el, update, relabel, actions, moreExtras, toggle, dispose: () => cleanups.splice(0).forEach((fn) => fn()) };\n}\n"],"core/scheme.js":[[],"// Colour scheme (F129, DESIGN.md §7.2): follows the system until the visitor picks light or dark; the choice is kept\n// in localStorage \"ui_theme\" (shared with the server-rendered UI pages; the template applies it before first paint).\n// tokens.css: :root[data-theme=\"dark\"] = dark; no data-theme + prefers-color-scheme: dark = dark.\n\nexport const SCHEME_KEY = 'ui_theme';\n\n/** Saved choice: 'light' | 'dark' | null (= follow the system). */\nexport function savedScheme(storage) {\n  let v = null;\n  try { v = storage ? storage.getItem(SCHEME_KEY) : null; } catch (e) { v = null; }\n  return v === 'light' || v === 'dark' ? v : null;\n}\n\n/** Scheme in effect: the saved choice, else the system preference. */\nexport function effectiveScheme({ storage, systemDark = false } = {}) {\n  return savedScheme(storage) || (systemDark ? 'dark' : 'light');\n}\n\n/** The scheme a toggle switches to. */\nexport const oppositeScheme = (scheme) => (scheme === 'dark' ? 'light' : 'dark');\n\nexport function createScheme({ storage, doc = document, win = window } = {}) {\n  const media = win.matchMedia ? win.matchMedia('(prefers-color-scheme: dark)') : null;\n  const listeners = new Set();\n  const current = () => effectiveScheme({ storage, systemDark: !!(media && media.matches) });\n  const apply = () => {\n    const saved = savedScheme(storage);\n    if (saved) doc.documentElement.setAttribute('data-theme', saved); else doc.documentElement.removeAttribute('data-theme');\n  };\n  const notify = () => { const s = current(); listeners.forEach((fn) => fn(s)); };\n  media?.addEventListener?.('change', () => { if (!savedScheme(storage)) notify(); });\n  apply();\n  return {\n    get current() { return current(); },\n    get saved() { return savedScheme(storage); },\n    set(choice) {\n      try { if (choice === 'light' || choice === 'dark') storage?.setItem(SCHEME_KEY, choice); else storage?.removeItem(SCHEME_KEY); } catch (e) { /* private mode: applies to this page only */ }\n      if (choice === 'light' || choice === 'dark') doc.documentElement.setAttribute('data-theme', choice); else apply();\n      notify();\n    },\n    toggle() { this.set(oppositeScheme(current())); },\n    subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); },\n  };\n}\n"],"core/handback.js":[[],"// Back to the page that sent the visitor to log in (F131). The server-rendered UI pages (e.g. the promotion centre)\n// store localStorage \"ui_return_to\" = {path, tokenKey, exp} before sending a logged-out visitor here; other themes get\n// a small injected script for this (public/assets/ui/return.js), 荔枝云 does it itself so that every script it loads\n// lives under the theme's own asset path. Same rules: single use, expires, same-origin absolute paths only.\n\nexport const RETURN_KEY = 'ui_return_to';\n\n/** The stored return path when it is still valid, else null; an invalid or expired marker is removed. */\nexport function readReturnMarker(storage, now = Date.now()) {\n  if (!storage) return null;\n  let raw = null;\n  try { raw = storage.getItem(RETURN_KEY); } catch (e) { return null; }\n  if (!raw) return null;\n  let m = null;\n  try { m = JSON.parse(raw); } catch (e) { m = null; }\n  const path = m && m.path;\n  const safe = typeof path === 'string' && path.charAt(0) === '/' && path.charAt(1) !== '/' && path.charAt(1) !== '\\\\';\n  if (!m || !safe || !(Number(m.exp) > now)) { try { storage.removeItem(RETURN_KEY); } catch (e) { /* ignore */ } return null; }\n  return path;\n}\n\n/** Once logged in: consume the marker and return where to go (null = stay). */\nexport function takeReturnPath(storage, loggedIn, now = Date.now()) {\n  if (!loggedIn) return null;\n  const path = readReturnMarker(storage, now);\n  if (path) { try { storage.removeItem(RETURN_KEY); } catch (e) { /* ignore */ } }\n  return path;\n}\n"],"core/bootstrap.js":[[],"// First-screen data in one request (SPEC F814 item 5): GET user/bootstrap returns, for the signed-in user, exactly\n// what user/info, user/getSubscribe, user/notice/fetch (page 1, whole body), user/comm/config and user/getStat return\n// (docs/api/user-bootstrap.md). main.js sends it at boot when the first page is the dashboard and hands the parts to\n// the request cache (cache.preload) under the keys those reads use — the views keep calling their own endpoints and\n// are answered from the one response; a part that failed on the server (null) falls back to its own request, so the\n// view sees the original error. Pure, no DOM.\n\n/** Request-cache key (core/cache.js cacheKey; raw reads are prefixed \"raw:\") → bootstrap part. */\nexport const BOOTSTRAP_PARTS = {\n  'user/info': 'user',\n  'user/getSubscribe': 'subscribe',\n  'raw:user/notice/fetch?current=1': 'notices',\n  'user/comm/config': 'config',\n  'user/getStat': 'stat',\n};\n\nconst DASHBOARD = new Set(['', '/', '/dashboard']);\n\n/**\n * Whether a signed-in visitor at location.hash is about to see the dashboard — the page bootstrap is for: the\n * dashboard itself, or a guest page (login / register) without a ?redirect= elsewhere (signed in, the router leaves\n * it for the redirect target, else the dashboard). Used at boot and right after logging in.\n */\nexport function wantsBootstrap(hash) {\n  const [path, query = ''] = String(hash || '').replace(/^#/, '').split('?');\n  if (DASHBOARD.has(path)) return true;\n  if (path !== '/login' && path !== '/register') return false;\n  const redirect = new URLSearchParams(query).get('redirect');\n  return !redirect || DASHBOARD.has(redirect.split('?')[0]);\n}\n\n/** bootstrap data → { cache key: value }; missing / null parts are left out (their reads send their own request). */\nexport function bootstrapEntries(data) {\n  const out = {};\n  if (!data || typeof data !== 'object') return out;\n  for (const [key, part] of Object.entries(BOOTSTRAP_PARTS)) {\n    if (data[part] !== undefined && data[part] !== null) out[key] = data[part];\n  }\n  return out;\n}\n\n/** Send user/bootstrap (never cached itself) and preload its parts into the request cache. */\nexport function preloadBootstrap(api, cache, { ttl } = {}) {\n  const promise = api.request('GET', 'user/bootstrap', { silent: true, cache: false }).then(bootstrapEntries);\n  cache.preload(Object.keys(BOOTSTRAP_PARTS), promise, ttl ? { ttl } : undefined);\n  return promise;\n}\n"],"core/invite.js":[[],"// Invite / promotion page (F189/F190, SPEC F41) — pure helpers over the phase-1 promotion APIs:\n//   user/promotion/summary (F15): promo_type, invite_codes[{code, link, pv, created_at}], invite_link_base,\n//     registered_count, paid_count, issued_days, pending_days, waiting_days, month_days, month_cap_days,\n//     rules {enabled, days, trigger, confirm_days, min_order_amount} (normal users only)\n//   user/promotion/duration-rewards (F15): {data:[{id, created_at, invitee_email (masked), days, trigger, status,\n//     issued_at}], total, current_page, per_page, last_page}\n\n/** Duration-reward status → label key + badge tone (PromoDurationReward statuses). */\nexport const REWARD_STATUS = {\n  pending: { label: 'invite.status.pending', tone: 'warning' },\n  waiting_plan: { label: 'invite.status.waiting_plan', tone: 'info' },\n  issued: { label: 'invite.status.issued', tone: 'leaf' },\n  not_applicable: { label: 'invite.status.not_applicable', tone: 'neutral' },\n  invalid: { label: 'invite.status.invalid', tone: 'neutral' },\n};\nexport const rewardStatus = (s) => REWARD_STATUS[s] || { label: 'invite.status.unknown', tone: 'neutral' };\n\n/** The link to share: the first invite code's link (the summary orders them), or null when there is none yet. */\nexport function primaryLink(summary) {\n  const codes = Array.isArray(summary?.invite_codes) ? summary.invite_codes : [];\n  return codes.length ? codes[0].link : null;\n}\n\nexport const isPro = (summary) => summary?.promo_type === 'pro';\n\n/** Month progress for the cap: { used, cap, percent (0–100, null without a cap) }. */\nexport function monthProgress(summary) {\n  const used = Math.max(0, Number(summary?.month_days) || 0);\n  const cap = Math.max(0, Number(summary?.month_cap_days) || 0);\n  return { used, cap, percent: cap > 0 ? Math.min(100, Math.round((used / cap) * 100)) : null };\n}\n\n/** Rule lines (i18n key + vars) from summary.rules; [] when the duration reward is switched off. */\nexport function ruleLines(rules) {\n  if (!rules || !rules.enabled) return [];\n  const lines = [];\n  lines.push({ key: rules.trigger === 'register' ? 'invite.rule.register' : 'invite.rule.firstOrder', vars: { days: Number(rules.days) || 0 } });\n  if (Number(rules.min_order_amount) > 0 && rules.trigger !== 'register') lines.push({ key: 'invite.rule.minOrder', vars: { cents: Number(rules.min_order_amount) } });\n  if (Number(rules.confirm_days) > 0) lines.push({ key: 'invite.rule.confirm', vars: { days: Number(rules.confirm_days) } });\n  return lines;\n}\n\n// ---- F190 Pro overview / trend (user/promotion/pro/overview, pro/trend; F20 / F21) ----\n\nexport const RANGES = [{ days: 7, label: 'invite.pro.range7' }, { days: 30, label: 'invite.pro.range30' }, { days: 90, label: 'invite.pro.range90' }];\n\n/** Y-m-d in the site time zone for `now` (ms). */\nexport function siteDate(now, timeZone) {\n  const p = Object.fromEntries(new Intl.DateTimeFormat('en-CA', { timeZone, year: 'numeric', month: '2-digit', day: '2-digit' }).formatToParts(new Date(now)).map((x) => [x.type, x.value]));\n  return `${p.year}-${p.month}-${p.day}`;\n}\n/** Last `days` days including today, site time zone: { start_date, end_date }. */\nexport function rangeFor(days, timeZone, now = Date.now()) {\n  const end = siteDate(now, timeZone);\n  const [y, m, d] = end.split('-').map(Number);\n  const start = new Date(Date.UTC(y, m - 1, d - (days - 1)));\n  return { start_date: start.toISOString().slice(0, 10), end_date: end };\n}\n\n/** Overview cards (values in their raw API units) from pro/overview. Commission = pending + valid (F21 checks). */\nexport function overviewCards(o) {\n  const sum = (x) => (Number(x?.l1) || 0) + (Number(x?.l2) || 0) + (Number(x?.l3) || 0);\n  const c = o?.commission?.total || {};\n  return [\n    { key: 'commission', label: 'invite.pro.commission', value: (Number(c.pending) || 0) + (Number(c.valid) || 0), money: true, sub: { key: 'invite.pro.commissionSub', pending: Number(c.pending) || 0, valid: Number(c.valid) || 0 } },\n    { key: 'new_members', label: 'invite.pro.newMembers', value: sum(o?.team?.new) },\n    { key: 'paid_orders', label: 'invite.pro.paidOrders', value: Number(o?.conversion?.paid_orders?.total) || 0 },\n    { key: 'order_amount', label: 'invite.pro.orderAmount', value: Number(o?.conversion?.order_amount?.total) || 0, money: true },\n    { key: 'clicks', label: 'invite.pro.clicks', value: Number(o?.links?.clicks) || 0, sub: { key: 'invite.pro.conversion', rate: o?.links?.conversion_rate ?? '0.00' } },\n  ];\n}\n\nexport const METRICS = [{ key: 'commission', label: 'invite.pro.mCommission', money: true }, { key: 'new_members', label: 'invite.pro.mNewMembers' }, { key: 'paid_orders', label: 'invite.pro.mPaidOrders' }];\n\n/** pro/trend points → { labels, series: [{key:'l1'|'l2'|'l3', values}] } for one metric. */\nexport function trendSeries(trend, metric) {\n  const points = Array.isArray(trend?.points) ? trend.points : [];\n  return {\n    labels: points.map((p) => p.date),\n    series: ['l1', 'l2', 'l3'].map((k) => ({ key: k, values: points.map((p) => Number(p?.[metric]?.[k]) || 0) })),\n  };\n}\n\n// ---- F191 Pro team / commissions / balance (user/promotion/pro/team F22, pro/commissions F23, pro/export F24) ----\n\nexport const LEVELS = [1, 2, 3];\n\n/** Commission-log status (CommissionLog::STATUSES) → label key + badge tone. */\nexport const COMMISSION_STATUS = {\n  pending: { label: 'invite.pro.status.pending', tone: 'warning' },\n  valid: { label: 'invite.pro.status.valid', tone: 'leaf' },\n  invalid: { label: 'invite.pro.status.invalid', tone: 'neutral' },\n};\nexport const commissionStatus = (s) => COMMISSION_STATUS[s] || { label: 'invite.status.unknown', tone: 'neutral' };\n\n/** Query for pro/commissions and the commission export: the range plus non-empty filters (level 1–3, status). */\nexport function commissionQuery(range, filters = {}, page) {\n  const q = { start_date: range.start_date, end_date: range.end_date };\n  if (LEVELS.includes(Number(filters.level))) q.level = Number(filters.level);\n  if (COMMISSION_STATUS[filters.status]) q.status = filters.status;\n  if (page) { q.current = page.current; q.page_size = page.page_size; }\n  return q;\n}\n\n/** Export query (F24): type=commissions with the commission filters, or type=team with the level (range names the file). */\nexport function exportQuery(type, range, filters = {}) {\n  if (type === 'team') return { type: 'team', start_date: range.start_date, end_date: range.end_date, level: LEVELS.includes(Number(filters.level)) ? Number(filters.level) : 1 };\n  return { type: 'commissions', ...commissionQuery(range, filters) };\n}\n\n/** Commission rate as a percentage string (\"12.50\" → \"12.5%\"); null / empty → null. */\nexport function ratePercent(rate) {\n  if (rate === null || rate === undefined || rate === '') return null;\n  const n = Number(rate);\n  return Number.isFinite(n) ? `${String(Math.round(n * 100) / 100)}%` : null;\n}\n\n/** Withdrawal entry from user/comm/config (stock flow user/ticket/withdraw): { open, methods }. */\nexport function withdrawState(cfg) {\n  const methods = Array.isArray(cfg?.withdraw_methods) ? cfg.withdraw_methods.filter((m) => typeof m === 'string' && m) : [];\n  return { open: Number(cfg?.withdraw_close) !== 1 && methods.length > 0, closed: Number(cfg?.withdraw_close) === 1, methods };\n}\n\n/**\n * Invite link visits (SPEC F26; moved here from the page template by F2906): the register page opened with ?code=…\n * reports one visit per code to {apiBase}/passport/comm/pv — now, and after every hash change. Called by boot()\n * before the router starts. The legacy server-rendered page (PHP's template, whose theme config still has `clients`)\n * reports inline itself, so nothing is sent there (no double count) until it is removed (F3004).\n * Returns the check function (tests call it), or null when it does nothing.\n */\nexport function reportInviteVisits({ config = {}, win = window, fetchImpl = (...a) => win.fetch(...a) } = {}) {\n  if (Array.isArray(config.theme?.clients)) return null;\n  const api = `${config.apiBase || ''}/passport/comm/pv`;\n  const sent = new Set();\n  const check = () => {\n    const m = /^#\\/register\\?(.*)$/.exec(win.location.hash || '');\n    if (!m) return;\n    const code = new URLSearchParams(m[1]).get('code');\n    if (!code || sent.has(code)) return;\n    sent.add(code);\n    try {\n      Promise.resolve(fetchImpl(api, { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify({ invite_code: code }), keepalive: true })).catch(() => {});\n    } catch (e) { /* a visit report never breaks the page */ }\n  };\n  check();\n  win.addEventListener('hashchange', check);\n  return check;\n}\n"],"i18n/zh-CN.js":[[],"// 简体中文（默认语言）。键集合必须与 en-US.js 完全一致（tests/js/lychee-i18n.test.mjs）。\nexport default {\n  'route.login': '登录',\n  'route.register': '注册',\n  'route.forgetpassword': '找回密码',\n  'route.dashboard': '仪表盘',\n  'route.plan': '购买套餐',\n  'route.planDetail': '套餐结算',\n  'route.order': '我的订单',\n  'route.orderDetail': '订单详情',\n  'route.ticket': '我的工单',\n  'route.ticketDetail': '工单详情',\n  'route.invite': '我的邀请',\n  'route.profile': '个人中心',\n  'route.knowledge': '使用文档',\n  'route.knowledgeDetail': '文章',\n  'kb.search': '搜索文章标题',\n  'kb.updated': '更新于 {date}',\n  'kb.noMatch': '没有找到相关文章',\n  'kb.noMatchBody': '没有标题包含「{q}」的文章。',\n  'kb.clear': '清除搜索',\n  'kb.articles': '文章列表',\n  'kb.empty': '还没有使用文档',\n  'kb.emptyBody': '管理员发布文档后会显示在这里。',\n  'kb.categories': '文档分类',\n  'kb.all': '全部',\n  'kb.back': '返回使用文档',\n  'kb.notFound': '文章不存在',\n  'kb.notFoundBody': '这篇文章可能已被删除或隐藏。',\n  'kb.backList': '查看全部文档',\n  'kb.table': '表格（可横向滚动）',\n  'route.node': '节点状态',\n  'node.online': '在线',\n  'node.offline': '离线',\n  'node.tags': '标签',\n  'node.rate': '倍率',\n  'node.protocol': '协议',\n  'node.summary': '共 {total} 个节点',\n  'node.onlineN': '{n} 个在线',\n  'node.offlineN': '{n} 个离线',\n  'node.list': '节点列表',\n  'node.hint': '倍率表示该节点流量的计费系数，例如 1.5× 表示使用 1 GB 计 1.5 GB。在线状态每几分钟更新一次。',\n  'node.noPlan': '还没有可用的套餐',\n  'node.noPlanBody': '购买或续费套餐后，可用的节点会显示在这里。',\n  'node.noNodes': '暂时没有可用节点',\n  'node.noNodesBody': '你的套餐目前没有分配节点，请稍后再来看看或联系客服。',\n  'traffic.usage': '本期流量',\n  'traffic.used': '已用',\n  'traffic.total': '总量',\n  'traffic.daily': '每日明细',\n  'traffic.lead': '本月每天的流量记录，按节点倍率计费。',\n  'traffic.count': '{n} 条记录 · 计费合计 {billed}',\n  'traffic.pages': '流量明细分页',\n  'traffic.col.date': '日期',\n  'traffic.col.upload': '上行',\n  'traffic.col.download': '下行',\n  'traffic.col.rate': '倍率',\n  'traffic.col.billed': '计费流量',\n  'traffic.hint': '计费流量 =（上行 + 下行）× 倍率，计入套餐用量。同一天使用不同倍率的节点会分成多行。',\n  'traffic.emptyTitle': '本月还没有流量记录',\n  'traffic.emptyBody': '使用节点后，每天的上行、下行和计费流量会显示在这里。',\n  'traffic.noPlanBody': '购买套餐并连接节点后，每天的流量记录会显示在这里。',\n  'route.traffic': '流量明细',\n  'route.components': '组件画廊',\n  'gallery.intro': '荔枝云设计令牌与组件（仅开发环境可见）。',\n  'gallery.colors': '颜色令牌',\n  'gallery.toc': '本页目录',\n  'gallery.type': '字体与字号',\n  'gallery.space': '间距、圆角与阴影',\n  'gallery.sample': '荔枝云 · 订阅剩余 128.00 GB',\n  'gallery.group.neutral': '中性色',\n  'gallery.group.brand': '品牌色',\n  'gallery.group.semantic': '语义色',\n  'gallery.group.soft': '浅底与对应文字',\n  'ui.copy': '复制',\n  'ui.copied': '已复制',\n  'ui.copyManual': '无法访问剪贴板，已选中文本，请手动复制',\n  'ui.close': '关闭',\n  'ui.selected': '已选择',\n  'ui.soldOut': '已售罄',\n  'ui.progressHigh': '流量已用 80% 以上，请留意',\n  'ui.progressFull': '流量已用完',\n  'gallery.buttons': '按钮',\n  'gallery.fields': '输入框与选择器',\n  'gallery.copy': '只读输入 + 复制',\n  'gallery.choices': '分段切换器、开关与复选框',\n  'gallery.cards': '卡片',\n  'gallery.plans': '套餐卡',\n  'gallery.badges': '标签',\n  'gallery.states': '全部状态',\n  'gallery.live': '可交互',\n  'gallery.state.default': '默认',\n  'gallery.state.hover': '悬停',\n  'gallery.state.active': '按下',\n  'gallery.state.focus': '聚焦',\n  'gallery.state.disabled': '禁用',\n  'gallery.state.loading': '加载',\n  'gallery.btn.primary': '主按钮',\n  'gallery.btn.secondary': '次按钮',\n  'gallery.btn.text': '文字按钮',\n  'gallery.btn.icon': '图标按钮',\n  'gallery.btn.danger': '危险按钮',\n  'gallery.btn.save': '保存',\n  'gallery.btn.delete': '删除',\n  'gallery.btn.asyncDemo': '点击后加载 1 秒',\n  'gallery.field.email': '邮箱',\n  'gallery.field.emailHelp': '用于登录和接收通知',\n  'gallery.field.emailError': '请输入有效的邮箱地址',\n  'gallery.field.hover': '悬停',\n  'gallery.field.focus': '聚焦',\n  'gallery.field.disabled': '禁用',\n  'gallery.field.value': '示例内容',\n  'gallery.field.coupon': '优惠券',\n  'gallery.field.couponHelp': '正在校验优惠券…',\n  'gallery.field.period': '订阅周期',\n  'gallery.field.message': '工单内容',\n  'gallery.field.messageHint': '请描述你遇到的问题',\n  'gallery.field.subscribe': '订阅链接',\n  'gallery.field.invite': '邀请链接',\n  'gallery.period.month': '月付',\n  'gallery.period.quarter': '季付',\n  'gallery.period.half': '半年付',\n  'gallery.period.year': '年付',\n  'gallery.switch.on': '已开启',\n  'gallery.switch.off': '已关闭',\n  'gallery.switch.saving': '保存时转圈',\n  'gallery.switch.fails': '保存失败会回滚',\n  'gallery.check.agree': '我已阅读并同意服务条款',\n  'gallery.check.remember': '记住我',\n  'gallery.check.required': '必须勾选',\n  'gallery.check.requiredError': '请先同意服务条款',\n  'gallery.card.title': '订阅状态',\n  'gallery.card.body': '卡片：白底、圆角 16、阴影 1，深色模式改用描边。',\n  'gallery.card.clickable': '可点击的卡片',\n  'gallery.card.clickBody': '悬停时描边加深并上移 1px。',\n  'gallery.card.hover': '悬停中',\n  'gallery.plan.f1': '每月 {n} GB 流量',\n  'gallery.plan.f2': '{n} 台设备同时在线',\n  'gallery.plan.f3': '全部线路',\n  'gallery.plan.buy': '立即购买',\n  'gallery.plan.popular': '推荐',\n  'gallery.badge.neutral': '普通',\n  'gallery.badge.primary': '推荐',\n  'gallery.badge.active': '已支付',\n  'gallery.badge.pending': '待支付',\n  'gallery.badge.expired': '已过期',\n  'gallery.badge.processing': '处理中',\n  'gallery.progress.title': '进度条',\n  'gallery.progress.label': '已用流量',\n  'gallery.progress.missing': '数据缺失',\n  'ui.cancel': '取消',\n  'ui.confirm': '确定',\n  'ui.loading': '加载中…',\n  'ui.loadFailed': '加载失败',\n  'ui.empty': '暂无数据',\n  'ui.emptyFiltered': '没有符合筛选条件的结果',\n  'ui.pagination': '分页',\n  'ui.prevPage': '上一页',\n  'ui.nextPage': '下一页',\n  'ui.page': '第 {n} 页',\n  'ui.pageOf': '第 {n} / {total} 页',\n  'ui.range': '第 {from}–{to} 条，共 {total} 条',\n  'gallery.overlays': '弹窗、抽屉与提示',\n  'gallery.dialogs': '弹窗与抽屉',\n  'gallery.toasts': 'Toast',\n  'gallery.statesTitle': '空状态、骨架屏与错误态',\n  'gallery.tables': '表格与分页',\n  'gallery.dialog.open': '打开弹窗',\n  'gallery.dialog.title': '修改备注',\n  'gallery.dialog.body': '第一次保存会失败（演示弹窗内错误），再点一次即可成功。',\n  'gallery.dialog.name': '备注',\n  'gallery.dialog.save': '保存',\n  'gallery.dialog.failed': '保存失败：服务暂时不可用',\n  'gallery.dialog.saved': '已保存',\n  'gallery.dialog.confirm': '危险操作确认',\n  'gallery.dialog.confirmTitle': '删除这条记录？',\n  'gallery.dialog.confirmBody': '删除后无法恢复。',\n  'gallery.dialog.confirmed': '已确认删除（演示，没有真的删除）',\n  'gallery.drawer.open': '打开抽屉',\n  'gallery.drawer.title': '更多',\n  'gallery.drawer.body': '桌面从右侧滑入，手机从底部滑出。',\n  'gallery.toast.success': '成功提示',\n  'gallery.toast.error': '错误提示',\n  'gallery.toast.info': '普通提示',\n  'gallery.toast.successText': '订阅链接已复制',\n  'gallery.toast.errorText': '支付失败，请稍后重试',\n  'gallery.toast.infoText': '订单已提交，正在等待支付',\n  'gallery.empty.title': '还没有工单',\n  'gallery.empty.body': '遇到问题可以随时提交工单，我们会尽快回复。',\n  'gallery.empty.action': '提交工单',\n  'gallery.empty.filteredBody': '换个筛选条件试试。',\n  'gallery.empty.clear': '清除筛选',\n  'gallery.table.caption': '我的订单',\n  'gallery.table.scrollCaption': '横向滚动的表格',\n  'gallery.table.no': '订单号',\n  'gallery.table.plan': '套餐',\n  'gallery.table.period': '周期',\n  'gallery.table.amount': '金额',\n  'gallery.table.status': '状态',\n  'gallery.table.date': '创建时间',\n  'gallery.brand': 'Logo 与品牌',\n  'gallery.brand.inApp': '页面中的 Logo',\n  'gallery.brand.custom': '后台配置了 Logo，页面使用后台的地址',\n  'gallery.brand.default': '后台没有配置 Logo，使用内置图形 + 站点名',\n  'gallery.brand.sizes': '图形尺寸：16 / 32 / 180',\n  'gallery.brand.files': '素材文件',\n  'gallery.icons': '图标',\n  'gallery.icons.note': 'Lucide {version} 子集，共 {n} 个；线宽 1.75，颜色继承文字色。',\n  'route.notFound': '页面不存在',\n  'placeholder.body': '此页面正在建设中。',\n  'placeholder.params': '参数',\n  'notFound.body': '你访问的页面不存在或已被移动。',\n  'notFound.home': '返回首页',\n  'error.title': '页面加载失败',\n  'error.body': '请检查网络后重试。',\n  'error.retry': '重试',\n  'error.network': '网络连接失败，请检查网络后重试',\n  'error.timeout': '请求超时，请稍后重试',\n  'error.server': '服务暂时不可用，请稍后重试',\n  'error.upstream': '网络异常，请稍后重试',\n  'error.unknown': '出了点问题，请稍后重试',\n  'error.auth': '登录已过期，请重新登录',\n  'state.loading': '加载中…',\n  'state.empty': '暂无数据',\n  'format.longTerm': '长期有效',\n  'format.none': '—',\n  'nav.main': '主导航',\n  'nav.group.base': '基础',\n  'nav.group.subscription': '订阅',\n  'nav.group.finance': '财务',\n  'nav.group.personal': '个人',\n  'nav.toggle': '折叠或展开导航',\n  'nav.userMenu': '用户菜单',\n  'nav.logout': '退出登录',\n  'nav.more': '更多',\n  'nav.tabs': '底部导航',\n  'nav.skip': '跳到主要内容',\n  'prefs.switchLanguage': '切换语言为 {language}',\n  'prefs.languageRow': '语言：切换为 {language}',\n  'prefs.toDark': '切换到深色模式',\n  'prefs.toLight': '切换到浅色模式',\n  'nav.tab.dashboard': '仪表盘',\n  'nav.tab.plan': '套餐',\n  'nav.tab.order': '订单',\n  'nav.tab.ticket': '工单',\n  'auth.email': '邮箱',\n  'auth.password': '密码',\n  'auth.showPassword': '显示密码',\n  'auth.hidePassword': '隐藏密码',\n  'auth.login': '登录',\n  'auth.loginTitle': '登录',\n  'auth.loginLead': '欢迎回来，登录 {name} 继续使用',\n  'auth.emailRequired': '请输入邮箱',\n  'auth.passwordRequired': '请输入密码',\n  'auth.forgot': '忘记密码？',\n  'auth.noAccount': '还没有账号？',\n  'auth.register': '注册',\n  'auth.emailInvalid': '邮箱格式不正确',\n  'auth.emailSuffix': '不支持该邮箱后缀',\n  'auth.suffixHelp': '仅支持以下邮箱后缀：{list}',\n  'auth.emailCode': '邮箱验证码',\n  'auth.sendCode': '发送验证码',\n  'auth.resendCode': '重新发送',\n  'auth.resendIn': '{s} 秒后重发',\n  'auth.codeSent': '验证码已发送，请查收邮件',\n  'auth.codeRequired': '请输入邮箱验证码',\n  'auth.codeInvalid': '验证码为 6 位数字',\n  'auth.passwordShort': '密码至少 8 位',\n  'auth.passwordHelp': '至少 8 位',\n  'auth.passwordConfirm': '确认密码',\n  'auth.passwordMismatch': '两次输入的密码不一致',\n  'auth.inviteCode': '邀请码',\n  'auth.inviteCodeOptional': '邀请码（选填）',\n  'auth.inviteRequired': '请输入邀请码',\n  'auth.tosAgree': '我已阅读并同意',\n  'auth.tos': '服务条款',\n  'auth.tosRequired': '请先阅读并同意服务条款',\n  'auth.registerTitle': '注册',\n  'auth.registerLead': '创建 {name} 账号，几步即可开始使用',\n  'auth.haveAccount': '已有账号？',\n  'auth.newPassword': '新密码',\n  'auth.newPasswordRequired': '请输入新密码',\n  'auth.resetSubmit': '重置密码',\n  'auth.resetDone': '密码已重置，请用新密码登录',\n  'auth.resetTitle': '找回密码',\n  'auth.resetLead': '输入注册邮箱，验证后设置新密码',\n  'auth.backToLogin': '返回登录',\n  'auth.captcha': '人机验证',\n  'auth.captchaRequired': '请先完成人机验证',\n  'auth.captchaLoadFailed': '人机验证加载失败，请检查网络后重试',\n  'auth.captchaInvisible': '本站使用人机验证保护登录与注册',\n  'auth.quickLoggingIn': '正在通过登录链接登录…',\n  'auth.quickLoginFailed': '登录链接无效或已过期，请重新登录',\n  'dash.hello': '你好，{name}',\n  'dash.helloAnon': '你好',\n  'dash.mySubscription': '我的订阅',\n  'dash.unnamedPlan': '未命名套餐',\n  'dash.active': '使用中',\n  'dash.permanent': '长期有效',\n  'dash.expired': '已过期',\n  'dash.status': '状态',\n  'dash.expiresAt': '到期时间',\n  'dash.daysLeftLabel': '剩余时间',\n  'dash.daysLeft': '{n} 天',\n  'dash.resetLabel': '流量重置',\n  'dash.resetIn': '{n} 天后',\n  'dash.resetToday': '今天',\n  'dash.noReset': '不重置',\n  'dash.renew': '续费',\n  'dash.noPlan': '还没有订阅',\n  'dash.noPlanLead': '选择一个套餐，开通后即可在这里导入订阅。',\n  'dash.buyPlan': '购买套餐',\n  'dash.traffic': '流量',\n  'dash.usedTraffic': '已用流量',\n  'dash.remaining': '剩余流量',\n  'dash.notices': '公告',\n  'dash.noNotices': '暂无公告',\n  'dash.moreNotices': '查看更多公告',\n  'ui.gotIt': '知道了',\n  'dash.subscription': '订阅',\n  'dash.subscribeUrl': '订阅链接',\n  'dash.subscribeHelp': '请勿泄露订阅链接；泄露后可在个人中心重置。',\n  'dash.copyLink': '复制订阅链接',\n  'dash.showQr': '二维码',\n  'dash.qrTitle': '订阅二维码',\n  'dash.qrHint': '用客户端扫描二维码即可导入订阅。',\n  'dash.qrAlt': '订阅链接二维码',\n  'dash.resetSubscription': '重置订阅',\n  'dash.oneClickImport': '一键导入到客户端',\n  'period.month': '月付',\n  'period.quarter': '季付',\n  'period.half': '半年付',\n  'period.year': '年付',\n  'period.twoYear': '两年付',\n  'period.threeYear': '三年付',\n  'period.onetime': '一次性',\n  'period.reset': '流量重置包',\n  'period.unit.month': '月',\n  'period.unit.quarter': '季',\n  'period.unit.half': '半年',\n  'period.unit.year': '年',\n  'period.unit.twoYear': '两年',\n  'period.unit.threeYear': '三年',\n  'plan.lead': '选择适合你的套餐，价格按所选周期显示。',\n  'plan.period': '付费周期',\n  'plan.subscription': '周期订阅',\n  'plan.buy': '立即购买',\n  'plan.noPrice': '暂无可选周期',\n  'plan.periodMissing': '该套餐不提供{period}',\n  'plan.traffic': '{n} GB 流量',\n  'plan.otherPeriods': '其他周期价格',\n  'plan.emptyTitle': '暂时没有可购买的套餐',\n  'plan.emptyBody': '套餐上架后会显示在这里，请稍后再来看看。',\n  'checkout.back': '返回套餐列表',\n  'checkout.period': '付费周期',\n  'checkout.coupon': '优惠券',\n  'checkout.couponPlaceholder': '有优惠码？在这里输入',\n  'checkout.applyCoupon': '使用',\n  'checkout.couponEmpty': '请输入优惠码',\n  'checkout.couponApplied': '已使用优惠码 {code}',\n  'checkout.removeCoupon': '移除',\n  'checkout.summary': '订单汇总',\n  'checkout.plan': '套餐',\n  'checkout.original': '原价',\n  'checkout.discount': '优惠',\n  'checkout.payable': '应付金额',\n  'checkout.submit': '提交订单',\n  'checkout.note': '提交后在订单页选择支付方式；余额抵扣与折扣以订单金额为准。',\n  'checkout.viewOrder': '查看订单',\n  'checkout.noPeriod': '这个套餐暂时没有可购买的周期。',\n  'period.unknown': '—',\n  'order.status.pending': '待支付',\n  'order.status.processing': '开通中',\n  'order.status.cancelled': '已取消',\n  'order.status.completed': '已完成',\n  'order.status.discounted': '已折抵',\n  'order.status.unknown': '未知状态',\n  'order.type.new': '新购',\n  'order.type.renew': '续费',\n  'order.type.upgrade': '升级',\n  'order.type.reset': '流量重置',\n  'order.type.unknown': '其他',\n  'order.lead': '查看全部订单，点击一行查看详情或继续支付。',\n  'order.col.tradeNo': '订单号',\n  'order.col.plan': '套餐',\n  'order.col.period': '周期',\n  'order.col.amount': '金额',\n  'order.col.status': '状态',\n  'order.col.createdAt': '创建时间',\n  'order.rowLabel': '订单 {no}，{status}，查看详情',\n  'order.loadMore': '加载更多（还有 {n} 条）',\n  'order.count': '共 {n} 个订单',\n  'order.emptyTitle': '暂无订单记录',\n  'order.emptyBody': '购买套餐后，订单会显示在这里。',\n  'order.buy': '购买套餐',\n  'orderDetail.back': '返回订单列表',\n  'orderDetail.info': '订单信息',\n  'orderDetail.type': '订单类型',\n  'orderDetail.paidAt': '支付时间',\n  'orderDetail.method': '支付方式',\n  'orderDetail.chooseMethod': '选择支付方式',\n  'orderDetail.noMethods': '暂时没有可用的支付方式，请提交工单联系我们。',\n  'orderDetail.noFee': '无手续费',\n  'orderDetail.fee': '手续费 {fee}',\n  'orderDetail.amounts': '金额明细',\n  'orderDetail.amount.price': '套餐价格',\n  'orderDetail.amount.discount': '优惠券',\n  'orderDetail.amount.surplus': '旧订阅折抵',\n  'orderDetail.amount.balance': '余额抵扣',\n  'orderDetail.amount.fee': '手续费',\n  'orderDetail.amount.paid': '实付金额',\n  'orderDetail.pay': '立即支付',\n  'orderDetail.activate': '确认开通',\n  'orderDetail.paidToast': '订单已支付',\n  'orderDetail.payUnknown': '支付方式返回了无法识别的结果，请换一种支付方式或联系我们。',\n  'orderDetail.cancel': '取消订单',\n  'orderDetail.cancelTitle': '取消这个订单？',\n  'orderDetail.cancelBody': '取消后不能恢复，需要时请重新下单。',\n  'orderDetail.cancelConfirm': '取消订单',\n  'orderDetail.cancelKeep': '再想想',\n  'orderDetail.cancelled': '订单已取消',\n  'orderDetail.rebuy': '重新购买',\n  'orderDetail.qrTitle': '扫码支付',\n  'orderDetail.qrAlt': '支付二维码',\n  'orderDetail.qrHint': '请使用{method}对应的 App 扫码完成支付，支付成功后本页会自动更新。',\n  'orderDetail.qrDone': '我已完成支付',\n  'orderDetail.headline.pending': '待支付',\n  'orderDetail.headline.processing': '已支付，正在开通',\n  'orderDetail.headline.completed': '已支付',\n  'orderDetail.headline.cancelled': '订单已取消',\n  'orderDetail.headline.discounted': '已折抵',\n  'orderDetail.headline.unknown': '订单状态未知',\n  'orderDetail.sub.pending': '选择支付方式完成付款，套餐会在支付后自动开通。',\n  'orderDetail.sub.processing': '付款已收到，套餐正在开通，通常只需几秒。',\n  'orderDetail.sub.completed': '套餐已开通，可以在仪表盘查看订阅。',\n  'orderDetail.sub.cancelled': '这个订单不会再扣款，需要时可以重新购买。',\n  'orderDetail.sub.discounted': '这个订单的金额已折抵到新订单中。',\n  'orderDetail.sub.unknown': '请刷新页面，或提交工单联系我们。',\n  'orderDetail.pollStopped': '已停止自动刷新订单状态（超过 10 分钟）。如果已经付款，请手动刷新。',\n  'orderDetail.refresh': '刷新状态',\n  'ticket.level.low': '低',\n  'ticket.level.medium': '中',\n  'ticket.level.high': '高',\n  'ticket.level.unknown': '未知',\n  'ticket.state.waiting': '待回复',\n  'ticket.state.replied': '已回复',\n  'ticket.state.closed': '已关闭',\n  'ticket.state.unknown': '未知状态',\n  'ticket.heroTitle': '有任何问题，请提交工单联系我们',\n  'ticket.heroBody': '描述你遇到的问题，客服回复后会在这里显示。',\n  'ticket.new': '提交工单',\n  'ticket.col.subject': '主题',\n  'ticket.col.level': '优先级',\n  'ticket.col.state': '状态',\n  'ticket.col.updatedAt': '最后更新',\n  'ticket.rowLabel': '工单 {subject}，{state}，查看详情',\n  'ticket.emptyTitle': '暂无工单记录',\n  'ticket.emptyBody': '遇到问题时提交工单，客服会尽快回复。',\n  'ticket.form.title': '提交工单',\n  'ticket.form.subject': '主题',\n  'ticket.form.subjectPlaceholder': '一句话说明问题，例如：香港节点无法连接',\n  'ticket.form.level': '优先级',\n  'ticket.form.message': '问题描述',\n  'ticket.form.messagePlaceholder': '请写清楚使用的客户端、节点、出现问题的时间和现象。',\n  'ticket.form.submit': '提交',\n  'ticket.form.cancel': '取消',\n  'ticket.form.subjectRequired': '请填写工单主题',\n  'ticket.form.levelRequired': '请选择优先级',\n  'ticket.form.messageRequired': '请填写问题描述',\n  'ticket.form.created': '工单已提交，我们会尽快回复',\n  'ticketDetail.back': '返回工单列表',\n  'ticketDetail.me': '我',\n  'ticketDetail.support': '客服',\n  'ticketDetail.conversation': '工单会话',\n  'ticketDetail.created': '创建于 {time}',\n  'ticketDetail.close': '关闭工单',\n  'ticketDetail.closeTitle': '关闭这个工单？',\n  'ticketDetail.closeBody': '关闭后不能再回复。问题没解决时可以再提交新的工单。',\n  'ticketDetail.closeConfirm': '关闭工单',\n  'ticketDetail.closeKeep': '先不关',\n  'ticketDetail.closed': '工单已关闭',\n  'ticketDetail.placeholder': '输入回复内容',\n  'ticketDetail.replyLabel': '回复内容',\n  'ticketDetail.sendHint': 'Ctrl + Enter 发送',\n  'ticketDetail.closedTitle': '工单已关闭',\n  'ticketDetail.closedHint': '工单已关闭，不能再回复。如有新问题请提交新的工单。',\n  'ticketDetail.send': '发送',\n  'ticketDetail.sending': '发送中…',\n  'ticketDetail.failed': '发送失败',\n  'ticketDetail.resend': '重发',\n  'ticketDetail.empty': '请输入回复内容',\n  'ticketDetail.emptyWithImages': '请输入回复内容或添加图片',\n  'ticket.form.messageOrImage': '请填写问题描述或添加图片',\n  'profile.account': '账户信息',\n  'profile.balance': '账户余额',\n  'profile.commission': '佣金余额',\n  'profile.pwd.title': '修改密码',\n  'profile.pwd.desc': '修改后当前设备保持登录，其他设备上的登录会失效。',\n  'profile.pwd.old': '当前密码',\n  'profile.pwd.new': '新密码',\n  'profile.pwd.confirm': '确认新密码',\n  'profile.pwd.help': '至少 8 位',\n  'profile.pwd.submit': '保存新密码',\n  'profile.pwd.oldRequired': '请输入当前密码',\n  'profile.pwd.newRequired': '请输入新密码',\n  'profile.pwd.tooShort': '新密码至少 8 位',\n  'profile.pwd.mismatch': '两次输入的新密码不一致',\n  'profile.pwd.done': '密码已修改，其他设备需要重新登录',\n  'profile.remind.title': '消息提醒',\n  'profile.remind.desc': '通过邮件提醒你，可随时关闭。',\n  'profile.remind.expire': '到期提醒',\n  'profile.remind.expireDesc': '套餐到期前发邮件提醒续费。',\n  'profile.remind.traffic': '流量提醒',\n  'profile.remind.trafficDesc': '流量快用完时发邮件提醒。',\n  'profile.remind.saved': '提醒设置已保存',\n  'profile.remind.failed': '保存失败，已恢复原设置：{reason}',\n  'profile.sub.title': '订阅地址',\n  'profile.sub.desc': '怀疑订阅地址泄露时可以重置，重置后需要在客户端重新导入。',\n  'profile.sub.url': '当前订阅地址',\n  'profile.sub.reset': '重置订阅',\n  'profile.sub.confirmTitle': '重置订阅地址？',\n  'profile.sub.confirmBody': '重置后旧的订阅地址会立即失效，所有设备上的客户端都需要重新导入新地址才能继续使用。',\n  'profile.sub.confirm': '确认重置',\n  'profile.sub.keep': '先不重置',\n  'profile.sub.done': '订阅已重置，请在客户端导入新地址',\n  'profile.tg.title': 'Telegram 通知',\n  'profile.tg.bound': '已绑定',\n  'profile.tg.unbound': '未绑定',\n  'profile.tg.step1': '在 Telegram 中搜索并打开机器人 {bot}',\n  'profile.tg.step2': '复制上方「当前订阅地址」',\n  'profile.tg.step3': '向机器人发送 /bind 加空格再粘贴订阅地址，完成后刷新本页',\n  'profile.tg.open': '打开 {bot}',\n  'profile.transfer.title': '佣金转余额',\n  'profile.transfer.desc': '转入账户余额后可用于购买套餐，转入后不能转回。',\n  'profile.transfer.amount': '转入金额',\n  'profile.transfer.help': '可转入 {max}',\n  'profile.transfer.submit': '转入余额',\n  'profile.transfer.invalid': '请输入大于 0 的金额，最多两位小数',\n  'profile.transfer.tooMuch': '超过可转入的佣金余额',\n  'profile.transfer.done': '已将 {amount} 转入账户余额',\n  'profile.gift.title': '礼品卡兑换',\n  'profile.gift.desc': '输入礼品卡或兑换码，奖励会直接发放到账户。',\n  'profile.gift.code': '兑换码',\n  'profile.gift.placeholder': '例如 GIFT-XXXX-XXXX',\n  'profile.gift.submit': '兑换',\n  'profile.gift.required': '请输入兑换码',\n  'profile.gift.done': '兑换成功 {name}',\n  'invite.hero': '邀请好友，一起获得会员时长',\n  'invite.heroBody': '好友通过你的链接注册并完成首单后，你将获得 {days} 天会员时长。',\n  'invite.heroPro': '邀请好友，获得推广佣金',\n  'invite.heroProBody': '通过你的链接注册的用户付费后，你会获得相应比例的佣金。',\n  'invite.link': '我的邀请链接',\n  'invite.noLink': '还没有邀请码，先生成一个。',\n  'invite.generate': '生成邀请码',\n  'invite.codeCreated': '邀请码已生成',\n  'invite.summary': '时长奖励汇总',\n  'invite.registered': '已邀请注册',\n  'invite.paid': '已付费',\n  'invite.issued': '已发放',\n  'invite.pending': '待确认',\n  'invite.people': '人',\n  'invite.days': '天',\n  'invite.month': '本月已获',\n  'invite.monthValue': '{used} / {cap} 天',\n  'invite.monthCaption': '本月奖励达到上限后不再增加，下月自动恢复。',\n  'invite.codes': '我的邀请码',\n  'invite.copyLink': '复制邀请链接',\n  'invite.noCodes': '还没有邀请码',\n  'invite.noCodesBody': '点击上方「生成邀请码」创建第一个。',\n  'invite.pvN': '访问 {n} 次',\n  'invite.col.code': '邀请码',\n  'invite.records': '奖励记录',\n  'invite.noRecords': '暂无奖励记录',\n  'invite.noRecordsBody': '好友通过你的链接完成首单后，奖励会出现在这里。',\n  'invite.col.time': '时间',\n  'invite.col.invitee': '被邀请人',\n  'invite.col.days': '天数',\n  'invite.col.status': '状态',\n  'invite.col.issued': '发放时间',\n  'invite.daysN': '{n} 天',\n  'invite.status.pending': '待确认',\n  'invite.status.waiting_plan': '待领取',\n  'invite.status.issued': '已发放',\n  'invite.status.not_applicable': '不适用',\n  'invite.status.invalid': '无效',\n  'invite.status.unknown': '未知',\n  'invite.rules': '规则说明',\n  'invite.rulesOff': '时长奖励暂未开启。',\n  'invite.rule.firstOrder': '好友通过你的链接注册并完成首单后，你获得 {days} 天会员时长。',\n  'invite.rule.register': '好友通过你的链接完成注册后，你获得 {days} 天会员时长。',\n  'invite.rule.minOrder': '首单实付金额需不低于 {amount}。',\n  'invite.rule.confirm': '奖励需等待 {days} 天确认期，期间退款的订单不计奖励。',\n  'invite.rule.cap': '每月最多获得 {cap} 天奖励。',\n  'invite.rule.fair': '自己邀请自己、同一网络批量注册等行为产生的奖励无效。',\n  'invite.pro.title': '推广数据',\n  'invite.pro.range': '统计区间',\n  'invite.pro.range7': '近 7 天',\n  'invite.pro.range30': '近 30 天',\n  'invite.pro.range90': '近 90 天',\n  'invite.pro.commission': '区间佣金',\n  'invite.pro.commissionSub': '待确认 {pending} · 已确认 {valid}',\n  'invite.pro.newMembers': '新增团队成员',\n  'invite.pro.paidOrders': '付费订单',\n  'invite.pro.orderAmount': '订单金额',\n  'invite.pro.clicks': '链接访问',\n  'invite.pro.conversion': '注册转化率 {rate}%',\n  'invite.pro.trend': '趋势',\n  'invite.pro.metric': '趋势指标',\n  'invite.pro.mCommission': '佣金',\n  'invite.pro.mNewMembers': '新成员',\n  'invite.pro.mPaidOrders': '付费订单',\n  'invite.pro.l1': '一级',\n  'invite.pro.l2': '二级',\n  'invite.pro.l3': '三级',\n  'invite.pro.chartLabel': '{metric}趋势，{start} 至 {end}，分一级、二级、三级三条线；数据表见下方',\n  'invite.pro.viewTable': '查看数据表',\n  'invite.pro.tableLabel': '趋势数据表',\n  'invite.pro.date': '日期',\n  'invite.pro.total': '合计',\n  'invite.pro.team': '团队成员',\n  'invite.pro.levelTab': '{level}成员',\n  'invite.pro.teamCaption': '{level}团队成员',\n  'invite.pro.noTeam': '还没有{level}成员',\n  'invite.pro.noTeamBody': '通过你的邀请链接注册的用户会出现在这里。',\n  'invite.pro.col.member': '成员',\n  'invite.pro.col.inviter': '邀请人',\n  'invite.pro.col.registered': '注册时间',\n  'invite.pro.col.paid': '付费',\n  'invite.pro.col.contributed': '贡献佣金',\n  'invite.pro.paidYes': '已付费',\n  'invite.pro.paidNo': '未付费',\n  'invite.pro.commissions': '佣金明细',\n  'invite.pro.filterLevel': '层级',\n  'invite.pro.filterStatus': '状态',\n  'invite.pro.allLevels': '全部层级',\n  'invite.pro.allStatuses': '全部状态',\n  'invite.pro.status.pending': '待确认',\n  'invite.pro.status.valid': '已确认',\n  'invite.pro.status.invalid': '已失效',\n  'invite.pro.noCommissions': '这段时间没有佣金记录',\n  'invite.pro.noCommissionsBody': '换一个统计区间或筛选条件试试。',\n  'invite.pro.col.time': '时间',\n  'invite.pro.col.level': '层级',\n  'invite.pro.col.payer': '付款用户',\n  'invite.pro.col.trade': '订单号',\n  'invite.pro.col.order': '订单金额',\n  'invite.pro.col.rate': '比例',\n  'invite.pro.col.amount': '佣金',\n  'invite.pro.col.status': '状态',\n  'invite.pro.export': '导出 CSV',\n  'invite.pro.exported': '已导出 {name}',\n  'invite.pro.exportLimit': '导出太频繁：{message}',\n  'invite.pro.balance': '佣金余额',\n  'invite.pro.balanceMeta': '累计已确认 {valid} · 已提现或转出 {out}',\n  'invite.pro.withdraw': '申请提现',\n  'invite.pro.withdrawCount': '已提交 {n} 次提现申请',\n  'invite.pro.withdrawHint': '提现申请会以工单形式提交，客服处理后在「我的工单」里回复。',\n  'invite.pro.withdrawClosed': '站点暂未开放提现。',\n  'invite.pro.withdrawNoMethod': '站点没有配置提现方式。',\n  'invite.pro.withdrawTitle': '申请提现',\n  'invite.pro.withdrawIntro': '当前佣金余额 {amount}。填写收款方式与账号，提交后客服会通过工单联系你。',\n  'invite.pro.withdrawMethod': '提现方式',\n  'invite.pro.withdrawAccount': '收款账号',\n  'invite.pro.withdrawAccountHint': '例如支付宝账号或钱包地址',\n  'invite.pro.withdrawAccountRequired': '请填写收款账号',\n  'invite.pro.withdrawSubmit': '提交申请',\n  'invite.pro.withdrawDone': '提现申请已提交，可在「我的工单」查看进度',\n  'attach.add': '添加图片',\n  'attach.listLabel': '已添加的图片',\n  'attach.hint': '支持 JPG、PNG、WebP、GIF，单张不超过 {mb}MB，最多 {n} 张；可拖拽或粘贴截图',\n  'attach.count': '{n} / {max}',\n  'attach.remove': '移除第 {n} 张图片',\n  'attach.retryN': '重新上传第 {n} 张图片',\n  'attach.uploading': '正在上传 {p}%',\n  'attach.ready': '已上传',\n  'attach.failed': '上传失败',\n  'attach.drop': '松开即可添加图片',\n  'attach.wait': '图片还在上传，请稍候再发送',\n  'attach.err.type': '只支持 JPG、PNG、WebP、GIF 图片',\n  'attach.err.size': '单张图片不能超过 {mb}MB',\n  'attach.err.count': '每条消息最多 {n} 张图片，多出的没有添加',\n  'attach.err.upload': '图片上传失败，请重试',\n  'attach.err.server': '图片服务暂时不可用，请稍后重试',\n  'attach.alt': '工单图片 {n}',\n  'attach.open': '查看工单图片 {n}',\n  'attach.gone': '图片已失效',\n  'lightbox.title': '工单图片',\n  'lightbox.prev': '上一张',\n  'lightbox.next': '下一张',\n  'lightbox.count': '{n} / {total}',\n};\n"],"i18n/en-US.js":[[],"// English. Must have exactly the same keys as zh-CN.js (tests/js/lychee-i18n.test.mjs).\nexport default {\n  'route.login': 'Log in',\n  'route.register': 'Sign up',\n  'route.forgetpassword': 'Reset password',\n  'route.dashboard': 'Dashboard',\n  'route.plan': 'Plans',\n  'route.planDetail': 'Checkout',\n  'route.order': 'My orders',\n  'route.orderDetail': 'Order details',\n  'route.ticket': 'Support tickets',\n  'route.ticketDetail': 'Ticket',\n  'route.invite': 'Invite',\n  'route.profile': 'Profile',\n  'route.knowledge': 'Help center',\n  'route.knowledgeDetail': 'Article',\n  'kb.search': 'Search article titles',\n  'kb.updated': 'Updated {date}',\n  'kb.noMatch': 'No matching articles',\n  'kb.noMatchBody': 'No article title contains “{q}”.',\n  'kb.clear': 'Clear search',\n  'kb.articles': 'Articles',\n  'kb.empty': 'No help articles yet',\n  'kb.emptyBody': 'Articles appear here once they are published.',\n  'kb.categories': 'Categories',\n  'kb.all': 'All',\n  'kb.back': 'Back to help center',\n  'kb.notFound': 'Article not found',\n  'kb.notFoundBody': 'It may have been removed or hidden.',\n  'kb.backList': 'See all articles',\n  'kb.table': 'Table (scrolls sideways)',\n  'route.node': 'Servers',\n  'node.online': 'Online',\n  'node.offline': 'Offline',\n  'node.tags': 'Tags',\n  'node.rate': 'Rate',\n  'node.protocol': 'Protocol',\n  'node.summary': '{total} nodes',\n  'node.onlineN': '{n} online',\n  'node.offlineN': '{n} offline',\n  'node.list': 'Nodes',\n  'node.hint': 'The rate is how traffic on a node is counted: 1.5× means 1 GB used counts as 1.5 GB. Status refreshes every few minutes.',\n  'node.noPlan': 'No active plan',\n  'node.noPlanBody': 'Buy or renew a plan and its nodes appear here.',\n  'node.noNodes': 'No nodes available yet',\n  'node.noNodesBody': 'Your plan has no nodes assigned right now. Check back later or contact support.',\n  'traffic.usage': 'This period',\n  'traffic.used': 'Used',\n  'traffic.total': 'Total',\n  'traffic.daily': 'Daily usage',\n  'traffic.lead': 'Traffic of each day this month, charged by node rate.',\n  'traffic.count': '{n} records · {billed} billed',\n  'traffic.pages': 'Traffic pages',\n  'traffic.col.date': 'Date',\n  'traffic.col.upload': 'Upload',\n  'traffic.col.download': 'Download',\n  'traffic.col.rate': 'Rate',\n  'traffic.col.billed': 'Billed',\n  'traffic.hint': 'Billed = (upload + download) × rate, counted against your plan. Nodes with different rates on the same day are listed separately.',\n  'traffic.emptyTitle': 'No traffic this month yet',\n  'traffic.emptyBody': 'Once you use a node, each day\\'s upload, download and billed traffic appears here.',\n  'traffic.noPlanBody': 'Buy a plan and connect to a node; each day\\'s traffic then appears here.',\n  'route.traffic': 'Traffic log',\n  'route.components': 'Component gallery',\n  'gallery.intro': 'Design tokens and components of this theme (development only).',\n  'gallery.colors': 'Colour tokens',\n  'gallery.toc': 'On this page',\n  'gallery.type': 'Typography',\n  'gallery.space': 'Spacing, radius and shadow',\n  'gallery.sample': 'Lychee Cloud · 128.00 GB left',\n  'gallery.group.neutral': 'Neutrals',\n  'gallery.group.brand': 'Brand',\n  'gallery.group.semantic': 'Semantic',\n  'gallery.group.soft': 'Soft backgrounds and their text',\n  'ui.copy': 'Copy',\n  'ui.copied': 'Copied',\n  'ui.copyManual': 'Clipboard unavailable. The text is selected — please copy it manually',\n  'ui.close': 'Close',\n  'ui.selected': 'Selected',\n  'ui.soldOut': 'Sold out',\n  'ui.progressHigh': 'Over 80% of your data is used',\n  'ui.progressFull': 'Your data is used up',\n  'gallery.buttons': 'Buttons',\n  'gallery.fields': 'Inputs and selects',\n  'gallery.copy': 'Read-only input + copy',\n  'gallery.choices': 'Segmented control, switch and checkbox',\n  'gallery.cards': 'Cards',\n  'gallery.plans': 'Plan cards',\n  'gallery.badges': 'Badges',\n  'gallery.states': 'All states',\n  'gallery.live': 'Interactive',\n  'gallery.state.default': 'Default',\n  'gallery.state.hover': 'Hover',\n  'gallery.state.active': 'Pressed',\n  'gallery.state.focus': 'Focus',\n  'gallery.state.disabled': 'Disabled',\n  'gallery.state.loading': 'Loading',\n  'gallery.btn.primary': 'Primary',\n  'gallery.btn.secondary': 'Secondary',\n  'gallery.btn.text': 'Text',\n  'gallery.btn.icon': 'Icon',\n  'gallery.btn.danger': 'Danger',\n  'gallery.btn.save': 'Save',\n  'gallery.btn.delete': 'Delete',\n  'gallery.btn.asyncDemo': 'Loads for 1 s',\n  'gallery.field.email': 'Email',\n  'gallery.field.emailHelp': 'Used to sign in and for notifications',\n  'gallery.field.emailError': 'Enter a valid email address',\n  'gallery.field.hover': 'Hover',\n  'gallery.field.focus': 'Focus',\n  'gallery.field.disabled': 'Disabled',\n  'gallery.field.value': 'Sample text',\n  'gallery.field.coupon': 'Coupon',\n  'gallery.field.couponHelp': 'Checking the coupon…',\n  'gallery.field.period': 'Billing period',\n  'gallery.field.message': 'Message',\n  'gallery.field.messageHint': 'Describe the problem',\n  'gallery.field.subscribe': 'Subscription link',\n  'gallery.field.invite': 'Invite link',\n  'gallery.period.month': 'Monthly',\n  'gallery.period.quarter': 'Quarterly',\n  'gallery.period.half': 'Half-yearly',\n  'gallery.period.year': 'Yearly',\n  'gallery.switch.on': 'On',\n  'gallery.switch.off': 'Off',\n  'gallery.switch.saving': 'Spins while saving',\n  'gallery.switch.fails': 'Rolls back on failure',\n  'gallery.check.agree': 'I agree to the terms of service',\n  'gallery.check.remember': 'Remember me',\n  'gallery.check.required': 'Required',\n  'gallery.check.requiredError': 'Please accept the terms first',\n  'gallery.card.title': 'Subscription',\n  'gallery.card.body': 'Card: surface, radius 16, shadow 1; a border in dark mode.',\n  'gallery.card.clickable': 'Clickable card',\n  'gallery.card.clickBody': 'On hover the border darkens and it lifts 1px.',\n  'gallery.card.hover': 'Hovered',\n  'gallery.plan.f1': '{n} GB data per month',\n  'gallery.plan.f2': '{n} devices at once',\n  'gallery.plan.f3': 'All routes',\n  'gallery.plan.buy': 'Buy now',\n  'gallery.plan.popular': 'Popular',\n  'gallery.badge.neutral': 'Neutral',\n  'gallery.badge.primary': 'Featured',\n  'gallery.badge.active': 'Paid',\n  'gallery.badge.pending': 'Pending',\n  'gallery.badge.expired': 'Expired',\n  'gallery.badge.processing': 'Processing',\n  'gallery.progress.title': 'Progress bar',\n  'gallery.progress.label': 'Data used',\n  'gallery.progress.missing': 'No data',\n  'ui.cancel': 'Cancel',\n  'ui.confirm': 'OK',\n  'ui.loading': 'Loading…',\n  'ui.loadFailed': 'Failed to load',\n  'ui.empty': 'Nothing here yet',\n  'ui.emptyFiltered': 'No results match these filters',\n  'ui.pagination': 'Pagination',\n  'ui.prevPage': 'Previous page',\n  'ui.nextPage': 'Next page',\n  'ui.page': 'Page {n}',\n  'ui.pageOf': 'Page {n} of {total}',\n  'ui.range': '{from}–{to} of {total}',\n  'gallery.overlays': 'Dialogs, drawers and toasts',\n  'gallery.dialogs': 'Dialogs and drawers',\n  'gallery.toasts': 'Toasts',\n  'gallery.statesTitle': 'Empty, skeleton and error states',\n  'gallery.tables': 'Tables and pagination',\n  'gallery.dialog.open': 'Open dialog',\n  'gallery.dialog.title': 'Edit note',\n  'gallery.dialog.body': 'The first save fails (shows the in-dialog error); the second one succeeds.',\n  'gallery.dialog.name': 'Note',\n  'gallery.dialog.save': 'Save',\n  'gallery.dialog.failed': 'Could not save: the service is unavailable',\n  'gallery.dialog.saved': 'Saved',\n  'gallery.dialog.confirm': 'Confirm a dangerous action',\n  'gallery.dialog.confirmTitle': 'Delete this record?',\n  'gallery.dialog.confirmBody': 'This cannot be undone.',\n  'gallery.dialog.confirmed': 'Deletion confirmed (demo, nothing was deleted)',\n  'gallery.drawer.open': 'Open drawer',\n  'gallery.drawer.title': 'More',\n  'gallery.drawer.body': 'Slides in from the right on desktop and up from the bottom on phones.',\n  'gallery.toast.success': 'Success toast',\n  'gallery.toast.error': 'Error toast',\n  'gallery.toast.info': 'Info toast',\n  'gallery.toast.successText': 'Subscription link copied',\n  'gallery.toast.errorText': 'Payment failed, please try again later',\n  'gallery.toast.infoText': 'Order placed, waiting for payment',\n  'gallery.empty.title': 'No tickets yet',\n  'gallery.empty.body': 'Open a ticket whenever you need help and we will reply soon.',\n  'gallery.empty.action': 'Open a ticket',\n  'gallery.empty.filteredBody': 'Try different filters.',\n  'gallery.empty.clear': 'Clear filters',\n  'gallery.table.caption': 'My orders',\n  'gallery.table.scrollCaption': 'Horizontally scrolling table',\n  'gallery.table.no': 'Order no.',\n  'gallery.table.plan': 'Plan',\n  'gallery.table.period': 'Period',\n  'gallery.table.amount': 'Amount',\n  'gallery.table.status': 'Status',\n  'gallery.table.date': 'Created',\n  'gallery.brand': 'Logo and brand',\n  'gallery.brand.inApp': 'Logo in the app',\n  'gallery.brand.custom': 'A logo is configured in the admin panel; the page uses it',\n  'gallery.brand.default': 'No logo configured: the built-in mark + the site name',\n  'gallery.brand.sizes': 'Mark sizes: 16 / 32 / 180',\n  'gallery.brand.files': 'Asset files',\n  'gallery.icons': 'Icons',\n  'gallery.icons.note': 'Lucide {version} subset, {n} icons; stroke 1.75, inherits the text colour.',\n  'route.notFound': 'Page not found',\n  'placeholder.body': 'This page is under construction.',\n  'placeholder.params': 'Parameters',\n  'notFound.body': 'The page you are looking for does not exist or has moved.',\n  'notFound.home': 'Back to home',\n  'error.title': 'This page failed to load',\n  'error.body': 'Check your connection and try again.',\n  'error.retry': 'Retry',\n  'error.network': 'Network error. Check your connection and try again',\n  'error.timeout': 'The request timed out. Please try again',\n  'error.server': 'The service is temporarily unavailable. Please try again later',\n  'error.upstream': 'Network problem. Please try again later',\n  'error.unknown': 'Something went wrong. Please try again',\n  'error.auth': 'Your session has expired. Please log in again',\n  'state.loading': 'Loading…',\n  'state.empty': 'Nothing here yet',\n  'format.longTerm': 'No expiry',\n  'format.none': '—',\n  'nav.main': 'Main navigation',\n  'nav.group.base': 'Basics',\n  'nav.group.subscription': 'Subscription',\n  'nav.group.finance': 'Billing',\n  'nav.group.personal': 'Account',\n  'nav.toggle': 'Collapse or expand navigation',\n  'nav.userMenu': 'User menu',\n  'nav.logout': 'Log out',\n  'nav.more': 'More',\n  'nav.tabs': 'Tab bar',\n  'nav.skip': 'Skip to main content',\n  'prefs.switchLanguage': 'Switch language to {language}',\n  'prefs.languageRow': 'Language: switch to {language}',\n  'prefs.toDark': 'Switch to dark mode',\n  'prefs.toLight': 'Switch to light mode',\n  'nav.tab.dashboard': 'Home',\n  'nav.tab.plan': 'Plans',\n  'nav.tab.order': 'Orders',\n  'nav.tab.ticket': 'Tickets',\n  'auth.email': 'Email',\n  'auth.password': 'Password',\n  'auth.showPassword': 'Show password',\n  'auth.hidePassword': 'Hide password',\n  'auth.login': 'Log in',\n  'auth.loginTitle': 'Log in',\n  'auth.loginLead': 'Welcome back — log in to {name} to continue',\n  'auth.emailRequired': 'Please enter your email',\n  'auth.passwordRequired': 'Please enter your password',\n  'auth.forgot': 'Forgot password?',\n  'auth.noAccount': 'Don\\'t have an account?',\n  'auth.register': 'Sign up',\n  'auth.emailInvalid': 'Please enter a valid email address',\n  'auth.emailSuffix': 'This email domain is not supported',\n  'auth.suffixHelp': 'Only these email domains are accepted: {list}',\n  'auth.emailCode': 'Email code',\n  'auth.sendCode': 'Send code',\n  'auth.resendCode': 'Resend',\n  'auth.resendIn': 'Resend in {s}s',\n  'auth.codeSent': 'Code sent — check your inbox',\n  'auth.codeRequired': 'Please enter the email code',\n  'auth.codeInvalid': 'The code is 6 digits',\n  'auth.passwordShort': 'Use at least 8 characters',\n  'auth.passwordHelp': 'At least 8 characters',\n  'auth.passwordConfirm': 'Confirm password',\n  'auth.passwordMismatch': 'The passwords do not match',\n  'auth.inviteCode': 'Invite code',\n  'auth.inviteCodeOptional': 'Invite code (optional)',\n  'auth.inviteRequired': 'Please enter an invite code',\n  'auth.tosAgree': 'I have read and agree to the',\n  'auth.tos': 'Terms of Service',\n  'auth.tosRequired': 'Please accept the Terms of Service first',\n  'auth.registerTitle': 'Create account',\n  'auth.registerLead': 'Create your {name} account in a few steps',\n  'auth.haveAccount': 'Already have an account?',\n  'auth.newPassword': 'New password',\n  'auth.newPasswordRequired': 'Please enter a new password',\n  'auth.resetSubmit': 'Reset password',\n  'auth.resetDone': 'Password reset — log in with the new one',\n  'auth.resetTitle': 'Reset your password',\n  'auth.resetLead': 'Enter your account email, verify it and choose a new password',\n  'auth.backToLogin': 'Back to log in',\n  'auth.captcha': 'Human verification',\n  'auth.captchaRequired': 'Please complete the verification first',\n  'auth.captchaLoadFailed': 'The verification could not load — check your connection and retry',\n  'auth.captchaInvisible': 'This site uses human verification to protect sign-in and sign-up',\n  'auth.quickLoggingIn': 'Logging you in with the link…',\n  'auth.quickLoginFailed': 'This login link is invalid or has expired — please log in again',\n  'dash.hello': 'Hi, {name}',\n  'dash.helloAnon': 'Hi there',\n  'dash.mySubscription': 'My subscription',\n  'dash.unnamedPlan': 'Unnamed plan',\n  'dash.active': 'Active',\n  'dash.permanent': 'No expiry',\n  'dash.expired': 'Expired',\n  'dash.status': 'Status',\n  'dash.expiresAt': 'Expires',\n  'dash.daysLeftLabel': 'Time left',\n  'dash.daysLeft': '{n} days',\n  'dash.resetLabel': 'Data reset',\n  'dash.resetIn': 'in {n} days',\n  'dash.resetToday': 'today',\n  'dash.noReset': 'No reset',\n  'dash.renew': 'Renew',\n  'dash.noPlan': 'No subscription yet',\n  'dash.noPlanLead': 'Pick a plan — once it is active you can import your subscription here.',\n  'dash.buyPlan': 'Buy a plan',\n  'dash.traffic': 'Data usage',\n  'dash.usedTraffic': 'Used',\n  'dash.remaining': 'Remaining',\n  'dash.notices': 'Announcements',\n  'dash.noNotices': 'No announcements yet',\n  'dash.moreNotices': 'Show more',\n  'ui.gotIt': 'Got it',\n  'dash.subscription': 'Subscription',\n  'dash.subscribeUrl': 'Subscription link',\n  'dash.subscribeHelp': 'Keep this link private; if it leaks, reset it in your profile.',\n  'dash.copyLink': 'Copy subscription link',\n  'dash.showQr': 'QR code',\n  'dash.qrTitle': 'Subscription QR code',\n  'dash.qrHint': 'Scan it with your client app to import the subscription.',\n  'dash.qrAlt': 'QR code of the subscription link',\n  'dash.resetSubscription': 'Reset subscription',\n  'dash.oneClickImport': 'One-click import',\n  'period.month': 'Monthly',\n  'period.quarter': 'Quarterly',\n  'period.half': 'Half-yearly',\n  'period.year': 'Yearly',\n  'period.twoYear': 'Every 2 years',\n  'period.threeYear': 'Every 3 years',\n  'period.onetime': 'One-time',\n  'period.reset': 'Traffic reset',\n  'period.unit.month': 'mo',\n  'period.unit.quarter': 'quarter',\n  'period.unit.half': '6 mo',\n  'period.unit.year': 'yr',\n  'period.unit.twoYear': '2 yrs',\n  'period.unit.threeYear': '3 yrs',\n  'plan.lead': 'Pick the plan that suits you; prices follow the selected billing period.',\n  'plan.period': 'Billing period',\n  'plan.subscription': 'Subscription',\n  'plan.buy': 'Buy now',\n  'plan.noPrice': 'No billing period available',\n  'plan.periodMissing': '{period} not offered',\n  'plan.traffic': '{n} GB traffic',\n  'plan.otherPeriods': 'Other billing periods',\n  'plan.emptyTitle': 'No plans available right now',\n  'plan.emptyBody': 'Plans will show up here once they are on sale. Please check back later.',\n  'checkout.back': 'Back to plans',\n  'checkout.period': 'Billing period',\n  'checkout.coupon': 'Coupon',\n  'checkout.couponPlaceholder': 'Have a coupon code? Enter it here',\n  'checkout.applyCoupon': 'Apply',\n  'checkout.couponEmpty': 'Enter a coupon code',\n  'checkout.couponApplied': 'Coupon {code} applied',\n  'checkout.removeCoupon': 'Remove',\n  'checkout.summary': 'Order summary',\n  'checkout.plan': 'Plan',\n  'checkout.original': 'Price',\n  'checkout.discount': 'Discount',\n  'checkout.payable': 'Amount due',\n  'checkout.submit': 'Place order',\n  'checkout.note': 'Choose a payment method on the order page; balance and discounts are settled in the order amount.',\n  'checkout.viewOrder': 'View order',\n  'checkout.noPeriod': 'This plan has no billing period available right now.',\n  'period.unknown': '—',\n  'order.status.pending': 'Awaiting payment',\n  'order.status.processing': 'Processing',\n  'order.status.cancelled': 'Cancelled',\n  'order.status.completed': 'Completed',\n  'order.status.discounted': 'Credited',\n  'order.status.unknown': 'Unknown status',\n  'order.type.new': 'New purchase',\n  'order.type.renew': 'Renewal',\n  'order.type.upgrade': 'Upgrade',\n  'order.type.reset': 'Traffic reset',\n  'order.type.unknown': 'Other',\n  'order.lead': 'All your orders. Open one to see the details or finish paying.',\n  'order.col.tradeNo': 'Order no.',\n  'order.col.plan': 'Plan',\n  'order.col.period': 'Period',\n  'order.col.amount': 'Amount',\n  'order.col.status': 'Status',\n  'order.col.createdAt': 'Created',\n  'order.rowLabel': 'Order {no}, {status}, view details',\n  'order.loadMore': 'Load more ({n} left)',\n  'order.count': '{n} orders',\n  'order.emptyTitle': 'No orders yet',\n  'order.emptyBody': 'Orders appear here after you buy a plan.',\n  'order.buy': 'Buy a plan',\n  'orderDetail.back': 'Back to orders',\n  'orderDetail.info': 'Order details',\n  'orderDetail.type': 'Order type',\n  'orderDetail.paidAt': 'Paid at',\n  'orderDetail.method': 'Payment method',\n  'orderDetail.chooseMethod': 'Choose a payment method',\n  'orderDetail.noMethods': 'No payment method is available right now. Please open a ticket to contact us.',\n  'orderDetail.noFee': 'No fee',\n  'orderDetail.fee': 'Fee {fee}',\n  'orderDetail.amounts': 'Amount',\n  'orderDetail.amount.price': 'Plan price',\n  'orderDetail.amount.discount': 'Coupon',\n  'orderDetail.amount.surplus': 'Credit from current plan',\n  'orderDetail.amount.balance': 'Paid from balance',\n  'orderDetail.amount.fee': 'Handling fee',\n  'orderDetail.amount.paid': 'Amount paid',\n  'orderDetail.pay': 'Pay now',\n  'orderDetail.activate': 'Activate',\n  'orderDetail.paidToast': 'Order paid',\n  'orderDetail.payUnknown': 'The payment method returned something we cannot handle. Try another method or contact us.',\n  'orderDetail.cancel': 'Cancel order',\n  'orderDetail.cancelTitle': 'Cancel this order?',\n  'orderDetail.cancelBody': 'This cannot be undone; place a new order when you need one.',\n  'orderDetail.cancelConfirm': 'Cancel order',\n  'orderDetail.cancelKeep': 'Keep it',\n  'orderDetail.cancelled': 'Order cancelled',\n  'orderDetail.rebuy': 'Buy again',\n  'orderDetail.qrTitle': 'Scan to pay',\n  'orderDetail.qrAlt': 'Payment QR code',\n  'orderDetail.qrHint': 'Scan with the {method} app to pay. This page updates by itself once the payment arrives.',\n  'orderDetail.qrDone': 'I have paid',\n  'orderDetail.headline.pending': 'Awaiting payment',\n  'orderDetail.headline.processing': 'Paid, activating',\n  'orderDetail.headline.completed': 'Paid',\n  'orderDetail.headline.cancelled': 'Order cancelled',\n  'orderDetail.headline.discounted': 'Credited',\n  'orderDetail.headline.unknown': 'Unknown order status',\n  'orderDetail.sub.pending': 'Choose a payment method; your plan starts as soon as the payment arrives.',\n  'orderDetail.sub.processing': 'Payment received. Your plan is being activated, usually within seconds.',\n  'orderDetail.sub.completed': 'Your plan is active. See your subscription on the dashboard.',\n  'orderDetail.sub.cancelled': 'Nothing will be charged for this order. You can buy again any time.',\n  'orderDetail.sub.discounted': 'The amount of this order was credited to a new order.',\n  'orderDetail.sub.unknown': 'Refresh the page, or open a ticket to contact us.',\n  'orderDetail.pollStopped': 'Automatic status updates stopped after 10 minutes. If you have paid, refresh by hand.',\n  'orderDetail.refresh': 'Refresh status',\n  'ticket.level.low': 'Low',\n  'ticket.level.medium': 'Medium',\n  'ticket.level.high': 'High',\n  'ticket.level.unknown': 'Unknown',\n  'ticket.state.waiting': 'Awaiting reply',\n  'ticket.state.replied': 'Replied',\n  'ticket.state.closed': 'Closed',\n  'ticket.state.unknown': 'Unknown status',\n  'ticket.heroTitle': 'Any questions? Open a ticket and we will help',\n  'ticket.heroBody': 'Describe the problem; replies from support show up here.',\n  'ticket.new': 'New ticket',\n  'ticket.col.subject': 'Subject',\n  'ticket.col.level': 'Priority',\n  'ticket.col.state': 'Status',\n  'ticket.col.updatedAt': 'Last update',\n  'ticket.rowLabel': 'Ticket {subject}, {state}, view details',\n  'ticket.emptyTitle': 'No tickets yet',\n  'ticket.emptyBody': 'Open a ticket whenever something goes wrong; support replies as soon as possible.',\n  'ticket.form.title': 'New ticket',\n  'ticket.form.subject': 'Subject',\n  'ticket.form.subjectPlaceholder': 'One line about the problem, e.g. cannot connect to the Hong Kong node',\n  'ticket.form.level': 'Priority',\n  'ticket.form.message': 'Description',\n  'ticket.form.messagePlaceholder': 'Which client and node, when it started and what you see.',\n  'ticket.form.submit': 'Submit',\n  'ticket.form.cancel': 'Cancel',\n  'ticket.form.subjectRequired': 'Enter a subject',\n  'ticket.form.levelRequired': 'Choose a priority',\n  'ticket.form.messageRequired': 'Describe the problem',\n  'ticket.form.created': 'Ticket submitted; we will reply soon',\n  'ticketDetail.back': 'Back to tickets',\n  'ticketDetail.me': 'Me',\n  'ticketDetail.support': 'Support',\n  'ticketDetail.conversation': 'Ticket conversation',\n  'ticketDetail.created': 'Opened {time}',\n  'ticketDetail.close': 'Close ticket',\n  'ticketDetail.closeTitle': 'Close this ticket?',\n  'ticketDetail.closeBody': 'You will not be able to reply afterwards. Open a new ticket if the problem comes back.',\n  'ticketDetail.closeConfirm': 'Close ticket',\n  'ticketDetail.closeKeep': 'Keep open',\n  'ticketDetail.closed': 'Ticket closed',\n  'ticketDetail.placeholder': 'Write a reply',\n  'ticketDetail.replyLabel': 'Reply',\n  'ticketDetail.sendHint': 'Ctrl + Enter to send',\n  'ticketDetail.closedTitle': 'Ticket closed',\n  'ticketDetail.closedHint': 'This ticket is closed and cannot be replied to. Open a new ticket for a new question.',\n  'ticketDetail.send': 'Send',\n  'ticketDetail.sending': 'Sending…',\n  'ticketDetail.failed': 'Not sent',\n  'ticketDetail.resend': 'Resend',\n  'ticketDetail.empty': 'Write a reply first',\n  'ticketDetail.emptyWithImages': 'Write a reply or add an image first',\n  'ticket.form.messageOrImage': 'Describe the problem or add an image',\n  'profile.account': 'Account',\n  'profile.balance': 'Account balance',\n  'profile.commission': 'Commission balance',\n  'profile.pwd.title': 'Change password',\n  'profile.pwd.desc': 'This device stays signed in; sessions on other devices end.',\n  'profile.pwd.old': 'Current password',\n  'profile.pwd.new': 'New password',\n  'profile.pwd.confirm': 'Confirm new password',\n  'profile.pwd.help': 'At least 8 characters',\n  'profile.pwd.submit': 'Save new password',\n  'profile.pwd.oldRequired': 'Enter your current password',\n  'profile.pwd.newRequired': 'Enter a new password',\n  'profile.pwd.tooShort': 'The new password needs at least 8 characters',\n  'profile.pwd.mismatch': 'The two new passwords do not match',\n  'profile.pwd.done': 'Password changed; other devices need to sign in again',\n  'profile.remind.title': 'Reminders',\n  'profile.remind.desc': 'Sent by e-mail; turn them off at any time.',\n  'profile.remind.expire': 'Expiry reminder',\n  'profile.remind.expireDesc': 'An e-mail before your plan expires.',\n  'profile.remind.traffic': 'Traffic reminder',\n  'profile.remind.trafficDesc': 'An e-mail when your traffic is nearly used up.',\n  'profile.remind.saved': 'Reminder saved',\n  'profile.remind.failed': 'Not saved, the previous setting is back: {reason}',\n  'profile.sub.title': 'Subscription URL',\n  'profile.sub.desc': 'Reset it if you think the URL leaked; then import the new one in your clients.',\n  'profile.sub.url': 'Current subscription URL',\n  'profile.sub.reset': 'Reset subscription',\n  'profile.sub.confirmTitle': 'Reset the subscription URL?',\n  'profile.sub.confirmBody': 'The old subscription URL stops working immediately. Clients on every device must import the new URL to keep working.',\n  'profile.sub.confirm': 'Reset',\n  'profile.sub.keep': 'Keep it',\n  'profile.sub.done': 'Subscription reset: import the new URL in your clients',\n  'profile.tg.title': 'Telegram notifications',\n  'profile.tg.bound': 'Linked',\n  'profile.tg.unbound': 'Not linked',\n  'profile.tg.step1': 'Find and open the bot {bot} in Telegram',\n  'profile.tg.step2': 'Copy the 「Current subscription URL」 above',\n  'profile.tg.step3': 'Send the bot /bind, a space and the URL, then reload this page',\n  'profile.tg.open': 'Open {bot}',\n  'profile.transfer.title': 'Commission to balance',\n  'profile.transfer.desc': 'Moved commission can pay for plans; it cannot be moved back.',\n  'profile.transfer.amount': 'Amount',\n  'profile.transfer.help': 'Up to {max}',\n  'profile.transfer.submit': 'Move to balance',\n  'profile.transfer.invalid': 'Enter an amount above 0 with at most two decimals',\n  'profile.transfer.tooMuch': 'More than your commission balance',\n  'profile.transfer.done': '{amount} moved to your balance',\n  'profile.gift.title': 'Gift cards',\n  'profile.gift.desc': 'Enter a gift card or redeem code; the reward goes straight to your account.',\n  'profile.gift.code': 'Code',\n  'profile.gift.placeholder': 'e.g. GIFT-XXXX-XXXX',\n  'profile.gift.submit': 'Redeem',\n  'profile.gift.required': 'Enter a code',\n  'profile.gift.done': 'Redeemed {name}',\n  'invite.hero': 'Invite friends, earn membership time',\n  'invite.heroBody': 'When a friend signs up with your link and pays a first order, you get {days} days of membership.',\n  'invite.heroPro': 'Invite friends, earn commission',\n  'invite.heroProBody': 'You earn a share of what the people who sign up with your link pay.',\n  'invite.link': 'My invite link',\n  'invite.noLink': 'No invite code yet. Create one first.',\n  'invite.generate': 'Create invite code',\n  'invite.codeCreated': 'Invite code created',\n  'invite.summary': 'Duration rewards',\n  'invite.registered': 'Signed up',\n  'invite.paid': 'Paid',\n  'invite.issued': 'Issued',\n  'invite.pending': 'Pending',\n  'invite.people': 'people',\n  'invite.days': 'days',\n  'invite.month': 'This month',\n  'invite.monthValue': '{used} / {cap} days',\n  'invite.monthCaption': 'Once the monthly cap is reached no more days are added until next month.',\n  'invite.codes': 'My invite codes',\n  'invite.copyLink': 'Copy invite link',\n  'invite.noCodes': 'No invite codes yet',\n  'invite.noCodesBody': 'Use 「Create invite code」 above to make the first one.',\n  'invite.pvN': '{n} visits',\n  'invite.col.code': 'Code',\n  'invite.records': 'Reward records',\n  'invite.noRecords': 'No reward records yet',\n  'invite.noRecordsBody': 'Rewards appear here once friends who used your link pay a first order.',\n  'invite.col.time': 'Time',\n  'invite.col.invitee': 'Invitee',\n  'invite.col.days': 'Days',\n  'invite.col.status': 'Status',\n  'invite.col.issued': 'Issued at',\n  'invite.daysN': '{n} days',\n  'invite.status.pending': 'Pending',\n  'invite.status.waiting_plan': 'To claim',\n  'invite.status.issued': 'Issued',\n  'invite.status.not_applicable': 'Not applicable',\n  'invite.status.invalid': 'Invalid',\n  'invite.status.unknown': 'Unknown',\n  'invite.rules': 'Rules',\n  'invite.rulesOff': 'Duration rewards are switched off.',\n  'invite.rule.firstOrder': 'When a friend signs up with your link and pays a first order, you get {days} days.',\n  'invite.rule.register': 'When a friend signs up with your link, you get {days} days.',\n  'invite.rule.minOrder': 'The first order must be at least {amount}.',\n  'invite.rule.confirm': 'Rewards are confirmed after {days} days; refunded orders do not count.',\n  'invite.rule.cap': 'At most {cap} days per month.',\n  'invite.rule.fair': 'Rewards from self-invites or bulk sign-ups from one network are invalid.',\n  'invite.pro.title': 'Promotion data',\n  'invite.pro.range': 'Period',\n  'invite.pro.range7': 'Last 7 days',\n  'invite.pro.range30': 'Last 30 days',\n  'invite.pro.range90': 'Last 90 days',\n  'invite.pro.commission': 'Commission',\n  'invite.pro.commissionSub': 'Pending {pending} · confirmed {valid}',\n  'invite.pro.newMembers': 'New team members',\n  'invite.pro.paidOrders': 'Paid orders',\n  'invite.pro.orderAmount': 'Order amount',\n  'invite.pro.clicks': 'Link visits',\n  'invite.pro.conversion': 'Sign-up rate {rate}%',\n  'invite.pro.trend': 'Trend',\n  'invite.pro.metric': 'Trend metric',\n  'invite.pro.mCommission': 'Commission',\n  'invite.pro.mNewMembers': 'New members',\n  'invite.pro.mPaidOrders': 'Paid orders',\n  'invite.pro.l1': 'Level 1',\n  'invite.pro.l2': 'Level 2',\n  'invite.pro.l3': 'Level 3',\n  'invite.pro.chartLabel': '{metric} trend from {start} to {end}, one line per level; the data table is below',\n  'invite.pro.viewTable': 'View data table',\n  'invite.pro.tableLabel': 'Trend data table',\n  'invite.pro.date': 'Date',\n  'invite.pro.total': 'Total',\n  'invite.pro.team': 'Team members',\n  'invite.pro.levelTab': '{level}',\n  'invite.pro.teamCaption': '{level} team members',\n  'invite.pro.noTeam': 'No {level} members yet',\n  'invite.pro.noTeamBody': 'People who sign up through your invite link appear here.',\n  'invite.pro.col.member': 'Member',\n  'invite.pro.col.inviter': 'Invited by',\n  'invite.pro.col.registered': 'Signed up',\n  'invite.pro.col.paid': 'Paid',\n  'invite.pro.col.contributed': 'Commission earned',\n  'invite.pro.paidYes': 'Paid',\n  'invite.pro.paidNo': 'Not yet',\n  'invite.pro.commissions': 'Commission detail',\n  'invite.pro.filterLevel': 'Level',\n  'invite.pro.filterStatus': 'Status',\n  'invite.pro.allLevels': 'All levels',\n  'invite.pro.allStatuses': 'All statuses',\n  'invite.pro.status.pending': 'Pending',\n  'invite.pro.status.valid': 'Confirmed',\n  'invite.pro.status.invalid': 'Void',\n  'invite.pro.noCommissions': 'No commission in this period',\n  'invite.pro.noCommissionsBody': 'Try another period or filter.',\n  'invite.pro.col.time': 'Time',\n  'invite.pro.col.level': 'Level',\n  'invite.pro.col.payer': 'Paid by',\n  'invite.pro.col.trade': 'Order',\n  'invite.pro.col.order': 'Order amount',\n  'invite.pro.col.rate': 'Rate',\n  'invite.pro.col.amount': 'Commission',\n  'invite.pro.col.status': 'Status',\n  'invite.pro.export': 'Export CSV',\n  'invite.pro.exported': 'Exported {name}',\n  'invite.pro.exportLimit': 'Too many exports: {message}',\n  'invite.pro.balance': 'Commission balance',\n  'invite.pro.balanceMeta': 'Confirmed in total {valid} · paid out or transferred {out}',\n  'invite.pro.withdraw': 'Withdraw',\n  'invite.pro.withdrawCount': '{n} withdrawal requests',\n  'invite.pro.withdrawHint': 'A withdrawal is submitted as a ticket; support replies under My tickets.',\n  'invite.pro.withdrawClosed': 'Withdrawals are not open on this site.',\n  'invite.pro.withdrawNoMethod': 'No withdrawal method is configured.',\n  'invite.pro.withdrawTitle': 'Request a withdrawal',\n  'invite.pro.withdrawIntro': 'Commission balance: {amount}. Enter how you want to be paid; support will follow up in a ticket.',\n  'invite.pro.withdrawMethod': 'Method',\n  'invite.pro.withdrawAccount': 'Account',\n  'invite.pro.withdrawAccountHint': 'e.g. your payment account or wallet address',\n  'invite.pro.withdrawAccountRequired': 'Enter the account to pay to',\n  'invite.pro.withdrawSubmit': 'Submit request',\n  'invite.pro.withdrawDone': 'Withdrawal requested. Follow it under My tickets.',\n  'attach.add': 'Add images',\n  'attach.listLabel': 'Attached images',\n  'attach.hint': 'JPG, PNG, WebP or GIF, up to {mb} MB each, {n} at most; drag or paste screenshots too',\n  'attach.count': '{n} / {max}',\n  'attach.remove': 'Remove image {n}',\n  'attach.retryN': 'Upload image {n} again',\n  'attach.uploading': 'Uploading {p}%',\n  'attach.ready': 'Uploaded',\n  'attach.failed': 'Upload failed',\n  'attach.drop': 'Drop to add the images',\n  'attach.wait': 'Images are still uploading, send them in a moment',\n  'attach.err.type': 'Only JPG, PNG, WebP and GIF images are supported',\n  'attach.err.size': 'Each image must be {mb} MB or smaller',\n  'attach.err.count': 'At most {n} images per message; the extra ones were not added',\n  'attach.err.upload': 'The image could not be uploaded, try again',\n  'attach.err.server': 'Image service is unavailable, try again later',\n  'attach.alt': 'Ticket image {n}',\n  'attach.open': 'View ticket image {n}',\n  'attach.gone': 'Image no longer available',\n  'lightbox.title': 'Ticket images',\n  'lightbox.prev': 'Previous image',\n  'lightbox.next': 'Next image',\n  'lightbox.count': '{n} / {total}',\n};\n"],"main.js":[["core/router.js","core/prefetch.js","core/nav.js","core/lazy.js","core/routes.js","core/cache.js","core/cache-policy.js","core/view.js","core/session.js","core/i18n.js","core/api.js","core/store.js","core/notify.js","ui/text.js","ui/brand.js","ui/feedback.js","ui/shell.js","core/scheme.js","core/handback.js","core/bootstrap.js","core/invite.js","i18n/zh-CN.js","i18n/en-US.js"],"// 荔枝云 application shell (native ES module, no build step): wires the runtime config the template injected\n// (window.__APP_CONFIG__), the login session, i18n, the request cache and the hash router. Views and libraries are\n// lazy (core/lazy.js); the entry module (app.js or app.full.js) registers their loaders and then calls boot().\n// Statically imported from here: the shell and the router only — never a view, never a vendored library.\nimport { Router, createRoutes, resolve } from '@@lydep:0@@';\nimport { createPrefetcher, idleCallback, saveDataMode, IDLE_ROUTES } from '@@lydep:1@@';\nimport { NAV_ITEMS } from '@@lydep:2@@';\nimport { lazy, VIEW_PREFIX } from '@@lydep:3@@';\nimport { ROUTES, NOT_FOUND } from '@@lydep:4@@';\nimport { createRequestCache, withRequestCache } from '@@lydep:5@@';\nimport { policyFor, invalidatedBy, invalidatedByRead } from '@@lydep:6@@';\nimport { createViewContext, h, isEditing } from '@@lydep:7@@';\nimport { createSession, tokenKeyFrom } from '@@lydep:8@@';\nimport { createI18n, initialLocale } from '@@lydep:9@@';\nimport { createApiClient } from '@@lydep:10@@';\nimport { createUserStore, createSiteStore, createUserConfigStore } from '@@lydep:11@@';\nimport { createNotifier } from '@@lydep:12@@';\nimport { configureUi } from '@@lydep:13@@';\nimport { applyThemeFavicon } from '@@lydep:14@@';\nimport { pageSkeleton } from '@@lydep:15@@';\nimport { createShell } from '@@lydep:16@@';\nimport { createScheme } from '@@lydep:17@@';\nimport { takeReturnPath } from '@@lydep:18@@';\nimport { wantsBootstrap, preloadBootstrap } from '@@lydep:19@@';\nimport { reportInviteVisits } from '@@lydep:20@@';\nimport zhCN from '@@lydep:21@@';\nimport enUS from '@@lydep:22@@';\n\nlet booted = false;\n\n/** Start the application once (the entry module calls it after registering the lazy loaders). */\nexport function boot() {\n  if (booted) return;\n  booted = true;\n  // read by the template's fallback: set as soon as an entry module runs\n  window.__LY_BOOTED__ = true;\n  const config = window.__APP_CONFIG__ || {};\n  // F2906: invite link visits (formerly an inline script of the template), before the router can change the hash\n  reportInviteVisits({ config });\n  const storage = (() => { try { return window.localStorage; } catch (e) { return null; } })();\n  const root = document.getElementById('app');\n\n  const i18n = createI18n({\n    bundles: { 'zh-CN': zhCN, 'en-US': enUS },\n    locale: initialLocale({ storage, serverLocale: config.locale, navigatorLanguage: navigator.language }),\n    storage,\n  });\n  configureUi({ t: (k, v) => i18n.t(k, v) });\n  const session = createSession({ storage, key: tokenKeyFrom(config) });\n  const notify = createNotifier(document);\n  // Every request goes to the injected apiBase (user_api_prefix). Not logged in any more → drop the login state; the\n  // router's guard then sends the visitor to /login?redirect=<current page>.\n  const http = createApiClient({\n    baseUrl: config.apiBase || '',\n    getToken: () => session.token(),\n    getLocale: () => i18n.locale,\n    t: (k) => i18n.t(k),\n    onUnauthorized: () => session.clear(),\n    onError: (err) => notify.error(err.message),\n  });\n  // Data convention (SPEC F815): every read of every view goes through the request cache — views keep calling\n  // app.api.get(path, query, opts), the cache decides (core/cache-policy.js; pass-through until policies are set).\n  // DESIGN.md §16.6: a background revalidation that brings new data for the page on screen updates it in place —\n  // same scroll position, no entrance animation, and never while the visitor is typing or a dialog is open\n  const routeReads = new Set();\n  let quietTimer = null;\n  const cache = createRequestCache({\n    onUpdate: (key) => {\n      if (!routeReads.has(key) || quietTimer) return;\n      quietTimer = setTimeout(() => { quietTimer = null; quietRerender(); }, 0);\n    },\n  });\n  const api = withRequestCache(http, cache, { policyFor, invalidatedBy, invalidatedByRead, onRead: (key) => routeReads.add(key) });\n  const user = createUserStore(api);\n  const site = createSiteStore(api);\n  const userConfig = createUserConfigStore(api);\n  const scheme = createScheme({ storage });\n  const app = { config, i18n: { t: (k, v) => i18n.t(k, v), get locale() { return i18n.locale; }, setLocale: (l) => i18n.setLocale(l), subscribe: (fn) => i18n.subscribe(fn) }, session, api, cache, user, site, userConfig, notify, scheme };\n  window.addEventListener('storage', (e) => { if (e.key === session.key) router.render(); });\n\n  document.documentElement.lang = i18n.locale;\n  const outlet = h('main', { id: 'ly-main', class: 'ly-main', tabindex: '-1' });\n  // F128: sidebar / rail / tab bar around the outlet; auth pages render bare\n  const shell = createShell({ app, outlet });\n  app.shell = shell;\n  root.replaceChildren(shell.el);\n\n  function renderError(err, info) {\n    outlet.replaceChildren(\n      h('section', { class: 'ly-page', 'data-view': 'error', role: 'alert' },\n        h('h1', { class: 'ly-page__title' }, i18n.t('error.title')),\n        h('div', { class: 'ly-card' },\n          h('p', { class: 'ly-muted' }, i18n.t('error.body')),\n          h('button', { type: 'button', class: 'ly-btn', onClick: () => router.render() }, i18n.t('error.retry')),\n        ),\n      ),\n    );\n    if (window.console) console.warn('[view]', info && info.route && info.route.name, err);\n  }\n\n  const router = new Router({\n    routes: createRoutes(ROUTES),\n    notFound: NOT_FOUND,\n    dev: config.devTools === true,\n    outlet,\n    isLoggedIn: () => session.isLoggedIn(),\n    loadView: (name, route) => route.load(),\n    createContext: (info) => Object.assign(createViewContext(info), { app, router }),\n    onError: renderError,\n    // the view's code is still on its way: its page skeleton now (SPEC F815 — no blank page after a click)\n    onPending: (info) => { outlet.replaceChildren(pageSkeleton({ view: info.route.view, title: i18n.t(info.route.title) })); },\n    onChange: (info) => {\n      const title = info.route ? i18n.t(info.route.title) : '';\n      document.title = title && config.siteName ? `${title} - ${config.siteName}` : (config.siteName || title);\n      root.setAttribute('data-route', info.route ? info.route.name : '');\n      shell.update(info);\n      startIdlePrefetch();\n    },\n  });\n  app.router = router;\n  // SPEC F815 item 3: code prefetch — hover / touch on a link, and the sidebar's first routes once idle\n  const routeTable = createRoutes(ROUTES);\n  const prefetcher = createPrefetcher({\n    load: (view) => lazy(VIEW_PREFIX + view),\n    viewOf: (hash) => { const r = resolve(routeTable, hash, { loggedIn: session.isLoggedIn(), notFound: NOT_FOUND }); return r.type === 'view' && !r.notFound ? r.route.view : null; },\n    saveData: () => saveDataMode(),\n    idle: idleCallback(window),\n  });\n  const onIntent = (e) => { const a = e.target && e.target.closest ? e.target.closest('a[href^=\"#/\"]') : null; if (a) prefetcher.intent(a.getAttribute('href')); };\n  document.addEventListener('mouseover', onIntent, { passive: true });\n  document.addEventListener('touchstart', onIntent, { passive: true });\n  let idleStarted = false;\n  const startIdlePrefetch = () => {\n    if (idleStarted || !session.isLoggedIn()) return;\n    idleStarted = true;\n    const go = () => prefetcher.idle(NAV_ITEMS.slice(0, IDLE_ROUTES).map((i) => resolve(routeTable, `#${i.path}`, { loggedIn: true, notFound: NOT_FOUND })).filter((r) => r.type === 'view' && !r.notFound).map((r) => r.route.view));\n    if (document.readyState === 'complete') go(); else window.addEventListener('load', go, { once: true });\n  };\n  window.addEventListener('hashchange', () => routeReads.clear());\n  function quietRerender() {\n    if (isEditing(outlet)) return;\n    const y = window.scrollY;\n    outlet.setAttribute('data-quiet', '');\n    router.render().finally(() => {\n      window.scrollTo(0, y);\n      // leaving quiet mode would start the entrance animations of the new elements now: finish them in the same task\n      // (getAnimations() flushes styles), so nothing replays; endless ones (status pulse, spinners) keep running\n      outlet.removeAttribute('data-quiet');\n      for (const a of outlet.getAnimations?.({ subtree: true }) || []) {\n        if (a.effect?.getTiming?.().iterations !== Infinity) { try { a.finish(); } catch (e) { /* not finishable */ } }\n      }\n    });\n  }\n  i18n.subscribe((locale) => { document.documentElement.lang = locale; shell.relabel(); router.render(); });\n  // F131: a server-rendered UI page sent the visitor here to log in → go back there once logged in\n  const handBack = () => { const to = takeReturnPath(storage, session.isLoggedIn()); if (to) { window.location.replace(to); return true; } return false; };\n  session.subscribe(() => {\n    // nothing cached for one login may be shown to the next one\n    cache.clear();\n    if (!session.isLoggedIn()) { user.clear(); userConfig.clear(); }\n    // just logged in and on the way to the dashboard: its data in one request, sent while its code loads\n    else if (wantsBootstrap(window.location.hash)) preloadBootstrap(api, cache).catch(() => {});\n    if (handBack()) return;\n    router.render();\n  });\n\n  // SPEC F814 item 5: a signed-in visitor opening the dashboard gets its first-screen data in one request, sent now —\n  // in parallel with site.load() and the dashboard's code; the dashboard's own reads are answered from it\n  if (session.isLoggedIn() && wantsBootstrap(window.location.hash)) preloadBootstrap(api, cache).catch(() => {});\n  site.load();\n  applyThemeFavicon({ config }).catch(() => {});\n  window.matchMedia?.('(prefers-color-scheme: dark)').addEventListener?.('change', () => { applyThemeFavicon({ config }).catch(() => {}); });\n  scheme.subscribe(() => { applyThemeFavicon({ config }).catch(() => {}); });\n  if (session.isLoggedIn()) user.load().catch(() => {});\n  if (!handBack()) router.start();\n}\n"],"app.js":[["core/lazy.js","core/lazy-loaders.js","main.js"],"// 荔枝云 entry (native ES module, no build step). First load = this file + main.js (shell, router) + the modules they\n// import statically; every view and vendored library is fetched on demand through the loaders registered here.\nimport { registerLazy } from '@@lydep:0@@';\nimport { LAZY_LOADERS } from '@@lydep:1@@';\nimport { boot } from '@@lydep:2@@';\n\nregisterLazy(LAZY_LOADERS);\nboot();\n"]}}