Ethscriptions commited on
Commit
7b4250a
·
verified ·
1 Parent(s): 7dbefbf

Step 2-6: 文案旁白、渲染引擎与全部镜头、配乐音效与播放器、MP4 本地导出、封面与发布文案

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +10 -5
  2. quanxue-src/package.json +85 -0
  3. quanxue-src/public/README.md +2 -0
  4. quanxue-src/quanxue.html +16 -0
  5. quanxue-src/scripts/quanxue/export_test.py +20 -0
  6. quanxue-src/scripts/quanxue/gen_fonts.py +44 -0
  7. quanxue-src/scripts/quanxue/gen_tts.py +61 -0
  8. quanxue-src/scripts/quanxue/page_test.py +29 -0
  9. quanxue-src/scripts/quanxue/render_music.py +29 -0
  10. quanxue-src/scripts/quanxue/shot.py +32 -0
  11. quanxue-src/src/App.tsx +103 -0
  12. quanxue-src/src/entry-client.tsx +112 -0
  13. quanxue-src/src/index.css +314 -0
  14. quanxue-src/src/quanxue/audio/engine.ts +188 -0
  15. quanxue-src/src/quanxue/audio/music.ts +234 -0
  16. quanxue-src/src/quanxue/audio/sfx.ts +194 -0
  17. quanxue-src/src/quanxue/covers.ts +144 -0
  18. quanxue-src/src/quanxue/dev.tsx +76 -0
  19. quanxue-src/src/quanxue/engine/draw.ts +407 -0
  20. quanxue-src/src/quanxue/engine/util.ts +65 -0
  21. quanxue-src/src/quanxue/exporter.ts +118 -0
  22. quanxue-src/src/quanxue/fonts.ts +24 -0
  23. quanxue-src/src/quanxue/publish.ts +58 -0
  24. quanxue-src/src/quanxue/quanxue.css +19 -0
  25. quanxue-src/src/quanxue/render.ts +214 -0
  26. quanxue-src/src/quanxue/scenes.ts +4 -0
  27. quanxue-src/src/quanxue/scenes/partA.ts +678 -0
  28. quanxue-src/src/quanxue/scenes/partB.ts +697 -0
  29. quanxue-src/src/quanxue/script.json +76 -0
  30. quanxue-src/src/quanxue/timeline.ts +189 -0
  31. quanxue-src/src/quanxue/ui/CoverPanel.tsx +95 -0
  32. quanxue-src/src/quanxue/ui/ExportPanel.tsx +109 -0
  33. quanxue-src/src/quanxue/ui/Player.tsx +155 -0
  34. quanxue-src/src/quanxue/ui/PublishPanel.tsx +58 -0
  35. quanxue-src/src/quanxue/ui/Transcript.tsx +28 -0
  36. quanxue-src/src/quanxue/ui/store.ts +37 -0
  37. quanxue-src/src/quanxue/voice.json +3172 -0
  38. quanxue-src/tsconfig.json +22 -0
  39. quanxue-src/vite.hf.config.ts +17 -0
  40. quanxue/assets/App-AJceFVqW.css +1 -0
  41. quanxue/assets/App-BVPCfY98.js +0 -0
  42. quanxue/assets/ErrorBoundary-DwultlP_.js +1 -0
  43. quanxue/assets/client-BlQxAbrl.js +0 -0
  44. quanxue/assets/index-BlGQAcOD.js +21 -0
  45. quanxue/assets/index-Br42UDbl.js +1 -0
  46. quanxue/assets/index-tKuM8enU.js +14 -0
  47. quanxue/assets/jsx-dev-runtime-Czb3f8pQ.js +14 -0
  48. quanxue/assets/mediabunny-aac-encoder-Dc8poPeB.js +3 -0
  49. quanxue/assets/quanxue-CcHbJimF.css +1 -0
  50. quanxue/assets/quanxue-sLzXMlPk.js +2 -0
README.md CHANGED
@@ -83,16 +83,21 @@ quanxue-src/
83
  ## 四、实施步骤(每完成一步推送一次到本 Space)
84
 
85
  - [x] **Step 1** 编写计划(本文件)→ 推送
86
- - [ ] **Step 2** 文案定稿 + 旁白 TTS 生成 + 字体子集化 → 推送
87
- - [ ] **Step 3** 渲染引擎与全部场景(横竖屏)→ 推送
88
- - [ ] **Step 4** 音乐、音效合成与播放器(播放/暂停/拖动/章节/全屏)→ 推送
89
- - [ ] **Step 5** 浏览器本地 MP4 导出(2K/1080P/720P、24/30/60fps、音乐可选、横竖屏)→ 推送
90
- - [ ] **Step 6** 封面生成(4:3 / 3:4 / 16:9 多选多张)+ 四平台发布文案 → 推送
91
  - [ ] **Step 7** 手机竖屏适配、生产构建、整体验收 → 最终推送
92
 
93
  ## 五、进度日志
94
 
95
  - Step 1:计划已写入 README。
 
 
 
 
 
96
 
97
  ---
98
 
 
83
  ## 四、实施步骤(每完成一步推送一次到本 Space)
84
 
85
  - [x] **Step 1** 编写计划(本文件)→ 推送
86
+ - [x] **Step 2** 文案定稿 + 旁白 TTS 生成 + 字体子集化 → 推送
87
+ - [x] **Step 3** 渲染引擎与全部场景(横竖屏)→ 推送
88
+ - [x] **Step 4** 音乐、音效合成与播放器(播放/暂停/拖动/章节/全屏)→ 推送
89
+ - [x] **Step 5** 浏览器本地 MP4 导出(2K/1080P/720P、24/30/60fps、音乐可选、横竖屏)→ 推送
90
+ - [x] **Step 6** 封面生成(4:3 / 3:4 / 16:9 多选多张)+ 四平台发布文案 → 推送
91
  - [ ] **Step 7** 手机竖屏适配、生产构建、整体验收 → 最终推送
92
 
93
  ## 五、进度日志
94
 
95
  - Step 1:计划已写入 README。
96
+ - Step 2:完成 40 句原创解说文案(6 章,约 5 分 46 秒旁白);神经网络 TTS 生成旁白,古文引文放慢语速,并对“輮、槁暴、参省、中绳、知明、跂、没”等多音/生僻字做读音校正;字体(霞鹜文楷、马善政毛笔楷书、思源宋体、刘建毛草)按实际用字子集化,共约 0.9 MB,自托管。
97
+ - Step 3:渲染引擎与 37 个镜头全部完成,横屏 / 竖屏两套构图;墨晕遮罩转场、竖排引文 + 乌丝栏 + 朱笔圈点、逐字随旁白显现、电影字幕、胶片颗粒、暗角、缓推运镜。
98
+ - Step 4:配乐(古琴拨弦模型 + 泛音 + 箫 + 低音铺底 + 卷积混响,旁白处自动闪避)与 16 种程序化音效;为加快加载,构建时把同一份合成配乐预渲染为 mp3(浏览器内实时合成作为后备)。播放器:音频时钟同步、拖动、章节跳转、键盘控制、全屏(含手机伪全屏)。
99
+ - Step 5:浏览器本地导出 MP4:WebCodecs H.264(不支持时依次回退 HEVC / VP9 / AV1)+ AAC(无原生 AAC 时自动加载 WASM AAC 编码器),2K / 1080P / 720P × 24 / 30 / 60fps × 横 / 竖屏 × 背景音乐可选;大文件可边渲染边写盘。已在无头浏览器实测 1080×1920@60fps 导出并解码校验通过。
100
+ - Step 6:5 套原创封面 × 4:3 / 3:4 / 16:9 多选批量下载;小红书 / 抖音 / 视频号 / B站 各 3 个标题(实时字数校验)+ 描述 + 话题,一键复制;B站描述自动附章节时间戳。
101
 
102
  ---
103
 
quanxue-src/package.json ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "frontend",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "node scripts/check-env.cjs vite",
8
+ "build": "node scripts/check-env.cjs npm run build:client && npm run build:server",
9
+ "build:client": "vite build --outDir dist/client",
10
+ "build:server": "vite build --ssr src/entry-server.tsx --outDir dist/server",
11
+ "lint": "eslint .",
12
+ "preview": "vite preview",
13
+ "type-check": "tsc --noEmit --incremental"
14
+ },
15
+ "dependencies": {
16
+ "@hookform/resolvers": "5.2.2",
17
+ "@mediabunny/aac-encoder": "1.62.1",
18
+ "@radix-ui/react-accordion": "1.2.12",
19
+ "@radix-ui/react-aspect-ratio": "1.1.8",
20
+ "@radix-ui/react-avatar": "1.1.11",
21
+ "@radix-ui/react-checkbox": "1.3.3",
22
+ "@radix-ui/react-collapsible": "1.1.12",
23
+ "@radix-ui/react-context-menu": "2.2.16",
24
+ "@radix-ui/react-dialog": "1.1.15",
25
+ "@radix-ui/react-dropdown-menu": "2.1.16",
26
+ "@radix-ui/react-hover-card": "1.1.15",
27
+ "@radix-ui/react-label": "2.1.8",
28
+ "@radix-ui/react-menubar": "1.1.16",
29
+ "@radix-ui/react-navigation-menu": "1.2.14",
30
+ "@radix-ui/react-popover": "1.1.15",
31
+ "@radix-ui/react-progress": "1.1.8",
32
+ "@radix-ui/react-radio-group": "1.3.8",
33
+ "@radix-ui/react-scroll-area": "1.2.10",
34
+ "@radix-ui/react-select": "2.2.6",
35
+ "@radix-ui/react-separator": "1.1.8",
36
+ "@radix-ui/react-slider": "1.3.6",
37
+ "@radix-ui/react-slot": "1.2.4",
38
+ "@radix-ui/react-switch": "1.2.6",
39
+ "@radix-ui/react-tabs": "1.1.13",
40
+ "@radix-ui/react-toast": "1.2.15",
41
+ "@radix-ui/react-toggle": "1.1.10",
42
+ "@radix-ui/react-toggle-group": "1.1.11",
43
+ "@radix-ui/react-tooltip": "1.2.8",
44
+ "@surf-ai/theme": "latest",
45
+ "@tanstack/query-core": "5.94.5",
46
+ "@tanstack/react-query": "5.94.5",
47
+ "class-variance-authority": "0.7.1",
48
+ "clsx": "2.1.1",
49
+ "cmdk": "1.1.1",
50
+ "date-fns": "4.1.0",
51
+ "echarts": "5.6.0",
52
+ "echarts-for-react": "3.0.6",
53
+ "embla-carousel-react": "8.6.0",
54
+ "lucide-react": "0.454.0",
55
+ "mediabunny": "^1.62.1",
56
+ "next-themes": "0.4.6",
57
+ "react": "19.2.4",
58
+ "react-day-picker": "9.14.0",
59
+ "react-dom": "19.2.4",
60
+ "react-hook-form": "7.72.0",
61
+ "react-resizable-panels": "4.7.6",
62
+ "scheduler": "0.27.0",
63
+ "sonner": "1.7.4",
64
+ "tailwind-merge": "2.6.1",
65
+ "vaul": "1.1.2",
66
+ "zod": "3.25.76"
67
+ },
68
+ "devDependencies": {
69
+ "@types/react": "19.2.14",
70
+ "@types/react-dom": "19.2.3",
71
+ "@types/node": "22.19.15",
72
+ "@eslint/js": "9.39.4",
73
+ "@vitejs/plugin-react": "4.7.0",
74
+ "@tailwindcss/vite": "4.2.2",
75
+ "eslint": "9.39.4",
76
+ "eslint-plugin-react-hooks": "5.2.0",
77
+ "eslint-plugin-react-refresh": "0.4.26",
78
+ "globals": "16.5.0",
79
+ "tailwindcss": "4.2.2",
80
+ "tw-animate-css": "1.4.0",
81
+ "typescript-eslint": "8.57.1",
82
+ "typescript": "5.9.3",
83
+ "vite": "6.4.2"
84
+ }
85
+ }
quanxue-src/public/README.md ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 运行时资源(旁白 mp3、配乐 mp3、字体子集 woff2)与构建产物一起放在 `../quanxue/quanxue/` 目录下,这里不重复存放。
2
+ 重新生成:`python3 -I scripts/quanxue/gen_tts.py`、`python3 -I scripts/quanxue/gen_fonts.py <字体源目录>`、`python3 -I scripts/quanxue/render_music.py`。
quanxue-src/quanxue.html ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
+ <meta name="theme-color" content="#0b0a08" />
7
+ <meta name="description" content="荀子《劝学》课文精讲:网页实时渲染的水墨动画视频,含旁白、古琴配乐与音效;支持浏览器本地导出 MP4、手机竖屏观看、封面与发布文案生成。" />
8
+ <title>劝学 · 荀子 | 课文精讲(网页实时渲染视频)</title>
9
+ <script>document.documentElement.classList.add('dark');</script>
10
+ <style>html,body{background:#0b0a08;margin:0}</style>
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ <script type="module" src="./src/entry-client.tsx"></script>
15
+ </body>
16
+ </html>
quanxue-src/scripts/quanxue/export_test.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """导出冒烟测试:python3 -I scripts/quanxue/export_test.py 720P,30,0,6,0,1 /tmp/out.mp4"""
2
+ import asyncio, base64, sys
3
+ from playwright.async_api import async_playwright
4
+ arg, out = sys.argv[1], sys.argv[2]
5
+ async def main():
6
+ async with async_playwright() as p:
7
+ b = await p.chromium.launch(channel=sys.argv[3] if len(sys.argv) > 3 else None)
8
+ pg = await b.new_page()
9
+ pg.on("pageerror", lambda e: print("PAGEERR", e))
10
+ await pg.goto(f"http://localhost:5173/?exporttest={arg}")
11
+ await pg.wait_for_function("window.__done === true", timeout=590000)
12
+ st = (await pg.evaluate("window.__stats"))[0]
13
+ print(st)
14
+ if "bytes" in st:
15
+ size = 4 * 1024 * 1024; data = bytearray()
16
+ for i in range((st["bytes"] + size - 1) // size):
17
+ data += base64.b64decode(await pg.evaluate(f"window.__chunk({i}, {size})"))
18
+ open(out, "wb").write(data)
19
+ await b.close()
20
+ asyncio.run(main())
quanxue-src/scripts/quanxue/gen_fonts.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """字体子集化:扫描 src/quanxue 与 App.tsx 中出现的所有字符,裁剪出极小的 woff2 字体,自托管。
2
+ 用法: python3 -I scripts/quanxue/gen_fonts.py /tmp/fontsrc
3
+ """
4
+ import os, re, sys, glob
5
+ from fontTools import subset
6
+ from fontTools.ttLib import TTFont
7
+
8
+ ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
9
+ SRC_DIR = sys.argv[1] if len(sys.argv) > 1 else "/tmp/fontsrc"
10
+ OUT = os.path.join(ROOT, "public/quanxue/fonts")
11
+ FONTS = {
12
+ "qx-kai": "LXGWWenKai-Regular.ttf", # 霞鹜文楷(引文、字幕,覆盖生僻字)
13
+ "qx-brush": "MaShanZheng-Regular.ttf", # 毛笔楷书(大标题)
14
+ "qx-cao": "LiuJianMaoCao-Regular.ttf", # 草书(大背景字)
15
+ "qx-song": "NotoSerifSC[wght].ttf", # 思源宋体(正文、字幕,可变字重)
16
+ }
17
+
18
+ chars = set(chr(c) for c in range(0x20, 0x7F))
19
+ chars |= set("·—–…“”‘’《》〈〉「」『』【】、,。;:?!()〇")
20
+ files = glob.glob(os.path.join(ROOT, "src/quanxue/**/*.*"), recursive=True) + [os.path.join(ROOT, "src/App.tsx")]
21
+ for f in files:
22
+ if f.endswith((".ts", ".tsx", ".json", ".css")):
23
+ if f.endswith("voice.json"):
24
+ continue
25
+ txt = open(f, encoding="utf-8").read()
26
+ chars |= set(ch for ch in txt if ord(ch) > 0x2000)
27
+ text = "".join(sorted(chars))
28
+ os.makedirs(OUT, exist_ok=True)
29
+ for name, fn in FONTS.items():
30
+ font = TTFont(os.path.join(SRC_DIR, fn))
31
+ cmap = font.getBestCmap()
32
+ opts = subset.Options()
33
+ opts.flavor = "woff2"
34
+ opts.layout_features = ["*"]
35
+ opts.name_IDs = ["*"]
36
+ sub = subset.Subsetter(opts)
37
+ sub.populate(text="荀性学假积止" if name == "qx-cao" else text)
38
+ sub.subset(font)
39
+ out = os.path.join(OUT, f"{name}.woff2")
40
+ font.flavor = "woff2"
41
+ font.save(out)
42
+ missing = [c for c in text if ord(c) not in cmap and ord(c) > 0x2E80]
43
+ print(name, os.path.getsize(out) // 1024, "KB", "missing:", "".join(missing[:40]))
44
+ print("chars:", len(text))
quanxue-src/scripts/quanxue/gen_tts.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """旁白生成:读取 src/quanxue/script.json,逐句合成 mp3,并记录时长与逐词时间戳。
2
+ 用法: python3 -I scripts/quanxue/gen_tts.py [--force]
3
+ """
4
+ import asyncio, json, os, sys
5
+ import edge_tts
6
+ from mutagen.mp3 import MP3
7
+
8
+ ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
9
+ SCRIPT = os.path.join(ROOT, "src/quanxue/script.json")
10
+ OUT_DIR = os.path.join(ROOT, "public/quanxue/voice")
11
+ META = os.path.join(ROOT, "src/quanxue/voice.json")
12
+ VOICE = "zh-CN-YunjianNeural"
13
+ RATE = {"say": "-6%", "quote": "-20%"}
14
+ PITCH = {"say": "-2Hz", "quote": "-4Hz"}
15
+ FORCE = "--force" in sys.argv
16
+
17
+
18
+ async def synth(line):
19
+ path = os.path.join(OUT_DIR, f"{line['id']}.mp3")
20
+ text = line.get("tts") or line["text"]
21
+ words = []
22
+ if FORCE or not os.path.exists(path) or not os.path.exists(path + ".json"):
23
+ for attempt in range(4):
24
+ try:
25
+ com = edge_tts.Communicate(text, VOICE, rate=RATE[line["kind"]], pitch=PITCH[line["kind"]], boundary="WordBoundary")
26
+ audio = bytearray()
27
+ words = []
28
+ async for chunk in com.stream():
29
+ if chunk["type"] == "audio":
30
+ audio.extend(chunk["data"])
31
+ elif chunk["type"] == "WordBoundary":
32
+ words.append({"o": round(chunk["offset"] / 1e7, 3), "d": round(chunk["duration"] / 1e7, 3), "t": chunk["text"]})
33
+ open(path, "wb").write(audio)
34
+ json.dump(words, open(path + ".json", "w"), ensure_ascii=False)
35
+ break
36
+ except Exception as e: # network hiccup → retry
37
+ print("retry", line["id"], e)
38
+ await asyncio.sleep(2)
39
+ words = json.load(open(path + ".json"))
40
+ dur = MP3(path).info.length
41
+ return line["id"], {"dur": round(dur, 3), "words": words}
42
+
43
+
44
+ async def main():
45
+ os.makedirs(OUT_DIR, exist_ok=True)
46
+ data = json.load(open(SCRIPT, encoding="utf-8"))
47
+ lines = [l for c in data["chapters"] for l in c["lines"]]
48
+ sem = asyncio.Semaphore(4)
49
+
50
+ async def run(l):
51
+ async with sem:
52
+ return await synth(l)
53
+
54
+ res = await asyncio.gather(*[run(l) for l in lines])
55
+ meta = {k: v for k, v in res}
56
+ json.dump(meta, open(META, "w", encoding="utf-8"), ensure_ascii=False, indent=0)
57
+ total = sum(v["dur"] for v in meta.values())
58
+ print(f"{len(meta)} lines, narration total {total:.1f}s")
59
+
60
+
61
+ asyncio.run(main())
quanxue-src/scripts/quanxue/page_test.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """页面冒烟测试:加载、播放、切换竖屏、检查控制台错误"""
2
+ import asyncio, sys
3
+ from playwright.async_api import async_playwright
4
+
5
+ async def main():
6
+ async with async_playwright() as p:
7
+ b = await p.chromium.launch(args=["--autoplay-policy=no-user-gesture-required"])
8
+ for vp in [{"width": 1440, "height": 900}, {"width": 390, "height": 844}]:
9
+ pg = await b.new_page(viewport=vp)
10
+ logs = []
11
+ pg.on("console", lambda m: logs.append(f"{m.type}: {m.text}") if m.type in ("error", "warning") else None)
12
+ pg.on("pageerror", lambda e: logs.append("PAGEERR " + str(e)))
13
+ await pg.goto("http://localhost:5173/")
14
+ await pg.wait_for_timeout(6000)
15
+ txt = await pg.evaluate("document.body.innerText.slice(0, 300)")
16
+ print(vp, "TEXT:", txt.replace("\n", " | ")[:300])
17
+ await pg.click("button[aria-label=播放]")
18
+ await pg.wait_for_timeout(3000)
19
+ t = await pg.evaluate("document.querySelector('.tabular-nums')?.innerText")
20
+ print("time after play:", t)
21
+ box = await pg.evaluate("(()=>{const c=document.querySelector('canvas');const r=c.getBoundingClientRect();return [r.width,r.height,c.width,c.height]})()")
22
+ print("canvas css/px:", box)
23
+ imgs = await pg.evaluate("document.querySelectorAll('#cover img').length")
24
+ print("cover previews:", imgs)
25
+ await pg.screenshot(path=f"/tmp/page_{vp['width']}.png", full_page=True)
26
+ for l in logs[:15]: print(" ", l)
27
+ await pg.close()
28
+ await b.close()
29
+ asyncio.run(main())
quanxue-src/scripts/quanxue/render_music.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """把程序化合成的配乐预渲染为 mp3(加快网页加载):python3 -I scripts/quanxue/render_music.py"""
2
+ import asyncio, base64, os
3
+ import lameenc
4
+ from playwright.async_api import async_playwright
5
+
6
+ ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7
+ OUT = os.path.join(ROOT, "public/quanxue/music.mp3")
8
+
9
+
10
+ async def main():
11
+ async with async_playwright() as p:
12
+ b = await p.chromium.launch()
13
+ pg = await b.new_page()
14
+ await pg.goto("http://localhost:5173/?musicdump=1")
15
+ await pg.wait_for_function("window.__done === true", timeout=600000)
16
+ st = (await pg.evaluate("window.__stats"))[0]
17
+ n, sr = st["bytes"], st["sr"]
18
+ size = 4 * 1024 * 1024
19
+ enc = lameenc.Encoder()
20
+ enc.set_bit_rate(128); enc.set_in_sample_rate(sr); enc.set_channels(2); enc.set_quality(2)
21
+ out = bytearray()
22
+ for i in range((n + size - 1) // size):
23
+ out += enc.encode(base64.b64decode(await pg.evaluate(f"window.__chunk({i}, {size})")))
24
+ out += enc.flush()
25
+ open(OUT, "wb").write(out)
26
+ print("music.mp3", len(out) // 1024, "KB", sr, "Hz")
27
+ await b.close()
28
+
29
+ asyncio.run(main())
quanxue-src/scripts/quanxue/shot.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """QA 截图:python3 -I scripts/quanxue/shot.py <out.png> <times,comma> [l|p]"""
2
+ import sys, asyncio
3
+ from playwright.async_api import async_playwright
4
+
5
+ out, ts = sys.argv[1], sys.argv[2]
6
+ o = sys.argv[3] if len(sys.argv) > 3 else 'l'
7
+
8
+
9
+ async def main():
10
+ async with async_playwright() as p:
11
+ b = await p.chromium.launch(args=["--use-gl=swiftshader", "--enable-unsafe-swiftshader"])
12
+ pg = await b.new_page(viewport={"width": 960 if o == 'l' else 540, "height": 540})
13
+ logs = []
14
+ pg.on("console", lambda m: logs.append(m.text) if m.type in ("error", "warning") else None)
15
+ pg.on("pageerror", lambda e: logs.append("PAGEERR " + str(e)))
16
+ await pg.goto(f"http://localhost:5173/?still={ts}&o={o}" if ts != "audio" else "http://localhost:5173/?audiotest=1")
17
+ try:
18
+ await pg.wait_for_function("window.__done === true", timeout=300000)
19
+ except Exception as e:
20
+ print("timeout", e)
21
+ st = await pg.evaluate("window.__stats")
22
+ for r in (st or []):
23
+ print(r)
24
+ if out != '-':
25
+ el = await pg.query_selector("canvas")
26
+ if el:
27
+ await el.screenshot(path=out)
28
+ for l in logs[:20]:
29
+ print(l)
30
+ await b.close()
31
+
32
+ asyncio.run(main())
quanxue-src/src/App.tsx ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useEffect, useState } from 'react'
2
+ import { BookOpen, Clapperboard, Image as ImageIcon, Send } from 'lucide-react'
3
+ import './quanxue/quanxue.css'
4
+ import { Player, type Orient } from './quanxue/ui/Player'
5
+ import { ExportPanel } from './quanxue/ui/ExportPanel'
6
+ import { CoverPanel } from './quanxue/ui/CoverPanel'
7
+ import { PublishPanel } from './quanxue/ui/PublishPanel'
8
+ import { Transcript } from './quanxue/ui/Transcript'
9
+ import { DURATION, TL } from './quanxue/timeline'
10
+ import { fmtTime } from './quanxue/ui/store'
11
+ import { ExportTest, MusicDump, Still } from './quanxue/dev'
12
+
13
+ const isPhonePortrait = () => typeof window !== 'undefined' && window.matchMedia('(max-width: 820px) and (orientation: portrait)').matches
14
+
15
+ function Section({ id, icon, title, sub, children }: { id: string; icon: React.ReactNode; title: string; sub: string; children: React.ReactNode }) {
16
+ return (
17
+ <section id={id} className="scroll-mt-20 rounded-2xl border border-[#cfa961]/12 bg-gradient-to-b from-white/[0.035] to-white/[0.01] p-5 sm:p-7">
18
+ <header className="flex items-end gap-3 mb-6">
19
+ <span className="text-[#cfa961]">{icon}</span>
20
+ <h2 className="qx-song text-xl sm:text-2xl font-semibold tracking-[0.15em] text-[#efe6d2]">{title}</h2>
21
+ <span className="text-xs text-[#9d927f] tracking-wider pb-1 hidden sm:inline">{sub}</span>
22
+ </header>
23
+ {children}
24
+ </section>
25
+ )
26
+ }
27
+
28
+ function Main() {
29
+ const [orient, setOrientState] = useState<Orient>(() => (isPhonePortrait() ? 'portrait' : 'landscape'))
30
+ const [manual, setManual] = useState(false)
31
+ const [seekReq, setSeekReq] = useState({ t: 0, n: 0 })
32
+ const setOrient = (o: Orient) => { setManual(true); setOrientState(o) }
33
+ // 手机旋转时自动切换横竖屏(除非用户手动选择过)
34
+ useEffect(() => {
35
+ const mq = window.matchMedia('(max-width: 820px) and (orientation: portrait)')
36
+ const mq2 = window.matchMedia('(max-height: 520px) and (orientation: landscape)')
37
+ const f = () => { if (manual) return; if (mq.matches) setOrientState('portrait'); else if (mq2.matches) setOrientState('landscape') }
38
+ mq.addEventListener('change', f); mq2.addEventListener('change', f)
39
+ return () => { mq.removeEventListener('change', f); mq2.removeEventListener('change', f) }
40
+ }, [manual])
41
+ const seek = (t: number) => { setSeekReq((s) => ({ t, n: s.n + 1 })); window.scrollTo({ top: 0, behavior: 'smooth' }) }
42
+
43
+ const nav = [['watch', '观看'], ['script', '文稿'], ['export', '导出'], ['cover', '封面'], ['publish', '发布']]
44
+ return (
45
+ <div className="qx-root min-h-screen text-[#efe6d2]">
46
+ <nav className="sticky top-0 z-40 backdrop-blur-md bg-[#0b0a08]/75 border-b border-white/5">
47
+ <div className="max-w-6xl mx-auto px-4 h-14 flex items-center gap-3">
48
+ <span className="qx-seal">荀</span>
49
+ <span className="qx-brush text-2xl tracking-[0.25em]">劝学</span>
50
+ <span className="hidden md:inline text-xs text-[#9d927f] tracking-[0.25em]">课文精讲 · 网页实时渲染</span>
51
+ <div className="flex-1" />
52
+ {nav.map(([id, t]) => <a key={id} href={`#${id}`} className="text-sm px-2 sm:px-3 py-1.5 text-[#c9bfa9] hover:text-[#cfa961] tracking-widest">{t}</a>)}
53
+ </div>
54
+ </nav>
55
+
56
+ <main className="max-w-6xl mx-auto px-3 sm:px-4 pb-24">
57
+ <div id="watch" className="pt-6 sm:pt-10 scroll-mt-20">
58
+ <div className="flex flex-col sm:flex-row sm:items-end gap-1 sm:gap-4 mb-5 px-1">
59
+ <h1 className="qx-brush text-4xl sm:text-5xl tracking-[0.2em]">劝学<span className="text-[#9d927f] text-2xl sm:text-3xl tracking-[0.1em] ml-3">· 荀子</span></h1>
60
+ <p className="text-sm text-[#9d927f] tracking-wider sm:pb-2">从“性恶论”到“化性起伪”,读懂学习的本质 · 时长 {fmtTime(DURATION)}</p>
61
+ </div>
62
+ <Player orient={orient} setOrient={setOrient} seekReq={seekReq} />
63
+ <div className="mt-4 flex gap-2 overflow-x-auto pb-1 qx-noscroll">
64
+ {TL.chapters.map((c) => (
65
+ <button key={c.id} onClick={() => setSeekReq((s) => ({ t: c.start + 0.01, n: s.n + 1 }))} className="shrink-0 flex items-center gap-2 px-3 py-2 rounded-lg border border-white/10 hover:border-[#cfa961]/50 bg-white/[0.02] transition">
66
+ <span className="qx-brush text-lg text-[#b8392b]">{c.no}</span>
67
+ <span className="text-sm text-[#e2d6bd] whitespace-nowrap">{c.title.replace(/\s/g, '')}</span>
68
+ <span className="text-[11px] text-[#7d7363] tabular-nums">{fmtTime(c.start)}</span>
69
+ </button>
70
+ ))}
71
+ </div>
72
+ </div>
73
+
74
+ <div className="mt-10 flex flex-col gap-8">
75
+ <Section id="script" icon={<BookOpen size={22} />} title="解说文稿" sub="点击任意一句跳转播放">
76
+ <Transcript onSeek={seek} />
77
+ </Section>
78
+ <Section id="export" icon={<Clapperboard size={22} />} title="导出 MP4" sub="浏览器本地渲染 · 不上传任何数据">
79
+ <ExportPanel defaultPortrait={orient === 'portrait'} />
80
+ </Section>
81
+ <Section id="cover" icon={<ImageIcon size={22} />} title="封面生成" sub="4:3 · 3:4 · 16:9 多选 · 每个比例多套设计">
82
+ <CoverPanel />
83
+ </Section>
84
+ <Section id="publish" icon={<Send size={22} />} title="发布文案" sub="小红书 · 抖音 · 视频号 · 哔哩哔哩">
85
+ <PublishPanel />
86
+ </Section>
87
+ </div>
88
+ <footer className="mt-14 text-center text-xs text-[#6f6656] tracking-[0.2em] leading-loose">
89
+ 原文据《荀子·劝学》(统编版高中语文必修上册)<br />解说文案原创 · AI 配音 · 画面 / 古琴配乐 / 音效 均为程序化实时生成
90
+ </footer>
91
+ </main>
92
+ </div>
93
+ )
94
+ }
95
+
96
+ export default function App() {
97
+ if (typeof location !== 'undefined') {
98
+ if (location.search.includes('still=')) return <Still />
99
+ if (location.search.includes('musicdump')) return <MusicDump />
100
+ if (location.search.includes('exporttest')) return <ExportTest />
101
+ }
102
+ return <Main />
103
+ }
quanxue-src/src/entry-client.tsx ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './index.css'
2
+
3
+ // ---------------------------------------------------------------------------
4
+ // Cold-start guard: verify React is real BEFORE rendering.
5
+ //
6
+ // During Vite dep-optimization (cold start or after `npm install <pkg>`),
7
+ // Vite may serve placeholder "stub" modules where all React exports are
8
+ // undefined. Rendering with stub hooks causes "Cannot read properties of
9
+ // null (reading 'useState')".
10
+ //
11
+ // Strategy:
12
+ // 1. Dynamic-import React and check if useState is a function.
13
+ // 2. If stub → show a loading banner, schedule a reload with increasing
14
+ // delay, and do NOT mount any React tree (avoids the error entirely).
15
+ // 3. If real → dynamic-import App/ErrorBoundary and render normally.
16
+ // 4. Use createElement (not JSX) in this file so Vite doesn't inject a
17
+ // static `import { jsx } from 'react/jsx-dev-runtime'` which would
18
+ // itself be a stub and crash before our guard runs.
19
+ // ---------------------------------------------------------------------------
20
+
21
+ const RELOAD_KEY = '__dep_reload'
22
+ const MAX_RELOADS = 6
23
+ const RELOAD_WINDOW = 60_000 // 1 minute
24
+
25
+ function getReloads(): { c: number; t: number } {
26
+ try {
27
+ return JSON.parse(sessionStorage.getItem(RELOAD_KEY) || '{}') as { c: number; t: number }
28
+ } catch { return { c: 0, t: 0 } }
29
+ }
30
+
31
+ async function boot() {
32
+ const root = document.getElementById('root')!
33
+
34
+ try {
35
+ const React = await import('react')
36
+
37
+ // If useState is not a function, React is a dep-optimization stub
38
+ if (typeof React.useState !== 'function') throw new Error('dep-stub')
39
+
40
+ const { createElement } = React
41
+ const { createRoot, hydrateRoot } = await import('react-dom/client')
42
+ const { QueryClient, QueryClientProvider } = await import('@tanstack/react-query')
43
+ const { default: App } = await import('./App')
44
+ const { default: ErrorBoundary } = await import('./ErrorBoundary')
45
+
46
+ const queryClient = new QueryClient({
47
+ defaultOptions: { queries: {
48
+ refetchOnWindowFocus: false,
49
+ retry: 3,
50
+ retryDelay: (attempt) => Math.min(1000 * 2 ** attempt, 10000),
51
+ staleTime: 30_000,
52
+ } },
53
+ })
54
+
55
+ const children = createElement(ErrorBoundary, null,
56
+ createElement(QueryClientProvider, { client: queryClient },
57
+ createElement(App)
58
+ )
59
+ )
60
+
61
+ // Use hydrateRoot only when SSR rendered real app content. The scaffold's
62
+ // server entry intentionally returns a lightweight placeholder shell so
63
+ // SSR-incompatible libraries (for example echarts-for-react) cannot crash
64
+ // deploy-time render. Placeholder markup must be client-rendered, not hydrated.
65
+ const hasPlaceholder = !!root.querySelector('[data-surf-placeholder]')
66
+ if (root.childNodes.length > 0 && root.innerHTML !== '<!--ssr-outlet-->' && !hasPlaceholder) {
67
+ hydrateRoot(root, children)
68
+ } else {
69
+ root.innerHTML = ''
70
+ createRoot(root).render(children)
71
+ }
72
+
73
+ // React rendered successfully — signal to index.html fallback & reset counter
74
+ ;(window as any).__reactOk = true
75
+ sessionStorage.removeItem(RELOAD_KEY)
76
+
77
+ // Notify parent frame when real app content renders (not the placeholder).
78
+ // DO NOT REMOVE — the hosting app uses this to dismiss the loading overlay.
79
+ function notifyParentReady() {
80
+ if (!document.querySelector('[data-surf-placeholder]')) {
81
+ try { window.parent.postMessage({ type: 'surf-app-ready' }, '*') } catch { /* cross-origin — ignore */ }
82
+ }
83
+ }
84
+ notifyParentReady()
85
+ new MutationObserver(notifyParentReady).observe(root, { childList: true, subtree: true })
86
+ } catch {
87
+ // React is not ready — show loading banner and schedule reload
88
+ const prev = getReloads()
89
+ const count = (Date.now() - prev.t > RELOAD_WINDOW) ? 0 : prev.c
90
+
91
+ if (count < MAX_RELOADS) {
92
+ root.innerHTML = [
93
+ '<div style="padding:24px;text-align:center;font-family:system-ui,sans-serif">',
94
+ '<p style="color:#3b82f6;font-weight:600;margin:0 0 4px">Loading dependencies...</p>',
95
+ '<p style="color:#3b82f6;opacity:0.7;font-size:12px;margin:0">Reloading automatically</p>',
96
+ '</div>',
97
+ ].join('')
98
+ sessionStorage.setItem(RELOAD_KEY, JSON.stringify({ c: count + 1, t: Date.now() }))
99
+ // Increasing delay: 3s, 4s, 5s, ... gives Vite more time to finish
100
+ setTimeout(() => location.reload(), 3000 + count * 1000)
101
+ } else {
102
+ root.innerHTML = [
103
+ '<div style="padding:24px;text-align:center;font-family:system-ui,sans-serif">',
104
+ '<p style="color:#c0392b;font-weight:600;margin:0 0 4px">Failed to load dependencies</p>',
105
+ '<p style="color:#c0392b;opacity:0.8;font-size:12px;margin:0">Please refresh the page</p>',
106
+ '</div>',
107
+ ].join('')
108
+ }
109
+ }
110
+ }
111
+
112
+ boot()
quanxue-src/src/index.css ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700;900&family=Roboto+Mono:wght@400;500&display=swap');
2
+
3
+ @import "tailwindcss";
4
+ @import "tw-animate-css";
5
+
6
+ /* ===== Tailwind CSS 4 Theme — maps CSS vars to Tailwind tokens ===== */
7
+ @theme inline {
8
+ --color-background: var(--background);
9
+ --color-foreground: var(--foreground);
10
+ --color-card: var(--card);
11
+ --color-card-foreground: var(--card-foreground);
12
+ --color-popover: var(--popover);
13
+ --color-popover-foreground: var(--popover-foreground);
14
+ --color-primary: var(--primary);
15
+ --color-primary-foreground: var(--primary-foreground);
16
+ --color-secondary: var(--secondary);
17
+ --color-secondary-foreground: var(--secondary-foreground);
18
+ --color-muted: var(--muted);
19
+ --color-muted-foreground: var(--muted-foreground);
20
+ --color-accent: var(--accent);
21
+ --color-accent-foreground: var(--accent-foreground);
22
+ --color-destructive: var(--destructive);
23
+ --color-destructive-foreground: var(--destructive-foreground);
24
+ --color-border: var(--border);
25
+ --color-input: var(--input);
26
+ --color-ring: var(--ring);
27
+ --radius-sm: calc(var(--radius) - 4px);
28
+ --radius-md: calc(var(--radius) - 2px);
29
+ --radius-lg: var(--radius);
30
+ --radius-xl: calc(var(--radius) + 4px);
31
+ --animate-accordion-down: accordion-down 0.2s ease-out;
32
+ --animate-accordion-up: accordion-up 0.2s ease-out;
33
+
34
+ /* Surf Semantic — Background */
35
+ --color-bg-subtle: var(--bg-subtle);
36
+ --color-bg-subtle-hover: var(--bg-subtle-hover);
37
+ --color-bg-base: var(--bg-base);
38
+ --color-bg-base-opaque: var(--bg-base-opaque);
39
+ --color-bg-menu: var(--bg-menu);
40
+ --color-bg-chat: var(--bg-chat);
41
+ --color-bg-chat-nav: var(--bg-chat-nav);
42
+
43
+ /* Surf Semantic — Foreground */
44
+ --color-fg-base: var(--fg-base);
45
+ --color-fg-subtle: var(--fg-subtle);
46
+ --color-fg-muted: var(--fg-muted);
47
+ --color-fg-disabled: var(--fg-disabled);
48
+
49
+ /* Surf Semantic — Border */
50
+ --color-border-base: var(--border-base);
51
+ --color-border-strong: var(--border-strong);
52
+ --color-border-contrast: var(--border-contrast);
53
+ --color-border-focus: var(--border-focus);
54
+
55
+ /* Surf Brand */
56
+ --color-brand-100: var(--brand-100);
57
+ --color-brand-60: var(--brand-60);
58
+ --color-brand-30: var(--brand-30);
59
+ --color-brand-10: var(--brand-10);
60
+
61
+ /* Surf Visualizer (Chart/Status) */
62
+ --color-visualizer-rose-pop: var(--visualizer-rose-pop);
63
+ --color-visualizer-indigo-breeze: var(--visualizer-indigo-breeze);
64
+ --color-visualizer-emerald-mint: var(--visualizer-emerald-mint);
65
+ --color-visualizer-golden-amber: var(--visualizer-golden-amber);
66
+ --color-visualizer-royal-blue: var(--visualizer-royal-blue);
67
+ --color-visualizer-crimson-spark: var(--visualizer-crimson-spark);
68
+ --color-visualizer-aqua-glow: var(--visualizer-aqua-glow);
69
+ --color-visualizer-sunbeam-yellow: var(--visualizer-sunbeam-yellow);
70
+
71
+ /* Surf Tags */
72
+ --color-tag-blue-10: var(--tag-blue-10);
73
+ --color-tag-blue-100: var(--tag-blue-100);
74
+ --color-tag-yellow-10: var(--tag-yellow-10);
75
+ --color-tag-yellow-100: var(--tag-yellow-100);
76
+ --color-tag-purple-10: var(--tag-purple-10);
77
+ --color-tag-purple-100: var(--tag-purple-100);
78
+ --color-tag-cyan-10: var(--tag-cyan-10);
79
+ --color-tag-cyan-100: var(--tag-cyan-100);
80
+ --color-tag-pink-10: var(--tag-pink-10);
81
+ --color-tag-pink-100: var(--tag-pink-100);
82
+ --color-tag-orange-10: var(--tag-orange-10);
83
+ --color-tag-orange-100: var(--tag-orange-100);
84
+
85
+ /* Neutral */
86
+ --color-neutral-0: var(--neutral-0);
87
+ }
88
+
89
+ @keyframes accordion-down {
90
+ from { height: 0; }
91
+ to { height: var(--radix-accordion-content-height); }
92
+ }
93
+
94
+ @keyframes accordion-up {
95
+ from { height: var(--radix-accordion-content-height); }
96
+ to { height: 0; }
97
+ }
98
+
99
+ /* ===== Light Mode (default) ===== */
100
+ :root {
101
+ /* shadcn semantic tokens (Surf Light) */
102
+ --background: hsl(0 0% 100%);
103
+ --foreground: hsl(0 0% 13%);
104
+ --card: hsl(0 0% 100%);
105
+ --card-foreground: hsl(0 0% 13%);
106
+ --popover: hsl(0 0% 100%);
107
+ --popover-foreground: hsl(0 0% 13%);
108
+ --primary: hsl(339 100% 58%);
109
+ --primary-foreground: hsl(0 0% 100%);
110
+ --secondary: hsl(0 3% 95%);
111
+ --secondary-foreground: hsl(0 0% 13%);
112
+ --muted: hsl(0 3% 95%);
113
+ --muted-foreground: hsl(0 0% 48%);
114
+ --accent: hsl(0 3% 95%);
115
+ --accent-foreground: hsl(0 0% 13%);
116
+ --destructive: hsl(357 91% 55%);
117
+ --destructive-foreground: hsl(0 0% 100%);
118
+ --border: hsl(0 0% 91%);
119
+ --input: hsl(0 0% 91%);
120
+ --ring: #212121;
121
+ --radius: 0.5rem;
122
+
123
+ /* Surf Neutral Palette */
124
+ --neutral-0: #ffffff;
125
+ --neutral-50: #fafafa;
126
+ --neutral-100: #f5f4f4;
127
+ --neutral-200: #e7e7e7;
128
+ --neutral-300: #d8d8d8;
129
+ --neutral-400: #aaaaaa;
130
+ --neutral-500: #7a7a7a;
131
+ --neutral-600: #5b5b5b;
132
+ --neutral-700: #464646;
133
+ --neutral-800: #2a2a2a;
134
+ --neutral-900: #212121;
135
+ --neutral-950: #1b1b1b;
136
+ --neutral-1000: #101010;
137
+
138
+ /* Surf Brand */
139
+ --brand-100: #ff2882;
140
+ --brand-60: rgba(255, 40, 130, 0.6);
141
+ --brand-30: rgba(255, 40, 130, 0.3);
142
+ --brand-10: rgba(255, 40, 130, 0.1);
143
+
144
+ /* Surf Brand Extended */
145
+ --brand-seafoam: #b6cfd0;
146
+ --brand-dusty-teal: #6ba4b8;
147
+ --brand-black-aqua: #002f38;
148
+ --brand-deep-teal-blue: #07272d;
149
+
150
+ /* Surf Visualizer (Chart) Colors */
151
+ --visualizer-rose-pop: #fd4b96;
152
+ --visualizer-indigo-breeze: #6366f1;
153
+ --visualizer-emerald-mint: #10b981;
154
+ --visualizer-golden-amber: #f59e0b;
155
+ --visualizer-royal-blue: #1d4ed8;
156
+ --visualizer-crimson-spark: #ef4444;
157
+ --visualizer-aqua-glow: #06b6d4;
158
+ --visualizer-sunbeam-yellow: #facc15;
159
+
160
+ /* Surf Semantic Tokens (Light) */
161
+ --bg-subtle: rgba(42, 42, 42, 0.04);
162
+ --bg-subtle-hover: rgba(42, 42, 42, 0.06);
163
+ --bg-base: rgba(255, 255, 255, 0.88);
164
+ --bg-base-opaque: #ffffff;
165
+ --bg-menu: #ffffff;
166
+ --bg-chat: #fcfcfc;
167
+ --bg-chat-nav: #f4f4f4;
168
+ --fg-base: #212121;
169
+ --fg-subtle: #7a7a7a;
170
+ --fg-muted: #aaaaaa;
171
+ --fg-disabled: #d8d8d8;
172
+ --border-base: rgba(42, 42, 42, 0.04);
173
+ --border-strong: rgba(42, 42, 42, 0.08);
174
+ --border-contrast: rgba(42, 42, 42, 0.12);
175
+ --border-focus: rgba(42, 42, 42, 0.4);
176
+
177
+ /* Tag Colors */
178
+ --tag-blue-10: rgba(91, 181, 255, 0.1);
179
+ --tag-blue-100: #5bb5ff;
180
+ --tag-yellow-10: rgba(222, 195, 120, 0.1);
181
+ --tag-yellow-100: #dec378;
182
+ --tag-purple-10: rgba(144, 142, 184, 0.1);
183
+ --tag-purple-100: #908eb8;
184
+ --tag-cyan-10: rgba(116, 173, 164, 0.1);
185
+ --tag-cyan-100: #74ada4;
186
+ --tag-pink-10: rgba(184, 142, 167, 0.1);
187
+ --tag-pink-100: #b88ea7;
188
+ --tag-orange-10: rgba(184, 160, 142, 0.1);
189
+ --tag-orange-100: #b8a08e;
190
+
191
+ /* Surf Gradient Definitions (raw, mode-independent) */
192
+ --gradient-max-dark: linear-gradient(213deg, #8c421d 2%, #fbe67b 31%, #fcfbe7 53%, #f7d14e 77%, #d4a041 100%);
193
+ --gradient-max-light: linear-gradient(125deg, #8c421d 22%, #d2af00 47%, #cd9124 67%, #d4a041 88%);
194
+ --gradient-pro-dark: linear-gradient(213deg, #7a96ac 1%, #c5d6e2 27%, #eaeff3 47%, #c5d6e2 65%, #a3bccf 89%);
195
+ --gradient-pro-light: linear-gradient(129deg, #7a96ac 4%, #6d7f8d 27%, #9fb9ce 55%, #6d7f8d 90%);
196
+ --gradient-plus-dark: linear-gradient(214deg, #986732 0%, #a7825b 23%, #f6d0ab 45%, #a07043 66%, #9d774e 100%);
197
+ --gradient-plus-light: linear-gradient(129deg, #9e8976 5%, #7a5e50 19%, #f6d0ab 35%, #9d774e 49%, #c99b70 65%, #795f52 78%);
198
+ --gradient-upgrade-dark: linear-gradient(214deg, #ffedf3 0%, #ff9fbf 30%, #fd5d92 59%, #ffdab2 100%);
199
+ --gradient-upgrade-light: linear-gradient(32deg, #fc3bb2 6%, #f7906e 79%);
200
+ --gradient-new-function: linear-gradient(33deg, #6e86ff 17%, #ff2882 55%, #ff98a4 103%);
201
+ --gradient-suggestion: linear-gradient(32deg, #fd538c 4%, #5aa6e0 47%, #ffdab2 98%);
202
+ --gradient-g1: linear-gradient(189deg, #ffacc6 6%, #b6e0f5 99%);
203
+ --gradient-g2: linear-gradient(34deg, #9796f0 9%, #fbc7d4 84%);
204
+ --gradient-g3: linear-gradient(to right, #ed4264, #ffedbc);
205
+ --gradient-g4: linear-gradient(232deg, #fedc2a 4%, #dd5789 56%, #7a2c9e 104%);
206
+ --gradient-g5: linear-gradient(32deg, #fc3bb2 6%, #f7906e 79%);
207
+
208
+ /* Surf Gradients (semantic, auto-switch by mode) */
209
+ --gradient-max: var(--gradient-max-light);
210
+ --gradient-pro: var(--gradient-pro-light);
211
+ --gradient-plus: var(--gradient-plus-light);
212
+ --gradient-upgrade: var(--gradient-upgrade-light);
213
+
214
+ /* Spacing */
215
+ --spacing-2: 2px;
216
+ --spacing-4: 4px;
217
+ --spacing-6: 6px;
218
+ --spacing-8: 8px;
219
+ --spacing-10: 10px;
220
+ --spacing-12: 12px;
221
+ --spacing-16: 16px;
222
+ --spacing-24: 24px;
223
+ --spacing-32: 32px;
224
+ --spacing-40: 40px;
225
+ --spacing-64: 64px;
226
+ --spacing-96: 96px;
227
+ --spacing-128: 128px;
228
+
229
+ /* Border Radius */
230
+ --radius-2: 2px;
231
+ --radius-4: 4px;
232
+ --radius-6: 6px;
233
+ --radius-8: 8px;
234
+ --radius-10: 10px;
235
+ --radius-12: 12px;
236
+ --radius-16: 16px;
237
+ --radius-20: 20px;
238
+ --radius-24: 24px;
239
+ --radius-full: 999px;
240
+
241
+ /* Typography */
242
+ --font-family-header: "Lato", "PingFang SC", sans-serif;
243
+ --font-family-body: "Lato", "PingFang SC", sans-serif;
244
+ --font-family-code: "Roboto Mono", monospace;
245
+ }
246
+
247
+ /* ===== Dark Mode ===== */
248
+ .dark {
249
+ /* shadcn semantic tokens (Surf Dark) */
250
+ --background: hsl(0 0% 9%);
251
+ --foreground: hsl(0 0% 91%);
252
+ --card: hsl(0 0% 9%);
253
+ --card-foreground: hsl(0 0% 91%);
254
+ --popover: hsl(0 0% 15%);
255
+ --popover-foreground: hsl(0 0% 91%);
256
+ --primary: hsl(339 100% 58%);
257
+ --primary-foreground: hsl(0 0% 100%);
258
+ --secondary: hsl(0 0% 16%);
259
+ --secondary-foreground: hsl(0 0% 91%);
260
+ --muted: hsl(0 0% 16%);
261
+ --muted-foreground: hsl(0 0% 67%);
262
+ --accent: hsl(0 0% 16%);
263
+ --accent-foreground: hsl(0 0% 91%);
264
+ --destructive: hsl(359 100% 65%);
265
+ --destructive-foreground: hsl(0 0% 100%);
266
+ --border: hsl(0 0% 20%);
267
+ --input: hsl(0 0% 20%);
268
+ --ring: #e7e7e7;
269
+
270
+ /* Surf Gradients (Dark) */
271
+ --gradient-max: var(--gradient-max-dark);
272
+ --gradient-pro: var(--gradient-pro-dark);
273
+ --gradient-plus: var(--gradient-plus-dark);
274
+ --gradient-upgrade: var(--gradient-upgrade-dark);
275
+
276
+ /* Surf Semantic Tokens (Dark) */
277
+ --bg-subtle: rgba(255, 255, 255, 0.04);
278
+ --bg-subtle-hover: rgba(255, 255, 255, 0.12);
279
+ --bg-base: rgba(42, 42, 42, 0.8);
280
+ --bg-base-opaque: #171717;
281
+ --bg-menu: #252525;
282
+ --bg-chat: #101010;
283
+ --bg-chat-nav: #171717;
284
+ --fg-base: #e7e7e7;
285
+ --fg-subtle: #aaaaaa;
286
+ --fg-muted: #7a7a7a;
287
+ --fg-disabled: #5b5b5b;
288
+ --border-base: rgba(255, 255, 255, 0.04);
289
+ --border-strong: rgba(255, 255, 255, 0.08);
290
+ --border-contrast: rgba(255, 255, 255, 0.12);
291
+ --border-focus: rgba(255, 255, 255, 0.4);
292
+ }
293
+
294
+ @layer base {
295
+ *,
296
+ ::after,
297
+ ::before {
298
+ border-color: var(--color-border);
299
+ }
300
+ body {
301
+ background-color: var(--color-background);
302
+ color: var(--color-foreground);
303
+ font-family: "Lato", "PingFang SC", sans-serif;
304
+ -webkit-font-smoothing: antialiased;
305
+ -moz-osx-font-smoothing: grayscale;
306
+ }
307
+ }
308
+
309
+ @media (max-width: 768px) {
310
+ :root {
311
+ --spacing-96: 64px;
312
+ --spacing-128: 64px;
313
+ }
314
+ }
quanxue-src/src/quanxue/audio/engine.ts ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 音频引擎:旁白加载、实时播放调度(音频时钟为主时钟)、导出用 PCM 混音
2
+ import { TL, DURATION } from '../timeline'
3
+ import { assetUrl } from '../fonts'
4
+ import { renderMusic, MUSIC_SR } from './music'
5
+ import { sfxData, SFX_SR } from './sfx'
6
+
7
+ export const GAIN = { voice: 0.95, sfx: 0.62, music: 0.9 }
8
+
9
+ type Clip = { t: number; data: Float32Array; sr: number; gain: number }
10
+
11
+ export class AudioEngine {
12
+ voice = new Map<string, AudioBuffer>()
13
+ music: AudioBuffer | null = null
14
+ musicPromise: Promise<AudioBuffer> | null = null
15
+ ctx: AudioContext | null = null
16
+ private master: GainNode | null = null
17
+ private musicGain: GainNode | null = null
18
+ private nodes: AudioScheduledSourceNode[] = []
19
+ private t0 = 0
20
+ private off = 0
21
+ playing = false
22
+ musicOn = true
23
+ onMusicReady?: () => void
24
+
25
+ async loadVoices(onProgress?: (p: number) => void) {
26
+ const dec = new OfflineAudioContext(1, 1, 24000)
27
+ let done = 0
28
+ await Promise.all(TL.lines.map(async (l) => {
29
+ const res = await fetch(assetUrl(`voice/${l.id}.mp3`))
30
+ const buf = await dec.decodeAudioData(await res.arrayBuffer())
31
+ this.voice.set(l.id, buf)
32
+ onProgress?.(++done / TL.lines.length)
33
+ }))
34
+ }
35
+
36
+ loadMusic() {
37
+ if (!this.musicPromise) {
38
+ const fromFile = async () => {
39
+ const res = await fetch(assetUrl('music.mp3'))
40
+ if (!res.ok) throw new Error('no music file')
41
+ const dec = new OfflineAudioContext(2, 1, MUSIC_SR)
42
+ return dec.decodeAudioData(await res.arrayBuffer())
43
+ }
44
+ // 优先加载预渲染的配乐;失败时在浏览器内实时合成同一份配乐
45
+ this.musicPromise = fromFile().catch(() => renderMusic()).then((b) => {
46
+ this.music = b
47
+ if (this.playing && this.ctx) this.startMusicAt(this.time())
48
+ this.onMusicReady?.()
49
+ return b
50
+ })
51
+ }
52
+ return this.musicPromise
53
+ }
54
+
55
+ private ensureCtx() {
56
+ if (!this.ctx) {
57
+ const Ctor = window.AudioContext || (window as any).webkitAudioContext
58
+ this.ctx = new Ctor({ latencyHint: 'playback' })
59
+ const comp = this.ctx.createDynamicsCompressor()
60
+ comp.threshold.value = -4; comp.knee.value = 4; comp.ratio.value = 12; comp.attack.value = 0.003; comp.release.value = 0.2
61
+ this.master = this.ctx.createGain(); this.master.gain.value = 1
62
+ this.master.connect(comp); comp.connect(this.ctx.destination)
63
+ this.musicGain = this.ctx.createGain(); this.musicGain.gain.value = this.musicOn ? GAIN.music : 0
64
+ this.musicGain.connect(this.master)
65
+ }
66
+ return this.ctx
67
+ }
68
+
69
+ setMusic(on: boolean) {
70
+ this.musicOn = on
71
+ if (this.musicGain && this.ctx) this.musicGain.gain.setTargetAtTime(on ? GAIN.music : 0, this.ctx.currentTime, 0.1)
72
+ }
73
+
74
+ time() {
75
+ if (!this.playing || !this.ctx) return this.off
76
+ return Math.min(DURATION, this.off + (this.ctx.currentTime - this.t0))
77
+ }
78
+
79
+ private startMusicAt(pos: number) {
80
+ const ctx = this.ctx!
81
+ if (!this.music) return
82
+ const s = ctx.createBufferSource(); s.buffer = this.music
83
+ s.connect(this.musicGain!)
84
+ const now = ctx.currentTime
85
+ s.start(now + 0.02, Math.max(0, pos + 0.02))
86
+ this.nodes.push(s)
87
+ }
88
+
89
+ async play(from: number) {
90
+ const ctx = this.ensureCtx()
91
+ if (ctx.state !== 'running') await ctx.resume()
92
+ this.stopNodes()
93
+ this.off = from
94
+ const lead = 0.06
95
+ this.t0 = ctx.currentTime + lead
96
+ const at = (t: number) => this.t0 + (t - from)
97
+ for (const l of TL.lines) {
98
+ const b = this.voice.get(l.id)
99
+ if (!b || l.start + b.duration < from) continue
100
+ const s = ctx.createBufferSource(); s.buffer = b
101
+ const g = ctx.createGain(); g.gain.value = GAIN.voice
102
+ s.connect(g); g.connect(this.master!)
103
+ if (l.start >= from) s.start(at(l.start)); else s.start(this.t0, from - l.start)
104
+ this.nodes.push(s)
105
+ }
106
+ for (const c of TL.cues) {
107
+ const d = sfxData(c.type, c.seed ?? 1)
108
+ const dur = d.length / SFX_SR
109
+ if (c.t + dur < from) continue
110
+ const b = ctx.createBuffer(1, d.length, SFX_SR); b.copyToChannel(d as Float32Array<ArrayBuffer>, 0)
111
+ const s = ctx.createBufferSource(); s.buffer = b
112
+ const g = ctx.createGain(); g.gain.value = GAIN.sfx * (c.gain ?? 1)
113
+ s.connect(g); g.connect(this.master!)
114
+ if (c.t >= from) s.start(at(c.t)); else s.start(this.t0, from - c.t)
115
+ this.nodes.push(s)
116
+ }
117
+ if (this.music) {
118
+ const s = ctx.createBufferSource(); s.buffer = this.music
119
+ s.connect(this.musicGain!)
120
+ s.start(this.t0, from)
121
+ this.nodes.push(s)
122
+ }
123
+ this.playing = true
124
+ }
125
+
126
+ pause() {
127
+ this.off = this.time()
128
+ this.playing = false
129
+ this.stopNodes()
130
+ }
131
+
132
+ seek(t: number) {
133
+ this.off = Math.max(0, Math.min(DURATION, t))
134
+ if (this.playing) this.play(this.off)
135
+ }
136
+
137
+ private stopNodes() {
138
+ for (const n of this.nodes) { try { n.stop() } catch { /* already stopped */ } try { n.disconnect() } catch { /* ignore */ } }
139
+ this.nodes = []
140
+ }
141
+
142
+ // ---------------- 导出混音 ----------------
143
+ clips(withMusic: boolean): { clips: Clip[]; music: AudioBuffer | null } {
144
+ const clips: Clip[] = []
145
+ for (const l of TL.lines) {
146
+ const b = this.voice.get(l.id)
147
+ if (b) clips.push({ t: l.start, data: b.getChannelData(0), sr: b.sampleRate, gain: GAIN.voice })
148
+ }
149
+ for (const c of TL.cues) clips.push({ t: c.t, data: sfxData(c.type, c.seed ?? 1), sr: SFX_SR, gain: GAIN.sfx * (c.gain ?? 1) })
150
+ return { clips, music: withMusic ? this.music : null }
151
+ }
152
+ }
153
+
154
+ /** 混出 [start, start+n) 区间的立体声 PCM(sr 采样率) */
155
+ export function mixChunk(src: { clips: Clip[]; music: AudioBuffer | null }, start: number, n: number, sr: number): [Float32Array, Float32Array] {
156
+ const L = new Float32Array(n), R = new Float32Array(n)
157
+ const t0 = start / sr, t1 = (start + n) / sr
158
+ for (const c of src.clips) {
159
+ const cd = c.data.length / c.sr
160
+ if (c.t > t1 || c.t + cd < t0) continue
161
+ const ratio = c.sr / sr
162
+ const i0 = Math.max(0, Math.floor((c.t - t0) * sr)), i1 = Math.min(n, Math.ceil((c.t + cd - t0) * sr))
163
+ for (let i = i0; i < i1; i++) {
164
+ const p = ((start + i) / sr - c.t) * c.sr
165
+ const k = Math.floor(p), f = p - k
166
+ if (k < 0 || k + 1 >= c.data.length) continue
167
+ const v = (c.data[k] * (1 - f) + c.data[k + 1] * f) * c.gain
168
+ L[i] += v; R[i] += v
169
+ }
170
+ void ratio
171
+ }
172
+ if (src.music) {
173
+ const ml = src.music.getChannelData(0), mr = src.music.getChannelData(1)
174
+ for (let i = 0; i < n; i++) {
175
+ const p = ((start + i) / sr) * src.music.sampleRate
176
+ const k = Math.floor(p), f = p - k
177
+ if (k + 1 >= ml.length) break
178
+ L[i] += (ml[k] * (1 - f) + ml[k + 1] * f) * GAIN.music
179
+ R[i] += (mr[k] * (1 - f) + mr[k + 1] * f) * GAIN.music
180
+ }
181
+ }
182
+ // 柔和限幅
183
+ for (const ch of [L, R]) for (let i = 0; i < n; i++) {
184
+ const x = ch[i], a = Math.abs(x)
185
+ if (a > 0.85) ch[i] = Math.sign(x) * (0.85 + 0.15 * Math.tanh((a - 0.85) / 0.15))
186
+ }
187
+ return [L, R]
188
+ }
quanxue-src/src/quanxue/audio/music.ts ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 背景音乐:古琴(Karplus-Strong 拨弦 + 泛音)、箫、低音铺底、卷积混响;旁白处自动闪避
2
+ // 全部在 OfflineAudioContext 中确定性渲染,播放与导出使用同一份音乐
3
+ import { TL, DURATION } from '../timeline'
4
+ import { clamp, rng } from '../engine/util'
5
+
6
+ export const MUSIC_SR = 32000
7
+ const mtof = (m: number) => 440 * Math.pow(2, (m - 69) / 12)
8
+ const PENTA = [0, 2, 4, 7, 9] // 宫 商 角 徵 羽(D 宫)
9
+ const deg2midi = (d: number, base = 50) => base + 12 * Math.floor(d / 5) + PENTA[((d % 5) + 5) % 5]
10
+
11
+ function pluckData(f: number, dur: number, sr: number, seed: number, bright = 0.55) {
12
+ const n = Math.floor(dur * sr), out = new Float32Array(n)
13
+ const N = Math.max(2, Math.round(sr / f))
14
+ const buf = new Float32Array(N), r = rng(seed)
15
+ let prev = 0
16
+ for (let i = 0; i < N; i++) { prev = (1 - bright) * prev + bright * (r() * 2 - 1); buf[i] = prev }
17
+ const T60 = f < 120 ? 7 : f < 250 ? 5.5 : 4
18
+ const decay = Math.pow(10, -3 / (f * T60))
19
+ let idx = 0
20
+ for (let i = 0; i < n; i++) {
21
+ const a = buf[idx], b = buf[(idx + 1) % N]
22
+ out[i] = a
23
+ buf[idx] = decay * (0.5 * (a + b))
24
+ idx = (idx + 1) % N
25
+ }
26
+ // 指触噪声
27
+ for (let i = 0; i < Math.min(n, sr * 0.02); i++) out[i] += (r() * 2 - 1) * 0.25 * (1 - i / (sr * 0.02))
28
+ let m = 0
29
+ for (let i = 0; i < n; i++) m = Math.max(m, Math.abs(out[i]))
30
+ for (let i = 0; i < n; i++) out[i] /= m || 1
31
+ return out
32
+ }
33
+
34
+ function harmonicData(f: number, dur: number, sr: number) {
35
+ const n = Math.floor(dur * sr), out = new Float32Array(n)
36
+ for (let i = 0; i < n; i++) {
37
+ const t = i / sr
38
+ out[i] = (Math.sin(2 * Math.PI * f * t) + 0.25 * Math.sin(2 * Math.PI * f * 2 * t) * Math.exp(-t * 2) + 0.1 * Math.sin(2 * Math.PI * f * 3.01 * t) * Math.exp(-t * 4)) * Math.exp(-t / 0.9) * Math.min(1, t / 0.003)
39
+ }
40
+ return out
41
+ }
42
+
43
+ function makeIR(ctx: BaseAudioContext, sec: number) {
44
+ const n = Math.floor(sec * ctx.sampleRate), ir = ctx.createBuffer(2, n, ctx.sampleRate)
45
+ for (let ch = 0; ch < 2; ch++) {
46
+ const d = ir.getChannelData(ch), r = rng(91 + ch)
47
+ let y = 0
48
+ for (let i = 0; i < n; i++) {
49
+ const t = i / ctx.sampleRate
50
+ const a = 0.85 - 0.7 * (i / n)
51
+ y += a * ((r() * 2 - 1) - y)
52
+ d[i] = y * Math.exp(-t / 1.15) * Math.min(1, t / 0.012)
53
+ }
54
+ }
55
+ return ir
56
+ }
57
+
58
+ type Section = { start: number; end: number; level: number; root: number }
59
+ function sections(): Section[] {
60
+ const roots = [38, 35, 43, 45, 40, 38]
61
+ const out: Section[] = [{ start: 0, end: 9, level: 1, root: 38 }]
62
+ TL.chapters.forEach((c, i) => out.push({ start: c.start, end: c.end, level: 0.72, root: roots[i] }))
63
+ out.push({ start: TL.shots[TL.shots.length - 1].start, end: DURATION + 1, level: 1, root: 38 })
64
+ return out
65
+ }
66
+
67
+ /** 音乐总线电平曲线:段落强弱 × 旁白闪避 */
68
+ export function musicLevel(t: number) {
69
+ let lvl = 0.72
70
+ if (t < 9) lvl = 1
71
+ for (const s of TL.shots) if ((s.vis === 'card' || s.vis === 'endcard') && t >= s.start - 0.3 && t < s.end) lvl = s.vis === 'card' ? 0.95 : 1
72
+ const fin = TL.shots.find((s) => s.vis === 'finale')!
73
+ if (t > fin.start) lvl = Math.max(lvl, 0.9)
74
+ let duck = 0
75
+ for (const l of TL.lines) {
76
+ if (t < l.start - 0.8 || t > l.end + 1.0) continue
77
+ const a = clamp((t - (l.start - 0.45)) / 0.35), b = clamp(((l.end + 0.55) - t) / 0.45)
78
+ duck = Math.max(duck, Math.min(a, b))
79
+ }
80
+ return lvl * (1 - 0.62 * duck)
81
+ }
82
+
83
+ export async function renderMusic(): Promise<AudioBuffer> {
84
+ const D = DURATION + 1
85
+ const sr = MUSIC_SR
86
+ const ctx = new OfflineAudioContext(2, Math.ceil(D * sr), sr)
87
+ const bus = ctx.createGain()
88
+ bus.connect(ctx.destination)
89
+ // 闪避曲线
90
+ const step = 0.05, N = Math.ceil(D / step)
91
+ const curve = new Float32Array(N)
92
+ for (let i = 0; i < N; i++) curve[i] = musicLevel(i * step) * 1.35
93
+ bus.gain.setValueAtTime(curve[0], 0)
94
+ bus.gain.setValueCurveAtTime(curve, 0.001, D - 0.01)
95
+
96
+ const rev = ctx.createConvolver(); rev.buffer = makeIR(ctx, 4.5)
97
+ const wet = ctx.createGain(); wet.gain.value = 0.85
98
+ rev.connect(wet); wet.connect(bus)
99
+ // 琴音色:低频温暖、中频木质
100
+ const qin = ctx.createBiquadFilter(); qin.type = 'peaking'; qin.frequency.value = 240; qin.gain.value = 4; qin.Q.value = 0.9
101
+ const qinLp = ctx.createBiquadFilter(); qinLp.type = 'lowpass'; qinLp.frequency.value = 3800
102
+ qin.connect(qinLp)
103
+ const qinDry = ctx.createGain(); qinDry.gain.value = 0.7; qinLp.connect(qinDry); qinDry.connect(bus)
104
+ const qinWet = ctx.createGain(); qinWet.gain.value = 0.5; qinLp.connect(qinWet); qinWet.connect(rev)
105
+
106
+ const r = rng(2024)
107
+ const pluckCache = new Map<number, AudioBuffer>()
108
+ const getPluck = (m: number) => {
109
+ let b = pluckCache.get(m)
110
+ if (!b) { const d = pluckData(mtof(m), 6, sr, m * 13); b = ctx.createBuffer(1, d.length, sr); b.copyToChannel(d, 0); pluckCache.set(m, b) }
111
+ return b
112
+ }
113
+ const harmCache = new Map<number, AudioBuffer>()
114
+ const getHarm = (m: number) => {
115
+ let b = harmCache.get(m)
116
+ if (!b) { const d = harmonicData(mtof(m), 4, sr); b = ctx.createBuffer(1, d.length, sr); b.copyToChannel(d, 0); harmCache.set(m, b) }
117
+ return b
118
+ }
119
+
120
+ const note = (t: number, m: number, vel: number, opts: { harm?: boolean; slideTo?: number; pan?: number } = {}) => {
121
+ if (t < 0 || t > D - 1) return
122
+ const src = ctx.createBufferSource()
123
+ src.buffer = opts.harm ? getHarm(m) : getPluck(m)
124
+ const g = ctx.createGain(); g.gain.value = vel * (opts.harm ? 0.35 : 0.5)
125
+ const p = ctx.createStereoPanner(); p.pan.value = opts.pan ?? (r() - 0.5) * 0.5
126
+ src.connect(g); g.connect(p); p.connect(qin)
127
+ // 吟猱 / 绰注(滑音)
128
+ if (!opts.harm) {
129
+ const len = 64, cv = new Float32Array(len), dur = 3
130
+ const ratio = opts.slideTo !== undefined ? Math.pow(2, (opts.slideTo - m) / 12) : 1
131
+ for (let i = 0; i < len; i++) {
132
+ const tt = (i / (len - 1)) * dur
133
+ const slide = opts.slideTo !== undefined ? 1 + (ratio - 1) * clamp((tt - 0.35) / 0.45) : 1
134
+ const vib = 1 + 0.0045 * Math.sin(2 * Math.PI * 4.6 * tt) * clamp((tt - 0.4) / 0.6) * Math.exp(-tt / 2.5)
135
+ cv[i] = slide * vib
136
+ }
137
+ src.playbackRate.setValueCurveAtTime(cv, t, dur)
138
+ }
139
+ src.start(t)
140
+ src.stop(t + 6)
141
+ }
142
+
143
+ // ---- 铺底和声 ----
144
+ for (const s of sections()) {
145
+ const out = ctx.createGain(); out.gain.value = 0
146
+ const lp = ctx.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.value = 650; lp.Q.value = 0.6
147
+ out.connect(lp); lp.connect(bus)
148
+ const send = ctx.createGain(); send.gain.value = 0.5; lp.connect(send); send.connect(rev)
149
+ const voices: [number, number, OscillatorType][] = [[s.root, 0.05, 'sine'], [s.root + 7, 0.03, 'triangle'], [s.root + 12, 0.028, 'sine'], [s.root + 19, 0.012, 'triangle']]
150
+ voices.forEach(([m, a, type], i) => {
151
+ const o = ctx.createOscillator(); o.type = type; o.frequency.value = mtof(m)
152
+ const lfo = ctx.createOscillator(); lfo.frequency.value = 0.05 + i * 0.023
153
+ const lg = ctx.createGain(); lg.gain.value = 5; lfo.connect(lg); lg.connect(o.detune)
154
+ const g = ctx.createGain(); g.gain.value = a
155
+ o.connect(g); g.connect(out)
156
+ o.start(Math.max(0, s.start - 2)); o.stop(Math.min(D, s.end + 4)); lfo.start(Math.max(0, s.start - 2)); lfo.stop(Math.min(D, s.end + 4))
157
+ })
158
+ const a0 = Math.max(0, s.start - 1.5)
159
+ out.gain.setValueAtTime(0, a0)
160
+ out.gain.linearRampToValueAtTime(s.level, a0 + 3)
161
+ out.gain.setValueAtTime(s.level, Math.max(a0 + 3, s.end - 1))
162
+ out.gain.linearRampToValueAtTime(0, Math.min(D, s.end + 3.5))
163
+ }
164
+
165
+ // ---- 箫 ----
166
+ const noiseBuf = ctx.createBuffer(1, sr * 2, sr)
167
+ { const d = noiseBuf.getChannelData(0), rr = rng(5); for (let i = 0; i < d.length; i++) d[i] = rr() * 2 - 1 }
168
+ const xiao = (t: number, m: number, dur: number, vel = 1) => {
169
+ if (t > D - 1) return
170
+ const f = mtof(m)
171
+ const g = ctx.createGain(); g.gain.value = 0
172
+ const pan = ctx.createStereoPanner(); pan.pan.value = -0.15
173
+ g.connect(pan); pan.connect(bus)
174
+ const s2 = ctx.createGain(); s2.gain.value = 0.9; pan.connect(s2); s2.connect(rev)
175
+ const peak = 0.06 * vel
176
+ g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + 0.35); g.gain.setValueAtTime(peak, t + Math.max(0.4, dur - 0.7)); g.gain.linearRampToValueAtTime(0, t + dur)
177
+ const vib = ctx.createOscillator(); vib.frequency.value = 4.8
178
+ const vg = ctx.createGain(); vg.gain.setValueAtTime(0, t); vg.gain.linearRampToValueAtTime(f * 0.006, t + 0.9)
179
+ vib.connect(vg)
180
+ ;[[1, 1], [2, 0.12], [3, 0.04]].forEach(([h, a]) => {
181
+ const o = ctx.createOscillator(); o.frequency.value = f * h
182
+ vg.connect(o.frequency)
183
+ const og = ctx.createGain(); og.gain.value = a
184
+ o.connect(og); og.connect(g); o.start(t); o.stop(t + dur + 0.1)
185
+ })
186
+ const nz = ctx.createBufferSource(); nz.buffer = noiseBuf; nz.loop = true
187
+ const bp = ctx.createBiquadFilter(); bp.type = 'bandpass'; bp.frequency.value = f * 1.5; bp.Q.value = 1.2
188
+ const ng = ctx.createGain(); ng.gain.value = 0.18
189
+ nz.connect(bp); bp.connect(ng); ng.connect(g); nz.start(t); nz.stop(t + dur + 0.1)
190
+ vib.start(t); vib.stop(t + dur + 0.1)
191
+ }
192
+
193
+ // ---- 编排 ----
194
+ // 片头
195
+ note(1.62, 38, 1, { pan: 0 }); note(1.62, 50, 0.6, { harm: true, pan: 0.1 })
196
+ xiao(2.8, 69, 2.6, 1); xiao(5.3, 71, 1.2, 0.9); xiao(6.4, 69, 2.4, 0.9)
197
+ ;[[3.2, 57], [3.9, 59], [4.5, 62], [5.6, 64, 66], [7.2, 62]].forEach(([t, m, sl]) => note(t, m, 0.7, sl ? { slideTo: sl } : {}))
198
+ // 章节卡
199
+ TL.chapters.forEach((c, i) => {
200
+ note(c.start + 0.15, 38 + (i % 2 ? 7 : 0), 0.9, { pan: 0 })
201
+ note(c.start + 0.15, 62, 0.5, { harm: true })
202
+ xiao(c.start + 0.5, [74, 69, 71, 69, 66, 74][i], 2.9, 0.8)
203
+ })
204
+ // 正文:稀疏、留白的琴句
205
+ let t = 10.5
206
+ let deg = 5
207
+ while (t < DURATION - 10) {
208
+ const inCard = TL.shots.some((s) => s.vis === 'card' && t > s.start - 0.5 && t < s.end + 0.5)
209
+ if (inCard) { t += 1.2; continue }
210
+ const n = 3 + Math.floor(r() * 4)
211
+ for (let k = 0; k < n; k++) {
212
+ deg = Math.max(2, Math.min(11, deg + Math.round((r() - 0.5) * 4)))
213
+ const m = deg2midi(deg, 45)
214
+ const slide = r() < 0.25 ? deg2midi(deg + (r() < 0.5 ? 1 : -1), 45) : undefined
215
+ note(t, m, 0.42 + r() * 0.25, slide ? { slideTo: slide } : {})
216
+ if (r() < 0.18) note(t, m + 12, 0.25, { harm: true })
217
+ if (k === 0 && r() < 0.5) note(t, deg2midi(0, 38), 0.4, { pan: 0 })
218
+ t += 0.55 + r() * 0.9 + (k === n - 1 ? 0.6 : 0)
219
+ }
220
+ deg = r() < 0.5 ? 5 : 8
221
+ t += 3 + r() * 4
222
+ }
223
+ // 结尾
224
+ const fin = TL.shots.find((s) => s.vis === 'finale')!
225
+ const end = TL.shots[TL.shots.length - 1]
226
+ note(fin.start + 0.2, 38, 0.9, { pan: 0 })
227
+ xiao(fin.end - 3.2, 74, 4.5, 1)
228
+ ;[[end.start + 0.4, 62], [end.start + 1.3, 64], [end.start + 2.1, 69, 71], [end.start + 3.6, 66], [end.start + 4.6, 62]].forEach(([tt, m, sl]) => note(tt, m, 0.6, sl ? { slideTo: sl } : {}))
229
+ note(end.start + 4.6, 74, 0.4, { harm: true })
230
+ note(end.start + 4.6, 38, 0.8, { pan: 0 })
231
+ xiao(end.start + 1.0, 69, 3.2, 0.8)
232
+
233
+ return ctx.startRendering()
234
+ }
quanxue-src/src/quanxue/audio/sfx.ts ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 程序化音效:全部用 JS 直接合成 PCM(确定性),播放与导出共用
2
+ import type { SfxType } from '../timeline'
3
+ import { rng } from '../engine/util'
4
+
5
+ export const SFX_SR = 48000
6
+
7
+ class Biquad {
8
+ b0 = 1; b1 = 0; b2 = 0; a1 = 0; a2 = 0; x1 = 0; x2 = 0; y1 = 0; y2 = 0
9
+ set(type: 'lp' | 'hp' | 'bp', f: number, q: number, sr = SFX_SR) {
10
+ const w = (2 * Math.PI * Math.min(f, sr * 0.45)) / sr, cs = Math.cos(w), al = Math.sin(w) / (2 * q)
11
+ let b0, b1, b2
12
+ if (type === 'lp') { b0 = (1 - cs) / 2; b1 = 1 - cs; b2 = (1 - cs) / 2 }
13
+ else if (type === 'hp') { b0 = (1 + cs) / 2; b1 = -(1 + cs); b2 = (1 + cs) / 2 }
14
+ else { b0 = al; b1 = 0; b2 = -al }
15
+ const a0 = 1 + al
16
+ this.b0 = b0 / a0; this.b1 = b1 / a0; this.b2 = b2 / a0; this.a1 = (-2 * cs) / a0; this.a2 = (1 - al) / a0
17
+ return this
18
+ }
19
+ run(x: number) {
20
+ const y = this.b0 * x + this.b1 * this.x1 + this.b2 * this.x2 - this.a1 * this.y1 - this.a2 * this.y2
21
+ this.x2 = this.x1; this.x1 = x; this.y2 = this.y1; this.y1 = y
22
+ return y
23
+ }
24
+ }
25
+
26
+ const env = (t: number, a: number, d: number) => (t < a ? t / a : Math.exp(-(t - a) / d))
27
+
28
+ function make(dur: number, fn: (t: number, i: number, out: Float32Array) => number) {
29
+ const n = Math.floor(dur * SFX_SR), out = new Float32Array(n)
30
+ for (let i = 0; i < n; i++) out[i] = fn(i / SFX_SR, i, out)
31
+ // 去直流 + 末尾淡出
32
+ let m = 0
33
+ for (let i = 0; i < n; i++) m = Math.max(m, Math.abs(out[i]))
34
+ const fade = Math.min(n, SFX_SR * 0.05)
35
+ for (let i = 0; i < fade; i++) out[n - 1 - i] *= i / fade
36
+ return { data: out, peak: m }
37
+ }
38
+
39
+ function normalize(d: Float32Array, peak: number, target: number) {
40
+ if (peak <= 0) return d
41
+ const k = target / peak
42
+ for (let i = 0; i < d.length; i++) d[i] *= k
43
+ return d
44
+ }
45
+
46
+ function partials(t: number, list: [number, number, number][]) {
47
+ let s = 0
48
+ for (const [f, a, dec] of list) s += a * Math.sin(2 * Math.PI * f * t) * Math.exp(-t / dec)
49
+ return s
50
+ }
51
+
52
+ export function synthSfx(type: SfxType, seed = 1): Float32Array {
53
+ const r = rng(seed * 7919 + type.length * 31)
54
+ const noise = () => r() * 2 - 1
55
+ switch (type) {
56
+ case 'drop': {
57
+ let ph = 0
58
+ const { data, peak } = make(0.6, (t) => {
59
+ const f = 700 + 1300 * Math.min(1, t / 0.07)
60
+ ph += (2 * Math.PI * f) / SFX_SR
61
+ return Math.sin(ph) * env(t, 0.003, 0.06) + 0.3 * Math.sin(ph * 0.5) * env(t, 0.002, 0.03)
62
+ })
63
+ return normalize(data, peak, 0.6)
64
+ }
65
+ case 'boom': {
66
+ const lp = new Biquad().set('lp', 220, 0.7)
67
+ let ph = 0
68
+ const { data, peak } = make(4, (t) => {
69
+ const f = 38 + 30 * Math.exp(-t / 0.25)
70
+ ph += (2 * Math.PI * f) / SFX_SR
71
+ return Math.sin(ph) * env(t, 0.01, 1.1) + lp.run(noise()) * env(t, 0.005, 0.35) * 1.2
72
+ })
73
+ return normalize(data, peak, 0.95)
74
+ }
75
+ case 'brush': {
76
+ const bp = new Biquad(), hp = new Biquad().set('hp', 900, 0.7)
77
+ const { data, peak } = make(0.9, (t, i) => {
78
+ if (i % 32 === 0) bp.set('bp', 2200 + 3000 * Math.sin(Math.min(1, t / 0.6) * Math.PI), 1.2)
79
+ return bp.run(hp.run(noise())) * (t < 0.12 ? t / 0.12 : Math.exp(-(t - 0.12) / 0.22)) * (0.7 + 0.3 * Math.sin(t * 60))
80
+ })
81
+ return normalize(data, peak, 0.5)
82
+ }
83
+ case 'stamp':
84
+ case 'thud': {
85
+ const lp = new Biquad().set('lp', type === 'stamp' ? 700 : 400, 0.8)
86
+ let ph = 0
87
+ const { data, peak } = make(1.0, (t) => {
88
+ const f = (type === 'stamp' ? 70 : 52) + 90 * Math.exp(-t / 0.04)
89
+ ph += (2 * Math.PI * f) / SFX_SR
90
+ return Math.sin(ph) * env(t, 0.002, 0.12) + lp.run(noise()) * env(t, 0.001, 0.05) * 0.8
91
+ })
92
+ return normalize(data, peak, 0.9)
93
+ }
94
+ case 'bell': {
95
+ const f = 146.83
96
+ const { data, peak } = make(7, (t) => partials(t, [[f, 1, 3.2], [f * 1.004, 0.6, 3.6], [f * 2.76, 0.45, 1.6], [f * 5.4, 0.2, 0.7], [f * 8.93, 0.08, 0.35]]) * Math.min(1, t / 0.004))
97
+ return normalize(data, peak, 0.65)
98
+ }
99
+ case 'chime': {
100
+ const f = 1174.66
101
+ const { data, peak } = make(4, (t) => partials(t, [[f, 1, 1.6], [f * 1.003, 0.5, 1.8], [f * 2.4, 0.3, 0.6], [f * 3.9, 0.12, 0.3]]) * Math.min(1, t / 0.002))
102
+ return normalize(data, peak, 0.35)
103
+ }
104
+ case 'whoosh': {
105
+ const bp = new Biquad()
106
+ const dur = 1.2 + r() * 0.4
107
+ const { data, peak } = make(dur, (t, i) => {
108
+ const p = t / dur
109
+ if (i % 32 === 0) bp.set('bp', 300 + 2400 * Math.sin(p * Math.PI), 0.9)
110
+ return bp.run(noise()) * Math.pow(Math.sin(p * Math.PI), 2)
111
+ })
112
+ return normalize(data, peak, 0.4)
113
+ }
114
+ case 'creak': {
115
+ const bp1 = new Biquad().set('bp', 520, 6), bp2 = new Biquad().set('bp', 1150, 5)
116
+ let acc = 0
117
+ const { data, peak } = make(1.6, (t) => {
118
+ const rate = 28 + 18 * Math.sin(t * 3.1) + 10 * Math.sin(t * 7.3)
119
+ acc += rate / SFX_SR
120
+ let imp = 0
121
+ if (acc >= 1) { acc -= 1; imp = 1 }
122
+ const x = imp + noise() * 0.02
123
+ return (bp1.run(x) + 0.6 * bp2.run(x)) * Math.sin(Math.min(1, t / 1.6) * Math.PI)
124
+ })
125
+ return normalize(data, peak, 0.5)
126
+ }
127
+ case 'fire': {
128
+ const lp = new Biquad().set('lp', 500, 0.7), hp = new Biquad().set('hp', 1500, 0.7)
129
+ const { data, peak } = make(3.6, (t) => {
130
+ const crack = r() < 0.0009 ? noise() * 3 : 0
131
+ const w = Math.sin(Math.min(1, t / 3.6) * Math.PI)
132
+ return (lp.run(noise()) * 0.6 + hp.run(crack)) * w
133
+ })
134
+ return normalize(data, peak, 0.45)
135
+ }
136
+ case 'tick': {
137
+ const hp = new Biquad().set('hp', 2500, 0.7)
138
+ const k = 0.9 + r() * 0.2
139
+ const { data, peak } = make(0.35, (t) => hp.run(noise()) * env(t, 0.0005, 0.006) * 1.5 + partials(t, [[2400 * k, 0.5, 0.05], [3720 * k, 0.35, 0.035], [5150 * k, 0.2, 0.02], [180, 0.4, 0.04]]))
140
+ return normalize(data, peak, 0.6)
141
+ }
142
+ case 'rain': {
143
+ const lp = new Biquad().set('lp', 3800, 0.6), hp = new Biquad().set('hp', 400, 0.6)
144
+ const { data, peak } = make(4.5, (t) => {
145
+ const d = r() < 0.004 ? noise() * 2 : 0
146
+ return (hp.run(lp.run(noise())) * 0.5 + d) * Math.sin(Math.min(1, t / 4.5) * Math.PI)
147
+ })
148
+ return normalize(data, peak, 0.35)
149
+ }
150
+ case 'drip': {
151
+ let ph = 0
152
+ const hits = [0, 0.55, 1.25]
153
+ const { data, peak } = make(2.2, (t) => {
154
+ let s = 0
155
+ for (const h of hits) {
156
+ const tt = t - h
157
+ if (tt < 0) continue
158
+ const f = 900 + 900 * Math.min(1, tt / 0.05)
159
+ s += Math.sin(2 * Math.PI * f * tt) * env(tt, 0.002, 0.07)
160
+ }
161
+ ph += 0
162
+ return s
163
+ })
164
+ return normalize(data, peak, 0.45)
165
+ }
166
+ case 'wind': {
167
+ const lp = new Biquad()
168
+ const { data, peak } = make(4.5, (t, i) => {
169
+ if (i % 64 === 0) lp.set('bp', 350 + 500 * (0.5 + 0.5 * Math.sin(t * 1.3)) + 200 * Math.sin(t * 3.7), 0.8)
170
+ return lp.run(noise()) * Math.sin(Math.min(1, t / 4.5) * Math.PI)
171
+ })
172
+ return normalize(data, peak, 0.4)
173
+ }
174
+ case 'water': {
175
+ const lp = new Biquad().set('lp', 900, 0.7)
176
+ const { data, peak } = make(4, (t) => lp.run(noise()) * (0.5 + 0.5 * Math.sin(t * 2 * Math.PI * 0.8)) * Math.sin(Math.min(1, t / 4) * Math.PI))
177
+ return normalize(data, peak, 0.4)
178
+ }
179
+ case 'page': {
180
+ const hp = new Biquad().set('hp', 1800, 0.7)
181
+ const { data, peak } = make(0.7, (t) => hp.run(noise()) * (r() < 0.3 ? 1 : 0.3) * Math.sin(Math.min(1, t / 0.7) * Math.PI))
182
+ return normalize(data, peak, 0.35)
183
+ }
184
+ }
185
+ return new Float32Array(1)
186
+ }
187
+
188
+ const cache = new Map<string, Float32Array>()
189
+ export function sfxData(type: SfxType, seed = 1) {
190
+ const key = type + ':' + (['whoosh', 'tick', 'brush'].includes(type) ? seed % 4 : 0)
191
+ let d = cache.get(key)
192
+ if (!d) { d = synthSfx(type, ['whoosh', 'tick', 'brush'].includes(type) ? seed % 4 : 0); cache.set(key, d) }
193
+ return d
194
+ }
quanxue-src/src/quanxue/covers.ts ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 封面生成:多套原创设计 × 4:3 / 3:4 / 16:9
2
+ import { COL, F, background, brush, cached, dust, glow, hairline, inkBlob, makeCanvas, mountains, revealChar, rgba, scholar, seal, text, vignette, grain, type Ctx } from './engine/draw'
3
+ import { fbm2, lerp } from './engine/util'
4
+
5
+ export type Ratio = '4:3' | '3:4' | '16:9'
6
+ export const RATIO_DIM: Record<Ratio, [number, number]> = { '16:9': [1920, 1080], '4:3': [1440, 1080], '3:4': [1080, 1440] }
7
+
8
+ export type CoverDesign = { id: string; name: string; draw: (c: Ctx, W: number, H: number) => void }
9
+
10
+ function paperBg(c: Ctx, W: number, H: number) {
11
+ const tex = cached('paper', W, H, (g, w, h) => {
12
+ g.fillStyle = '#ece2cb'; g.fillRect(0, 0, w, h)
13
+ const sw = Math.ceil(w / 6), sh = Math.ceil(h / 6)
14
+ const s = makeCanvas(sw, sh), sc = s.getContext('2d')!, img = sc.createImageData(sw, sh)
15
+ for (let y = 0; y < sh; y++) for (let x = 0; x < sw; x++) {
16
+ const v = (fbm2(x / sw * 6, y / sh * 6 * (h / w)) + 1) / 2, i = (y * sw + x) * 4
17
+ img.data[i] = 236 - v * 26; img.data[i + 1] = 226 - v * 26; img.data[i + 2] = 203 - v * 30; img.data[i + 3] = 255
18
+ }
19
+ sc.putImageData(img, 0, 0); g.globalAlpha = 0.8; g.drawImage(s, 0, 0, w, h); g.globalAlpha = 1
20
+ for (let i = 0; i < 900; i++) { g.strokeStyle = `rgba(120,100,70,${Math.random() * 0.08})`; g.lineWidth = 0.6; const x = Math.random() * w, y = Math.random() * h, a = Math.random() * 6.28, l = 6 + Math.random() * 30; g.beginPath(); g.moveTo(x, y); g.quadraticCurveTo(x + Math.cos(a) * l * 0.5 + 4, y + Math.sin(a) * l * 0.5, x + Math.cos(a) * l, y + Math.sin(a) * l); g.stroke() }
21
+ const v = g.createRadialGradient(w / 2, h / 2, Math.min(w, h) * 0.3, w / 2, h / 2, Math.hypot(w, h) * 0.6)
22
+ v.addColorStop(0, 'rgba(0,0,0,0)'); v.addColorStop(1, 'rgba(80,60,30,0.28)')
23
+ g.fillStyle = v; g.fillRect(0, 0, w, h)
24
+ })
25
+ c.drawImage(tex, 0, 0, W, H)
26
+ }
27
+
28
+ const big = (c: Ctx, chars: string, x: number, y: number, size: number, vertical: boolean, color: string, fam = F.brush, lead = 1.08) => {
29
+ ;[...chars].forEach((ch, i) => revealChar(c, ch, vertical ? x : x + (i - (chars.length - 1) / 2) * size * lead, vertical ? y + (i - (chars.length - 1) / 2) * size * lead : y, size, fam, color, 1))
30
+ }
31
+
32
+ export const COVERS: CoverDesign[] = [
33
+ {
34
+ id: 'ink', name: '墨韵 · 主标题',
35
+ draw(c, W, H) {
36
+ const u = Math.min(W, H) / 1080, P = H > W
37
+ background(c, W, H)
38
+ mountains(c, W, H, 3, { seed: 3, alpha: 0.75, y: P ? 260 * u : 120 * u })
39
+ const X = P ? W / 2 : W * 0.42, Y = P ? H * 0.4 : H * 0.46
40
+ inkBlob(c, X, Y, Math.min(W, H) * 0.42, 11, '#51473a', 0.8, 0.3)
41
+ glow(c, X, Y, Math.min(W, H) * 0.5, COL.gold, 0.1)
42
+ const size = (P ? 330 : 300) * u
43
+ big(c, '劝学', X, Y, size, P, COL.paper)
44
+ seal(c, P ? X + size * 0.75 : X + size * 1.2, P ? Y + size * 0.95 : Y + size * 0.38, 110 * u, '荀子', 1, -0.04)
45
+ const tx = P ? W / 2 : W * 0.8
46
+ if (P) {
47
+ text(c, '高中语文 · 课文精讲', tx, H * 0.79, 52 * u, F.song, COL.gold, 1, 'center', 14 * u, 700)
48
+ text(c, '学不可以已', tx, H * 0.86, 44 * u, F.kai, COL.paper, 0.9, 'center', 18 * u)
49
+ } else {
50
+ for (const [s, x, sz, col] of [['课文精讲', tx + 40 * u, 64, COL.gold], ['学不可以已', tx - 50 * u, 46, COL.paper]] as const) {
51
+ ;[...s].forEach((ch, i) => revealChar(c, ch, x, H * 0.24 + i * sz * 1.2 * u, sz * u, F.kai, col, 1))
52
+ }
53
+ }
54
+ text(c, '统编版 · 必修上册', P ? W / 2 : 90 * u, P ? 80 * u : 70 * u, 30 * u, F.song, COL.muted, 0.9, P ? 'center' : 'left', 8 * u)
55
+ vignette(c, W, H); grain(c, W, H, 1, 0.06)
56
+ },
57
+ },
58
+ {
59
+ id: 'paper', name: '宣纸 · 朱印',
60
+ draw(c, W, H) {
61
+ const u = Math.min(W, H) / 1080, P = H > W
62
+ paperBg(c, W, H)
63
+ const X = P ? W / 2 : W * 0.4, Y = P ? H * 0.42 : H * 0.5
64
+ inkBlob(c, X + 40 * u, Y + 20 * u, Math.min(W, H) * 0.36, 31, '#8b8270', 0.35, 0.34)
65
+ const size = (P ? 320 : 300) * u
66
+ big(c, '劝学', X, Y, size, P, '#15120e')
67
+ seal(c, P ? X - size * 0.72 : X - size * 1.15, P ? Y - size * 0.85 : Y - size * 0.4, 100 * u, '荀子', 1, 0.05)
68
+ const quote = '青取之于蓝而青于蓝'
69
+ const qx = P ? W * 0.86 : W * 0.86, qy = P ? H * 0.12 : H * 0.14
70
+ ;[...quote].forEach((ch, i) => revealChar(c, ch, qx, qy + i * 50 * u, 40 * u, F.kai, '#4b4236', 1))
71
+ text(c, '荀子《劝学》深度精讲', P ? W / 2 : W * 0.4, P ? H * 0.82 : H * 0.86, 54 * u, F.song, '#2a241c', 1, 'center', 10 * u, 700)
72
+ hairline(c, (P ? W / 2 : W * 0.4) - 280 * u, (P ? H * 0.86 : H * 0.91), (P ? W / 2 : W * 0.4) + 280 * u, (P ? H * 0.86 : H * 0.91), 1, COL.red, 0.8, 2 * u)
73
+ text(c, '性恶 · 化性起伪 · 善假于物 · 积恒专', P ? W / 2 : W * 0.4, P ? H * 0.9 : H * 0.95, 30 * u, F.song, '#6b5d48', 1, 'center', 4 * u)
74
+ },
75
+ },
76
+ {
77
+ id: 'quote', name: '金句 · 锲而不舍',
78
+ draw(c, W, H) {
79
+ const u = Math.min(W, H) / 1080, P = H > W
80
+ background(c, W, H)
81
+ dust(c, W, H, 7, 70, 4, COL.gold, 0.4)
82
+ const size = (P ? 150 : 140) * u
83
+ const cols = ['锲而不舍', '金石可镂']
84
+ cols.forEach((s, ci) => {
85
+ const x = (P ? W / 2 : W * 0.42) + (0.5 - ci) * size * 1.7
86
+ ;[...s].forEach((ch, i) => revealChar(c, ch, x, (P ? H * 0.2 : H * 0.18) + i * size * 1.12 + size * 0.5, size, F.brush, ci === 1 ? COL.gold : COL.paper, 1))
87
+ })
88
+ const bx = P ? W / 2 : W * 0.78, by = P ? H * 0.8 : H * 0.5
89
+ seal(c, bx, by - (P ? 0 : 150 * u), 110 * u, '劝学', 1)
90
+ text(c, '荀子《劝学》', bx, by + (P ? 120 : 0) * u, 56 * u, F.kai, COL.paper, 1, 'center', 8 * u)
91
+ text(c, '7 分钟读懂学习的本质', bx, by + (P ? 190 : 70) * u, 34 * u, F.song, COL.gold, 1, 'center', 6 * u)
92
+ vignette(c, W, H); grain(c, W, H, 2, 0.06)
93
+ },
94
+ },
95
+ {
96
+ id: 'question', name: '设问 · 三把钥匙',
97
+ draw(c, W, H) {
98
+ const u = Math.min(W, H) / 1080, P = H > W
99
+ background(c, W, H)
100
+ mountains(c, W, H, 5, { seed: 21, alpha: 0.5, y: P ? 300 * u : 160 * u })
101
+ const X = W / 2
102
+ text(c, '为什么', X, P ? H * 0.17 : H * 0.17, 70 * u, F.song, COL.muted, 1, 'center', 20 * u, 700)
103
+ text(c, '学不可以已?', X, P ? H * 0.3 : H * 0.36, (P ? 150 : 170) * u, F.brush, COL.paper, 1, 'center', 6 * u)
104
+ const sz = (P ? 170 : 150) * u
105
+ ;['积', '恒', '专'].forEach((s, i) => {
106
+ const x = X + (i - 1) * sz * 1.45, y = P ? H * 0.53 : H * 0.62
107
+ inkBlob(c, x, y, sz * 0.8, 120 + i, '#3e372e', 0.6, 0.3)
108
+ seal(c, x, y, sz, s, 1, (i - 1) * 0.05)
109
+ })
110
+ text(c, '读懂荀子《劝学》的三层逻辑', X, P ? H * 0.7 : H * 0.83, 54 * u, F.kai, COL.gold, 1, 'center', 8 * u)
111
+ if (P) text(c, '高中语文 · 课文精讲', X, H * 0.77, 36 * u, F.song, COL.muted, 1, 'center', 10 * u)
112
+ vignette(c, W, H); grain(c, W, H, 3, 0.06)
113
+ },
114
+ },
115
+ {
116
+ id: 'sunrise', name: '日出 · 行者',
117
+ draw(c, W, H) {
118
+ const u = Math.min(W, H) / 1080, P = H > W
119
+ background(c, W, H)
120
+ const sy = H * (P ? 0.52 : 0.55)
121
+ const g = c.createLinearGradient(0, 0, 0, H)
122
+ g.addColorStop(0, 'rgba(0,0,0,0)'); g.addColorStop(0.55, 'rgba(170,110,55,0.35)'); g.addColorStop(1, 'rgba(0,0,0,0)')
123
+ c.fillStyle = g; c.fillRect(0, 0, W, H)
124
+ glow(c, W / 2, sy, Math.min(W, H) * 0.55, '#f6c46f', 0.6)
125
+ c.beginPath(); c.arc(W / 2, sy, Math.min(W, H) * 0.08, 0, Math.PI * 2); c.fillStyle = 'rgba(251,226,176,0.95)'; c.fill()
126
+ mountains(c, W, H, 4, { seed: 71, tint: '#7a6a55', y: P ? 200 * u : 60 * u })
127
+ const pts: [number, number][] = []
128
+ for (let i = 0; i <= 50; i++) { const q = i / 50; pts.push([W * (0.5 + 0.18 * Math.sin(q * 6) * (1 - q)), lerp(H, H * (P ? 0.66 : 0.68), Math.pow(q, 0.7))]) }
129
+ brush(c, pts, 30 * u, 1, '#d8c7a4', 0.35, 8, 0.4)
130
+ scholar(c, pts[18][0], pts[18][1], 90 * u, COL.paper, 0.95, 'walk', 0.3)
131
+ big(c, '劝学', W / 2, P ? H * 0.2 : H * 0.22, (P ? 230 : 200) * u, false, COL.paper)
132
+ text(c, '天性给出起点 学习决定远方', W / 2, P ? H * 0.32 : H * 0.4, 44 * u, F.kai, COL.gold, 1, 'center', 8 * u)
133
+ seal(c, W / 2 + (P ? 260 : 240) * u, P ? H * 0.17 : H * 0.17, 80 * u, '荀子', 1)
134
+ vignette(c, W, H); grain(c, W, H, 4, 0.05)
135
+ },
136
+ },
137
+ ]
138
+
139
+ export function renderCover(design: CoverDesign, ratio: Ratio, scale = 1) {
140
+ const [w, h] = RATIO_DIM[ratio]
141
+ const cv = makeCanvas(w * scale, h * scale)
142
+ design.draw(cv.getContext('2d')!, cv.width, cv.height)
143
+ return cv
144
+ }
quanxue-src/src/quanxue/dev.tsx ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 开发工具页(仅在带查询参数时启用):帧质检、配乐预渲染导出
2
+ import { useEffect, useRef } from 'react'
3
+ import { loadFonts } from './fonts'
4
+ import { renderFrame } from './render'
5
+
6
+ export function Still() {
7
+ const ref = useRef<HTMLCanvasElement>(null)
8
+ useEffect(() => {
9
+ const q = new URLSearchParams(location.search)
10
+ const ts = (q.get('still') || '10').split(',').map(Number)
11
+ const P = q.get('o') === 'p'
12
+ const W = P ? 540 : 960, H = P ? 960 : 540
13
+ loadFonts().then(() => {
14
+ const c = ref.current!
15
+ c.width = W; c.height = H * Math.min(ts.length, 12)
16
+ const ctx = c.getContext('2d')!
17
+ const tmp = document.createElement('canvas'); tmp.width = W; tmp.height = H
18
+ const tc = tmp.getContext('2d', { willReadFrequently: true })!
19
+ const stats: any[] = []
20
+ ts.forEach((t, i) => {
21
+ const t0 = performance.now()
22
+ renderFrame(tc, W, H, t)
23
+ const ms = performance.now() - t0
24
+ if (i < 12) ctx.drawImage(tmp, 0, i * H)
25
+ const d = tc.getImageData(0, 0, W, H).data
26
+ let sum = 0, n = 0, x0 = W, y0 = H, x1 = 0, y1 = 0
27
+ for (let y = 0; y < H; y += 2) for (let x = 0; x < W; x += 2) {
28
+ const k = (y * W + x) * 4, l = 0.3 * d[k] + 0.59 * d[k + 1] + 0.11 * d[k + 2]
29
+ sum += l
30
+ if (l > 140) { n++; if (x < x0) x0 = x; if (x > x1) x1 = x; if (y < y0) y0 = y; if (y > y1) y1 = y }
31
+ }
32
+ stats.push({ t, ms: Math.round(ms), mean: Math.round(sum / (W * H / 4)), bright: +(n / (W * H / 4) * 100).toFixed(2), box: n ? [x0, y0, x1, y1].map((v, j) => +(v / (j % 2 ? H : W)).toFixed(2)) : null })
33
+ })
34
+ ;(window as any).__stats = stats
35
+ ;(window as any).__done = true
36
+ })
37
+ }, [])
38
+ return <canvas ref={ref} style={{ display: 'block' }} />
39
+ }
40
+
41
+ export function MusicDump() {
42
+ useEffect(() => {
43
+ import('./audio/music').then(async ({ renderMusic }) => {
44
+ const m = await renderMusic()
45
+ const L = m.getChannelData(0), R = m.getChannelData(1)
46
+ const pcm = new Int16Array(L.length * 2)
47
+ for (let i = 0; i < L.length; i++) { pcm[2 * i] = Math.max(-1, Math.min(1, L[i])) * 32767; pcm[2 * i + 1] = Math.max(-1, Math.min(1, R[i])) * 32767 }
48
+ const bytes = new Uint8Array(pcm.buffer)
49
+ ;(window as any).__chunk = (i: number, size: number) => { let s = ''; const sub = bytes.subarray(i * size, (i + 1) * size); for (let k = 0; k < sub.length; k += 8192) s += String.fromCharCode(...sub.subarray(k, k + 8192)); return btoa(s) }
50
+ ;(window as any).__stats = [{ bytes: bytes.length, sr: m.sampleRate }]
51
+ ;(window as any).__done = true
52
+ })
53
+ }, [])
54
+ return <div>music dump</div>
55
+ }
56
+
57
+ export function ExportTest() {
58
+ useEffect(() => {
59
+ (async () => {
60
+ const q = new URLSearchParams(location.search)
61
+ const [res, fps, a, b, por, mus] = (q.get('exporttest') || '720P,30,0,6,0,1').split(',')
62
+ const { engine } = await import('./ui/store')
63
+ const { exportMp4 } = await import('./exporter')
64
+ await loadFonts(); await engine.loadVoices()
65
+ const t0 = performance.now()
66
+ try {
67
+ const r = await exportMp4(engine, { res: res as any, fps: +fps as any, portrait: por === '1', music: mus === '1', range: [+a, +b] }, () => {}, { cancelled: false })
68
+ const buf = new Uint8Array(await r.blob!.arrayBuffer())
69
+ ;(window as any).__chunk = (i: number, size: number) => { let s = ''; const sub = buf.subarray(i * size, (i + 1) * size); for (let k = 0; k < sub.length; k += 8192) s += String.fromCharCode(...sub.subarray(k, k + 8192)); return btoa(s) }
70
+ ;(window as any).__stats = [{ bytes: buf.length, codec: r.codec, ms: Math.round(performance.now() - t0) }]
71
+ } catch (e: any) { (window as any).__stats = [{ error: String(e?.message || e) }] }
72
+ ;(window as any).__done = true
73
+ })()
74
+ }, [])
75
+ return <div>export test</div>
76
+ }
quanxue-src/src/quanxue/engine/draw.ts ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 绘制工具:纹理缓存、水墨晕染、毛笔笔触、竖排文字、印章、人物剪影、尘埃粒子
2
+ import { clamp, easeOut, fbm1, fbm2, hash, lerp, noise1, rng, isPunct, type Rect } from './util'
3
+
4
+ export type Ctx = CanvasRenderingContext2D
5
+
6
+ export const COL = {
7
+ ink: '#0d0c0a',
8
+ ink2: '#191713',
9
+ paper: '#efe6d2',
10
+ muted: '#9d927f',
11
+ dim: '#5f574b',
12
+ gold: '#cfa961',
13
+ red: '#b8392b',
14
+ redDeep: '#8f2a20',
15
+ indigo: '#28508a',
16
+ ice: '#d5ecf2',
17
+ bamboo: '#b39a68',
18
+ wood: '#8a6440',
19
+ }
20
+ export const F = {
21
+ brush: '"qx-brush", "qx-kai", serif',
22
+ kai: '"qx-kai", serif',
23
+ song: '"qx-song", serif',
24
+ cao: '"qx-cao", "qx-kai", serif',
25
+ }
26
+ export const font = (size: number, fam: string, weight = 400) => `${weight} ${Math.max(1, size).toFixed(1)}px ${fam}`
27
+
28
+ export function rgba(hex: string, a: number) {
29
+ const n = parseInt(hex.slice(1), 16)
30
+ return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${clamp(a)})`
31
+ }
32
+
33
+ export function makeCanvas(w: number, h: number) {
34
+ const c = document.createElement('canvas')
35
+ c.width = Math.max(1, Math.round(w)); c.height = Math.max(1, Math.round(h))
36
+ return c
37
+ }
38
+
39
+ const cache = new Map<string, HTMLCanvasElement>()
40
+ export function cached(key: string, w: number, h: number, paint: (c: Ctx, w: number, h: number) => void) {
41
+ const k = `${key}@${Math.round(w)}x${Math.round(h)}`
42
+ let c = cache.get(k)
43
+ if (!c) {
44
+ if (cache.size > 160) cache.clear()
45
+ c = makeCanvas(w, h)
46
+ paint(c.getContext('2d')!, c.width, c.height)
47
+ cache.set(k, c)
48
+ }
49
+ return c
50
+ }
51
+
52
+ // ---------------- 背景与氛围 ----------------
53
+ export function background(ctx: Ctx, W: number, H: number, warm = 1) {
54
+ const tex = cached('bg', W, H, (c, w, h) => {
55
+ c.fillStyle = COL.ink; c.fillRect(0, 0, w, h)
56
+ // 低分辨率 fbm 云纹,放大后形成柔和的宣纸墨韵
57
+ const sw = Math.ceil(w / 10), sh = Math.ceil(h / 10)
58
+ const small = makeCanvas(sw, sh), sc = small.getContext('2d')!
59
+ const img = sc.createImageData(sw, sh)
60
+ for (let y = 0; y < sh; y++) for (let x = 0; x < sw; x++) {
61
+ const v = (fbm2(x / sw * 4, y / sh * 4 * (h / w)) + 1) / 2
62
+ const i = (y * sw + x) * 4
63
+ img.data[i] = 40 + v * 18; img.data[i + 1] = 35 + v * 15; img.data[i + 2] = 28 + v * 11; img.data[i + 3] = 255
64
+ }
65
+ sc.putImageData(img, 0, 0)
66
+ c.globalAlpha = 0.55; c.imageSmoothingQuality = 'high'; c.drawImage(small, 0, 0, w, h); c.globalAlpha = 1
67
+ const g = c.createRadialGradient(w * 0.5, h * 0.42, 0, w * 0.5, h * 0.45, Math.max(w, h) * 0.75)
68
+ g.addColorStop(0, 'rgba(70,58,40,0.35)'); g.addColorStop(0.6, 'rgba(20,18,14,0)'); g.addColorStop(1, 'rgba(0,0,0,0.5)')
69
+ c.fillStyle = g; c.fillRect(0, 0, w, h)
70
+ })
71
+ ctx.drawImage(tex, 0, 0, W, H)
72
+ if (warm !== 1) { ctx.fillStyle = `rgba(0,0,0,${clamp(1 - warm) * 0.6})`; ctx.fillRect(0, 0, W, H) }
73
+ }
74
+
75
+ export function vignette(ctx: Ctx, W: number, H: number, k = 1) {
76
+ const tex = cached('vig', W, H, (c, w, h) => {
77
+ const g = c.createRadialGradient(w / 2, h / 2, Math.min(w, h) * 0.35, w / 2, h / 2, Math.hypot(w, h) * 0.62)
78
+ g.addColorStop(0, 'rgba(0,0,0,0)'); g.addColorStop(1, 'rgba(0,0,0,0.78)')
79
+ c.fillStyle = g; c.fillRect(0, 0, w, h)
80
+ })
81
+ ctx.globalAlpha = k; ctx.drawImage(tex, 0, 0, W, H); ctx.globalAlpha = 1
82
+ }
83
+
84
+ const grainTiles: HTMLCanvasElement[] = []
85
+ function grainTile(i: number) {
86
+ if (!grainTiles[i]) {
87
+ const s = 256, c = makeCanvas(s, s), g = c.getContext('2d')!, img = g.createImageData(s, s), r = rng(1000 + i)
88
+ for (let p = 0; p < s * s; p++) { const v = r() * 255; img.data[p * 4] = v; img.data[p * 4 + 1] = v; img.data[p * 4 + 2] = v; img.data[p * 4 + 3] = 255 }
89
+ g.putImageData(img, 0, 0); grainTiles[i] = c
90
+ }
91
+ return grainTiles[i]
92
+ }
93
+ const patterns = new WeakMap<Ctx, CanvasPattern[]>()
94
+ export function grain(ctx: Ctx, W: number, H: number, t: number, amt = 0.07) {
95
+ let ps = patterns.get(ctx)
96
+ if (!ps) { ps = [0, 1, 2, 3].map((i) => ctx.createPattern(grainTile(i), 'repeat')!); patterns.set(ctx, ps) }
97
+ const f = Math.floor(t * 24)
98
+ const p = ps[f % 4]
99
+ ctx.save()
100
+ ctx.globalCompositeOperation = 'overlay'; ctx.globalAlpha = amt
101
+ const scale = Math.max(1, Math.min(W, H) / 900)
102
+ ctx.translate((hash(f) * 256) | 0, (hash(f + 7) * 256) | 0)
103
+ ctx.scale(scale, scale)
104
+ ctx.fillStyle = p; ctx.fillRect(-256, -256, W / scale + 512, H / scale + 512)
105
+ ctx.restore()
106
+ }
107
+
108
+ /** 漂浮尘埃(光中微尘) */
109
+ export function dust(ctx: Ctx, W: number, H: number, t: number, n = 60, seed = 1, color = COL.paper, a = 0.5) {
110
+ const u = Math.min(W, H) / 1080
111
+ for (let i = 0; i < n; i++) {
112
+ const s = seed * 100 + i
113
+ const sp = 0.004 + hash(s + 3) * 0.012
114
+ const x = ((hash(s) + t * sp * 0.6 + noise1(t * 0.1 + s) * 0.03) % 1 + 1) % 1
115
+ const y = ((hash(s + 1) - t * sp) % 1 + 1) % 1
116
+ const tw = 0.35 + 0.65 * (0.5 + 0.5 * Math.sin(t * (0.6 + hash(s + 5)) + s))
117
+ const r = (0.8 + hash(s + 2) * 2.2) * u
118
+ ctx.fillStyle = rgba(color, a * tw * (0.3 + hash(s + 4) * 0.7))
119
+ ctx.beginPath(); ctx.arc(x * W, y * H, r, 0, Math.PI * 2); ctx.fill()
120
+ }
121
+ }
122
+
123
+ /** 远山:程序化山脊 + 皴擦,预渲染缓存 */
124
+ export function mountainLayer(W: number, H: number, seed: number, base: number, amp: number, color: string, alpha: number, freq = 2.2) {
125
+ return cached(`mt${seed}_${base}_${amp}_${color}_${alpha}_${freq}`, W * 1.3, H, (c, w, h) => {
126
+ const ridge = (x: number) => h * base - h * amp * (0.55 + 0.45 * fbm1(x / w * freq + seed * 3.1, 6)) - h * amp * 0.6 * Math.pow(Math.max(0, Math.sin((x / w) * Math.PI * (1.2 + (seed % 3) * 0.4) + seed)), 3)
127
+ c.beginPath(); c.moveTo(0, h)
128
+ for (let x = 0; x <= w; x += 3) c.lineTo(x, ridge(x))
129
+ c.lineTo(w, h); c.closePath()
130
+ const g = c.createLinearGradient(0, h * (base - amp * 1.6), 0, h * Math.min(1, base + 0.25))
131
+ g.addColorStop(0, rgba(color, alpha)); g.addColorStop(0.45, rgba(color, alpha * 0.55)); g.addColorStop(1, rgba(color, 0))
132
+ c.fillStyle = g; c.fill()
133
+ // 皴擦纹理
134
+ c.save(); c.clip()
135
+ const r = rng(seed * 77)
136
+ c.lineCap = 'round'
137
+ for (let i = 0; i < w / 4; i++) {
138
+ const x = r() * w, y0 = ridge(x) + r() * h * 0.02
139
+ const len = h * (0.02 + r() * 0.12)
140
+ c.strokeStyle = rgba(color, alpha * (0.15 + r() * 0.35))
141
+ c.lineWidth = 0.6 + r() * 1.6
142
+ c.beginPath(); c.moveTo(x, y0); c.quadraticCurveTo(x + (r() - 0.5) * len * 0.5, y0 + len * 0.5, x + (r() - 0.5) * len * 0.8, y0 + len); c.stroke()
143
+ }
144
+ c.restore()
145
+ })
146
+ }
147
+
148
+ /** 绘制一组带视差与雾气的山 */
149
+ export function mountains(ctx: Ctx, W: number, H: number, t: number, opts: { seed?: number; y?: number; drift?: number; alpha?: number; tint?: string } = {}) {
150
+ const seed = opts.seed ?? 1, dy = opts.y ?? 0, drift = opts.drift ?? 1, A = opts.alpha ?? 1
151
+ const tint = opts.tint ?? '#8e8676'
152
+ const layers = [
153
+ { b: 0.62, a: 0.2, c: tint, al: 0.22, sp: 0.004, f: 1.6 },
154
+ { b: 0.72, a: 0.18, c: '#5d574c', al: 0.45, sp: 0.008, f: 2.0 },
155
+ { b: 0.84, a: 0.16, c: '#2c2924', al: 0.85, sp: 0.014, f: 2.6 },
156
+ ]
157
+ layers.forEach((L, i) => {
158
+ const tex = mountainLayer(W, H, seed + i, L.b, L.a, L.c, L.al, L.f)
159
+ const off = W * 0.12 * (1 - Math.cos(t * L.sp * drift * 5)) + W * 0.03 * i
160
+ ctx.globalAlpha = A
161
+ ctx.drawImage(tex, -off, dy * (i + 1) * 0.5, W * 1.3, H)
162
+ // 雾带
163
+ const my = H * (L.b + 0.02) + dy * (i + 1) * 0.5
164
+ const g = ctx.createLinearGradient(0, my - H * 0.08, 0, my + H * 0.1)
165
+ g.addColorStop(0, 'rgba(30,27,22,0)'); g.addColorStop(0.5, `rgba(48,43,36,${0.35 * A})`); g.addColorStop(1, 'rgba(30,27,22,0)')
166
+ ctx.fillStyle = g; ctx.fillRect(0, my - H * 0.08, W, H * 0.18)
167
+ })
168
+ ctx.globalAlpha = 1
169
+ }
170
+
171
+ // ---------------- 水墨 ----------------
172
+ /** 墨晕:不规则边缘 + 湿边沉积 */
173
+ export function inkBlob(ctx: Ctx, x: number, y: number, r: number, seed: number, color: string, alpha: number, rough = 0.28, t = 0) {
174
+ if (r <= 0 || alpha <= 0) return
175
+ const N = 120
176
+ const path = (rr: number, k: number) => {
177
+ ctx.beginPath()
178
+ for (let i = 0; i <= N; i++) {
179
+ const a = (i / N) * Math.PI * 2
180
+ const n = fbm1(Math.cos(a) * 1.6 + Math.sin(a) * 0.9 + seed * 9.7 + k + t * 0.05, 5) + 0.35 * fbm1(a * 6 + seed + t * 0.1, 3)
181
+ const R = rr * (1 + rough * n)
182
+ const px = x + Math.cos(a) * R, py = y + Math.sin(a) * R
183
+ if (i === 0) ctx.moveTo(px, py); else ctx.lineTo(px, py)
184
+ }
185
+ ctx.closePath()
186
+ }
187
+ const layers = [[1.0, 0.22], [0.88, 0.25], [0.7, 0.3], [0.45, 0.35]]
188
+ layers.forEach(([s, a], i) => { path(r * s, i * 1.3); ctx.fillStyle = rgba(color, alpha * a); ctx.fill() })
189
+ path(r * 0.985, 0); ctx.strokeStyle = rgba(color, alpha * 0.35); ctx.lineWidth = Math.max(1, r * 0.012); ctx.stroke()
190
+ }
191
+
192
+ /** 毛笔笔触:沿路径的变宽带状多边形 + 飞白 */
193
+ export function brush(ctx: Ctx, pts: [number, number][], width: number, progress: number, color: string, alpha = 1, seed = 1, dry = 0.5) {
194
+ if (pts.length < 2 || progress <= 0) return
195
+ const L: number[] = [0]
196
+ for (let i = 1; i < pts.length; i++) L.push(L[i - 1] + Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]))
197
+ const total = L[L.length - 1], lim = total * clamp(progress)
198
+ const left: [number, number][] = [], right: [number, number][] = [], mids: { p: [number, number]; n: [number, number]; w: number }[] = []
199
+ for (let i = 0; i < pts.length; i++) {
200
+ if (L[i] > lim && i > 0) {
201
+ const k = (lim - L[i - 1]) / Math.max(1e-6, L[i] - L[i - 1])
202
+ const p: [number, number] = [lerp(pts[i - 1][0], pts[i][0], k), lerp(pts[i - 1][1], pts[i][1], k)]
203
+ pushPt(p, i, lim)
204
+ break
205
+ }
206
+ pushPt(pts[i], i, L[i])
207
+ }
208
+ function pushPt(p: [number, number], i: number, s: number) {
209
+ const a = pts[Math.max(0, i - 1)], b = pts[Math.min(pts.length - 1, i + 1)]
210
+ let nx = -(b[1] - a[1]), ny = b[0] - a[0]
211
+ const nl = Math.hypot(nx, ny) || 1; nx /= nl; ny /= nl
212
+ const u = s / total
213
+ const prof = Math.min(1, u / 0.08 + 0.25) * Math.min(1, (1 - u) / 0.18 + 0.15)
214
+ const w = width * prof * (1 + 0.18 * noise1(s / width * 0.6 + seed * 13)) / 2
215
+ left.push([p[0] + nx * w, p[1] + ny * w]); right.push([p[0] - nx * w, p[1] - ny * w]); mids.push({ p, n: [nx, ny], w })
216
+ }
217
+ ctx.beginPath()
218
+ left.forEach((p, i) => (i ? ctx.lineTo(p[0], p[1]) : ctx.moveTo(p[0], p[1])))
219
+ for (let i = right.length - 1; i >= 0; i--) ctx.lineTo(right[i][0], right[i][1])
220
+ ctx.closePath(); ctx.fillStyle = rgba(color, alpha * 0.92); ctx.fill()
221
+ // 飞白:几条细的暗色擦痕
222
+ if (dry > 0 && mids.length > 3) {
223
+ const r = rng(seed)
224
+ for (let k = 0; k < 7; k++) {
225
+ const off = (r() * 2 - 1) * 0.8, st = Math.floor(mids.length * (0.3 + r() * 0.5))
226
+ ctx.beginPath()
227
+ for (let i = st; i < mids.length; i++) { const m = mids[i]; const px = m.p[0] + m.n[0] * m.w * off, py = m.p[1] + m.n[1] * m.w * off; i === st ? ctx.moveTo(px, py) : ctx.lineTo(px, py) }
228
+ ctx.strokeStyle = `rgba(13,12,10,${dry * (0.25 + r() * 0.4) * alpha})`; ctx.lineWidth = width * (0.02 + r() * 0.05); ctx.stroke()
229
+ }
230
+ }
231
+ }
232
+
233
+ /** 二次贝塞尔采样为点列 */
234
+ export function bez(p0: [number, number], p1: [number, number], p2: [number, number], n = 40): [number, number][] {
235
+ const out: [number, number][] = []
236
+ for (let i = 0; i <= n; i++) { const t = i / n, a = (1 - t) * (1 - t), b = 2 * (1 - t) * t, c = t * t; out.push([a * p0[0] + b * p1[0] + c * p2[0], a * p0[1] + b * p1[1] + c * p2[1]]) }
237
+ return out
238
+ }
239
+
240
+ // ---------------- 文字 ----------------
241
+ /** 单字显现:由虚到实、由大到正,如墨落纸面 */
242
+ export function revealChar(ctx: Ctx, ch: string, x: number, y: number, size: number, fam: string, color: string, r: number, alpha = 1) {
243
+ if (r <= 0 || alpha <= 0) return
244
+ const e = easeOut(r)
245
+ ctx.save()
246
+ ctx.translate(x, y)
247
+ const s = 1 + 0.12 * (1 - e)
248
+ ctx.scale(s, s)
249
+ ctx.font = font(size, fam)
250
+ ctx.textAlign = 'center'; ctx.textBaseline = 'middle'
251
+ if (r < 1) { ctx.shadowColor = rgba(color, 0.8); ctx.shadowBlur = size * 0.25 * (1 - e) }
252
+ ctx.fillStyle = rgba(color, alpha * e)
253
+ ctx.fillText(ch, 0, size * 0.04)
254
+ ctx.restore()
255
+ }
256
+
257
+ export function text(ctx: Ctx, s: string, x: number, y: number, size: number, fam: string, color: string, alpha = 1, align: CanvasTextAlign = 'center', spacing = 0, weight = 400) {
258
+ if (alpha <= 0) return
259
+ ctx.font = font(size, fam, weight)
260
+ ctx.textAlign = align; ctx.textBaseline = 'middle'
261
+ ctx.fillStyle = rgba(color, alpha)
262
+ if (spacing) {
263
+ try { (ctx as any).letterSpacing = `${spacing}px` } catch { /* ignore */ }
264
+ ctx.fillText(s, x + (align === 'center' ? spacing / 2 : 0), y)
265
+ try { (ctx as any).letterSpacing = '0px' } catch { /* ignore */ }
266
+ } else ctx.fillText(s, x, y)
267
+ }
268
+
269
+ /** 竖排一列文字(逐字可控显现) */
270
+ export function vtext(ctx: Ctx, s: string, x: number, y: number, size: number, fam: string, color: string, alpha = 1, lead = 1.12, rev?: (i: number) => number) {
271
+ let k = 0
272
+ for (const ch of s) {
273
+ if (isPunct(ch)) continue
274
+ revealChar(ctx, ch, x, y + k * size * lead, size, fam, color, rev ? rev(k) : 1, alpha)
275
+ k++
276
+ }
277
+ }
278
+
279
+ export type Col = { chars: { ch: string; i: number; mark?: 'stop' | 'pause' }[] }
280
+ /** 把一句古文切成竖排列:按小句合并,每列不超过 max 字;句读改为朱色圈点 */
281
+ export function columns(textS: string, max: number): Col[] {
282
+ const clauses: { ch: string; i: number; mark?: 'stop' | 'pause' }[][] = []
283
+ let cur: { ch: string; i: number; mark?: 'stop' | 'pause' }[] = []
284
+ ;[...textS].forEach((ch, i) => {
285
+ if (isPunct(ch)) {
286
+ if (cur.length && ',、:'.includes(ch)) cur[cur.length - 1].mark = 'pause'
287
+ if (cur.length && '。;?!'.includes(ch)) cur[cur.length - 1].mark = 'stop'
288
+ if (',。;:?!、'.includes(ch) && cur.length) { clauses.push(cur); cur = [] }
289
+ return
290
+ }
291
+ cur.push({ ch, i })
292
+ })
293
+ if (cur.length) clauses.push(cur)
294
+ const cols: Col[] = []
295
+ for (const c of clauses) {
296
+ const last = cols[cols.length - 1]
297
+ const lastStop = last && last.chars[last.chars.length - 1].mark === 'stop'
298
+ if (last && last.chars.length + c.length <= max && !lastStop) last.chars.push(...c)
299
+ else if (c.length > max) { for (let k = 0; k < c.length; k += max) cols.push({ chars: c.slice(k, k + max) }) }
300
+ else cols.push({ chars: [...c] })
301
+ }
302
+ return cols
303
+ }
304
+
305
+ // ---------------- 印章 ----------------
306
+ export function seal(ctx: Ctx, x: number, y: number, s: number, label: string, alpha = 1, rot = 0, yang = false) {
307
+ if (alpha <= 0) return
308
+ const tex = cached(`seal_${label}_${yang ? 1 : 0}`, 256, 256, (c, w) => {
309
+ const r = rng(label.charCodeAt(0) * 31 + label.length)
310
+ const m = w * 0.06
311
+ c.fillStyle = COL.red
312
+ c.beginPath()
313
+ const pts = 28
314
+ for (let i = 0; i < pts; i++) {
315
+ const side = Math.floor(i / 7), k = (i % 7) / 7
316
+ let px = 0, py = 0
317
+ if (side === 0) { px = lerp(m, w - m, k); py = m } else if (side === 1) { px = w - m; py = lerp(m, w - m, k) } else if (side === 2) { px = lerp(w - m, m, k); py = w - m } else { px = m; py = lerp(w - m, m, k) }
318
+ px += (r() - 0.5) * w * 0.018; py += (r() - 0.5) * w * 0.018
319
+ i ? c.lineTo(px, py) : c.moveTo(px, py)
320
+ }
321
+ c.closePath()
322
+ if (yang) { c.lineWidth = w * 0.05; c.strokeStyle = COL.red; c.stroke() } else c.fill()
323
+ const chars = [...label]
324
+ c.fillStyle = yang ? COL.red : '#f3e6d6'
325
+ c.textAlign = 'center'; c.textBaseline = 'middle'
326
+ if (chars.length === 1) { c.font = font(w * 0.7, F.brush); c.fillText(chars[0], w / 2, w / 2 + w * 0.03) }
327
+ else if (chars.length === 2) { c.font = font(w * 0.4, F.brush); c.fillText(chars[0], w / 2, w * 0.3); c.fillText(chars[1], w / 2, w * 0.72) }
328
+ else { c.font = font(w * 0.38, F.brush); const pos = [[0.72, 0.3], [0.72, 0.72], [0.28, 0.3], [0.28, 0.72]]; chars.slice(0, 4).forEach((ch, i) => c.fillText(ch, w * pos[i][0], w * pos[i][1] + w * 0.02)) }
329
+ // 印泥斑驳
330
+ c.globalCompositeOperation = 'destination-out'
331
+ for (let i = 0; i < 260; i++) { c.globalAlpha = 0.2 + r() * 0.6; c.beginPath(); c.arc(r() * w, r() * w, r() * w * 0.012 + 0.5, 0, Math.PI * 2); c.fill() }
332
+ c.globalAlpha = 1; c.globalCompositeOperation = 'source-over'
333
+ })
334
+ ctx.save(); ctx.translate(x, y); ctx.rotate(rot); ctx.globalAlpha = alpha
335
+ ctx.drawImage(tex, -s / 2, -s / 2, s, s)
336
+ ctx.restore()
337
+ }
338
+
339
+ /** 落印动画:从放大到压下 */
340
+ export function stamp(ctx: Ctx, x: number, y: number, s: number, label: string, p: number, rot = -0.04) {
341
+ if (p <= 0) return
342
+ const e = clamp(p / 0.35)
343
+ const sc = 1 + 0.6 * Math.pow(1 - e, 2)
344
+ seal(ctx, x, y, s * sc, label, clamp(e * 1.4), rot)
345
+ }
346
+
347
+ // ---------------- 人物剪影(古代士人) ----------------
348
+ export function scholar(ctx: Ctx, x: number, y: number, h: number, color: string, alpha = 1, pose: 'stand' | 'tiptoe' | 'walk' | 'wave' = 'stand', t = 0) {
349
+ if (alpha <= 0) return
350
+ ctx.save(); ctx.translate(x, y); ctx.fillStyle = rgba(color, alpha); ctx.strokeStyle = rgba(color, alpha)
351
+ const lift = pose === 'tiptoe' ? h * 0.04 : 0
352
+ const sway = pose === 'walk' ? Math.sin(t * 4) * h * 0.012 : 0
353
+ ctx.translate(sway, -lift)
354
+ // 衣袍
355
+ ctx.beginPath()
356
+ ctx.moveTo(-h * 0.07, -h * 0.78)
357
+ ctx.quadraticCurveTo(-h * 0.13, -h * 0.4, -h * 0.17 + (pose === 'walk' ? Math.sin(t * 4) * h * 0.02 : 0), 0)
358
+ ctx.lineTo(h * 0.17, 0)
359
+ ctx.quadraticCurveTo(h * 0.13, -h * 0.4, h * 0.07, -h * 0.78)
360
+ ctx.closePath(); ctx.fill()
361
+ // 头与发髻
362
+ ctx.beginPath(); ctx.arc(0, -h * 0.86, h * 0.07, 0, Math.PI * 2); ctx.fill()
363
+ ctx.beginPath(); ctx.arc(0, -h * 0.955, h * 0.03, 0, Math.PI * 2); ctx.fill()
364
+ // 衣袖/手臂
365
+ ctx.lineCap = 'round'; ctx.lineWidth = h * 0.05
366
+ ctx.beginPath()
367
+ if (pose === 'wave') {
368
+ const a = -1.2 + Math.sin(t * 5) * 0.25
369
+ ctx.moveTo(h * 0.05, -h * 0.72); ctx.lineTo(h * 0.05 + Math.cos(a) * h * 0.32, -h * 0.72 + Math.sin(a) * h * 0.32)
370
+ } else {
371
+ ctx.moveTo(-h * 0.06, -h * 0.7); ctx.quadraticCurveTo(-h * 0.16, -h * 0.5, -h * 0.05, -h * 0.42)
372
+ ctx.moveTo(h * 0.06, -h * 0.7); ctx.quadraticCurveTo(h * 0.16, -h * 0.5, h * 0.05, -h * 0.42)
373
+ }
374
+ ctx.stroke()
375
+ ctx.restore()
376
+ }
377
+
378
+ /** 细金线 */
379
+ export function hairline(ctx: Ctx, x1: number, y1: number, x2: number, y2: number, p: number, color = COL.gold, a = 0.8, w = 1) {
380
+ if (p <= 0) return
381
+ const mx = (x1 + x2) / 2, my = (y1 + y2) / 2
382
+ ctx.strokeStyle = rgba(color, a); ctx.lineWidth = w
383
+ ctx.beginPath(); ctx.moveTo(lerp(mx, x1, p), lerp(my, y1, p)); ctx.lineTo(lerp(mx, x2, p), lerp(my, y2, p)); ctx.stroke()
384
+ }
385
+
386
+ /** 金色细框 */
387
+ export function frame(ctx: Ctx, r: Rect, p: number, color = COL.gold, a = 0.6, w = 1) {
388
+ if (p <= 0) return
389
+ const per = 2 * (r.w + r.h), lim = per * clamp(p)
390
+ ctx.strokeStyle = rgba(color, a); ctx.lineWidth = w
391
+ ctx.beginPath(); ctx.moveTo(r.x, r.y)
392
+ const segs: [number, number][] = [[r.x + r.w, r.y], [r.x + r.w, r.y + r.h], [r.x, r.y + r.h], [r.x, r.y]]
393
+ let used = 0, px = r.x, py = r.y
394
+ for (const [qx, qy] of segs) {
395
+ const len = Math.hypot(qx - px, qy - py)
396
+ if (used + len >= lim) { const k = (lim - used) / len; ctx.lineTo(lerp(px, qx, k), lerp(py, qy, k)); break }
397
+ ctx.lineTo(qx, qy); used += len; px = qx; py = qy
398
+ }
399
+ ctx.stroke()
400
+ }
401
+
402
+ export function glow(ctx: Ctx, x: number, y: number, r: number, color: string, a: number) {
403
+ if (a <= 0 || r <= 0) return
404
+ const g = ctx.createRadialGradient(x, y, 0, x, y, r)
405
+ g.addColorStop(0, rgba(color, a)); g.addColorStop(0.4, rgba(color, a * 0.35)); g.addColorStop(1, rgba(color, 0))
406
+ ctx.fillStyle = g; ctx.fillRect(x - r, y - r, r * 2, r * 2)
407
+ }
quanxue-src/src/quanxue/engine/util.ts ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 数学、随机、噪声、缓动 —— 渲染引擎的基础工具(全部确定性,保证导出与播放画面一致)
2
+
3
+ export const clamp = (v: number, a = 0, b = 1) => (v < a ? a : v > b ? b : v)
4
+ export const lerp = (a: number, b: number, t: number) => a + (b - a) * t
5
+ export const inv = (a: number, b: number, v: number) => clamp((v - a) / (b - a))
6
+ export const smooth = (t: number) => { t = clamp(t); return t * t * (3 - 2 * t) }
7
+ export const easeOut = (t: number) => 1 - Math.pow(1 - clamp(t), 3)
8
+ export const easeIn = (t: number) => Math.pow(clamp(t), 3)
9
+ export const easeInOut = (t: number) => { t = clamp(t); return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2 }
10
+ export const easeOutExpo = (t: number) => (t >= 1 ? 1 : 1 - Math.pow(2, -10 * clamp(t)))
11
+ export const easeOutBack = (t: number) => { t = clamp(t); const c1 = 1.70158, c3 = c1 + 1; return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2) }
12
+ /** 在 [a, a+d] 区间内从 0 平滑到 1 */
13
+ export const ramp = (t: number, a: number, d = 0.6) => smooth((t - a) / d)
14
+ /** 淡入淡出窗口 */
15
+ export const win = (t: number, a: number, b: number, f = 0.5) => Math.min(ramp(t, a, f), 1 - ramp(t, b - f, f))
16
+
17
+ export function rng(seed: number) {
18
+ let s = seed >>> 0
19
+ return () => {
20
+ s = (s + 0x6d2b79f5) >>> 0
21
+ let t = s
22
+ t = Math.imul(t ^ (t >>> 15), t | 1)
23
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61)
24
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296
25
+ }
26
+ }
27
+
28
+ export function hash(n: number) {
29
+ const x = Math.sin(n * 127.1 + 311.7) * 43758.5453
30
+ return x - Math.floor(x)
31
+ }
32
+ export function hash2(x: number, y: number) {
33
+ const v = Math.sin(x * 127.1 + y * 311.7) * 43758.5453
34
+ return v - Math.floor(v)
35
+ }
36
+
37
+ export function noise1(x: number) {
38
+ const i = Math.floor(x), f = x - i
39
+ const u = f * f * (3 - 2 * f)
40
+ return lerp(hash(i), hash(i + 1), u) * 2 - 1
41
+ }
42
+ export function noise2(x: number, y: number) {
43
+ const ix = Math.floor(x), iy = Math.floor(y)
44
+ const fx = x - ix, fy = y - iy
45
+ const ux = fx * fx * (3 - 2 * fx), uy = fy * fy * (3 - 2 * fy)
46
+ const a = hash2(ix, iy), b = hash2(ix + 1, iy), c = hash2(ix, iy + 1), d = hash2(ix + 1, iy + 1)
47
+ return lerp(lerp(a, b, ux), lerp(c, d, ux), uy) * 2 - 1
48
+ }
49
+ export function fbm1(x: number, oct = 5) {
50
+ let v = 0, a = 0.5, f = 1
51
+ for (let i = 0; i < oct; i++) { v += a * noise1(x * f + i * 17.3); f *= 2.03; a *= 0.5 }
52
+ return v
53
+ }
54
+ export function fbm2(x: number, y: number, oct = 4) {
55
+ let v = 0, a = 0.5, f = 1
56
+ for (let i = 0; i < oct; i++) { v += a * noise2(x * f + i * 7.1, y * f - i * 3.3); f *= 2.01; a *= 0.5 }
57
+ return v
58
+ }
59
+
60
+ export type Rect = { x: number; y: number; w: number; h: number }
61
+ export const cx = (r: Rect) => r.x + r.w / 2
62
+ export const cy = (r: Rect) => r.y + r.h / 2
63
+
64
+ export const PUNCT = new Set(',。;:、?!“”‘’《》()—…·「」 ,.;:!?')
65
+ export const isPunct = (ch: string) => PUNCT.has(ch)
quanxue-src/src/quanxue/exporter.ts ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 浏览器本地导出 MP4:逐帧离线渲染 → WebCodecs 编码(H.264 / AAC)→ Mediabunny 封装
2
+ import { AudioSample, AudioSampleSource, BufferTarget, CanvasSource, Mp4OutputFormat, Output, StreamTarget, canEncodeAudio, canEncodeVideo, type AudioCodec, type VideoCodec } from 'mediabunny'
3
+ import { DURATION } from './timeline'
4
+ import { renderFrame } from './render'
5
+ import { mixChunk, type AudioEngine } from './audio/engine'
6
+
7
+ export type Res = '2K' | '1080P' | '720P'
8
+ export type ExportOpts = { res: Res; fps: 24 | 30 | 60; portrait: boolean; music: boolean; range?: [number, number] }
9
+ export type Progress = { phase: string; p: number; frame: number; total: number; fps: number; eta: number }
10
+
11
+ export const RES_DIM: Record<Res, [number, number]> = { '2K': [2560, 1440], '1080P': [1920, 1080], '720P': [1280, 720] }
12
+ const BASE_BITRATE: Record<Res, number> = { '2K': 10_000_000, '1080P': 6_000_000, '720P': 3_000_000 }
13
+
14
+ export function dims(o: ExportOpts): [number, number] {
15
+ const [a, b] = RES_DIM[o.res]
16
+ return o.portrait ? [b, a] : [a, b]
17
+ }
18
+ export function bitrate(o: ExportOpts) {
19
+ return Math.round(BASE_BITRATE[o.res] * (o.fps === 60 ? 1.4 : o.fps === 24 ? 0.85 : 1))
20
+ }
21
+ export function estimateMB(o: ExportOpts) {
22
+ const len = o.range ? o.range[1] - o.range[0] : DURATION
23
+ return Math.round(((bitrate(o) + 192_000) * len) / 8 / 1024 / 1024)
24
+ }
25
+
26
+ let aacRegistered = false
27
+ export function webCodecsSupported() {
28
+ return typeof window !== 'undefined' && 'VideoEncoder' in window && 'AudioEncoder' in window
29
+ }
30
+
31
+ export async function pickCodecs(o: ExportOpts): Promise<{ video: VideoCodec | null; audio: AudioCodec | null }> {
32
+ const [w, h] = dims(o)
33
+ let video: VideoCodec | null = null
34
+ for (const c of ['avc', 'hevc', 'vp9', 'av1'] as VideoCodec[]) {
35
+ try { if (await canEncodeVideo(c, { width: w, height: h, bitrate: bitrate(o), frameRate: o.fps })) { video = c; break } } catch { /* next */ }
36
+ }
37
+ let audio: AudioCodec | null = null
38
+ // 浏览器若无原生 AAC 编码(如 Linux / 部分 Firefox),按需加载 WASM 版 AAC 编码器,保证 MP4 音轨兼容所有播放器与平台
39
+ try {
40
+ if (!aacRegistered && !(await canEncodeAudio('aac', { numberOfChannels: 2, sampleRate: 48000, bitrate: 192_000 }))) {
41
+ const { registerAacEncoder } = await import('@mediabunny/aac-encoder')
42
+ registerAacEncoder(); aacRegistered = true
43
+ }
44
+ } catch { /* 回退 Opus */ }
45
+ for (const c of ['aac', 'opus'] as AudioCodec[]) {
46
+ try { if (await canEncodeAudio(c, { numberOfChannels: 2, sampleRate: 48000, bitrate: 192_000 })) { audio = c; break } } catch { /* next */ }
47
+ }
48
+ return { video, audio }
49
+ }
50
+
51
+ export async function exportMp4(engine: AudioEngine, o: ExportOpts, onProgress: (p: Progress) => void, signal: { cancelled: boolean }, fileHandle?: any): Promise<{ blob?: Blob; savedToDisk: boolean; codec: string }> {
52
+ const [w, h] = dims(o)
53
+ onProgress({ phase: '准备编码器', p: 0, frame: 0, total: 0, fps: 0, eta: 0 })
54
+ const { video, audio } = await pickCodecs(o)
55
+ if (!video) throw new Error('当前浏览器不支持该分辨率/帧率的视频编码,请降低分辨率或帧率,或使用最新版 Chrome / Edge。')
56
+ if (o.music) { onProgress({ phase: '加载配乐', p: 0, frame: 0, total: 0, fps: 0, eta: 0 }); await engine.loadMusic() }
57
+
58
+ const canvas = document.createElement('canvas')
59
+ canvas.width = w; canvas.height = h
60
+ const ctx = canvas.getContext('2d', { alpha: false })!
61
+
62
+ let writable: any = null
63
+ let target: BufferTarget | StreamTarget
64
+ if (fileHandle) { writable = await fileHandle.createWritable(); target = new StreamTarget(writable, { chunked: true }) }
65
+ else target = new BufferTarget()
66
+ const output = new Output({ format: new Mp4OutputFormat({ fastStart: fileHandle ? false : 'in-memory' }), target })
67
+ const vsrc = new CanvasSource(canvas, { codec: video, bitrate: bitrate(o), keyFrameInterval: 2 })
68
+ output.addVideoTrack(vsrc, { frameRate: o.fps })
69
+ let asrc: AudioSampleSource | null = null
70
+ if (audio) { asrc = new AudioSampleSource({ codec: audio, bitrate: 192_000 }); output.addAudioTrack(asrc) }
71
+ await output.start()
72
+
73
+ const [r0, r1] = o.range ?? [0, DURATION]
74
+ const total = Math.ceil((r1 - r0) * o.fps)
75
+ const SR = 48000
76
+ const mixSrc = engine.clips(o.music)
77
+ let audioSec = 0
78
+ const audioLen = r1 - r0
79
+ const pushAudio = async (upTo: number) => {
80
+ if (!asrc) return
81
+ while (audioSec < Math.min(upTo, audioLen)) {
82
+ const n = Math.min(SR, Math.ceil((audioLen - audioSec) * SR))
83
+ const [L, R] = mixChunk(mixSrc, Math.round((r0 + audioSec) * SR), n, SR)
84
+ const data = new Float32Array(n * 2); data.set(L, 0); data.set(R, n)
85
+ const s = new AudioSample({ data, format: 'f32-planar', numberOfChannels: 2, sampleRate: SR, timestamp: audioSec })
86
+ await asrc.add(s)
87
+ s.close()
88
+ audioSec += n / SR
89
+ }
90
+ }
91
+
92
+ const tStart = performance.now()
93
+ try {
94
+ for (let i = 0; i < total; i++) {
95
+ if (signal.cancelled) throw new Error('cancelled')
96
+ const t = r0 + i / o.fps
97
+ renderFrame(ctx, w, h, t)
98
+ await vsrc.add(i / o.fps, 1 / o.fps)
99
+ if (i % o.fps === 0) await pushAudio(i / o.fps + 2)
100
+ if (i % 6 === 0) {
101
+ const el = (performance.now() - tStart) / 1000
102
+ const fps = (i + 1) / Math.max(0.001, el)
103
+ onProgress({ phase: '渲染编码中', p: (i + 1) / total, frame: i + 1, total, fps, eta: (total - i - 1) / Math.max(0.1, fps) })
104
+ if (i % 30 === 0) await new Promise((r) => setTimeout(r, 0))
105
+ }
106
+ }
107
+ await pushAudio(audioLen + 1)
108
+ onProgress({ phase: '封装 MP4', p: 1, frame: total, total, fps: 0, eta: 0 })
109
+ await output.finalize()
110
+ } catch (e) {
111
+ try { await output.cancel() } catch { /* ignore */ }
112
+ throw e
113
+ }
114
+ const codec = `${video === 'avc' ? 'H.264' : video.toUpperCase()} + ${audio ? audio.toUpperCase() : '无音轨'}`
115
+ if (fileHandle) return { savedToDisk: true, codec }
116
+ const buf = (target as BufferTarget).buffer!
117
+ return { blob: new Blob([buf], { type: 'video/mp4' }), savedToDisk: false, codec }
118
+ }
quanxue-src/src/quanxue/fonts.ts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 自托管字体(子集化 woff2),全部加载完成后才开始绘制,保证导出画面字体正确
2
+ const FAMS: [string, string, FontFaceDescriptors?][] = [
3
+ ['qx-kai', 'qx-kai.woff2'],
4
+ ['qx-brush', 'qx-brush.woff2'],
5
+ ['qx-cao', 'qx-cao.woff2'],
6
+ ['qx-song', 'qx-song.woff2', { weight: '200 900' }],
7
+ ]
8
+
9
+ let ready: Promise<void> | null = null
10
+ export function assetUrl(p: string) {
11
+ return `${import.meta.env.BASE_URL}quanxue/${p}`
12
+ }
13
+ export function loadFonts() {
14
+ if (!ready) {
15
+ ready = Promise.all(
16
+ FAMS.map(async ([name, file, desc]) => {
17
+ const f = new FontFace(name, `url(${assetUrl('fonts/' + file)}) format("woff2")`, desc)
18
+ await f.load()
19
+ document.fonts.add(f)
20
+ }),
21
+ ).then(() => undefined)
22
+ }
23
+ return ready
24
+ }
quanxue-src/src/quanxue/publish.ts ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 四个平台的发布文案(标题、描述、话题),字数与话题数按平台规则校验
2
+ import { TL } from './timeline'
3
+
4
+ export type Platform = {
5
+ id: string; name: string; color: string
6
+ titleMax: number; tagMax: number | null; hashTag: boolean
7
+ titles: string[]; desc: string; tags: string[]
8
+ }
9
+
10
+ const fmt = (t: number) => `${String(Math.floor(t / 60)).padStart(2, '0')}:${String(Math.floor(t % 60)).padStart(2, '0')}`
11
+ const chapterIndex = () => TL.chapters.map((c) => `${fmt(c.start)} ${c.no === '终' ? '终章' : '第' + c.no + '章'} ${c.title.replace(/\s/g, '')}`).join('\n')
12
+
13
+ export const PLATFORMS: Platform[] = [
14
+ {
15
+ id: 'xhs', name: '小红书', color: '#ff2442', titleMax: 20, tagMax: 10, hashTag: true,
16
+ titles: ['荀子《劝学》精讲|学习为何不可停止', '7分钟读懂《劝学》:后天胜过先天', '高中必背《劝学》,原来这么深刻'],
17
+ desc: `📜 《劝学》不只是一篇必背课文,更是荀子写给所有人的一套“学习方法论”。
18
+
19
+ 🔹 为什么“学不可以已”?荀子主张“人之性恶,其善者伪也”——“伪”不是虚伪,而是“人为”。善是后天学出来的,学习就是“化性起伪”。
20
+ 🔹 青出于蓝、輮木为轮:学习带来的改变是根本的、不可逆的。
21
+ 🔹 善假于物:君子生非异也,差别在于是否善于借助前人的智慧。
22
+ 🔹 积·恒·专:积土成山、锲而不舍、用心一也。
23
+
24
+ 水墨动画逐句精讲,原文朱笔圈点,高一预习复习、背诵默写都用得上✍️ 先收藏,慢慢看。`,
25
+ tags: ['劝学', '荀子', '高中语文', '文言文', '必修上册', '课文精讲', '学习方法', '国学经典', '传统文化', '水墨动画'],
26
+ },
27
+ {
28
+ id: 'dy', name: '抖音', color: '#25f4ee', titleMax: 30, tagMax: 5, hashTag: true,
29
+ titles: ['两千年前的学习方法论:荀子《劝学》7分钟精讲', '为什么学不可以已?读懂《劝学》背后的人性论', '锲而不舍,金石可镂|《劝学》全篇深度解读'],
30
+ desc: '荀子说“人之性恶,其善者伪也”——善不是天生的,是学出来的。从青出于蓝、輮木为轮,到善假于物、锲而不舍,7分钟水墨动画带你读懂《劝学》的三层逻辑。',
31
+ tags: ['劝学', '荀子', '高中语文', '文言文', '学习方法'],
32
+ },
33
+ {
34
+ id: 'wx', name: '微信视频号', color: '#fa9d3b', titleMax: 16, tagMax: null, hashTag: true,
35
+ titles: ['《劝学》精讲:学不可以已', '荀子:善,是学出来的', '7分钟读懂荀子《劝学》'],
36
+ desc: '两千多年前,荀子把“学”放在全书之首。性恶论、化性起伪、善假于物、积恒专——一部水墨动画,讲透这篇必背名篇的深层逻辑。学不可以已,与君共勉。',
37
+ tags: ['劝学', '荀子', '高中语文', '文言文', '语文课', '课文讲解', '国学', '传统文化', '学习方法', '终身学习', '读书', '水墨动画'],
38
+ },
39
+ {
40
+ id: 'bili', name: '哔哩哔哩', color: '#00aeec', titleMax: 80, tagMax: 10, hashTag: false,
41
+ titles: ['【高中语文·课文精讲】荀子《劝学》深度解读:从“性恶论”到“化性起伪”,读懂学习的本质|水墨动画', '两千年前的学习方法论:荀子《劝学》逐句精讲(青出于蓝·善假于物·锲而不舍)', '【水墨动画】7分钟读懂《劝学》:为什么“学不可以已”?'],
42
+ desc: `荀子《劝学》(统编版高中语文必修上册)深度精讲。
43
+
44
+ 不止于翻译与背诵:本期从荀子的“性恶论”出发——“人之性恶,其善者伪也”,“伪”即“人为”——理解为什么荀子要把《劝学》放在全书三十二篇之首,再逐段拆解原文的三层论证:
45
+ ① 学不可以已:青出于蓝、冰寒于水、輮木为轮——后天胜过先天,改变不可逆;
46
+ ② 善假于物:登高而招、顺风而呼、舆马舟楫——君子生非异也;
47
+ ③ 积·恒·专:积土成山、骐骥驽马、锲而不舍、蚓与蟹。
48
+
49
+ 章节:
50
+ ${chapterIndex()}
51
+
52
+ 解说文案原创,旁白为 AI 配音;画面、配乐(古琴·箫)与音效均为程序化原创生成。学不可以已,与君共勉。`,
53
+ tags: ['劝学', '荀子', '高中语文', '文言文', '课文讲解', '必修上册', '国学', '学习方法', '水墨动画', '知识分享'],
54
+ },
55
+ ]
56
+
57
+ export const countChars = (s: string) => [...s].length
58
+ export const tagText = (p: Platform) => p.tags.map((t) => (p.hashTag ? `#${t}` : t)).join(p.hashTag ? ' ' : ',')
quanxue-src/src/quanxue/quanxue.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ .qx-root {
3
+ background:
4
+ radial-gradient(1200px 600px at 50% -10%, rgba(120, 92, 52, 0.18), transparent 60%),
5
+ radial-gradient(900px 500px at 100% 100%, rgba(184, 57, 43, 0.06), transparent 60%),
6
+ #0b0a08;
7
+ font-family: 'qx-song', 'Noto Serif SC', 'Songti SC', serif;
8
+ }
9
+ .qx-brush { font-family: 'qx-brush', 'qx-kai', 'Kaiti SC', 'STKaiti', serif; font-weight: 400; }
10
+ .qx-kai { font-family: 'qx-kai', 'Kaiti SC', 'STKaiti', serif; }
11
+ .qx-song { font-family: 'qx-song', 'Noto Serif SC', 'Songti SC', serif; }
12
+ .qx-seal {
13
+ display: inline-flex; align-items: center; justify-content: center;
14
+ width: 30px; height: 30px; background: #b8392b; color: #f3e6d6; border-radius: 3px;
15
+ font-family: 'qx-brush', serif; font-size: 20px; line-height: 1; box-shadow: inset 0 0 0 2px rgba(0,0,0,0.12);
16
+ }
17
+ .qx-noscroll::-webkit-scrollbar { display: none; }
18
+ .qx-noscroll { scrollbar-width: none; }
19
+ .qx-root ::selection { background: rgba(207, 169, 97, 0.35); }
quanxue-src/src/quanxue/render.ts ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 帧合成:镜头 → 墨晕转场 → 引文竖排 → 字幕 → 章节标识 → 暗角 → 胶片颗粒
2
+ import { TL, DURATION, keyT, getLine, shotAt, chapterAt, type Line, type Shot } from './timeline'
3
+ import { clamp, easeInOut, fbm1, ramp, smooth, type Rect } from './engine/util'
4
+ import { COL, F, background, columns, font, grain, makeCanvas, revealChar, rgba, text, vignette, type Col, type Ctx } from './engine/draw'
5
+ import { SCENES } from './scenes'
6
+
7
+ export type SceneCtx = {
8
+ c: Ctx; W: number; H: number; u: number; P: boolean
9
+ t: number; lt: number; dur: number; shot: Shot
10
+ /** 镜头内相对时间:某句某词被念出的时刻 */
11
+ k: (id: string, sub: string, off?: number) => number
12
+ ls: (id: string) => number
13
+ le: (id: string) => number
14
+ art: Rect; txt: Rect; full: Rect
15
+ }
16
+
17
+ export function layout(W: number, H: number) {
18
+ const P = H > W
19
+ const art: Rect = P ? { x: 0.05 * W, y: 0.385 * H, w: 0.9 * W, h: 0.42 * H } : { x: 0.045 * W, y: 0.1 * H, w: 0.57 * W, h: 0.73 * H }
20
+ const txt: Rect = P ? { x: 0.08 * W, y: 0.085 * H, w: 0.84 * W, h: 0.27 * H } : { x: 0.645 * W, y: 0.12 * H, w: 0.3 * W, h: 0.66 * H }
21
+ const full: Rect = P ? { x: 0.06 * W, y: 0.12 * H, w: 0.88 * W, h: 0.68 * H } : { x: 0.06 * W, y: 0.1 * H, w: 0.88 * W, h: 0.72 * H }
22
+ return { P, art, txt, full }
23
+ }
24
+
25
+ function sceneCtx(c: Ctx, W: number, H: number, t: number, shot: Shot): SceneCtx {
26
+ const L = layout(W, H)
27
+ return {
28
+ c, W, H, u: Math.min(W, H) / 1080, P: L.P, t, lt: t - shot.start, dur: shot.end - shot.start, shot,
29
+ k: (id, sub, off = 0) => keyT(id, sub, off) - shot.start,
30
+ ls: (id) => getLine(id).start - shot.start,
31
+ le: (id) => getLine(id).end - shot.start,
32
+ art: L.art, txt: L.txt, full: L.full,
33
+ }
34
+ }
35
+
36
+ // ---------------- 引文:竖排、乌丝栏、朱色句读 ----------------
37
+ const quoteCache = new Map<string, { size: number; cols: Col[]; maxLen: number }>()
38
+ function fitQuote(line: Line, r: Rect, sizeMax: number) {
39
+ const key = `${line.id}_${r.w | 0}_${r.h | 0}_${sizeMax | 0}`
40
+ let q = quoteCache.get(key)
41
+ if (q) return q
42
+ let size = sizeMax
43
+ for (let it = 0; it < 40; it++) {
44
+ const max = Math.max(3, Math.floor(r.h / (size * 1.13)))
45
+ const cols = columns(line.text, max)
46
+ const maxLen = Math.max(...cols.map((c) => c.chars.length))
47
+ if (cols.length * size * 1.62 <= r.w || it === 39) { q = { size, cols, maxLen }; break }
48
+ size *= 0.95
49
+ }
50
+ quoteCache.set(key, q!)
51
+ return q!
52
+ }
53
+
54
+ export function drawQuote(S: SceneCtx, line: Line, r: Rect, opts: { sizeMax?: number; fam?: string; color?: string; alpha?: number } = {}) {
55
+ const { c, u } = S
56
+ const t = S.t
57
+ if (t < line.start - 0.4) return
58
+ const q = fitQuote(line, r, (opts.sizeMax ?? 74) * u)
59
+ const { size, cols, maxLen } = q
60
+ const pitch = size * 1.62
61
+ const totalW = cols.length * pitch
62
+ const x0 = r.x + r.w / 2 + totalW / 2 - pitch / 2
63
+ const y0 = r.y + (r.h - maxLen * size * 1.13) / 2 + size * 0.5
64
+ const dim = 1 - 0.55 * ramp(t, line.end + 0.3, 1.0)
65
+ const A = (opts.alpha ?? 1) * dim * clamp((t - line.start + 0.4) / 0.4)
66
+ // 乌丝栏
67
+ c.lineWidth = Math.max(1, u * 1.1)
68
+ for (let i = 0; i <= cols.length; i++) {
69
+ const x = x0 + pitch / 2 - i * pitch
70
+ const p = ramp(t, line.start - 0.3 + i * 0.05, 0.9)
71
+ const yTop = y0 - size * 0.75, yBot = y0 + maxLen * size * 1.13 - size * 0.25
72
+ c.strokeStyle = rgba(COL.gold, 0.22 * A)
73
+ c.beginPath(); c.moveTo(x, yTop); c.lineTo(x, yTop + (yBot - yTop) * p); c.stroke()
74
+ }
75
+ const fam = opts.fam ?? F.kai
76
+ const color = opts.color ?? COL.paper
77
+ cols.forEach((col, ci) => {
78
+ const x = x0 - ci * pitch
79
+ col.chars.forEach((ch, k) => {
80
+ const y = y0 + k * size * 1.13
81
+ const ct = line.charT[ch.i]
82
+ const rv = (t - ct + 0.06) / 0.45
83
+ revealChar(c, ch.ch, x, y, size, fam, color, clamp(rv), A)
84
+ if (ch.mark && rv > 0.4) {
85
+ // 朱笔圈点
86
+ c.strokeStyle = rgba(COL.red, 0.9 * A); c.fillStyle = rgba(COL.red, 0.9 * A); c.lineWidth = Math.max(1, size * 0.04)
87
+ c.beginPath()
88
+ if (ch.mark === 'stop') { c.arc(x + size * 0.56, y + size * 0.38, size * 0.075, 0, Math.PI * 2); c.stroke() }
89
+ else { c.arc(x + size * 0.56, y + size * 0.4, size * 0.05, 0, Math.PI * 2); c.fill() }
90
+ }
91
+ })
92
+ })
93
+ if (line.src) {
94
+ const lastX = x0 - (cols.length - 1) * pitch - pitch * 0.85
95
+ const by = y0 + maxLen * size * 1.13 - size * 0.4
96
+ c.save(); c.translate(lastX, by)
97
+ c.font = font(size * 0.34, F.song); c.textAlign = 'center'; c.textBaseline = 'bottom'
98
+ c.fillStyle = rgba(COL.gold, 0.85 * A * ramp(t, line.end - 0.5, 0.8))
99
+ let yy = 0
100
+ for (const chh of [...line.src].reverse()) { if ('《》·'.includes(chh)) continue; c.fillText(chh, 0, yy); yy -= size * 0.4 }
101
+ c.restore()
102
+ }
103
+ }
104
+
105
+ // ---------------- 字幕 ----------------
106
+ function drawSubtitle(c: Ctx, W: number, H: number, t: number) {
107
+ const P = H > W, u = Math.min(W, H) / 1080
108
+ const line = TL.lines.find((l) => l.kind === 'say' && t >= l.start - 0.2 && t <= l.end + 0.4)
109
+ if (!line) return
110
+ const chunks = P ? line.chunksP : line.chunksL
111
+ const ch = chunks.find((k) => t >= k.start && t < k.end)
112
+ if (!ch) return
113
+ const a = Math.min(clamp((t - ch.start) / 0.18), clamp((ch.end - t) / 0.18))
114
+ const y = P ? H * 0.868 : H * 0.895
115
+ const size = (P ? 46 : 42) * u
116
+ // 柔和底衬
117
+ const g = c.createLinearGradient(0, y - size * 1.6, 0, y + size * 1.6)
118
+ g.addColorStop(0, 'rgba(8,7,6,0)'); g.addColorStop(0.5, `rgba(8,7,6,${0.5 * a})`); g.addColorStop(1, 'rgba(8,7,6,0)')
119
+ c.fillStyle = g; c.fillRect(0, y - size * 1.6, W, size * 3.2)
120
+ c.save()
121
+ c.shadowColor = 'rgba(0,0,0,0.8)'; c.shadowBlur = size * 0.3
122
+ text(c, ch.text, W / 2, y, size, F.kai, COL.paper, a * 0.96, 'center', size * 0.06)
123
+ c.restore()
124
+ }
125
+
126
+ function drawHud(c: Ctx, W: number, H: number, t: number) {
127
+ const ci = chapterAt(t)
128
+ if (ci < 0) return
129
+ const ch = TL.chapters[ci]
130
+ const shot = TL.shots[shotAt(t)]
131
+ if (shot.vis === 'card') return
132
+ const a = 0.75 * Math.min(ramp(t, ch.start + 3.6, 1), 1 - ramp(t, ch.end - 0.6, 0.6))
133
+ if (a <= 0) return
134
+ const P = H > W, u = Math.min(W, H) / 1080
135
+ const x = P ? W / 2 : 72 * u, y = P ? 62 * u : 60 * u
136
+ const label = `${ch.no === '终' ? '终章' : '第' + ch.no + '章'} ${ch.title}`
137
+ c.save()
138
+ if (P) {
139
+ text(c, label, x, y, 24 * u, F.song, COL.gold, a, 'center', 6 * u)
140
+ } else {
141
+ c.fillStyle = rgba(COL.red, a); c.fillRect(x, y - 9 * u, 6 * u, 18 * u)
142
+ text(c, label, x + 20 * u, y, 24 * u, F.song, COL.gold, a, 'left', 6 * u)
143
+ text(c, '劝学 · 荀子', W - 72 * u, y, 22 * u, F.song, COL.muted, a * 0.8, 'right', 8 * u)
144
+ }
145
+ c.restore()
146
+ }
147
+
148
+ // ---------------- 镜头渲染 ----------------
149
+ function renderShot(c: Ctx, W: number, H: number, t: number, shot: Shot) {
150
+ const S = sceneCtx(c, W, H, t, shot)
151
+ const sc = SCENES[shot.vis]
152
+ c.save()
153
+ background(c, W, H)
154
+ // 缓慢推镜
155
+ const zoom = 1 + 0.035 * smooth(S.lt / Math.max(1, S.dur)) * (sc?.zoom ?? 1)
156
+ c.translate(W / 2, H / 2); c.scale(zoom, zoom); c.translate(-W / 2, -H / 2)
157
+ if (sc) sc.draw(S)
158
+ if (shot.quote && !sc?.customQuote) drawQuote(S, shot.quote, S.txt, { sizeMax: sc?.quoteSize })
159
+ c.restore()
160
+ }
161
+
162
+ let layer: HTMLCanvasElement | null = null
163
+ function inkMask(c: Ctx, W: number, H: number, p: number, seed: number) {
164
+ if (p >= 1) { c.fillRect(0, 0, W, H); return }
165
+ const R = Math.hypot(W, H) * 0.62
166
+ const centers = [[0.5 + 0.2 * Math.sin(seed * 3.1), 0.5 + 0.15 * Math.cos(seed * 1.7)], [0.18 + 0.1 * Math.sin(seed), 0.3], [0.82, 0.72 + 0.1 * Math.cos(seed)]]
167
+ centers.forEach(([x, y], i) => {
168
+ const pp = clamp((p - i * 0.12) / (1 - i * 0.12))
169
+ const r = R * easeInOut(pp) * (i === 0 ? 1.1 : 0.8)
170
+ if (r <= 0) return
171
+ for (const [s, a] of [[1.12, 0.25], [1.05, 0.5], [1, 1]] as const) {
172
+ c.globalAlpha = a
173
+ c.beginPath()
174
+ for (let k = 0; k <= 90; k++) {
175
+ const ang = (k / 90) * Math.PI * 2
176
+ const n = fbm1(Math.cos(ang) * 1.5 + Math.sin(ang) + seed * 5 + i * 9, 5)
177
+ const rr = r * s * (1 + 0.25 * n)
178
+ const px = x * W + Math.cos(ang) * rr, py = y * H + Math.sin(ang) * rr
179
+ k ? c.lineTo(px, py) : c.moveTo(px, py)
180
+ }
181
+ c.fill()
182
+ }
183
+ })
184
+ c.globalAlpha = 1
185
+ }
186
+
187
+ const TR = 0.95
188
+ export function renderFrame(c: Ctx, W: number, H: number, t: number) {
189
+ t = clamp(t, 0, DURATION)
190
+ const i = shotAt(t)
191
+ const shot = TL.shots[i]
192
+ const inTr = i > 0 && t < shot.start + TR
193
+ if (inTr) {
194
+ const prev = TL.shots[i - 1]
195
+ renderShot(c, W, H, t, prev)
196
+ if (!layer || layer.width !== W || layer.height !== H) layer = makeCanvas(W, H)
197
+ const L = layer.getContext('2d')!
198
+ L.globalCompositeOperation = 'source-over'
199
+ L.clearRect(0, 0, W, H)
200
+ renderShot(L, W, H, t, shot)
201
+ L.globalCompositeOperation = 'destination-in'
202
+ L.fillStyle = '#000'
203
+ inkMask(L, W, H, (t - shot.start) / TR, i)
204
+ L.globalCompositeOperation = 'source-over'
205
+ c.drawImage(layer, 0, 0)
206
+ } else renderShot(c, W, H, t, shot)
207
+ drawSubtitle(c, W, H, t)
208
+ drawHud(c, W, H, t)
209
+ vignette(c, W, H)
210
+ grain(c, W, H, t, 0.075)
211
+ // 首尾淡入淡出
212
+ const fade = Math.max(1 - clamp(t / 0.8), clamp((t - (DURATION - 1.6)) / 1.6))
213
+ if (fade > 0) { c.fillStyle = `rgba(0,0,0,${fade})`; c.fillRect(0, 0, W, H) }
214
+ }
quanxue-src/src/quanxue/scenes.ts ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import { partA, type Scene } from './scenes/partA'
2
+ import { partB } from './scenes/partB'
3
+
4
+ export const SCENES: Record<string, Scene> = { ...partA, ...partB }
quanxue-src/src/quanxue/scenes/partA.ts ADDED
@@ -0,0 +1,678 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 场景(上):片头、章节卡、其人其书、思想底色、学不可以已
2
+ import type { SceneCtx } from '../render'
3
+ import { TL } from '../timeline'
4
+ import { clamp, easeIn, easeInOut, easeOut, easeOutBack, easeOutExpo, fbm1, hash, lerp, noise1, ramp, rng, smooth, win, type Rect } from '../engine/util'
5
+ import { COL, F, bez, brush, dust, font, frame, glow, hairline, inkBlob, mountains, revealChar, rgba, seal, stamp, text, vtext, type Ctx } from '../engine/draw'
6
+
7
+ export type Scene = { draw: (S: SceneCtx) => void; customQuote?: boolean; zoom?: number; quoteSize?: number }
8
+
9
+ export const two = (r: Rect, gap = 0.06): [Rect, Rect] => {
10
+ if (r.w >= r.h * 0.9) { const w = r.w * (1 - gap) / 2; return [{ x: r.x, y: r.y, w, h: r.h }, { x: r.x + r.w - w, y: r.y, w, h: r.h }] }
11
+ const h = r.h * (1 - gap) / 2; return [{ x: r.x, y: r.y, w: r.w, h }, { x: r.x, y: r.y + r.h - h, w: r.w, h }]
12
+ }
13
+ export const mn = (r: Rect) => Math.min(r.w, r.h)
14
+
15
+ export function ellipse(c: Ctx, x: number, y: number, rx: number, ry: number, fill?: string, stroke?: string, lw = 1) {
16
+ c.beginPath(); c.ellipse(x, y, Math.max(0.1, rx), Math.max(0.1, ry), 0, 0, Math.PI * 2)
17
+ if (fill) { c.fillStyle = fill; c.fill() }
18
+ if (stroke) { c.strokeStyle = stroke; c.lineWidth = lw; c.stroke() }
19
+ }
20
+ /** 面板底部标注 */
21
+ export function caption(S: SceneCtx, r: Rect, s: string, a: number, color = COL.gold, dy = 0) {
22
+ text(S.c, s, r.x + r.w / 2, r.y + r.h - 18 * S.u + dy, 32 * S.u, F.kai, color, a, 'center', 4 * S.u)
23
+ }
24
+ /** 箭头 */
25
+ export function arrow(c: Ctx, x1: number, y1: number, x2: number, y2: number, color: string, a: number, w: number) {
26
+ if (a <= 0) return
27
+ const ang = Math.atan2(y2 - y1, x2 - x1), hl = w * 6
28
+ c.strokeStyle = rgba(color, a); c.lineWidth = w; c.lineCap = 'round'
29
+ c.beginPath(); c.moveTo(x1, y1); c.lineTo(x2, y2)
30
+ c.moveTo(x2, y2); c.lineTo(x2 - Math.cos(ang - 0.45) * hl, y2 - Math.sin(ang - 0.45) * hl)
31
+ c.moveTo(x2, y2); c.lineTo(x2 - Math.cos(ang + 0.45) * hl, y2 - Math.sin(ang + 0.45) * hl)
32
+ c.stroke()
33
+ }
34
+ /** 一笔圆相(ensō) */
35
+ export function enso(c: Ctx, x: number, y: number, R: number, p: number, color: string, a: number, w: number, seed = 1, start = -Math.PI / 2) {
36
+ const pts: [number, number][] = []
37
+ for (let i = 0; i <= 120; i++) {
38
+ const ang = start + (i / 120) * Math.PI * 2 * 0.94
39
+ const rr = R * (1 + 0.025 * noise1(i * 0.15 + seed))
40
+ pts.push([x + Math.cos(ang) * rr, y + Math.sin(ang) * rr])
41
+ }
42
+ brush(c, pts, w, p, color, a, seed, 0.6)
43
+ }
44
+
45
+ const CH_KEY = ['荀', '性', '学', '假', '积', '止']
46
+
47
+ export const partA: Record<string, Scene> = {
48
+ // ---------- 片头 ----------
49
+ title: {
50
+ zoom: 0.6,
51
+ draw(S) {
52
+ const { c, W, H, u, P, lt } = S
53
+ const m = Math.min(W, H)
54
+ dust(c, W, H, lt, 46, 3, COL.paper, 0.32)
55
+ const X = W / 2, Y = P ? H * 0.4 : H * 0.44
56
+ if (lt < 1.62) {
57
+ const y = lerp(-0.05 * H, Y, easeIn(lt / 1.62))
58
+ ellipse(c, X, y, 4.5 * u, 11 * u, rgba(COL.paper, 0.9))
59
+ glow(c, X, y, 30 * u, COL.paper, 0.25)
60
+ }
61
+ for (let i = 0; i < 3; i++) {
62
+ const p = (lt - 1.62 - i * 0.28) / 2.4
63
+ if (p > 0 && p < 1) ellipse(c, X, Y, p * 0.55 * m, p * 0.16 * m, undefined, rgba(COL.paper, 0.4 * (1 - p)), 1.4 * u)
64
+ }
65
+ const g = (lt - 1.62) / 3.6
66
+ if (g > 0) {
67
+ inkBlob(c, X, Y, easeOutExpo(g) * 0.4 * m, 11, '#51473a', 0.85, 0.3, lt)
68
+ inkBlob(c, X + 0.05 * m, Y - 0.03 * m, easeOutExpo(g * 1.2) * 0.26 * m, 23, '#2c2720', 0.9, 0.35, lt)
69
+ glow(c, X, Y, 0.5 * m, COL.gold, 0.08 * easeOut(g))
70
+ }
71
+ const size = (P ? 290 : 250) * u
72
+ ;['劝', '学'].forEach((ch, i) => {
73
+ const r = (lt - 2.3 - i * 0.42) / 1.15
74
+ const x = P ? X : X + (i - 0.5) * size * 1.12
75
+ const y = P ? Y + (i - 0.5) * size * 1.08 : Y
76
+ revealChar(c, ch, x, y, size, F.brush, COL.paper, clamp(r))
77
+ })
78
+ const sx = P ? X + size * 0.78 : X + size * 1.3, sy = P ? Y + size * 0.98 : Y + size * 0.36
79
+ stamp(c, sx, sy, 96 * u, '荀子', lt - 4.55)
80
+ const a = ramp(lt, 5.1, 1.1)
81
+ const ty = P ? Y + size * 1.62 : Y + size * 0.98
82
+ text(c, '《荀子》首篇 · 课文精讲', X, ty, 32 * u, F.song, COL.gold, a, 'center', 12 * u)
83
+ hairline(c, X - 520 * u, ty, X - 290 * u, ty, a, COL.gold, 0.5 * a, u)
84
+ hairline(c, X + 290 * u, ty, X + 520 * u, ty, a, COL.gold, 0.5 * a, u)
85
+ text(c, 'XUNZI · AN EXHORTATION TO LEARNING', X, ty + 54 * u, 15 * u, F.song, COL.muted, a * 0.75, 'center', 6 * u)
86
+ },
87
+ },
88
+
89
+ // ---------- 章节卡 ----------
90
+ card: {
91
+ zoom: 1.4,
92
+ draw(S) {
93
+ const { c, W, H, u, P, lt } = S
94
+ const ci = S.shot.chapter, ch = TL.chapters[ci]
95
+ mountains(c, W, H, lt + ci * 9, { seed: 10 + ci, alpha: 0.3, y: 40 * u })
96
+ dust(c, W, H, lt, 40, 7 + ci, COL.gold, 0.25)
97
+ const m = Math.min(W, H)
98
+ c.save(); c.translate(W / 2, H * 0.47); c.scale(1 + lt * 0.02, 1 + lt * 0.02)
99
+ text(c, CH_KEY[ci], 0, 0, m * 0.95, F.cao, COL.paper, 0.06 * ramp(lt, 0, 1.4))
100
+ c.restore()
101
+ const Y = P ? H * 0.46 : H * 0.48
102
+ const a0 = ramp(lt, 0.2, 0.8)
103
+ const no = ch.no === '终' ? '终 章' : `第 ${ch.no} 章`
104
+ text(c, no, W / 2, Y - 150 * u, 30 * u, F.song, COL.gold, a0, 'center', 12 * u)
105
+ const chars = [...ch.title.replace(/\s/g, '')]
106
+ const adv = chars.map((cc) => (cc === '·' ? 0.7 : 1.08))
107
+ const totalAdv = adv.reduce((a, b) => a + b, 0)
108
+ const size = Math.min((chars.length > 5 ? 112 : 136) * u, (W * 0.82) / totalAdv)
109
+ let acc = -totalAdv / 2
110
+ chars.forEach((cc, i) => {
111
+ const x = W / 2 + (acc + adv[i] / 2) * size
112
+ acc += adv[i]
113
+ revealChar(c, cc, x, Y, size, F.brush, cc === '·' ? COL.gold : COL.paper, clamp((lt - 0.55 - i * 0.12) / 0.8))
114
+ })
115
+ const hl = ramp(lt, 1.3, 1)
116
+ hairline(c, W / 2 - 300 * u, Y + 110 * u, W / 2 + 300 * u, Y + 110 * u, hl, COL.gold, 0.6, u)
117
+ text(c, ch.sub, W / 2, Y + 160 * u, 30 * u, F.song, COL.muted, ramp(lt, 1.6, 0.9), 'center', 8 * u)
118
+ seal(c, W / 2, Y + 250 * u, 58 * u, ch.no, ramp(lt, 1.0, 0.4))
119
+ },
120
+ },
121
+
122
+ // ---------- 壹 · 其人其书 ----------
123
+ era: {
124
+ draw(S) {
125
+ const { c, W, H, u, P, lt } = S
126
+ const sy = lerp(H * 0.42, H * 0.3, smooth(lt / S.dur))
127
+ glow(c, W * 0.66, sy, 0.3 * Math.min(W, H), '#e9d7ad', 0.16)
128
+ ellipse(c, W * 0.66, sy, 46 * u, 46 * u, 'rgba(236,222,190,0.22)')
129
+ mountains(c, W, H, lt, { seed: 3, drift: 1.4, y: P ? 120 * u : 0 })
130
+ // 飞鸟
131
+ for (let i = 0; i < 7; i++) {
132
+ const bx = W * (0.2 + i * 0.05) + lt * 22 * u + hash(i) * 60 * u, by = H * (0.26 + hash(i + 9) * 0.08) + Math.sin(lt * 2 + i) * 6 * u
133
+ const f = Math.sin(lt * 6 + i * 2) * 4 * u
134
+ c.strokeStyle = rgba(COL.paper, 0.5); c.lineWidth = 1.6 * u
135
+ c.beginPath(); c.moveTo(bx - 9 * u, by - f); c.quadraticCurveTo(bx - 3 * u, by - 2 * u, bx, by); c.quadraticCurveTo(bx + 3 * u, by - 2 * u, bx + 9 * u, by - f); c.stroke()
136
+ }
137
+ const x = P ? W * 0.5 : W * 0.84, y = P ? H * 0.12 : H * 0.18
138
+ vtext(c, '战国末年', x, y, 76 * u, F.brush, COL.paper, 1, 1.12, (i) => (lt - 0.6 - i * 0.18) / 0.7)
139
+ vtext(c, '约公元前三世纪', x - 74 * u, y + 10 * u, 24 * u, F.song, COL.gold, ramp(lt, 1.6, 1), 1.5)
140
+ const kj = S.k('c1l1', '稷下学宫')
141
+ const lx = P ? W * 0.5 : W * 0.3, ly = P ? H * 0.6 : H * 0.62
142
+ seal(c, lx - 120 * u, ly, 64 * u, '齐', ramp(lt, kj - 0.2, 0.4))
143
+ text(c, '稷下学宫', lx + 10 * u, ly, 54 * u, F.kai, COL.paper, ramp(lt, kj, 0.8), 'center', 10 * u)
144
+ text(c, '百家争鸣之所', lx + 10 * u, ly + 52 * u, 22 * u, F.song, COL.muted, ramp(lt, kj + 0.6, 0.8), 'center', 8 * u)
145
+ },
146
+ },
147
+
148
+ person: {
149
+ draw(S) {
150
+ const { c, W, H, u, P, lt } = S
151
+ const m = Math.min(W, H)
152
+ text(c, '荀', P ? W * 0.5 : W * 0.25, P ? H * 0.32 : H * 0.48, m * 0.95, F.brush, COL.paper, 0.07 * ramp(lt, 0, 1.5))
153
+ dust(c, W, H, lt, 30, 5, COL.gold, 0.25)
154
+ const cards = [
155
+ { t: '荀况', s: '赵人 · 世称荀卿', k: S.k('c1l2', '荀况') },
156
+ { t: '祭酒', s: '三为稷下学宫祭酒', k: S.k('c1l2', '三次出任') },
157
+ { t: '门生', s: '韩非 · 李斯', k: S.k('c1l2', '韩非') },
158
+ ]
159
+ cards.forEach((cd, i) => {
160
+ // 竖排从右往左:第一张在最右
161
+ const r: Rect = P
162
+ ? { x: W * (0.69 - i * 0.29) - W * 0.12, y: H * 0.36, w: W * 0.24, h: H * 0.38 }
163
+ : { x: W * (0.84 - i * 0.15) - W * 0.06, y: H * 0.2, w: W * 0.12, h: H * 0.58 }
164
+ const a = ramp(lt, cd.k - 0.3, 0.7)
165
+ if (a <= 0) return
166
+ c.fillStyle = rgba('#1b1915', 0.75 * a); c.fillRect(r.x, r.y, r.w, r.h)
167
+ frame(c, r, ramp(lt, cd.k - 0.3, 1.2), COL.gold, 0.55, 1.2 * u)
168
+ frame(c, { x: r.x + 8 * u, y: r.y + 8 * u, w: r.w - 16 * u, h: r.h - 16 * u }, ramp(lt, cd.k, 1.2), COL.gold, 0.25, u)
169
+ const size = 78 * u
170
+ vtext(c, cd.t, r.x + r.w * 0.56, r.y + r.h * 0.22, size, F.brush, COL.paper, 1, 1.15, (j) => (lt - cd.k - j * 0.15) / 0.6)
171
+ vtext(c, cd.s.replace(/ · /g, '·').replace(/·/g, ''), r.x + r.w * 0.2, r.y + r.h * 0.2, 24 * u, F.song, COL.gold, ramp(lt, cd.k + 0.5, 0.8), 1.3)
172
+ seal(c, r.x + r.w * 0.56, r.y + r.h - 44 * u, 40 * u, ['荀', '酒', '师'][i], ramp(lt, cd.k + 0.8, 0.3))
173
+ })
174
+ },
175
+ },
176
+
177
+ slips: {
178
+ draw(S) {
179
+ const { c, W, H, u, P, lt } = S
180
+ const k0 = S.k('c1l3', '三十二篇'), kq = S.k('c1l3', '劝学'), kd = S.k('c1l4', '宣言')
181
+ const rows = P ? 2 : 1, per = 32 / rows
182
+ const totalW = (P ? 0.9 : 0.86) * W
183
+ const sw = (totalW / per) * 0.74, gap = totalW / per
184
+ const sh = P ? H * 0.24 : H * 0.5
185
+ const top = P ? H * 0.22 : H * 0.17
186
+ const focus = ramp(lt, kq - 0.2, 0.9)
187
+ for (let j = 0; j < 32; j++) {
188
+ const row = Math.floor(j / per), col = j % per
189
+ const x = W / 2 + totalW / 2 - gap / 2 - col * gap
190
+ const y = top + row * (sh + H * 0.05)
191
+ const ap = ramp(lt, k0 - 1.6 + j * 0.05, 0.5)
192
+ if (ap <= 0) continue
193
+ const first = j === 0
194
+ const lift = first ? -focus * 24 * u : 0
195
+ const yy = y + (1 - easeOut(ap)) * 40 * u + lift
196
+ const alpha = ap * (first ? 1 : 1 - 0.65 * focus)
197
+ const g = c.createLinearGradient(x - sw / 2, 0, x + sw / 2, 0)
198
+ g.addColorStop(0, rgba('#7d6640', alpha)); g.addColorStop(0.5, rgba(first ? '#d8bf88' : COL.bamboo, alpha)); g.addColorStop(1, rgba('#6e5a38', alpha))
199
+ c.fillStyle = g
200
+ c.beginPath(); c.roundRect(x - sw / 2, yy, sw, sh, sw * 0.18); c.fill()
201
+ // 简上墨迹
202
+ const r = rng(j * 13 + 1)
203
+ if (!first) for (let q = 0; q < 14; q++) { c.fillStyle = `rgba(30,24,16,${0.35 * alpha})`; c.fillRect(x - sw * 0.16, yy + sh * (0.08 + q * 0.062), sw * (0.22 + r() * 0.12), sh * 0.02 + r() * sh * 0.012) }
204
+ if (first) {
205
+ glow(c, x, yy + sh / 2, sh * 0.7, COL.gold, 0.18 * focus)
206
+ vtext(c, '劝学篇第一', x, yy + sh * 0.12, Math.min(sw * 0.72, sh / 6.2), F.kai, '#2a2015', 1, 1.14, (q) => (lt - kq - q * 0.12) / 0.5)
207
+ }
208
+ }
209
+ // 编绳
210
+ for (let row = 0; row < rows; row++) {
211
+ const y = top + row * (sh + H * 0.05)
212
+ for (const f of [0.14, 0.86]) {
213
+ c.strokeStyle = rgba('#3a2a1a', 0.85 * ramp(lt, k0 - 0.4, 0.8)); c.lineWidth = 2.2 * u
214
+ c.beginPath(); c.moveTo(W / 2 - totalW / 2, y + sh * f); c.lineTo(W / 2 + totalW / 2, y + sh * f); c.stroke()
215
+ }
216
+ }
217
+ const by = P ? top + 2 * sh + H * 0.12 : top + sh + H * 0.1
218
+ text(c, '《荀子》 三十二篇', W / 2, by, 44 * u, F.kai, COL.paper, ramp(lt, k0, 0.8) * (1 - 0.5 * ramp(lt, kd - 1.5, 1)), 'center', 12 * u)
219
+ text(c, '西汉 刘向 校定 · 劝学居首', W / 2, by + 52 * u, 22 * u, F.song, COL.muted, ramp(lt, k0 + 1, 0.8) * (1 - ramp(lt, kd - 1.5, 1)), 'center', 6 * u)
220
+ const da = ramp(lt, kd - 0.3, 0.8)
221
+ if (da > 0) {
222
+ text(c, '一种思想的宣言', W / 2, by + 10 * u, 58 * u, F.brush, COL.gold, da, 'center', 16 * u)
223
+ }
224
+ },
225
+ },
226
+
227
+ // ---------- 贰 · 思想底色 ----------
228
+ ren: {
229
+ draw(S) {
230
+ const { c, W, H, u, P, lt } = S
231
+ const hasQ = lt > S.ls('c2l2') - 0.6
232
+ const shift = easeInOut(ramp(lt, S.ls('c2l2') - 0.9, 1.2))
233
+ const cxp = P ? W / 2 : lerp(W / 2, W * 0.33, shift)
234
+ const cyp = P ? lerp(H * 0.48, H * 0.6, shift) : H * 0.47
235
+ const s = Math.min(W, H) * (P ? 0.46 : 0.5) * (1 - 0.12 * shift)
236
+ inkBlob(c, cxp, cyp, s * 0.9 * easeOutExpo(ramp(lt, 0.1, 2.5)), 41, '#3b352c', 0.55, 0.32, lt)
237
+ dust(c, W, H, lt, 36, 9, COL.paper, 0.3)
238
+ const s1 = bez([cxp + s * 0.06, cyp - s * 0.5], [cxp - s * 0.02, cyp + 0.05 * s], [cxp - s * 0.46, cyp + s * 0.44])
239
+ const s2 = bez([cxp - s * 0.04, cyp - s * 0.1], [cxp + s * 0.12, cyp + s * 0.3], [cxp + s * 0.5, cyp + s * 0.44])
240
+ brush(c, s1, s * 0.15, easeInOut(ramp(lt, 0.4, 1.0)), COL.paper, 0.95, 3, 0.7)
241
+ brush(c, s2, s * 0.17, easeInOut(ramp(lt, 1.25, 1.0)), COL.paper, 0.95, 7, 0.7)
242
+ text(c, '人', cxp, cyp + s * 0.72, 26 * u, F.song, COL.gold, ramp(lt, 2.2, 1) * (hasQ ? 0 : 1), 'center', 8 * u)
243
+ text(c, '荀子如何看“人”?', cxp, cyp + s * 0.72, 30 * u, F.song, COL.gold, ramp(lt, 2.2, 1) * (1 - shift), 'center', 8 * u)
244
+ },
245
+ },
246
+
247
+ wei: {
248
+ draw(S) {
249
+ const { c, W, H, u, P, lt } = S
250
+ const size = Math.min(W, H) * 0.44
251
+ const X = W / 2, Y = P ? H * 0.42 : H * 0.42
252
+ const kx = S.k('c2l3', '不是虚伪'), kr = S.k('c2l3', '而是'), kh = S.k('c2l3', '后天')
253
+ const sp = easeInOut(ramp(lt, kr - 0.2, 1.1))
254
+ inkBlob(c, X, Y, size * 0.75, 51, '#3a342b', 0.5 * (1 - sp * 0.5), 0.3, lt)
255
+ const ra = clamp(lt / 0.8)
256
+ c.font = font(size, F.brush); c.textAlign = 'center'; c.textBaseline = 'middle'
257
+ const off = sp * size * 0.32
258
+ const split = X - size * 0.17
259
+ c.save(); c.beginPath(); c.rect(0, 0, split, H); c.clip()
260
+ revealChar(c, '伪', X - off, Y, size, F.brush, sp > 0 ? COL.gold : COL.paper, ra)
261
+ c.restore()
262
+ c.save(); c.beginPath(); c.rect(split, 0, W - split, H); c.clip()
263
+ revealChar(c, '伪', X + off, Y, size, F.brush, COL.paper, ra)
264
+ c.restore()
265
+ // 虚伪 ✗
266
+ const xa = win(lt, kx - 0.1, kr + 0.4, 0.4)
267
+ if (xa > 0) {
268
+ const qx = P ? X : X + size * 0.95, qy = P ? Y + size * 0.72 : Y
269
+ text(c, '虚伪', qx, qy, 48 * u, F.kai, COL.muted, xa, 'center', 6 * u)
270
+ c.strokeStyle = rgba(COL.red, xa); c.lineWidth = 4 * u
271
+ c.beginPath(); c.moveTo(qx - 60 * u, qy + 4 * u); c.lineTo(qx - 60 * u + 120 * u * ramp(lt, kx + 0.5, 0.4), qy - 4 * u); c.stroke()
272
+ }
273
+ const la = ramp(lt, kr + 0.4, 0.7)
274
+ const ly = Y + size * 0.72
275
+ text(c, '人', X - off - size * 0.1, ly, 64 * u, F.kai, COL.gold, la)
276
+ text(c, '+', X, ly, 40 * u, F.song, COL.muted, la)
277
+ text(c, '为', X + off + size * 0.06, ly, 64 * u, F.kai, COL.paper, la)
278
+ text(c, '伪 = 人为 · 后天的努力���塑造', X, ly + 96 * u, 34 * u, F.song, COL.paper, ramp(lt, kh, 0.8), 'center', 6 * u)
279
+ },
280
+ },
281
+
282
+ mengxun: {
283
+ draw(S) {
284
+ const { c, W, H, u, P, lt } = S
285
+ const km = S.k('c2l4', '孟子'), kx = S.k('c2l4', '荀子'), kw = S.k('c2l4', '向外求取')
286
+ const [A, B] = P ? [{ x: 0, y: H * 0.1, w: W, h: H * 0.36 }, { x: 0, y: H * 0.48, w: W, h: H * 0.36 }] : [{ x: W * 0.06, y: H * 0.12, w: W * 0.42, h: H * 0.68 }, { x: W * 0.52, y: H * 0.12, w: W * 0.42, h: H * 0.68 }]
287
+ // 分隔金线
288
+ if (P) hairline(c, W * 0.2, H * 0.47, W * 0.8, H * 0.47, ramp(lt, 0, 1), COL.gold, 0.4, u)
289
+ else hairline(c, W / 2, H * 0.18, W / 2, H * 0.78, ramp(lt, 0, 1), COL.gold, 0.4, u)
290
+ // 孟子:向内
291
+ const aa = ramp(lt, km - 0.3, 0.8)
292
+ const ax = A.x + A.w / 2, ay = A.y + A.h * 0.5, R = mn(A) * 0.3
293
+ for (let i = 0; i < 6; i++) {
294
+ const p = ((lt * 0.22 + i / 6) % 1)
295
+ const r = R * (1 - p)
296
+ ellipse(c, ax, ay, r, r, undefined, rgba(COL.paper, aa * 0.4 * p), 1.3 * u)
297
+ }
298
+ glow(c, ax, ay, R * 0.6, COL.gold, 0.5 * aa)
299
+ ellipse(c, ax, ay, 7 * u, 7 * u, rgba(COL.gold, aa))
300
+ text(c, '孟子 · 性善', ax, A.y + A.h * 0.08, 46 * u, F.kai, COL.paper, aa, 'center', 6 * u)
301
+ text(c, '善端本具 · 向内寻回', ax, A.y + A.h * 0.92, 28 * u, F.song, COL.muted, aa, 'center', 6 * u)
302
+ // 荀子:向外筑起
303
+ const ba = ramp(lt, kx - 0.3, 0.8)
304
+ const bx = B.x + B.w / 2, base = B.y + B.h * 0.78
305
+ const bw = mn(B) * 0.13, bh = bw * 0.42
306
+ let n = 0
307
+ for (let row = 0; row < 6; row++) {
308
+ const cnt = 6 - row
309
+ for (let q = 0; q < cnt; q++) {
310
+ const tb = kw - 0.8 + n * 0.11
311
+ const p = ramp(lt, tb, 0.35)
312
+ n++
313
+ if (p <= 0) continue
314
+ const x = bx + (q - (cnt - 1) / 2) * bw * 1.06, y = base - row * bh * 1.12 - (1 - easeOutBack(p)) * 30 * u
315
+ c.fillStyle = rgba('#2b2721', p * ba); c.fillRect(x - bw / 2, y - bh, bw, bh)
316
+ c.strokeStyle = rgba(COL.gold, 0.7 * p * ba); c.lineWidth = 1.2 * u; c.strokeRect(x - bw / 2, y - bh, bw, bh)
317
+ }
318
+ }
319
+ text(c, '荀子 · 性恶', bx, B.y + B.h * 0.08, 46 * u, F.kai, COL.paper, ba, 'center', 6 * u)
320
+ text(c, '欲望本能 · 向外筑起', bx, B.y + B.h * 0.92, 28 * u, F.song, COL.muted, ba, 'center', 6 * u)
321
+ },
322
+ },
323
+
324
+ road: {
325
+ draw(S) {
326
+ const { c, W, H, u, P, lt } = S
327
+ mountains(c, W, H, lt, { seed: 21, alpha: 0.45, y: P ? 200 * u : 60 * u })
328
+ const pts: [number, number][] = []
329
+ for (let i = 0; i <= 80; i++) {
330
+ const t = i / 80
331
+ if (P) pts.push([W * (0.5 + 0.18 * Math.sin(t * Math.PI * 2.2)), lerp(H * 0.8, H * 0.2, t)])
332
+ else pts.push([lerp(W * 0.1, W * 0.9, t), H * (0.6 - 0.12 * t + 0.06 * Math.sin(t * Math.PI * 2.4))])
333
+ }
334
+ const pp = easeInOut(ramp(lt, 0.3, 2.6))
335
+ brush(c, pts, 10 * u, pp, COL.paper, 0.75, 5, 0.6)
336
+ for (let i = 1; i <= 4; i++) {
337
+ const p = pts[i * 16], a = ramp(lt, 0.6 + i * 0.5, 0.5)
338
+ ellipse(c, p[0], p[1], 7 * u, 7 * u, rgba(COL.gold, a))
339
+ text(c, '学', p[0] + (P ? 44 * u : 0), p[1] - (P ? 0 : 42 * u), 30 * u, F.kai, COL.gold, a * 0.9)
340
+ }
341
+ const mv = smooth(ramp(lt, 1, S.dur - 2))
342
+ const idx = Math.min(80, Math.floor(mv * 80)), dot = pts[idx]
343
+ glow(c, dot[0], dot[1], 60 * u, COL.gold, 0.55 * ramp(lt, 1, 0.6))
344
+ ellipse(c, dot[0], dot[1], 6 * u, 6 * u, rgba('#fff3d6', ramp(lt, 1, 0.6)))
345
+ const k1 = S.k('c2l5', '自然之人'), k2 = S.k('c2l5', '文明之人')
346
+ const s0 = pts[0], s1 = pts[80]
347
+ text(c, '自然之人', s0[0] + (P ? 0 : 20 * u), s0[1] + 56 * u, 40 * u, F.kai, COL.muted, ramp(lt, k1, 0.7), P ? 'center' : 'left', 6 * u)
348
+ text(c, '文明之人', s1[0] - (P ? 0 : 20 * u), s1[1] - 56 * u, 46 * u, F.kai, COL.gold, ramp(lt, k2, 0.7), P ? 'center' : 'right', 6 * u)
349
+ const ky = S.k('c2l5', '唯一道路')
350
+ stamp(c, P ? W * 0.82 : W * 0.5, P ? H * 0.5 : H * 0.78, 70 * u, '唯一', lt - ky)
351
+ },
352
+ },
353
+
354
+ huaxing: {
355
+ draw(S) {
356
+ const { c, W, H, u, P, lt } = S
357
+ const k0 = S.k('c2l6', '化性起伪'), kz = S.k('c2l6', '总纲')
358
+ const size = (P ? 190 : 180) * u
359
+ ;['化', '性', '起', '伪'].forEach((ch, i) => {
360
+ const x = P ? W / 2 : W / 2 + (i - 1.5) * size * 1.3
361
+ const y = P ? H * 0.2 + i * size * 1.18 : H * 0.42
362
+ const tt = k0 + 0.25 + i * 0.32
363
+ const p = ramp(lt, tt - 0.1, 0.9)
364
+ inkBlob(c, x, y, size * 0.7 * easeOutExpo(p), 60 + i, i === 3 ? '#6e2a20' : '#3e382f', 0.75, 0.3, lt)
365
+ revealChar(c, ch, x, y, size, F.brush, i === 3 ? COL.gold : COL.paper, clamp((lt - tt) / 0.6))
366
+ })
367
+ const ty = P ? H * 0.2 + 4 * size * 1.18 : H * 0.68
368
+ const a = ramp(lt, kz - 0.4, 0.9)
369
+ text(c, '《劝学》 即此道之总纲', W / 2, ty, 36 * u, F.song, COL.gold, a, 'center', 10 * u)
370
+ hairline(c, W / 2 - 340 * u, ty + 40 * u, W / 2 + 340 * u, ty + 40 * u, a, COL.gold, 0.4, u)
371
+ text(c, '化:改造本性  起:兴起人为', W / 2, ty + 80 * u, 24 * u, F.song, COL.muted, ramp(lt, kz + 0.4, 0.9), 'center', 6 * u)
372
+ },
373
+ },
374
+
375
+ // ---------- 叁 · 学不可以已 ----------
376
+ five: {
377
+ customQuote: true,
378
+ draw(S) {
379
+ const { c, W, H, u, P, lt } = S
380
+ const L = S.shot.lines[0]
381
+ const kz = S.k('c3l2', '斩钉截铁'), ks = S.k('c3l2', '不可以停止')
382
+ const shake = Math.exp(-Math.max(0, lt - kz) * 7) * (lt > kz ? 1 : 0) * 9 * u
383
+ c.save(); c.translate(noise1(lt * 40) * shake, noise1(lt * 40 + 9) * shake)
384
+ const size = (P ? 200 : 190) * u
385
+ const chars = '学不可以已'
386
+ const base = L.text.indexOf('学')
387
+ text(c, '君子曰', P ? W / 2 : W / 2, P ? H * 0.12 : H * 0.24, 44 * u, F.kai, COL.muted, ramp(lt, L.charT[0] - S.shot.start, 0.6), 'center', 14 * u)
388
+ for (let i = 0; i < 5; i++) {
389
+ const x = P ? W / 2 : W / 2 + (i - 2) * size * 1.12
390
+ const y = P ? H * 0.22 + i * size * 1.1 : H * 0.47
391
+ const ct = L.charT[base + i] - S.shot.start
392
+ revealChar(c, chars[i], x, y, size, F.brush, i === 4 ? COL.gold : COL.paper, clamp((lt - ct) / 0.6))
393
+ }
394
+ // 斩钉截铁:朱笔
395
+ const bp = easeOut(ramp(lt, kz, 0.5))
396
+ if (bp > 0) {
397
+ const pts: [number, number][] = P
398
+ ? Array.from({ length: 30 }, (_, i) => [W / 2 + size * 0.72 + Math.sin(i * 0.2) * 4 * u, H * 0.22 + size * 0.6 + i / 29 * size * 3.9] as [number, number])
399
+ : Array.from({ length: 30 }, (_, i) => [W / 2 - size * 1.4 + i / 29 * size * 4.0, H * 0.47 + size * 0.72 + Math.sin(i * 0.2) * 4 * u] as [number, number])
400
+ brush(c, pts, 16 * u, bp, COL.red, 0.9, 4, 0.4)
401
+ glow(c, W / 2, H / 2, Math.max(W, H) * 0.6, COL.paper, 0.12 * Math.exp(-Math.max(0, lt - kz) * 4))
402
+ }
403
+ const qa = ramp(lt, ks, 0.7)
404
+ const ax = P ? W / 2 - size * 0.9 : W / 2 + size * 2.24, ay = P ? H * 0.22 + 4 * size * 1.1 : H * 0.47 - size * 0.85
405
+ text(c, '已:停止', ax, ay, 30 * u, F.song, COL.gold, qa, 'center', 6 * u)
406
+ c.restore()
407
+ },
408
+ },
409
+
410
+ indigo: {
411
+ quoteSize: 76,
412
+ draw(S) {
413
+ const { c, u, lt } = S
414
+ const [A, B] = two(S.art)
415
+ const k1 = S.k('c3l3', '青'), k2 = S.k('c3l3', '而青于蓝'), k3 = S.k('c3l3', '冰'), k4 = S.k('c3l3', '而寒于水')
416
+ const kt = S.k('c3l4', '提炼'), kn = S.k('c3l4', '凝结')
417
+ // 蓝 → 青
418
+ const ax = A.x + A.w / 2, ay = A.y + A.h * 0.44, R = mn(A) * 0.42
419
+ const g = ramp(lt, k1 - 0.3, 3)
420
+ const deep = ramp(lt, k2 - 0.6, 1.8)
421
+ const col = deep > 0 ? mix('#7fa2c9', '#132a58', deep) : '#7fa2c9'
422
+ for (let i = 0; i < 3; i++) inkBlob(c, ax + Math.cos(lt * 0.3 + i * 2) * R * 0.12, ay + Math.sin(lt * 0.3 + i * 2) * R * 0.12, R * (0.55 + i * 0.18) * easeOutExpo(g), 70 + i, col, 0.55 - i * 0.12, 0.3, lt)
423
+ glow(c, ax, ay, R, '#5c86c4', 0.12 * g)
424
+ const sw = 34 * u, sy = A.y + A.h * 0.84
425
+ const ca = ramp(lt, k2 - 0.2, 0.6)
426
+ c.fillStyle = rgba('#7fa2c9', ca); c.fillRect(ax - 110 * u, sy - sw / 2, sw, sw)
427
+ c.fillStyle = rgba('#132a58', ca); c.fillRect(ax + 76 * u, sy - sw / 2, sw, sw)
428
+ c.strokeStyle = rgba(COL.gold, ca * 0.7); c.lineWidth = u; c.strokeRect(ax + 76 * u, sy - sw / 2, sw, sw)
429
+ text(c, '蓝', ax - 93 * u, sy + 46 * u, 26 * u, F.kai, COL.muted, ca)
430
+ text(c, '青', ax + 93 * u, sy + 46 * u, 26 * u, F.kai, COL.paper, ca)
431
+ arrow(c, ax - 60 * u, sy, ax + 60 * u, sy, COL.gold, ca, 1.6 * u)
432
+ text(c, '提炼', ax, sy - 30 * u, 22 * u, F.song, COL.gold, ramp(lt, kt, 0.6))
433
+ // 水 → 冰
434
+ const bx = B.x + B.w / 2, by = B.y + B.h * 0.44, BR = mn(B) * 0.4
435
+ const gi = easeOut(ramp(lt, k3 - 0.2, Math.max(1, k4 - k3 + 1.5)))
436
+ glow(c, bx, by, BR * 1.3, '#bfe3ee', 0.18 * gi)
437
+ c.strokeStyle = rgba(COL.ice, 0.9 * Math.min(1, gi * 3)); c.lineCap = 'round'
438
+ for (let arm = 0; arm < 6; arm++) {
439
+ const ang = arm * Math.PI / 3 - Math.PI / 2
440
+ const len = BR * gi
441
+ c.lineWidth = 2.4 * u
442
+ c.beginPath(); c.moveTo(bx, by); c.lineTo(bx + Math.cos(ang) * len, by + Math.sin(ang) * len); c.stroke()
443
+ for (let b = 1; b <= 4; b++) {
444
+ const d = (b / 5) * BR
445
+ if (d > len) break
446
+ const bl = Math.min(len - d, BR * 0.32 * (1 - b / 6))
447
+ const px = bx + Math.cos(ang) * d, py = by + Math.sin(ang) * d
448
+ c.lineWidth = 1.6 * u
449
+ for (const s of [-1, 1]) {
450
+ const a2 = ang + s * Math.PI / 3
451
+ c.beginPath(); c.moveTo(px, py); c.lineTo(px + Math.cos(a2) * bl, py + Math.sin(a2) * bl); c.stroke()
452
+ }
453
+ }
454
+ }
455
+ const ia = ramp(lt, k4 - 0.2, 0.6)
456
+ c.fillStyle = rgba('#5b6f78', ia); c.fillRect(bx - 110 * u, sy - sw / 2, sw, sw)
457
+ c.fillStyle = rgba(COL.ice, ia); c.fillRect(bx + 76 * u, sy - sw / 2, sw, sw)
458
+ text(c, '水', bx - 93 * u, sy + 46 * u, 26 * u, F.kai, COL.muted, ia)
459
+ text(c, '冰', bx + 93 * u, sy + 46 * u, 26 * u, F.kai, COL.paper, ia)
460
+ arrow(c, bx - 60 * u, sy, bx + 60 * u, sy, COL.gold, ia, 1.6 * u)
461
+ text(c, '凝结', bx, sy - 30 * u, 22 * u, F.song, COL.gold, ramp(lt, kn, 0.6))
462
+ },
463
+ },
464
+
465
+ surpass: {
466
+ draw(S) {
467
+ const { c, W, H, u, P, lt } = S
468
+ const X = W / 2, Y = P ? H * 0.44 : H * 0.46, R = Math.min(W, H) * 0.17
469
+ const kb = S.k('c3l5', '本来面目'), kc = S.k('c3l5', '超越'), kh = S.k('c3l5', '后天')
470
+ const a0 = ramp(lt, 0.2, 0.8)
471
+ const g = c.createRadialGradient(X, Y, 0, X, Y, R)
472
+ g.addColorStop(0, rgba('#6b6253', 0.8 * a0)); g.addColorStop(1, rgba('#3a352d', 0.6 * a0))
473
+ ellipse(c, X, Y, R, R, undefined); c.fillStyle = g; c.fill()
474
+ text(c, '本来面目', X, Y, 36 * u, F.kai, COL.paper, ramp(lt, kb - 0.2, 0.6), 'center', 6 * u)
475
+ text(c, '先天', X, Y + 46 * u, 22 * u, F.song, COL.muted, ramp(lt, kb, 0.6), 'center', 6 * u)
476
+ const ep = easeInOut(ramp(lt, kc - 0.4, 1.6))
477
+ enso(c, X, Y, R * 1.75, ep, COL.gold, 0.9, 22 * u, 5)
478
+ glow(c, X, Y, R * 2.4, COL.gold, 0.1 * ep)
479
+ text(c, '学而后成', X, Y - R * 1.75 - 46 * u, 32 * u, F.kai, COL.gold, ramp(lt, kc + 0.6, 0.7), 'center', 8 * u)
480
+ const ha = ramp(lt, kh - 0.2, 0.7)
481
+ const ty = Y + R * 1.75 + 96 * u
482
+ text(c, '后天', X - 110 * u, ty, 62 * u, F.brush, COL.gold, ha)
483
+ text(c, '>', X, ty, 44 * u, F.song, COL.paper, ha)
484
+ text(c, '先天', X + 110 * u, ty, 62 * u, F.brush, COL.muted, ha)
485
+ },
486
+ },
487
+
488
+ wheel: {
489
+ quoteSize: 66,
490
+ draw(S) {
491
+ const { c, u, lt } = S
492
+ const r = S.art
493
+ const ax = r.x + r.w / 2, ay = r.y + r.h * 0.46, R = mn(r) * 0.3
494
+ const kStraight = S.k('c3l6', '木直中绳'), kb = S.k('c3l6', '輮以为轮'), kg = S.k('c3l6', '其曲中规'), ks = S.k('c3l6', '虽有槁暴'), kr = S.ls('c3l7'), kn = S.k('c3l7', '也不会重新挺直')
495
+ const L = 2 * Math.PI * R * 0.97
496
+ const p = easeInOut(ramp(lt, kb, 2.4))
497
+ const th = p * Math.PI * 2 * 0.97
498
+ const kap = Math.max(1e-5, th / L)
499
+ const rot = lt > kr ? (lt - kr) * 0.25 : 0
500
+ const pts: [number, number][] = []
501
+ for (let i = 0; i <= 90; i++) {
502
+ const s = (i / 90 - 0.5) * L
503
+ const ph = s * kap
504
+ let x = ax + Math.sin(ph) / kap, y = ay + R - (1 - Math.cos(ph)) / kap
505
+ if (rot) { const dx = x - ax, dy = y - ay; x = ax + dx * Math.cos(rot) - dy * Math.sin(rot); y = ay + dx * Math.sin(rot) + dy * Math.cos(rot) }
506
+ pts.push([x, y])
507
+ }
508
+ // 墨线(绳)
509
+ const sa = win(lt, kStraight - 0.2, kb + 0.3, 0.4)
510
+ if (sa > 0) {
511
+ c.strokeStyle = rgba(COL.gold, 0.8 * sa); c.lineWidth = 1.4 * u; c.setLineDash([10 * u, 8 * u])
512
+ c.beginPath(); c.moveTo(ax - L / 2 - 30 * u, ay + R - 26 * u); c.lineTo(ax + L / 2 + 30 * u, ay + R - 26 * u); c.stroke(); c.setLineDash([])
513
+ text(c, '绳', ax - L / 2 - 50 * u, ay + R - 26 * u, 30 * u, F.kai, COL.gold, sa)
514
+ }
515
+ // 火
516
+ const fa = win(lt, kb - 0.3, kb + 3.2, 0.5) + 0.35 * win(lt, S.k('c3l7', '用火烘烤') - 0.2, S.k('c3l7', '弯成车轮') + 0.6, 0.4)
517
+ if (fa > 0) {
518
+ c.save(); c.globalCompositeOperation = 'lighter'
519
+ for (let i = 0; i < 14; i++) {
520
+ const fx = ax + (hash(i) - 0.5) * R * 1.2, ph = (lt * (1.4 + hash(i + 3)) + hash(i + 5)) % 1
521
+ const fy = ay + R + 60 * u - ph * 110 * u
522
+ glow(c, fx + noise1(lt * 3 + i) * 10 * u, fy, (34 - ph * 24) * u, ph < 0.5 ? '#ff9a3c' : '#c4421f', 0.5 * fa * (1 - ph))
523
+ }
524
+ c.restore()
525
+ }
526
+ // 木
527
+ c.lineCap = 'round'
528
+ c.strokeStyle = rgba('#5d4026', 1); c.lineWidth = 30 * u
529
+ c.beginPath(); pts.forEach((q, i) => (i ? c.lineTo(q[0], q[1]) : c.moveTo(q[0], q[1]))); c.stroke()
530
+ c.strokeStyle = rgba('#a77d4f', 0.95); c.lineWidth = 22 * u; c.stroke()
531
+ c.strokeStyle = rgba('#d4ad78', 0.45); c.lineWidth = 3 * u; c.stroke()
532
+ // 辐条
533
+ const spk = ramp(lt, kg - 0.2, 1.4)
534
+ if (spk > 0 && p > 0.98) {
535
+ const n = 12
536
+ for (let i = 0; i < n; i++) {
537
+ const a = rot + (i / n) * Math.PI * 2, e = clamp(spk * n - i)
538
+ if (e <= 0) continue
539
+ c.strokeStyle = rgba('#8c6640', e); c.lineWidth = 6 * u
540
+ c.beginPath(); c.moveTo(ax + Math.cos(a) * R * 0.14, ay + Math.sin(a) * R * 0.14); c.lineTo(ax + Math.cos(a) * R * (0.14 + 0.82 * e), ay + Math.sin(a) * R * (0.14 + 0.82 * e)); c.stroke()
541
+ }
542
+ ellipse(c, ax, ay, R * 0.15, R * 0.15, rgba('#6e4c2e', spk), rgba('#d4ad78', 0.6 * spk), 2 * u)
543
+ // 规
544
+ c.setLineDash([6 * u, 9 * u]); ellipse(c, ax, ay, R * 1.14, R * 1.14, undefined, rgba(COL.gold, 0.6 * win(lt, kg, ks + 1.5, 0.5)), 1.4 * u); c.setLineDash([])
545
+ text(c, '规', ax + R * 1.22, ay - R * 0.9, 30 * u, F.kai, COL.gold, win(lt, kg, ks + 1.5, 0.5))
546
+ }
547
+ // 槁暴:日晒风干
548
+ const sa2 = win(lt, ks - 0.2, kr + 1, 0.6)
549
+ if (sa2 > 0) {
550
+ glow(c, r.x + r.w * 0.86, r.y + r.h * 0.1, R * 0.9, '#f2c46d', 0.5 * sa2)
551
+ for (let i = 0; i < 5; i++) {
552
+ const yy = r.y + r.h * (0.25 + i * 0.12), xx = r.x + ((lt * 0.3 + i * 0.23) % 1) * r.w
553
+ c.strokeStyle = rgba(COL.paper, 0.25 * sa2); c.lineWidth = 1.2 * u
554
+ c.beginPath(); c.moveTo(xx, yy); c.bezierCurveTo(xx + 40 * u, yy - 8 * u, xx + 80 * u, yy + 8 * u, xx + 130 * u, yy); c.stroke()
555
+ }
556
+ }
557
+ stamp(c, ax, ay + R + 90 * u, 70 * u, '不复', lt - kn)
558
+ },
559
+ },
560
+
561
+ reshape: {
562
+ draw(S) {
563
+ const { c, W, H, u, P, lt } = S
564
+ const kg = S.k('c3l8', '根本的'), kt = S.k('c3l8', '涂上'), kz = S.k('c3l8', '重塑')
565
+ text(c, '根本 · 不可逆', W / 2, P ? H * 0.16 : H * 0.17, 64 * u, F.brush, COL.paper, ramp(lt, kg - 0.2, 0.8), 'center', 16 * u)
566
+ const [A, B] = two(P ? { x: W * 0.06, y: H * 0.28, w: W * 0.88, h: H * 0.5 } : { x: W * 0.12, y: H * 0.28, w: W * 0.76, h: H * 0.54 })
567
+ const shape = (x: number, y: number, R: number, m: number, seed: number) => {
568
+ c.beginPath()
569
+ for (let i = 0; i <= 100; i++) {
570
+ const a = (i / 100) * Math.PI * 2
571
+ const rr = R * (1 + (1 - m) * 0.32 * fbm1(Math.cos(a) * 1.3 + Math.sin(a) + seed, 4))
572
+ const px = x + Math.cos(a) * rr, py = y + Math.sin(a) * rr
573
+ i ? c.lineTo(px, py) : c.moveTo(px, py)
574
+ }
575
+ c.closePath()
576
+ }
577
+ const aa = ramp(lt, kt - 0.4, 0.6), dimA = 1 - 0.55 * ramp(lt, kz - 0.2, 0.8)
578
+ const ax = A.x + A.w / 2, ay = A.y + A.h * 0.45, R = mn(A) * 0.3
579
+ shape(ax, ay, R, 0, 3); c.fillStyle = rgba('#4d463b', aa * dimA); c.fill()
580
+ c.strokeStyle = rgba('#6f9ad0', aa * dimA * ramp(lt, kt, 0.9)); c.lineWidth = 7 * u; c.stroke()
581
+ caption(S, A, '涂上一层颜色', aa * dimA, COL.muted)
582
+ const ba = ramp(lt, kz - 0.4, 0.6)
583
+ const m = easeInOut(ramp(lt, kz, 2.2))
584
+ const bx = B.x + B.w / 2, by = B.y + B.h * 0.45
585
+ glow(c, bx, by, R * 1.8, COL.gold, 0.15 * m * ba)
586
+ shape(bx, by, R, m, 3)
587
+ const gg = c.createRadialGradient(bx - R * 0.3, by - R * 0.3, 0, bx, by, R * 1.2)
588
+ gg.addColorStop(0, rgba('#f3e7cc', ba)); gg.addColorStop(1, rgba('#a88a55', ba))
589
+ c.fillStyle = gg; c.fill()
590
+ caption(S, B, '重塑人的形状', ba, COL.gold)
591
+ },
592
+ },
593
+
594
+ rope: {
595
+ quoteSize: 62,
596
+ draw(S) {
597
+ const { c, u, lt } = S
598
+ const [A, B] = two(S.art)
599
+ const k1 = S.k('c3l9', '木受绳'), k2 = S.k('c3l9', '金就砺')
600
+ // 绳墨
601
+ const aa = ramp(lt, k1 - 0.5, 0.6)
602
+ const px = A.x + A.w * 0.1, pw = A.w * 0.8, py = A.y + A.h * 0.5, ph = mn(A) * 0.13
603
+ const g = c.createLinearGradient(0, py - ph / 2, 0, py + ph / 2)
604
+ g.addColorStop(0, rgba('#a9824f', aa)); g.addColorStop(1, rgba('#6b4b2a', aa))
605
+ c.fillStyle = g; c.fillRect(px, py - ph / 2, pw, ph)
606
+ for (let i = 0; i < 9; i++) { c.strokeStyle = rgba('#4a321c', 0.4 * aa); c.lineWidth = u; c.beginPath(); c.moveTo(px, py - ph / 2 + ph * (i + 0.5) / 9 + Math.sin(i) * 2 * u); for (let x = 0; x <= pw; x += 20 * u) c.lineTo(px + x, py - ph / 2 + ph * (i + 0.5) / 9 + Math.sin(x * 0.01 + i) * 3 * u); c.stroke() }
607
+ const snap = k1 + 0.9
608
+ const before = lt < snap
609
+ const amp = before ? 24 * u * Math.sin(Math.max(0, lt - k1 + 0.3) * 30) * ramp(lt, k1 - 0.3, 0.3) : 0
610
+ c.strokeStyle = rgba('#141210', aa); c.lineWidth = 2.5 * u
611
+ c.beginPath(); c.moveTo(px - 10 * u, py - (before ? ph : 0)); c.quadraticCurveTo(px + pw / 2, py - (before ? ph : 0) + amp, px + pw + 10 * u, py - (before ? ph : 0)); c.stroke()
612
+ if (!before) { c.strokeStyle = rgba('#0b0a09', aa); c.lineWidth = 4 * u; c.beginPath(); c.moveTo(px, py); c.lineTo(px + pw, py); c.stroke() }
613
+ caption(S, A, '木受绳则直', aa)
614
+ // 金就砺
615
+ const ba = ramp(lt, k2 - 0.5, 0.6)
616
+ const sx = B.x + B.w / 2, sy = B.y + B.h * 0.56, sw = B.w * 0.7, sh2 = mn(B) * 0.1
617
+ c.fillStyle = rgba('#3d3b38', ba); c.beginPath(); c.roundRect(sx - sw / 2, sy, sw, sh2, 8 * u); c.fill()
618
+ const slide = Math.sin(Math.max(0, lt - k2) * 3.2) * sw * 0.18
619
+ const bl = sw * 0.62
620
+ const x0 = sx - bl / 2 + slide, y0 = sy - 4 * u
621
+ const bg = c.createLinearGradient(0, y0 - 40 * u, 0, y0)
622
+ bg.addColorStop(0, rgba('#8e9499', ba)); bg.addColorStop(1, rgba('#e8eef2', ba))
623
+ c.fillStyle = bg
624
+ c.beginPath(); c.moveTo(x0, y0); c.lineTo(x0 + bl, y0); c.lineTo(x0 + bl - 20 * u, y0 - 34 * u); c.lineTo(x0 + 10 * u, y0 - 38 * u); c.closePath(); c.fill()
625
+ c.fillStyle = rgba('#3a2a1c', ba); c.fillRect(x0 - 60 * u, y0 - 34 * u, 62 * u, 26 * u)
626
+ const shine = ramp(lt, k2 + 0.4, 2.5)
627
+ glow(c, x0 + bl * ((lt * 0.6) % 1), y0 - 2 * u, 40 * u, '#ffffff', 0.5 * shine * ba)
628
+ if (lt > k2) {
629
+ c.save(); c.globalCompositeOperation = 'lighter'
630
+ for (let i = 0; i < 16; i++) {
631
+ const ph = (lt * 2 + hash(i)) % 1
632
+ const spx = x0 + bl * 0.5 + (hash(i + 2) - 0.5) * bl * 0.8 + ph * 60 * u * (hash(i + 7) - 0.5) * 2, spy = y0 - ph * 50 * u + ph * ph * 80 * u
633
+ glow(c, spx, spy, 6 * u, '#ffc77a', ba * (1 - ph))
634
+ }
635
+ c.restore()
636
+ }
637
+ caption(S, B, '金就砺则利', ba)
638
+ },
639
+ },
640
+
641
+ rings: {
642
+ draw(S) {
643
+ const { c, W, H, u, P, lt } = S
644
+ const X = W / 2, Y = P ? H * 0.45 : H * 0.47, R = Math.min(W, H) * 0.29
645
+ const kn = S.k('c3l10', '绳墨'), kb = S.k('c3l10', '博学'), kc = S.k('c3l10', '参省'), kz = S.k('c3l10', '知与行')
646
+ const sa = ramp(lt, kn - 0.2, 0.7) * (1 - 0.6 * ramp(lt, kb, 0.8))
647
+ vtext(c, '绳墨', P ? W * 0.14 : W * 0.2, Y - 60 * u, 48 * u, F.kai, COL.muted, sa)
648
+ vtext(c, '砺石', P ? W * 0.86 : W * 0.8, Y - 60 * u, 48 * u, F.kai, COL.muted, sa)
649
+ text(c, '外在的规范', W / 2, P ? H * 0.12 : H * 0.12, 30 * u, F.song, COL.muted, sa, 'center', 10 * u)
650
+ const oa = ramp(lt, kb - 0.3, 0.8)
651
+ c.setLineDash([3 * u, 9 * u]); ellipse(c, X, Y, R, R, undefined, rgba(COL.paper, 0.6 * oa), 1.6 * u); c.setLineDash([])
652
+ for (let i = 0; i < 12; i++) {
653
+ const a = (i / 12) * Math.PI * 2 + lt * 0.05
654
+ const d = R + 10 * u + ((lt * 30 * u + i * 7) % (40 * u))
655
+ arrow(c, X + Math.cos(a) * (R + 6 * u), Y + Math.sin(a) * (R + 6 * u), X + Math.cos(a) * d, Y + Math.sin(a) * d, COL.paper, 0.45 * oa, 1.4 * u)
656
+ }
657
+ text(c, '博学 · 向外求知', X, Y - R - 64 * u, 34 * u, F.kai, COL.paper, oa, 'center', 6 * u)
658
+ const ia = ramp(lt, kc - 0.3, 0.8)
659
+ const sp = ramp(lt, kc - 0.3, 2.2)
660
+ c.strokeStyle = rgba(COL.gold, 0.85 * ia); c.lineWidth = 2 * u
661
+ c.beginPath()
662
+ const turns = 2.6, N = Math.floor(180 * sp)
663
+ for (let i = 0; i <= N; i++) { const q = i / 180, a = -Math.PI / 2 + q * turns * Math.PI * 2 + lt * 0.15, rr = R * 0.66 * (1 - q * 0.9); const px = X + Math.cos(a) * rr, py = Y + Math.sin(a) * rr; i ? c.lineTo(px, py) : c.moveTo(px, py) }
664
+ c.stroke()
665
+ text(c, '参省 · 向内反省', X, Y + R + 64 * u, 34 * u, F.kai, COL.gold, ia, 'center', 6 * u)
666
+ const za = ramp(lt, kz - 0.2, 0.8)
667
+ glow(c, X, Y, R * 0.6, COL.gold, 0.35 * za)
668
+ text(c, '知行', X, Y, 96 * u, F.brush, COL.paper, za, 'center', 8 * u)
669
+ },
670
+ },
671
+ }
672
+
673
+ function mix(a: string, b: string, t: number) {
674
+ const pa = parseInt(a.slice(1), 16), pb = parseInt(b.slice(1), 16)
675
+ const ch = (s: number) => Math.round(lerp((pa >> s) & 255, (pb >> s) & 255, clamp(t)))
676
+ return '#' + ((ch(16) << 16) | (ch(8) << 8) | ch(0)).toString(16).padStart(6, '0')
677
+ }
678
+ export { mix }
quanxue-src/src/quanxue/scenes/partB.ts ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 场景(下):善假于物、积恒专、结语、片尾
2
+ import type { SceneCtx } from '../render'
3
+ import { carveStrikes, getLine } from '../timeline'
4
+ import { clamp, easeInOut, easeOut, easeOutExpo, fbm1, hash, lerp, noise1, ramp, rng, smooth, win, type Rect } from '../engine/util'
5
+ import { COL, F, brush, cached, dust, font, glow, hairline, inkBlob, makeCanvas, mountains, revealChar, rgba, scholar, seal, stamp, text, vtext, type Ctx } from '../engine/draw'
6
+ import { arrow, caption, ellipse, mn, two, type Scene } from './partA'
7
+
8
+ /** 山形剪影 */
9
+ function hill(c: Ctx, x: number, base: number, w: number, h: number, seed: number, color: string, a: number) {
10
+ if (a <= 0 || h <= 0) return
11
+ c.beginPath(); c.moveTo(x - w / 2, base)
12
+ for (let i = 0; i <= 60; i++) {
13
+ const q = i / 60, px = x - w / 2 + q * w
14
+ const env = Math.pow(Math.sin(q * Math.PI), 1.4)
15
+ c.lineTo(px, base - h * env * (0.82 + 0.18 * fbm1(q * 5 + seed, 4)))
16
+ }
17
+ c.closePath()
18
+ const g = c.createLinearGradient(0, base - h, 0, base)
19
+ g.addColorStop(0, rgba(color, a)); g.addColorStop(1, rgba(color, a * 0.25))
20
+ c.fillStyle = g; c.fill()
21
+ }
22
+ function ground(c: Ctx, r: Rect, y: number, a: number, u: number) {
23
+ c.strokeStyle = rgba(COL.paper, 0.35 * a); c.lineWidth = 1.2 * u
24
+ c.beginPath(); c.moveTo(r.x, y); c.lineTo(r.x + r.w, y); c.stroke()
25
+ }
26
+ function cone(c: Ctx, x: number, y: number, dir: number, spread: number, len: number, a: number) {
27
+ if (a <= 0) return
28
+ const g = c.createRadialGradient(x, y, 0, x, y, len)
29
+ g.addColorStop(0, rgba('#f6e2b0', 0.32 * a)); g.addColorStop(1, rgba('#f6e2b0', 0))
30
+ c.fillStyle = g
31
+ c.beginPath(); c.moveTo(x, y); c.arc(x, y, len, dir - spread, dir + spread); c.closePath(); c.fill()
32
+ }
33
+
34
+ // ---- 积土成山 / 积水成渊 / 积善成德 三个面板 ----
35
+ function panelMountain(S: SceneCtx, r: Rect, p: number, rain: number) {
36
+ const { c, u, lt } = S
37
+ const base = r.y + r.h * 0.82, H0 = r.h * 0.58
38
+ hill(c, r.x + r.w / 2, base, r.w * 0.86, H0 * easeOut(p), 5, '#8d8370', 0.95)
39
+ if (p < 1) for (let i = 0; i < 26; i++) {
40
+ const ph = (lt * 0.9 + hash(i)) % 1
41
+ const x = r.x + r.w * (0.3 + hash(i + 4) * 0.4), y = lerp(r.y, base - H0 * p * 0.9, ph)
42
+ ellipse(c, x, y, 2 * u, 2 * u, rgba(COL.paper, 0.5 * (1 - p)))
43
+ }
44
+ if (rain > 0) {
45
+ const top = base - H0 - 30 * u
46
+ for (let i = 0; i < 5; i++) inkBlob(c, r.x + r.w * (0.32 + i * 0.09), top - (i % 2) * 20 * u, r.w * 0.11, 80 + i, '#6c665c', 0.6 * rain, 0.3, lt)
47
+ c.strokeStyle = rgba('#b7c3cb', 0.4 * rain); c.lineWidth = 1.1 * u
48
+ for (let i = 0; i < 40; i++) {
49
+ const ph = (lt * 1.6 + hash(i + 50)) % 1
50
+ const x = r.x + r.w * (0.25 + hash(i + 9) * 0.5) - ph * 20 * u, y = top + ph * (H0 * 0.9)
51
+ c.beginPath(); c.moveTo(x, y); c.lineTo(x - 6 * u, y + 22 * u); c.stroke()
52
+ }
53
+ }
54
+ }
55
+ function panelAbyss(S: SceneCtx, r: Rect, p: number, dragon: number) {
56
+ const { c, u, lt } = S
57
+ const top = r.y + r.h * (0.62 - 0.32 * easeOut(p)), bot = r.y + r.h * 0.86
58
+ const g = c.createLinearGradient(0, top, 0, bot)
59
+ g.addColorStop(0, rgba('#3d5a73', 0.75)); g.addColorStop(1, rgba('#0b1622', 0.95))
60
+ c.fillStyle = g
61
+ c.beginPath(); c.moveTo(r.x + r.w * 0.08, top)
62
+ for (let i = 0; i <= 40; i++) c.lineTo(r.x + r.w * (0.08 + 0.84 * i / 40), top + Math.sin(i * 0.6 + lt * 2) * 3 * u)
63
+ c.lineTo(r.x + r.w * 0.92, bot); c.quadraticCurveTo(r.x + r.w / 2, bot + r.h * 0.08, r.x + r.w * 0.08, bot); c.closePath(); c.fill()
64
+ // 水滴
65
+ if (p < 1) for (let i = 0; i < 4; i++) {
66
+ const ph = (lt * 0.7 + i / 4) % 1
67
+ const x = r.x + r.w * (0.35 + i * 0.1), y = lerp(r.y + r.h * 0.05, top, ph * ph)
68
+ ellipse(c, x, y, 3 * u, 6 * u, rgba('#cfe4ef', 0.8))
69
+ if (ph > 0.9) ellipse(c, x, top, (ph - 0.9) * 300 * u, (ph - 0.9) * 60 * u, undefined, rgba('#cfe4ef', 0.5), u)
70
+ }
71
+ if (dragon > 0) {
72
+ const pts: [number, number][] = []
73
+ for (let i = 0; i <= 60; i++) {
74
+ const q = i / 60
75
+ const x = r.x + r.w * (0.15 + 0.7 * q), y = lerp(top, bot, 0.5) + Math.sin(q * 9 - lt * 2.2) * (bot - top) * 0.22
76
+ pts.push([x, y])
77
+ }
78
+ brush(c, pts, 16 * u, easeInOut(dragon), COL.gold, 0.75, 9, 0.5)
79
+ const hd = pts[Math.min(60, Math.floor(60 * easeInOut(dragon)))]
80
+ glow(c, hd[0], hd[1], 26 * u, '#ffe1a0', 0.8 * dragon)
81
+ }
82
+ }
83
+ function panelHeart(S: SceneCtx, r: Rect, p: number) {
84
+ const { c, u, lt } = S
85
+ const x = r.x + r.w / 2, y = r.y + r.h * 0.45, R = mn(r) * 0.32
86
+ for (let i = 0; i < 30; i++) {
87
+ const ph = (lt * 0.35 + hash(i)) % 1, a = hash(i + 3) * Math.PI * 2
88
+ const d = R * 1.6 * (1 - ph)
89
+ ellipse(c, x + Math.cos(a) * d, y + Math.sin(a) * d, 2.2 * u, 2.2 * u, rgba(COL.gold, 0.7 * ph * p))
90
+ }
91
+ glow(c, x, y, R * (0.6 + 0.9 * p), COL.gold, 0.55 * p)
92
+ ellipse(c, x, y, R * 0.12 * (0.5 + p), R * 0.12 * (0.5 + p), rgba('#fff2d0', p))
93
+ }
94
+
95
+ // 刻字遮罩
96
+ let carveLayer: HTMLCanvasElement | null = null
97
+
98
+ export const partB: Record<string, Scene> = {
99
+ // ---------- 肆 · 善假于物 ----------
100
+ climb: {
101
+ quoteSize: 62,
102
+ draw(S) {
103
+ const { c, u, lt } = S
104
+ const r = S.art
105
+ const kd = S.k('c4l1', '登高'), ks = S.k('c4l2', '空想'), kx = S.k('c4l2', '片刻的学习')
106
+ const gy = r.y + r.h * 0.8
107
+ ground(c, r, gy, 1, u)
108
+ // 远方群山(登高后显现)
109
+ const reveal = ramp(lt, kd, 1.6)
110
+ for (let i = 0; i < 3; i++) hill(c, r.x + r.w * (0.25 + i * 0.25), gy, r.w * 0.5, r.h * (0.14 + 0.05 * i), 30 + i, '#57524a', 0.25 + 0.45 * reveal)
111
+ const tx = r.x + r.w * 0.18
112
+ cone(c, tx + 10 * u, gy - mn(r) * 0.22, -0.15, 0.22, r.w * 0.22, 1)
113
+ scholar(c, tx, gy, mn(r) * 0.24, COL.paper, 0.9, 'tiptoe')
114
+ text(c, '跂而望', tx, gy + 40 * u, 26 * u, F.kai, COL.muted, ramp(lt, 0.4, 0.6))
115
+ const mx = r.x + r.w * 0.66, mh = r.h * 0.55
116
+ hill(c, mx, gy, r.w * 0.5, mh, 12, '#9a8f7a', 0.95)
117
+ const sa = ramp(lt, kd - 0.2, 0.7)
118
+ cone(c, mx, gy - mh - mn(r) * 0.12, Math.PI * 0.05, 0.9 * reveal, r.w * 0.75, sa)
119
+ scholar(c, mx, gy - mh + 6 * u, mn(r) * 0.14, COL.paper, sa)
120
+ text(c, '登高博见', mx, gy + 40 * u, 26 * u, F.kai, COL.gold, sa)
121
+ const la = ramp(lt, ks - 0.2, 0.6), lb = ramp(lt, kx - 0.2, 0.6)
122
+ text(c, '终日而思', r.x + r.w * 0.25, r.y + r.h * 0.08, 34 * u, F.kai, COL.muted, la)
123
+ text(c, '<', r.x + r.w * 0.5, r.y + r.h * 0.08, 34 * u, F.song, COL.paper, lb)
124
+ text(c, '须臾之学', r.x + r.w * 0.75, r.y + r.h * 0.08, 34 * u, F.kai, COL.gold, lb)
125
+ },
126
+ },
127
+
128
+ wave: {
129
+ quoteSize: 62,
130
+ draw(S) {
131
+ const { c, u, lt } = S
132
+ const [A, B] = two(S.art)
133
+ const ka = S.k('c4l3', '登高而招'), kb = S.k('c4l3', '顺风而呼'), kw = S.k('c4l3', '而见者远'), kh = S.k('c4l3', '而闻者彰')
134
+ // 登高而招
135
+ const aa = ramp(lt, ka - 0.4, 0.6)
136
+ const gy = A.y + A.h * 0.8
137
+ hill(c, A.x + A.w * 0.28, gy, A.w * 0.5, A.h * 0.4, 7, '#8d8370', aa)
138
+ const px = A.x + A.w * 0.28, py = gy - A.h * 0.4 + 4 * u
139
+ scholar(c, px, py, mn(A) * 0.2, COL.paper, aa, 'wave', lt)
140
+ for (let i = 0; i < 4; i++) {
141
+ const p = ((lt - ka) * 0.5 + i / 4) % 1
142
+ if (lt < ka) break
143
+ c.strokeStyle = rgba(COL.gold, 0.5 * (1 - p) * aa); c.lineWidth = 1.4 * u
144
+ c.beginPath(); c.arc(px, py - mn(A) * 0.18, p * A.w * 0.8, -0.6, 0.6); c.stroke()
145
+ }
146
+ const sa = ramp(lt, kw - 0.2, 0.6)
147
+ for (let i = 0; i < 3; i++) { const fx = A.x + A.w * (0.72 + i * 0.09), fy = gy; scholar(c, fx, fy, mn(A) * 0.09, i === 1 ? COL.gold : COL.paper, 0.4 + 0.6 * sa) }
148
+ caption(S, A, '见者远', aa)
149
+ // 顺风而呼
150
+ const ba = ramp(lt, kb - 0.4, 0.6)
151
+ const gy2 = B.y + B.h * 0.8
152
+ ground(c, B, gy2, ba, u)
153
+ const sx = B.x + B.w * 0.14
154
+ scholar(c, sx, gy2, mn(B) * 0.2, COL.paper, ba)
155
+ for (let i = 0; i < 7; i++) {
156
+ const y = B.y + B.h * (0.28 + i * 0.07), ph = (lt * 0.5 + hash(i)) % 1
157
+ const x = B.x + ph * B.w
158
+ c.strokeStyle = rgba(COL.paper, 0.25 * ba * Math.sin(ph * Math.PI)); c.lineWidth = 1.2 * u
159
+ c.beginPath(); c.moveTo(x - 60 * u, y); c.bezierCurveTo(x - 20 * u, y - 8 * u, x + 20 * u, y + 8 * u, x + 60 * u, y); c.stroke()
160
+ }
161
+ for (let i = 0; i < 5; i++) {
162
+ const p = ((lt - kb) * 0.45 + i / 5) % 1
163
+ if (lt < kb) break
164
+ c.strokeStyle = rgba(COL.gold, 0.6 * (1 - p) * ba); c.lineWidth = 1.6 * u
165
+ c.beginPath(); c.arc(sx + 20 * u, gy2 - mn(B) * 0.17, 20 * u + p * B.w * 0.75, -0.35, 0.35); c.stroke()
166
+ }
167
+ const ha = ramp(lt, kh - 0.2, 0.6)
168
+ scholar(c, B.x + B.w * 0.86, gy2, mn(B) * 0.14, ha > 0.5 ? COL.gold : COL.paper, 0.4 + 0.6 * ha)
169
+ caption(S, B, '闻者彰', ba)
170
+ },
171
+ },
172
+
173
+ boat: {
174
+ quoteSize: 62,
175
+ draw(S) {
176
+ const { c, u, lt } = S
177
+ const [A, B] = two(S.art)
178
+ const ka = S.k('c4l4', '假舆马'), kb = S.k('c4l4', '假舟楫')
179
+ // 舆马致千里
180
+ const aa = ramp(lt, ka - 0.4, 0.6)
181
+ const vx = A.x + A.w / 2, vy = A.y + A.h * 0.3, by = A.y + A.h * 0.82
182
+ c.strokeStyle = rgba(COL.paper, 0.5 * aa); c.lineWidth = 1.6 * u
183
+ c.beginPath(); c.moveTo(A.x + A.w * 0.05, by); c.lineTo(vx - 4 * u, vy); c.moveTo(A.x + A.w * 0.95, by); c.lineTo(vx + 4 * u, vy); c.stroke()
184
+ hill(c, vx - A.w * 0.25, vy + 2 * u, A.w * 0.5, A.h * 0.08, 41, '#5f594e', aa * 0.8)
185
+ hill(c, vx + A.w * 0.25, vy + 2 * u, A.w * 0.5, A.h * 0.06, 42, '#5f594e', aa * 0.8)
186
+ for (let i = 0; i < 8; i++) {
187
+ const q = ((lt * 0.35 + i / 8) % 1), z = Math.pow(q, 2.2)
188
+ const y = lerp(vy, by, z), w = lerp(1, 10, z) * u
189
+ c.fillStyle = rgba(COL.gold, 0.6 * aa); c.fillRect(vx - w / 2, y, w, lerp(2, 18, z) * u)
190
+ }
191
+ const cp = easeInOut(ramp(lt, ka, 4)), z = 1 - cp * 0.92
192
+ const cy2 = lerp(vy, by - 20 * u, Math.pow(z, 1.6)), sc = z
193
+ const s = mn(A) * 0.22 * sc
194
+ if (s > 1) {
195
+ c.fillStyle = rgba('#c9b27f', aa); c.fillRect(vx - s * 0.5, cy2 - s * 0.7, s, s * 0.45)
196
+ c.fillStyle = rgba('#7e6440', aa); c.beginPath(); c.moveTo(vx - s * 0.6, cy2 - s * 0.7); c.lineTo(vx, cy2 - s * 0.98); c.lineTo(vx + s * 0.6, cy2 - s * 0.7); c.closePath(); c.fill()
197
+ for (const d of [-0.5, 0.5]) ellipse(c, vx + d * s, cy2 - s * 0.18, s * 0.08, s * 0.24, undefined, rgba(COL.paper, aa), Math.max(1, 3 * u * sc))
198
+ }
199
+ text(c, '千里', vx, vy - 36 * u, 30 * u, F.kai, COL.gold, aa * ramp(lt, ka + 1.6, 0.8))
200
+ caption(S, A, '假舆马 · 致千里', aa)
201
+ // 舟楫绝江河
202
+ const ba = ramp(lt, kb - 0.4, 0.6)
203
+ const rt = B.y + B.h * 0.25, rb = B.y + B.h * 0.75
204
+ const g = c.createLinearGradient(0, rt, 0, rb)
205
+ g.addColorStop(0, rgba('#20384a', 0.6 * ba)); g.addColorStop(0.5, rgba('#2c4c63', 0.75 * ba)); g.addColorStop(1, rgba('#20384a', 0.6 * ba))
206
+ c.fillStyle = g; c.fillRect(B.x, rt, B.w, rb - rt)
207
+ for (let i = 0; i < 9; i++) {
208
+ const y = lerp(rt, rb, (i + 0.5) / 9)
209
+ c.strokeStyle = rgba('#a8c3d3', 0.22 * ba); c.lineWidth = u
210
+ c.beginPath(); for (let x = 0; x <= B.w; x += 12 * u) { const yy = y + Math.sin(x * 0.03 + lt * 1.5 + i) * 3 * u; x ? c.lineTo(B.x + x, yy) : c.moveTo(B.x + x, yy) } c.stroke()
211
+ }
212
+ const bp = easeInOut(ramp(lt, kb, 3.6))
213
+ const bx = B.x + B.w / 2 + Math.sin(lt * 0.8) * 6 * u, byy = lerp(rb + 20 * u, rt - 10 * u, bp)
214
+ const bs = mn(B) * 0.22
215
+ c.fillStyle = rgba('#d8c393', ba); c.beginPath(); c.moveTo(bx - bs * 0.6, byy); c.quadraticCurveTo(bx, byy + bs * 0.3, bx + bs * 0.6, byy); c.lineTo(bx + bs * 0.45, byy + bs * 0.1); c.lineTo(bx - bs * 0.45, byy + bs * 0.1); c.closePath(); c.fill()
216
+ scholar(c, bx, byy, bs * 0.65, COL.paper, ba)
217
+ c.strokeStyle = rgba(COL.paper, ba); c.lineWidth = 2 * u
218
+ const oa = Math.sin(lt * 2.4) * 0.3
219
+ c.beginPath(); c.moveTo(bx + bs * 0.1, byy - bs * 0.35); c.lineTo(bx + bs * 0.6 + oa * bs, byy + bs * 0.25); c.stroke()
220
+ for (let i = 1; i < 5; i++) ellipse(c, bx, byy + i * 22 * u, i * 14 * u, i * 4 * u, undefined, rgba('#a8c3d3', 0.3 * ba * (1 - i / 5)), u)
221
+ caption(S, B, '假舟楫 · 绝江河', ba)
222
+ },
223
+ },
224
+
225
+ jia: {
226
+ draw(S) {
227
+ const { c, u, lt } = S
228
+ const r = S.art
229
+ const k6 = S.ls('c4l6'), kd = S.k('c4l6', '生来'), kj = S.k('c4l6', '善于借助外物')
230
+ const ax = r.x + r.w / 2, ay = r.y + r.h * 0.45
231
+ const a1 = ramp(lt, 0, 0.8) * (1 - ramp(lt, k6 - 0.6, 0.8))
232
+ const s = mn(r) * 0.6
233
+ inkBlob(c, ax, ay, s * 0.7, 91, '#3b352c', 0.6 * a1, 0.3, lt)
234
+ revealChar(c, '假', ax, ay, s, S.P ? F.brush : F.brush, COL.paper, clamp(lt / 0.9), a1)
235
+ text(c, '假:借助', ax, ay + s * 0.66, 32 * u, F.song, COL.gold, a1 * ramp(lt, 1, 0.8), 'center', 8 * u)
236
+ const a2 = ramp(lt, k6 - 0.3, 0.8)
237
+ if (a2 <= 0) return
238
+ const gy = r.y + r.h * 0.8
239
+ ground(c, r, gy, a2, u)
240
+ const h = mn(r) * 0.36
241
+ const lx = r.x + r.w * 0.3, rx = r.x + r.w * 0.7
242
+ const lift = easeOut(ramp(lt, kj, 1.2)) * r.h * 0.2
243
+ scholar(c, lx, gy, h, COL.paper, a2)
244
+ // 书卷台阶
245
+ for (let i = 0; i < 4; i++) {
246
+ const bh = lift / 4
247
+ if (bh <= 0) break
248
+ c.fillStyle = rgba(['#4a6283', '#7a3b2e', '#8a7344', '#3f5a4b'][i], a2)
249
+ c.fillRect(rx - h * (0.42 - i * 0.04), gy - bh * (i + 1), h * (0.84 - i * 0.08), bh * 0.92)
250
+ }
251
+ glow(c, rx, gy - lift - h * 0.5, h * 1.1, COL.gold, 0.3 * ramp(lt, kj, 1))
252
+ scholar(c, rx, gy - lift, h, ramp(lt, kj, 1) > 0.5 ? '#f6e3b4' : COL.paper, a2)
253
+ c.setLineDash([4 * u, 6 * u]); c.strokeStyle = rgba(COL.gold, 0.5 * win(lt, kd - 0.2, kj + 0.2, 0.4)); c.lineWidth = u
254
+ c.beginPath(); c.moveTo(lx - h * 0.3, gy - h * 1.02); c.lineTo(rx + h * 0.3, gy - h * 1.02); c.stroke(); c.setLineDash([])
255
+ text(c, '生非异也', ax, gy - h * 1.1 - 24 * u, 28 * u, F.kai, COL.gold, win(lt, kd - 0.2, kj + 0.2, 0.4))
256
+ text(c, '常人', lx, gy + 40 * u, 28 * u, F.kai, COL.muted, a2)
257
+ text(c, '善假于物', rx, gy + 40 * u, 28 * u, F.kai, COL.gold, ramp(lt, kj, 0.6))
258
+ },
259
+ },
260
+
261
+ books: {
262
+ draw(S) {
263
+ const { c, W, H, u, P, lt } = S
264
+ const kq = S.k('c4l7', '前人积累'), kr = S.k('c4l7', '读一本书'), kh = S.k('c4l7', '登上一处高地'), kc = S.k('c4l7', '乘上一辆车马')
265
+ const names = ['诗', '书', '礼', '乐', '易', '春秋']
266
+ const cols = ['#3d5674', '#7a3a2c', '#8c7546', '#3d5b4c', '#5b4a6e', '#8a5a36']
267
+ const n = names.length
268
+ const bw = P ? W * 0.13 : W * 0.085, bh = P ? H * 0.045 : H * 0.075
269
+ const x0 = P ? W * 0.12 : W * 0.2, y0 = P ? H * 0.78 : H * 0.8
270
+ const dx = P ? (W * 0.76 - bw) / (n - 1) : W * 0.09, dy = P ? H * 0.065 : H * 0.075
271
+ for (let i = 0; i < n; i++) {
272
+ const a = ramp(lt, kq - 0.6 + i * 0.28, 0.5)
273
+ if (a <= 0) continue
274
+ for (let j = 0; j <= i; j++) {
275
+ const x = x0 + i * dx, y = y0 - (j + 1) * dy - (1 - easeOut(a)) * 30 * u * (j === i ? 1 : 0)
276
+ c.fillStyle = rgba(cols[(i + j) % n], a); c.fillRect(x, y, bw, bh * 0.94)
277
+ c.fillStyle = rgba('#e9dcc0', 0.85 * a); c.fillRect(x + bw * 0.06, y + bh * 0.12, bw * 0.88, bh * 0.08)
278
+ if (j === i) text(c, names[i], x + bw / 2, y + bh * 0.58, bh * 0.42, F.kai, '#f3e6cd', a)
279
+ }
280
+ }
281
+ const climb = smooth(ramp(lt, kr - 0.3, Math.max(1, kh - kr + 0.6)))
282
+ const fi = climb * (n - 1)
283
+ const bi = Math.floor(fi), fr = fi - bi
284
+ const px = x0 + bw / 2 + fi * dx
285
+ const py = y0 - (Math.min(n - 1, bi) + 1) * dy - (bi < n - 1 ? easeOut(fr) * dy : 0)
286
+ const sa = ramp(lt, kr - 0.5, 0.5)
287
+ scholar(c, px, py, (P ? H * 0.09 : H * 0.17), COL.paper, sa, 'walk', lt)
288
+ const top = ramp(lt, kh, 1)
289
+ glow(c, px, py - H * 0.1, Math.min(W, H) * 0.35, COL.gold, 0.3 * top)
290
+ text(c, '站在前人的肩上', P ? W / 2 : W * 0.72, P ? H * 0.16 : H * 0.2, 54 * u, F.brush, COL.gold, ramp(lt, kc - 0.2, 0.9), 'center', 10 * u)
291
+ },
292
+ },
293
+
294
+ // ---------- 伍 · 积 · 恒 · 专 ----------
295
+ mountain: {
296
+ quoteSize: 60,
297
+ draw(S) {
298
+ const { c, u, lt } = S
299
+ const r = S.art
300
+ const ka = S.k('c5l1', '积土成山'), kr = S.k('c5l1', '风雨兴焉'), kb = S.k('c5l1', '积水成渊'), kd = S.k('c5l1', '蛟龙生焉'), kc = S.k('c5l1', '积善成德'), ke = S.k('c5l1', '圣心备焉')
301
+ const k2 = S.ls('c5l2'), kq = S.k('c5l2', '量的积累')
302
+ const tri = ramp(lt, k2 - 0.6, 1)
303
+ const pa = ramp(lt, ka - 0.3, 3), rain = ramp(lt, kr - 0.2, 0.8)
304
+ const pb = ramp(lt, kb - 0.3, 3), dr = ramp(lt, kd - 0.2, 2.4)
305
+ const pc = ramp(lt, kc - 0.2, 2.2)
306
+ const phase = lt < kb - 0.4 ? 0 : lt < kc - 0.4 ? 1 : 2
307
+ const pf = (i: number) => (i === 0 ? 1 - ramp(lt, kb - 0.6, 0.6) : i === 1 ? ramp(lt, kb - 0.6, 0.6) * (1 - ramp(lt, kc - 0.6, 0.6)) : ramp(lt, kc - 0.6, 0.6))
308
+ const labels = ['积土成山', '积水成渊', '积善成德']
309
+ if (tri < 1) {
310
+ c.globalAlpha = 1 - tri
311
+ for (let i = 0; i < 3; i++) {
312
+ const a = pf(i)
313
+ if (a <= 0) continue
314
+ c.globalAlpha = a * (1 - tri)
315
+ if (i === 0) panelMountain(S, r, pa, rain)
316
+ if (i === 1) panelAbyss(S, r, pb, dr)
317
+ if (i === 2) panelHeart(S, r, pc)
318
+ caption(S, r, labels[i], 1)
319
+ }
320
+ c.globalAlpha = 1
321
+ void phase
322
+ }
323
+ if (tri > 0) {
324
+ const P = S.P
325
+ const w = r.w / 3
326
+ c.globalAlpha = tri
327
+ for (let i = 0; i < 3; i++) {
328
+ const q: Rect = P ? { x: r.x + i * w, y: r.y + r.h * 0.1, w, h: r.h * 0.7 } : { x: r.x + i * w, y: r.y + r.h * 0.12, w, h: r.h * 0.62 }
329
+ if (i === 0) panelMountain(S, q, 1, 1)
330
+ if (i === 1) panelAbyss(S, q, 1, 1)
331
+ if (i === 2) panelHeart(S, q, 1)
332
+ text(c, ['山', '渊', '德'][i], q.x + q.w / 2, q.y + q.h + 30 * u, 40 * u, F.brush, COL.paper, 1)
333
+ }
334
+ const qa = ramp(lt, kq - 0.2, 0.8)
335
+ const yy = r.y + r.h * 0.94
336
+ text(c, '量变', r.x + r.w * 0.32, yy, 40 * u, F.kai, COL.muted, qa)
337
+ arrow(c, r.x + r.w * 0.42, yy, r.x + r.w * 0.58, yy, COL.gold, qa, 2 * u)
338
+ text(c, '质变', r.x + r.w * 0.68, yy, 40 * u, F.kai, COL.gold, qa)
339
+ c.globalAlpha = 1
340
+ }
341
+ void ke
342
+ },
343
+ },
344
+
345
+ steps: {
346
+ quoteSize: 66,
347
+ draw(S) {
348
+ const { c, u, lt } = S
349
+ const [A, B] = two(S.art)
350
+ const ka = S.k('c5l3', '不积跬步'), kq = S.k('c5l3', '千里'), kb = S.k('c5l3', '不积小流'), ke = S.k('c5l3', '江海')
351
+ // 跬步 → 千里
352
+ const n = 26
353
+ const pr = ramp(lt, ka - 0.2, Math.max(1, kq - ka + 0.6))
354
+ hill(c, A.x + A.w * 0.5, A.y + A.h * 0.22, A.w * 0.8, A.h * 0.08, 61, '#5f594e', 0.8)
355
+ for (let i = 0; i < n; i++) {
356
+ const q = i / (n - 1), z = Math.pow(q, 0.8)
357
+ const x = A.x + A.w * (0.5 + 0.28 * Math.sin(q * 5) * (1 - z * 0.8)) + (i % 2 ? 1 : -1) * 10 * u * (1 - z)
358
+ const y = lerp(A.y + A.h * 0.86, A.y + A.h * 0.24, z)
359
+ const a = clamp(pr * n - i)
360
+ const s = lerp(9, 2, z) * u
361
+ ellipse(c, x, y, s * 0.6, s, rgba(COL.paper, 0.85 * a))
362
+ }
363
+ text(c, '千里', A.x + A.w * 0.5, A.y + A.h * 0.12, 34 * u, F.kai, COL.gold, ramp(lt, kq, 0.6))
364
+ caption(S, A, '跬步 · 半步', ramp(lt, ka, 0.6), COL.muted)
365
+ // 小流 → 江海
366
+ const sp = ramp(lt, kb - 0.2, Math.max(1, ke - kb + 0.8))
367
+ const sea = ramp(lt, ke - 0.2, 0.9)
368
+ const g = c.createLinearGradient(0, B.y + B.h * 0.12, 0, B.y + B.h * 0.3)
369
+ g.addColorStop(0, rgba('#d9e7ee', 0.0)); g.addColorStop(1, rgba('#9fbcd0', 0.45 * sea))
370
+ c.fillStyle = g; c.fillRect(B.x, B.y + B.h * 0.12, B.w, B.h * 0.18)
371
+ glow(c, B.x + B.w / 2, B.y + B.h * 0.22, B.w * 0.5, '#cfe4ef', 0.3 * sea)
372
+ for (let i = 0; i < 5; i++) {
373
+ const sx = B.x + B.w * (0.08 + i * 0.21)
374
+ const pts: [number, number][] = []
375
+ for (let j = 0; j <= 40; j++) {
376
+ const q = j / 40
377
+ const x = lerp(sx, B.x + B.w / 2, Math.pow(q, 1.5)) + Math.sin(q * 8 + i) * 8 * u * (1 - q)
378
+ const y = lerp(B.y + B.h * 0.86, B.y + B.h * 0.3, q)
379
+ pts.push([x, y])
380
+ }
381
+ brush(c, pts, lerp(4, 10, i === 2 ? 1 : 0.5) * u, sp, '#8fb3cc', 0.8, 20 + i, 0.3)
382
+ }
383
+ text(c, '江海', B.x + B.w / 2, B.y + B.h * 0.07, 34 * u, F.kai, COL.gold, sea)
384
+ caption(S, B, '小流 · 细水', ramp(lt, kb, 0.6), COL.muted)
385
+ },
386
+ },
387
+
388
+ horse: {
389
+ quoteSize: 66,
390
+ draw(S) {
391
+ const { c, u, lt } = S
392
+ const r = S.art
393
+ const ka = S.k('c5l4', '骐骥一跃'), kb = S.k('c5l4', '驽马十驾'), kf = S.k('c5l4', '功在不舍'), kt = S.k('c5l5', '不是天赋'), ks = S.k('c5l5', '不肯停下')
394
+ const A: Rect = { x: r.x, y: r.y, w: r.w, h: r.h * 0.46 }, B: Rect = { x: r.x, y: r.y + r.h * 0.52, w: r.w, h: r.h * 0.46 }
395
+ const nums = '一二三四五六七八九十'
396
+ // 骐骥一跃
397
+ const aa = ramp(lt, ka - 0.5, 0.6)
398
+ const gy = A.y + A.h * 0.75, x0 = A.x + A.w * 0.08, step = (A.w * 0.84) / 10
399
+ ground(c, A, gy, aa, u)
400
+ for (let i = 0; i <= 10; i++) {
401
+ c.strokeStyle = rgba(COL.paper, 0.45 * aa); c.lineWidth = u
402
+ c.beginPath(); c.moveTo(x0 + i * step, gy - 6 * u); c.lineTo(x0 + i * step, gy + 6 * u); c.stroke()
403
+ if (i > 0) text(c, nums[i - 1], x0 + (i - 0.5) * step, gy + 26 * u, 18 * u, F.song, COL.muted, aa * 0.8)
404
+ }
405
+ const jp = easeOut(ramp(lt, ka, 1.3))
406
+ const land = 8.3
407
+ c.strokeStyle = rgba(COL.gold, 0.85 * aa); c.lineWidth = 2.4 * u
408
+ c.beginPath()
409
+ for (let i = 0; i <= 60 * jp; i++) { const q = i / 60, x = x0 + q * land * step, y = gy - Math.sin(q * Math.PI) * A.h * 0.55; i ? c.lineTo(x, y) : c.moveTo(x, y) }
410
+ c.stroke()
411
+ const hx = x0 + jp * land * step, hy = gy - Math.sin(jp * Math.PI) * A.h * 0.55
412
+ glow(c, hx, hy, 30 * u, '#ffe1a0', aa); ellipse(c, hx, hy, 6 * u, 6 * u, rgba('#fff3d6', aa))
413
+ text(c, '骐骥一跃 · 不能十步', A.x + A.w * 0.5, A.y + A.h * 0.08, 30 * u, F.kai, COL.paper, aa, 'center', 4 * u)
414
+ // 驽马十驾
415
+ const ba = ramp(lt, kb - 0.5, 0.6)
416
+ const gy2 = B.y + B.h * 0.6
417
+ ground(c, B, gy2, ba, u)
418
+ const wp = smooth(ramp(lt, kb, Math.max(2, ks - kb)))
419
+ for (let i = 0; i < 10; i++) {
420
+ const x = x0 + (i + 1) * step
421
+ const reached = wp * 10 >= i + 1
422
+ ellipse(c, x, gy2, 4 * u, 4 * u, rgba(reached ? COL.gold : COL.dim, ba))
423
+ text(c, nums[i] + '驾', x, gy2 + 28 * u, 18 * u, F.song, reached ? COL.gold : COL.muted, ba * 0.85)
424
+ }
425
+ for (let d = 0; d < wp * 10 * 6; d++) ellipse(c, x0 + (d / 6) * step, gy2 - 14 * u, 1.4 * u, 1.4 * u, rgba(COL.paper, 0.5 * ba))
426
+ const mx = x0 + wp * 10 * step
427
+ ellipse(c, mx, gy2 - 14 * u, 6 * u, 6 * u, rgba(COL.paper, ba))
428
+ const fa = ramp(lt, ks - 0.4, 0.8) + (wp > 0.99 ? 0.5 : 0)
429
+ glow(c, x0 + 10 * step, gy2 - 14 * u, 50 * u, COL.gold, 0.5 * clamp(fa))
430
+ text(c, '驽马十驾 · 功在不舍', B.x + B.w * 0.5, B.y + B.h * 0.12, 30 * u, F.kai, COL.gold, ba, 'center', 4 * u)
431
+ const ta = ramp(lt, kt - 0.2, 0.6)
432
+ if (ta > 0) {
433
+ text(c, '天赋', A.x + A.w * 0.85, A.y + A.h * 0.3, 30 * u, F.kai, COL.muted, ta)
434
+ c.strokeStyle = rgba(COL.red, ta); c.lineWidth = 3 * u; c.beginPath(); c.moveTo(A.x + A.w * 0.85 - 40 * u, A.y + A.h * 0.3); c.lineTo(A.x + A.w * 0.85 - 40 * u + 80 * u * ramp(lt, kt + 0.3, 0.4), A.y + A.h * 0.3); c.stroke()
435
+ }
436
+ stamp(c, B.x + B.w * 0.9, B.y + B.h * 0.25, 64 * u, '不舍', lt - Math.max(kf + 0.5, ks))
437
+ },
438
+ },
439
+
440
+ carve: {
441
+ quoteSize: 70,
442
+ draw(S) {
443
+ const { c, u, lt, t } = S
444
+ const [A, B] = two(S.art)
445
+ const strikes = carveStrikes().map((x) => x - S.shot.start)
446
+ const kc = S.k('c5l6', '锲而不舍'), kz = S.k('c5l6', '朽木不折')
447
+ const past = strikes.filter((x) => x <= lt)
448
+ const lastStrike = past.length ? past[past.length - 1] : -9
449
+ const split = strikes.findIndex((x) => x >= kc - 0.05)
450
+ const woodN = past.filter((_, i) => i < split).length, stoneN = past.length - woodN
451
+ const chisel = (x: number, y: number, a: number, active: boolean) => {
452
+ const dt = lt - lastStrike
453
+ const lift = active ? (dt < 0.08 ? 0 : Math.min(1, (dt - 0.08) / 0.14)) * 34 * u : 50 * u
454
+ c.save(); c.translate(x, y - lift); c.rotate(-0.5)
455
+ c.fillStyle = rgba('#c9ccd0', a); c.fillRect(-3 * u, -70 * u, 6 * u, 70 * u)
456
+ c.fillStyle = rgba('#6b4c2e', a); c.fillRect(-7 * u, -130 * u, 14 * u, 62 * u)
457
+ c.restore()
458
+ if (active && dt < 0.25) { c.save(); c.globalCompositeOperation = 'lighter'; for (let i = 0; i < 8; i++) { const ang = hash(i + past.length * 9) * Math.PI * 2, d = dt * 260 * u; glow(c, x + Math.cos(ang) * d, y + Math.sin(ang) * d * 0.6, 6 * u, '#ffcf8a', a * (1 - dt / 0.25)) } c.restore() }
459
+ }
460
+ // 朽木
461
+ const aa = ramp(lt, 0, 0.6)
462
+ const wx = A.x + A.w / 2, wy = A.y + A.h * 0.5, ww = A.w * 0.7, wh = mn(A) * 0.3
463
+ c.fillStyle = rgba('#5e4630', aa); c.beginPath(); c.roundRect(wx - ww / 2, wy - wh / 2, ww, wh, 16 * u); c.fill()
464
+ for (let i = 0; i < 6; i++) { c.strokeStyle = rgba('#2f2216', 0.6 * aa); c.lineWidth = 1.4 * u; c.beginPath(); c.moveTo(wx - ww * 0.45, wy - wh * 0.35 + i * wh * 0.14); c.bezierCurveTo(wx - ww * 0.1, wy - wh * 0.3 + i * wh * 0.14, wx + ww * 0.1, wy - wh * 0.4 + i * wh * 0.14, wx + ww * 0.45, wy - wh * 0.35 + i * wh * 0.14); c.stroke() }
465
+ for (let i = 0; i < woodN; i++) { c.fillStyle = rgba('#1e150d', aa); c.beginPath(); c.moveTo(wx - 8 * u + i * 4 * u, wy - wh / 2); c.lineTo(wx + i * 4 * u, wy - wh / 2 + (10 + i * 5) * u); c.lineTo(wx + 8 * u + i * 4 * u, wy - wh / 2); c.closePath(); c.fill() }
466
+ chisel(wx + woodN * 4 * u, wy - wh / 2, aa * (1 - ramp(lt, kz + 0.5, 0.5)), lt < kc - 0.05 && past.length > 0)
467
+ caption(S, A, '锲而舍之 · 朽木不折', aa, COL.muted)
468
+ // 金石
469
+ const ba = ramp(lt, kz, 0.6)
470
+ const sx = B.x + B.w / 2, sy = B.y + B.h * 0.48, ss = mn(B) * 0.66
471
+ const sg = c.createLinearGradient(sx - ss / 2, sy - ss / 2, sx + ss / 2, sy + ss / 2)
472
+ sg.addColorStop(0, rgba('#5c5a56', ba)); sg.addColorStop(1, rgba('#2e2d2b', ba))
473
+ c.fillStyle = sg; c.beginPath(); c.roundRect(sx - ss / 2, sy - ss / 2, ss, ss, 10 * u); c.fill()
474
+ const cs = ss * 0.8
475
+ const L = (carveLayer && carveLayer.width === Math.ceil(cs) ? carveLayer : (carveLayer = makeCanvas(cs, cs)))
476
+ const g = L.getContext('2d')!
477
+ g.clearRect(0, 0, L.width, L.height)
478
+ const r = rng(77)
479
+ const total = Math.max(1, strikes.length - split)
480
+ const full = ramp(lt, strikes[strikes.length - 1] + 0.3, 1.2)
481
+ g.fillStyle = '#000'
482
+ for (let i = 0; i < stoneN; i++) for (let k = 0; k < 26; k++) { g.beginPath(); g.arc(r() * cs, r() * cs, cs * (0.05 + r() * 0.05), 0, Math.PI * 2); g.fill() }
483
+ if (full > 0) { g.globalAlpha = full; g.fillRect(0, 0, cs, cs); g.globalAlpha = 1 }
484
+ g.globalCompositeOperation = 'source-in'
485
+ g.font = font(cs * 0.9, F.brush); g.textAlign = 'center'; g.textBaseline = 'middle'
486
+ g.fillStyle = '#e2c27f'; g.fillText('学', cs / 2, cs / 2 + cs * 0.04)
487
+ g.globalCompositeOperation = 'source-over'
488
+ c.globalAlpha = ba; c.drawImage(L, sx - cs / 2, sy - cs / 2); c.globalAlpha = 1
489
+ glow(c, sx, sy, ss * 0.6, COL.gold, 0.2 * full * ba)
490
+ const cur = Math.min(stoneN, total)
491
+ chisel(sx - cs * 0.3 + (hash(cur) * cs * 0.6), sy - cs * 0.3 + hash(cur + 1) * cs * 0.6, ba * (1 - full), lt >= kc - 0.05)
492
+ caption(S, B, '锲而不舍 · 金石可镂', ba)
493
+ void t
494
+ },
495
+ },
496
+
497
+ worm: {
498
+ quoteSize: 56,
499
+ draw(S) {
500
+ const { c, u, lt } = S
501
+ const [A, B] = two(S.art)
502
+ const kc = S.k('c5l7', '蟹六跪'), k1 = S.k('c5l7', '用心一也'), k2 = S.k('c5l7', '用心躁也')
503
+ const ky = S.k('c5l8', '专一'), kz = S.k('c5l8', '浮躁')
504
+ // 土层剖面
505
+ const layers = ['#4a3b2a', '#3e3124', '#33291e', '#2a221a']
506
+ for (let i = 0; i < 4; i++) {
507
+ c.fillStyle = rgba(layers[i], 0.9)
508
+ c.beginPath(); c.moveTo(A.x, A.y + A.h * (0.12 + i * 0.19))
509
+ for (let x = 0; x <= A.w; x += 10 * u) c.lineTo(A.x + x, A.y + A.h * (0.12 + i * 0.19) + fbm1(x / A.w * 4 + i * 3) * 10 * u)
510
+ c.lineTo(A.x + A.w, A.y + A.h * 0.88); c.lineTo(A.x, A.y + A.h * 0.88); c.closePath(); c.fill()
511
+ }
512
+ const gq = c.createLinearGradient(0, A.y + A.h * 0.78, 0, A.y + A.h * 0.88)
513
+ gq.addColorStop(0, 'rgba(198,160,74,0)'); gq.addColorStop(1, 'rgba(198,160,74,0.55)')
514
+ c.fillStyle = gq; c.fillRect(A.x, A.y + A.h * 0.78, A.w, A.h * 0.1)
515
+ text(c, '埃土', A.x + A.w * 0.9, A.y + A.h * 0.07, 22 * u, F.song, COL.muted, 0.9)
516
+ text(c, '黄泉', A.x + A.w * 0.9, A.y + A.h * 0.93, 22 * u, F.song, COL.gold, 0.9)
517
+ // 蚯蚓:沿竖直蛇形路径往复
518
+ const cyc = (lt * 0.08) % 2, ph = cyc < 1 ? cyc : 2 - cyc
519
+ const path = (q: number): [number, number] => [A.x + A.w * (0.5 + 0.22 * Math.sin(q * 10)), A.y + A.h * (0.1 + 0.74 * q)]
520
+ const pts: [number, number][] = []
521
+ for (let i = 0; i < 24; i++) pts.push(path(clamp(ph - i * 0.012 * (cyc < 1 ? 1 : -1))))
522
+ c.lineCap = 'round'
523
+ c.strokeStyle = rgba('#c58d7a', 0.95); c.lineWidth = 11 * u
524
+ c.beginPath(); pts.forEach((p, i) => (i ? c.lineTo(p[0], p[1]) : c.moveTo(p[0], p[1]))); c.stroke()
525
+ for (let i = 2; i < 24; i += 3) ellipse(c, pts[i][0], pts[i][1], 4 * u, 4 * u, undefined, 'rgba(90,50,40,0.7)', u)
526
+ caption(S, A, '用心一也', ramp(lt, k1 - 0.2, 0.6))
527
+ // 蟹
528
+ const ba = ramp(lt, kc - 0.4, 0.6)
529
+ const holes: [number, number][] = [[0.25, 0.7], [0.75, 0.72], [0.5, 0.45]]
530
+ holes.forEach(([hx, hy], i) => {
531
+ ellipse(c, B.x + B.w * hx, B.y + B.h * hy, B.w * 0.12, B.w * 0.04, rgba('#090807', 0.9 * ba))
532
+ text(c, ['蛇穴', '鳝穴', '蛇穴'][i], B.x + B.w * hx, B.y + B.h * hy + 34 * u, 18 * u, F.song, COL.dim, ba)
533
+ })
534
+ const tt = lt * 0.9
535
+ const seg = Math.floor(tt), fr = tt - seg
536
+ const h0 = holes[seg % 3], h1 = holes[(seg + 1) % 3]
537
+ const e = easeInOut(fr)
538
+ const crx = B.x + B.w * (lerp(h0[0], h1[0], e) + noise1(lt * 7) * 0.03), cry = B.y + B.h * (lerp(h0[1], h1[1], e) - 0.12 + noise1(lt * 6 + 3) * 0.02)
539
+ drawCrab(c, crx, cry, mn(B) * 0.2, ba, lt)
540
+ caption(S, B, '用心躁也', ramp(lt, k2 - 0.2, 0.6))
541
+ const ya = ramp(lt, ky - 0.2, 0.6), za = ramp(lt, kz - 0.2, 0.6)
542
+ text(c, '专一 · 上下自如', A.x + A.w / 2, A.y - 8 * u, 26 * u, F.song, COL.gold, ya, 'center', 4 * u)
543
+ text(c, '浮躁 · 无处安身', B.x + B.w / 2, B.y - 8 * u, 26 * u, F.song, COL.muted, za, 'center', 4 * u)
544
+ },
545
+ },
546
+
547
+ keys: {
548
+ draw(S) {
549
+ const { c, W, H, u, P, lt } = S
550
+ const items = [
551
+ { s: '积', w: '积累', d: '积土成山', k: S.k('c5l9', '积累') },
552
+ { s: '恒', w: '坚持', d: '锲而不舍', k: S.k('c5l9', '坚持') },
553
+ { s: '专', w: '专一', d: '用心一也', k: S.k('c5l9', '专一') },
554
+ ]
555
+ const sz = Math.min(W, H) * (P ? 0.24 : 0.2)
556
+ items.forEach((it, i) => {
557
+ const x = P ? W / 2 : W / 2 + (i - 1) * W * 0.24
558
+ const y = P ? H * (0.24 + i * 0.22) : H * 0.42
559
+ const p = lt - it.k
560
+ inkBlob(c, x, y, sz * 0.85 * easeOutExpo(clamp(p / 1.2)), 120 + i, '#3e372e', 0.6, 0.3, lt)
561
+ stamp(c, x, y, sz, it.s, p, (i - 1) * 0.04)
562
+ const ty = P ? y : y + sz * 0.85
563
+ const tx = P ? x + sz * 1.05 : x
564
+ text(c, it.w, tx, ty - (P ? 20 * u : 0), 44 * u, F.kai, COL.paper, ramp(lt, it.k + 0.3, 0.6), 'center', 8 * u)
565
+ text(c, it.d, tx, ty + (P ? 30 * u : 50 * u), 24 * u, F.song, COL.gold, ramp(lt, it.k + 0.6, 0.6), 'center', 6 * u)
566
+ })
567
+ if (!P) hairline(c, W * 0.2, H * 0.42, W * 0.8, H * 0.42, ramp(lt, items[2].k + 0.5, 1.4), COL.gold, 0.18, u)
568
+ },
569
+ },
570
+
571
+ // ---------- 终 · 学至乎没而后止 ----------
572
+ traveler: {
573
+ draw(S) {
574
+ const { c, W, H, u, P, lt } = S
575
+ glow(c, W * 0.5, H * 0.52, Math.max(W, H) * 0.55, '#c7894a', 0.12)
576
+ mountains(c, W, H, lt, { seed: 51, tint: '#9b8a72', y: P ? 180 * u : 0 })
577
+ const pts: [number, number][] = []
578
+ for (let i = 0; i <= 60; i++) {
579
+ const q = i / 60
580
+ pts.push([W * (0.5 + 0.2 * Math.sin(q * 6) * (1 - q)), lerp(H * 0.98, H * (P ? 0.68 : 0.62), Math.pow(q, 0.7))])
581
+ }
582
+ brush(c, pts, 26 * u, 1, '#d8c7a4', 0.32, 8, 0.4)
583
+ const q = 0.15 + 0.6 * smooth(lt / S.dur)
584
+ const i = Math.floor(q * 60), p = pts[i]
585
+ scholar(c, p[0], p[1], lerp(110, 30, q) * u, COL.paper, 0.95, 'walk', lt)
586
+ const L1 = getLine('c6l1')
587
+ const qi = L1.text.indexOf('学至乎没')
588
+ const x = P ? W * 0.5 : W * 0.86, y = P ? H * 0.12 : H * 0.15
589
+ const qs = '学至乎没而后止也'
590
+ ;[...qs].forEach((ch, j) => {
591
+ const ct = L1.charT[qi + j] - S.shot.start
592
+ revealChar(c, ch, x, y + j * 64 * u * (P ? 0.92 : 1.1), (P ? 54 : 62) * u, F.brush, COL.paper, clamp((lt - ct) / 0.6))
593
+ })
594
+ const ws = [['以自身为材料', S.k('c6l2', '以自身为材料')], ['日复一日', S.k('c6l2', '日复一日')], ['成为完整的人', S.k('c6l2', '完整的人')]] as const
595
+ ws.forEach(([w, k], j) => {
596
+ const xx = P ? W * (0.2 + j * 0.3) : W * (0.12 + j * 0.07)
597
+ const yy = P ? H * 0.42 : H * 0.18
598
+ if (P) text(c, w, xx, yy + j * 0 , 26 * u, F.song, COL.gold, ramp(lt, k - 0.1, 0.8) * 0.9, 'center', 4 * u)
599
+ else vtext(c, w, xx, yy, 30 * u, F.kai, COL.gold, ramp(lt, k - 0.1, 0.8) * 0.9, 1.2)
600
+ })
601
+ },
602
+ },
603
+
604
+ sunrise: {
605
+ draw(S) {
606
+ const { c, W, H, u, P, lt } = S
607
+ const kt = S.k('c6l3', '天性'), kx = S.k('c6l3', '学习,决定')
608
+ const rise = easeOut(ramp(lt, 0, S.dur * 0.8))
609
+ const sy = lerp(H * 0.72, H * 0.48, rise)
610
+ const g = c.createLinearGradient(0, 0, 0, H)
611
+ g.addColorStop(0, 'rgba(0,0,0,0)'); g.addColorStop(0.6, `rgba(160,104,52,${0.25 * rise})`); g.addColorStop(1, 'rgba(0,0,0,0)')
612
+ c.fillStyle = g; c.fillRect(0, 0, W, H)
613
+ c.save(); c.globalCompositeOperation = 'lighter'
614
+ for (let i = 0; i < 9; i++) {
615
+ const a = -Math.PI / 2 + (i - 4) * 0.22 + Math.sin(lt * 0.2 + i) * 0.02
616
+ c.fillStyle = rgba('#f0c27a', 0.05 * rise)
617
+ c.beginPath(); c.moveTo(W / 2, sy); c.lineTo(W / 2 + Math.cos(a - 0.04) * W, sy + Math.sin(a - 0.04) * W); c.lineTo(W / 2 + Math.cos(a + 0.04) * W, sy + Math.sin(a + 0.04) * W); c.closePath(); c.fill()
618
+ }
619
+ glow(c, W / 2, sy, Math.min(W, H) * 0.5, '#f6c46f', 0.6 * rise)
620
+ c.restore()
621
+ ellipse(c, W / 2, sy, Math.min(W, H) * 0.07, Math.min(W, H) * 0.07, rgba('#fbe2b0', 0.95))
622
+ mountains(c, W, H, lt, { seed: 71, tint: '#7a6a55', y: P ? 160 * u : 30 * u })
623
+ const a1 = ramp(lt, kt - 0.2, 0.8), a2 = ramp(lt, kx - 0.2, 0.8)
624
+ const p1: [number, number] = P ? [W * 0.25, H * 0.8] : [W * 0.18, H * 0.78]
625
+ const p2: [number, number] = P ? [W * 0.72, H * 0.3] : [W * 0.78, H * 0.3]
626
+ text(c, '天性 · 出发的地方', p1[0], p1[1], 32 * u, F.kai, COL.paper, a1, 'center', 4 * u)
627
+ text(c, '学习 · 能走多远', p2[0], p2[1], 36 * u, F.kai, COL.gold, a2, 'center', 4 * u)
628
+ c.setLineDash([3 * u, 10 * u]); c.strokeStyle = rgba(COL.gold, 0.6 * a2); c.lineWidth = 1.6 * u
629
+ c.beginPath(); c.moveTo(p1[0], p1[1] - 30 * u); c.quadraticCurveTo(W * 0.5, H * 0.75, p2[0], p2[1] + 30 * u); c.stroke(); c.setLineDash([])
630
+ dust(c, W, H, lt, 50, 31, '#f6d9a0', 0.4)
631
+ },
632
+ },
633
+
634
+ finale: {
635
+ customQuote: true,
636
+ zoom: 0.5,
637
+ draw(S) {
638
+ const { c, W, H, u, P, lt } = S
639
+ const L = S.shot.lines[0]
640
+ const base = L.text.indexOf('学')
641
+ const m = Math.min(W, H)
642
+ const g = ramp(lt, 0, 3.5)
643
+ inkBlob(c, W / 2, H * 0.47, easeOutExpo(g) * m * 0.5, 201, '#4a4236', 0.7, 0.3, lt)
644
+ dust(c, W, H, lt, 60, 41, COL.gold, 0.35)
645
+ text(c, '君子曰', W / 2, P ? H * 0.13 : H * 0.22, 44 * u, F.kai, COL.muted, ramp(lt, L.charT[0] - S.shot.start, 0.6), 'center', 14 * u)
646
+ const size = (P ? 200 : 180) * u
647
+ for (let i = 0; i < 5; i++) {
648
+ const x = P ? W / 2 : W / 2 + (i - 2) * size * 1.12
649
+ const y = P ? H * 0.23 + i * size * 1.1 : H * 0.47
650
+ const ct = L.charT[base + i] - S.shot.start
651
+ revealChar(c, '学不可以已'[i], x, y, size, F.brush, COL.paper, clamp((lt - ct) / 0.7))
652
+ }
653
+ const se = L.end - S.shot.start + 0.6
654
+ const sx = P ? W / 2 + size * 0.8 : W / 2 + size * 3.0, sy = P ? H * 0.23 + 4 * size * 1.1 + size * 0.3 : H * 0.47 + size * 0.2
655
+ stamp(c, sx, sy, 90 * u, '荀子', lt - se)
656
+ text(c, '— 《荀子 · 劝学》', W / 2, P ? H * 0.9 : H * 0.72, 28 * u, F.song, COL.gold, ramp(lt, se + 0.6, 1), 'center', 8 * u)
657
+ },
658
+ },
659
+
660
+ endcard: {
661
+ zoom: 0.4,
662
+ draw(S) {
663
+ const { c, W, H, u, P, lt } = S
664
+ mountains(c, W, H, lt, { seed: 81, alpha: 0.35, y: 80 * u })
665
+ dust(c, W, H, lt, 40, 51, COL.paper, 0.3)
666
+ const Y = P ? H * 0.36 : H * 0.36
667
+ text(c, '劝 学', W / 2, Y, 120 * u, F.brush, COL.paper, ramp(lt, 0.3, 1), 'center', 10 * u)
668
+ text(c, '荀子 · 《荀子》第一篇', W / 2, Y + 100 * u, 30 * u, F.song, COL.gold, ramp(lt, 0.8, 1), 'center', 8 * u)
669
+ hairline(c, W / 2 - 260 * u, Y + 150 * u, W / 2 + 260 * u, Y + 150 * u, ramp(lt, 1.2, 1), COL.gold, 0.4, u)
670
+ const cr = ['原文 《荀子 · 劝学》 统编版高中语文必修上册', '文案原创 · AI 配音 · 画面 音乐 音效 程序化生成', '学不可以已 · 与君共勉']
671
+ cr.forEach((s, i) => text(c, s, W / 2, Y + (200 + i * 50) * u, (i === 2 ? 30 : 22) * u, i === 2 ? F.kai : F.song, i === 2 ? COL.paper : COL.muted, ramp(lt, 1.6 + i * 0.5, 1), 'center', 4 * u))
672
+ seal(c, W / 2, Y + 420 * u, 70 * u, '劝学', ramp(lt, 3, 0.5))
673
+ },
674
+ },
675
+ }
676
+
677
+ function drawCrab(c: Ctx, x: number, y: number, s: number, a: number, t: number) {
678
+ if (a <= 0) return
679
+ c.save(); c.translate(x, y)
680
+ c.strokeStyle = rgba('#b5523b', a); c.lineCap = 'round'; c.lineWidth = s * 0.05
681
+ for (const side of [-1, 1]) {
682
+ for (let i = 0; i < 3; i++) {
683
+ const ox = side * s * 0.32, oy = (i - 1) * s * 0.14
684
+ const wig = Math.sin(t * 14 + i * 2 + side) * s * 0.05
685
+ c.beginPath(); c.moveTo(ox, oy); c.lineTo(ox + side * s * 0.28, oy - s * 0.12 + wig); c.lineTo(ox + side * s * 0.42, oy + s * 0.2 + wig); c.stroke()
686
+ }
687
+ // 螯
688
+ c.beginPath(); c.moveTo(side * s * 0.22, -s * 0.2); c.lineTo(side * s * 0.4, -s * 0.48); c.stroke()
689
+ c.fillStyle = rgba('#c25d43', a)
690
+ c.beginPath(); c.ellipse(side * s * 0.44, -s * 0.56, s * 0.12, s * 0.08, side * 0.6, 0, Math.PI * 2); c.fill()
691
+ }
692
+ c.fillStyle = rgba('#a9472f', a)
693
+ c.beginPath(); c.ellipse(0, 0, s * 0.36, s * 0.24, 0, 0, Math.PI * 2); c.fill()
694
+ c.fillStyle = rgba('#e7d6b8', a)
695
+ for (const side of [-1, 1]) { c.beginPath(); c.arc(side * s * 0.1, -s * 0.24, s * 0.03, 0, Math.PI * 2); c.fill() }
696
+ c.restore()
697
+ }
quanxue-src/src/quanxue/script.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "劝学",
3
+ "author": "荀子",
4
+ "chapters": [
5
+ {
6
+ "id": "c1", "no": "壹", "title": "其人其书", "sub": "战国末年 · 稷下学宫",
7
+ "lines": [
8
+ { "id": "c1l1", "kind": "say", "vis": "era", "text": "两千两百多年前,战国末年,一位年过半百的学者,来到齐国的稷下学宫。" },
9
+ { "id": "c1l2", "kind": "say", "vis": "person", "text": "他叫荀况,赵国人,世人尊称荀卿。他三次出任学宫祭酒,是那个时代最有分量的学者;韩非与李斯,都出自他的门下。" },
10
+ { "id": "c1l3", "kind": "say", "vis": "slips", "text": "后人整理的《荀子》共三十二篇,开卷第一篇,便是《劝学》。" },
11
+ { "id": "c1l4", "kind": "say", "vis": "slips", "text": "把“学”放在一切之前——这不是偶然的编排,而是一种思想的宣言。" }
12
+ ]
13
+ },
14
+ {
15
+ "id": "c2", "no": "贰", "title": "思想底色", "sub": "性恶 · 化性起伪",
16
+ "lines": [
17
+ { "id": "c2l1", "kind": "say", "vis": "ren", "text": "要读懂《劝学》,先要读懂荀子对“人”的判断。" },
18
+ { "id": "c2l2", "kind": "quote", "vis": "ren", "text": "人之性恶,其善者伪也。", "src": "《荀子·性恶》" },
19
+ { "id": "c2l3", "kind": "say", "vis": "wei", "text": "这里的“伪”,不是虚伪,而是“人为”——人后天的努力与塑造。" },
20
+ { "id": "c2l4", "kind": "say", "vis": "mengxun", "text": "孟子相信,善端本自具足,只需向内寻回;荀子却认为,人生来只有欲望与本能,善,必须向外求取,一点一点筑起。" },
21
+ { "id": "c2l5", "kind": "say", "vis": "road", "text": "所以在荀子这里,学习不是锦上添花,而是一个人从“自然之人”走向“文明之人”的唯一道路。" },
22
+ { "id": "c2l6", "kind": "say", "vis": "huaxing", "text": "这就是“化性起伪”。而《劝学》,正是这条道路的总纲。" }
23
+ ]
24
+ },
25
+ {
26
+ "id": "c3", "no": "叁", "title": "学不可以已", "sub": "后天胜先天 · 改变不可逆",
27
+ "lines": [
28
+ { "id": "c3l1", "kind": "quote", "vis": "five", "text": "君子曰:学不可以已。" },
29
+ { "id": "c3l2", "kind": "say", "vis": "five", "text": "开篇五个字,斩钉截铁:学习,不可以停止。" },
30
+ { "id": "c3l3", "kind": "quote", "vis": "indigo", "text": "青,取之于蓝,而青于蓝;冰,水为之,而寒于水。" },
31
+ { "id": "c3l4", "kind": "say", "vis": "indigo", "text": "靛青从蓼蓝中提炼,颜色却比蓼蓝更深;冰由水凝结,却比水更寒冷。" },
32
+ { "id": "c3l5", "kind": "say", "vis": "surpass", "text": "荀子借此说明:经过学习的人,可以超越自己的本来面目。后天,能够胜过先天。" },
33
+ { "id": "c3l6", "kind": "quote", "vis": "wheel", "text": "木直中绳,輮以为轮,其曲中规。虽有槁暴,不复挺者,輮使之然也。", "tts": "木直众绳,柔以为轮,其曲众规。虽有搞瀑,不复挺者,柔使之然也。" },
34
+ { "id": "c3l7", "kind": "say", "vis": "wheel", "text": "一根笔直的木头,用火烘烤,弯成车轮;即便再经日晒风干,也不会重新挺直。" },
35
+ { "id": "c3l8", "kind": "say", "vis": "reshape", "text": "这是全篇最深刻的比喻:学习带来的改变,是根本的、不可逆的。它不是给人涂上一层颜色,而是重塑人的形状。" },
36
+ { "id": "c3l9", "kind": "quote", "vis": "rope", "text": "故木受绳则直,金就砺则利,君子博学而日参省乎己,则知明而行无过矣。", "tts": "故木受绳则直,金就砺则利,君子博学而日餐醒乎己,则智明而行无过矣。" },
37
+ { "id": "c3l10", "kind": "say", "vis": "rings", "text": "绳墨与砺石,是外在的规范;“博学”与“参省”,是向外求知与向内反省的结合。知与行,由此统一。", "tts": "绳墨与砺石,是外在的规范;“博学”与“餐醒”,是向外求知与向内反省的结合。知与行,由此统一。" }
38
+ ]
39
+ },
40
+ {
41
+ "id": "c4", "no": "肆", "title": "善假于物", "sub": "站在前人的肩上",
42
+ "lines": [
43
+ { "id": "c4l1", "kind": "quote", "vis": "climb", "text": "吾尝终日而思矣,不如须臾之所学也;吾尝跂而望矣,不如登高之博见也。", "tts": "吾尝终日而思矣,不如须臾之所学也;吾尝企而望矣,不如登高之博见也。" },
44
+ { "id": "c4l2", "kind": "say", "vis": "climb", "text": "空想一整天,比不上片刻的学习;踮起脚尖眺望,比不上登上高处看得辽阔。荀子并不轻视思考,他反对的,是脱离积累的空想。" },
45
+ { "id": "c4l3", "kind": "quote", "vis": "wave", "text": "登高而招,臂非加长也,而见者远;顺风而呼,声非加疾也,而闻者彰。" },
46
+ { "id": "c4l4", "kind": "quote", "vis": "boat", "text": "假舆马者,非���足也,而致千里;假舟楫者,非能水也,而绝江河。" },
47
+ { "id": "c4l5", "kind": "quote", "vis": "jia", "text": "君子生非异也,善假于物也。" },
48
+ { "id": "c4l6", "kind": "say", "vis": "jia", "text": "君子与常人,生来并没有什么不同;差别只在于,是否善于借助外物。" },
49
+ { "id": "c4l7", "kind": "say", "vis": "books", "text": "而人所能借助的最伟大的“物”,正是前人积累下来的知识与经验。读一本书,就是登上一处高地;学一门学问,就是乘上一辆车马。" }
50
+ ]
51
+ },
52
+ {
53
+ "id": "c5", "no": "伍", "title": "积 · 恒 · 专", "sub": "学习的方法与态度",
54
+ "lines": [
55
+ { "id": "c5l1", "kind": "quote", "vis": "mountain", "text": "积土成山,风雨兴焉;积水成渊,蛟龙生焉;积善成德,而神明自得,圣心备焉。" },
56
+ { "id": "c5l2", "kind": "say", "vis": "mountain", "text": "土积成山,才会兴起风雨;水积成渊,才会孕育蛟龙。量的积累,终将引发质的飞跃。" },
57
+ { "id": "c5l3", "kind": "quote", "vis": "steps", "text": "故不积跬步,无以至千里;不积小流,无以成江海。" },
58
+ { "id": "c5l4", "kind": "quote", "vis": "horse", "text": "骐骥一跃,不能十步;驽马十驾,功在不舍。" },
59
+ { "id": "c5l5", "kind": "say", "vis": "horse", "text": "千里马纵身一跃,也跳不出十步;劣马拉车走上十天,同样能抵达远方。决定成败的,不是天赋,而是不肯停下。" },
60
+ { "id": "c5l6", "kind": "quote", "vis": "carve", "text": "锲而舍之,朽木不折;锲而不舍,金石可镂。" },
61
+ { "id": "c5l7", "kind": "quote", "vis": "worm", "text": "蚓无爪牙之利,筋骨之强,上食埃土,下饮黄泉,用心一也。蟹六跪而二螯,非蛇鳝之穴无可寄托者,用心躁也。" },
62
+ { "id": "c5l8", "kind": "say", "vis": "worm", "text": "蚯蚓柔弱,却因专一而上下自如;螃蟹强悍,却因浮躁而无处安身。" },
63
+ { "id": "c5l9", "kind": "say", "vis": "keys", "text": "积累、坚持、专一——这是荀子交给我们的三把钥匙。" }
64
+ ]
65
+ },
66
+ {
67
+ "id": "c6", "no": "终", "title": "学至乎没而后止", "sub": "以自身为材料的终身雕琢",
68
+ "lines": [
69
+ { "id": "c6l1", "kind": "say", "vis": "traveler", "text": "荀子在后文写道:“学至乎没而后止也。”学习,要到生命终结才停止。", "tts": "荀子在后文写道:“学至乎末而后止也。”学习,要到生命终结才停止。" },
70
+ { "id": "c6l2", "kind": "say", "vis": "traveler", "text": "在他看来,学习不只是获取知识,而是一个人以自身为材料,日复一日地雕琢、塑形,最终成为一个完整的人。" },
71
+ { "id": "c6l3", "kind": "say", "vis": "sunrise", "text": "两千多年后,我们依然站在同样的起点上:天性给了我们出发的地方,而学习,决定我们能走多远。" },
72
+ { "id": "c6l4", "kind": "quote", "vis": "finale", "text": "君子曰:学不可以已。" }
73
+ ]
74
+ }
75
+ ]
76
+ }
quanxue-src/src/quanxue/timeline.ts ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 由旁白真实时长自动排布全片时间轴:章节卡、镜头、每句旁白、逐字时间、字幕分段、音效点
2
+ import script from './script.json'
3
+ import voice from './voice.json'
4
+ import { isPunct } from './engine/util'
5
+
6
+ type RawLine = { id: string; kind: 'say' | 'quote'; vis: string; text: string; tts?: string; src?: string }
7
+ type RawChapter = { id: string; no: string; title: string; sub: string; lines: RawLine[] }
8
+ type VoiceMeta = Record<string, { dur: number; words: { o: number; d: number; t: string }[] }>
9
+
10
+ export type Chunk = { text: string; start: number; end: number }
11
+ export type Line = RawLine & {
12
+ start: number; dur: number; end: number
13
+ chapter: number
14
+ charT: number[]
15
+ chunksL: Chunk[]; chunksP: Chunk[]
16
+ }
17
+ export type Shot = { idx: number; vis: string; start: number; end: number; lines: Line[]; quote?: Line; chapter: number }
18
+ export type ChapterT = { id: string; no: string; title: string; sub: string; start: number; end: number }
19
+ export type SfxType = 'drop' | 'boom' | 'brush' | 'stamp' | 'bell' | 'chime' | 'whoosh' | 'creak' | 'fire' | 'tick' | 'rain' | 'drip' | 'wind' | 'water' | 'page' | 'thud'
20
+ export type Cue = { t: number; type: SfxType; gain?: number; seed?: number }
21
+
22
+ export const INTRO = 9
23
+ export const CARD = 3.8
24
+ export const END_CARD = 9
25
+ const FIRST_DELAY = 0.55
26
+ const GAP = { say: 0.5, quote: 1.05 }
27
+
28
+ const V = voice as VoiceMeta
29
+ const chapters = (script as { chapters: RawChapter[] }).chapters
30
+
31
+ function charTimes(line: RawLine, start: number, dur: number): number[] {
32
+ const text = line.text
33
+ const tts = line.tts || line.text
34
+ const words = V[line.id]?.words || []
35
+ const T: number[] = new Array(text.length).fill(NaN)
36
+ let p = 0
37
+ for (const w of words) {
38
+ const chars = [...w.t].filter((c) => !isPunct(c))
39
+ chars.forEach((c, k) => {
40
+ let q = p
41
+ while (q < tts.length && tts[q] !== c) q++
42
+ if (q < tts.length) { T[q] = start + w.o + (w.d * k) / Math.max(1, chars.length); p = q + 1 }
43
+ })
44
+ }
45
+ // 补齐未匹配字符:线性插值
46
+ let last = start, lastI = -1
47
+ for (let i = 0; i <= text.length; i++) {
48
+ if (i === text.length || !isNaN(T[i])) {
49
+ const next = i === text.length ? start + dur : T[i]
50
+ for (let j = lastI + 1; j < i; j++) T[j] = last + ((next - last) * (j - lastI)) / (i - lastI)
51
+ if (i < text.length) { last = T[i]; lastI = i }
52
+ }
53
+ }
54
+ return T
55
+ }
56
+
57
+ const TRIM = /^[,。;:、\s]+|[,。;:、\s]+$/g
58
+ function chunks(text: string, T: number[], end: number, max: number): Chunk[] {
59
+ // 先按标点切成小句,再贪心合并到不超过 max 字
60
+ const parts: { s: number; e: number }[] = []
61
+ let s = 0
62
+ for (let i = 0; i < text.length; i++) {
63
+ if (',。;:?!、—'.includes(text[i])) {
64
+ let e = i + 1
65
+ while (e < text.length && ('—”'.includes(text[e]))) e++
66
+ parts.push({ s, e }); s = e; i = e - 1
67
+ }
68
+ }
69
+ if (s < text.length) parts.push({ s, e: text.length })
70
+ const out: { s: number; e: number }[] = []
71
+ for (const p of parts) {
72
+ const cur = out[out.length - 1]
73
+ const len = (a: number, b: number) => [...text.slice(a, b)].filter((c) => !isPunct(c)).length
74
+ if (cur && len(cur.s, p.e) <= max && !/[。?!]/.test(text[cur.e - 1])) cur.e = p.e
75
+ else out.push({ ...p })
76
+ }
77
+ return out.map((p, i) => ({
78
+ text: text.slice(p.s, p.e).replace(TRIM, '').replace(/——$/, ''),
79
+ start: T[p.s] - 0.08,
80
+ end: i + 1 < out.length ? T[out[i + 1].s] - 0.08 : end + 0.15,
81
+ })).filter((c) => c.text.length > 0)
82
+ }
83
+
84
+ function build() {
85
+ const shots: Shot[] = []
86
+ const lines: Line[] = []
87
+ const chs: ChapterT[] = []
88
+ const cues: Cue[] = []
89
+ let t = 0
90
+ shots.push({ idx: 0, vis: 'title', start: 0, end: INTRO, lines: [], chapter: -1 })
91
+ cues.push({ t: 1.32, type: 'drop' }, { t: 1.62, type: 'boom', gain: 1 }, { t: 2.3, type: 'brush', gain: 0.8 }, { t: 4.55, type: 'stamp' }, { t: 5.1, type: 'chime', gain: 0.7 })
92
+ t = INTRO
93
+ chapters.forEach((c, ci) => {
94
+ const cStart = t
95
+ shots.push({ idx: shots.length, vis: 'card', start: t, end: t + CARD, lines: [], chapter: ci })
96
+ cues.push({ t: t + 0.15, type: 'bell', gain: 0.9 }, { t: t + 0.7, type: 'brush', gain: 0.6 })
97
+ t += CARD
98
+ let shot: Shot | null = null
99
+ c.lines.forEach((rl) => {
100
+ if (!shot || shot.vis !== rl.vis) {
101
+ if (shot) shot.end = t
102
+ shot = { idx: shots.length, vis: rl.vis, start: t, end: t, lines: [], chapter: ci }
103
+ shots.push(shot)
104
+ cues.push({ t: t - 0.25, type: 'whoosh', gain: 0.45, seed: shots.length })
105
+ t += FIRST_DELAY
106
+ }
107
+ const dur = V[rl.id]?.dur ?? 3
108
+ const start = t
109
+ const charT = charTimes(rl, start, dur)
110
+ const line: Line = { ...rl, start, dur, end: start + dur, chapter: ci, charT, chunksL: chunks(rl.text, charT, start + dur, 20), chunksP: chunks(rl.text, charT, start + dur, 13) }
111
+ if (rl.kind === 'quote') { shot.quote = line; cues.push({ t: start - 0.15, type: 'brush', gain: 0.35, seed: lines.length }) }
112
+ shot.lines.push(line)
113
+ lines.push(line)
114
+ t = start + dur + GAP[rl.kind]
115
+ })
116
+ t += 0.5
117
+ if (ci === chapters.length - 1) t += 3.2 // 结尾定格
118
+ if (shot) (shot as Shot).end = t
119
+ chs.push({ id: c.id, no: c.no, title: c.title, sub: c.sub, start: cStart, end: t })
120
+ })
121
+ shots.push({ idx: shots.length, vis: 'endcard', start: t, end: t + END_CARD, lines: [], chapter: -1 })
122
+ cues.push({ t: t + 0.3, type: 'bell', gain: 0.8 })
123
+ t += END_CARD
124
+ return { shots, lines, chapters: chs, cues, duration: t }
125
+ }
126
+
127
+ export const TL = build()
128
+ export const DURATION = TL.duration
129
+
130
+ const lineById = new Map(TL.lines.map((l) => [l.id, l]))
131
+ export const getLine = (id: string) => lineById.get(id)!
132
+
133
+ /** 某句中某个词开始被念出的绝对时间 */
134
+ export function keyT(id: string, sub: string, offset = 0): number {
135
+ const l = lineById.get(id)
136
+ if (!l) return 0
137
+ const i = l.text.indexOf(sub)
138
+ if (i < 0) { console.warn('keyT miss', id, sub); return l.start }
139
+ return l.charT[i] + offset
140
+ }
141
+
142
+ // ---- 与画面共享的音效节拍 ----
143
+ /** 刻凿的敲击时间(锲而舍之 → 少量后停止;锲而不舍 → 持续) */
144
+ export function carveStrikes(): number[] {
145
+ const a = keyT('c5l6', '锲而舍之'), b = keyT('c5l6', '朽木不折'), c = keyT('c5l6', '锲而不舍'), d = getLine('c5l6').end + 1.0
146
+ const out: number[] = []
147
+ for (let x = a; x < b - 0.2; x += 0.42) out.push(x)
148
+ for (let x = c; x < d; x += 0.26) out.push(x)
149
+ return out
150
+ }
151
+
152
+ function addSceneCues() {
153
+ const C = TL.cues
154
+ C.push({ t: keyT('c1l3', '三十二篇'), type: 'page', gain: 0.6 })
155
+ C.push({ t: keyT('c1l4', '宣言'), type: 'chime', gain: 0.55 })
156
+ C.push({ t: keyT('c2l3', '人为'), type: 'thud', gain: 0.6 })
157
+ C.push({ t: keyT('c2l6', '化性起伪'), type: 'boom', gain: 0.7 })
158
+ ;['化', '性', '起', '伪'].forEach((ch, i) => C.push({ t: keyT('c2l6', '化性起伪') + 0.25 + i * 0.32, type: 'stamp', gain: 0.4 }))
159
+ C.push({ t: keyT('c3l2', '斩钉截铁'), type: 'boom', gain: 0.9 })
160
+ C.push({ t: keyT('c3l3', '冰'), type: 'chime', gain: 0.4 })
161
+ C.push({ t: keyT('c3l6', '輮以为轮'), type: 'fire', gain: 0.8 })
162
+ C.push({ t: keyT('c3l6', '輮以为轮', 0.6), type: 'creak', gain: 0.7 })
163
+ C.push({ t: keyT('c3l9', '金就砺'), type: 'tick', gain: 0.5, seed: 3 })
164
+ C.push({ t: keyT('c4l1', '登高'), type: 'wind', gain: 0.4 })
165
+ C.push({ t: keyT('c4l3', '顺风而呼'), type: 'wind', gain: 0.7 })
166
+ C.push({ t: keyT('c4l4', '假舟楫'), type: 'water', gain: 0.7 })
167
+ C.push({ t: keyT('c4l7', '读一本书'), type: 'page', gain: 0.6 })
168
+ C.push({ t: keyT('c5l1', '风雨兴焉'), type: 'rain', gain: 0.7 })
169
+ C.push({ t: keyT('c5l1', '积水成渊'), type: 'drip', gain: 0.8 })
170
+ C.push({ t: keyT('c5l1', '蛟龙生焉'), type: 'boom', gain: 0.45 })
171
+ C.push({ t: keyT('c5l1', '积善成德'), type: 'chime', gain: 0.6 })
172
+ C.push({ t: keyT('c5l4', '骐骥一跃'), type: 'whoosh', gain: 0.6, seed: 91 })
173
+ carveStrikes().forEach((x, i) => C.push({ t: x, type: 'tick', gain: 0.5, seed: i }))
174
+ ;['积累', '坚持', '专一'].forEach((w) => C.push({ t: keyT('c5l9', w), type: 'stamp', gain: 0.9 }))
175
+ C.push({ t: keyT('c6l3', '能走多远'), type: 'chime', gain: 0.5 })
176
+ C.push({ t: keyT('c6l4', '学不可以已'), type: 'boom', gain: 0.8 })
177
+ C.push({ t: getLine('c6l4').end + 0.6, type: 'stamp', gain: 1 })
178
+ C.sort((a, b) => a.t - b.t)
179
+ }
180
+ addSceneCues()
181
+
182
+ export function shotAt(t: number): number {
183
+ const S = TL.shots
184
+ for (let i = S.length - 1; i >= 0; i--) if (t >= S[i].start) return i
185
+ return 0
186
+ }
187
+ export function chapterAt(t: number): number {
188
+ return TL.chapters.findIndex((c) => t >= c.start && t < c.end)
189
+ }
quanxue-src/src/quanxue/ui/CoverPanel.tsx ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useEffect, useState } from 'react'
2
+ import { Check, Download, ImageDown } from 'lucide-react'
3
+ import { COVERS, RATIO_DIM, renderCover, type Ratio } from '../covers'
4
+ import { useAssets } from './store'
5
+
6
+ const RATIOS: { r: Ratio; t: string; tip: string }[] = [
7
+ { r: '3:4', t: '3:4 竖版', tip: '小红书 / 视频号' },
8
+ { r: '4:3', t: '4:3 横版', tip: '视频号 / 公众号' },
9
+ { r: '16:9', t: '16:9 宽屏', tip: 'B站 / 抖音横屏' },
10
+ ]
11
+
12
+ function download(cv: HTMLCanvasElement, name: string) {
13
+ return new Promise<void>((res) => cv.toBlob((b) => {
14
+ if (b) { const url = URL.createObjectURL(b); const a = document.createElement('a'); a.href = url; a.download = name; document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(url), 4000) }
15
+ res()
16
+ }, 'image/png'))
17
+ }
18
+
19
+ export function CoverPanel() {
20
+ const assets = useAssets()
21
+ const [ratios, setRatios] = useState<Ratio[]>(['3:4', '4:3', '16:9'])
22
+ const [designs, setDesigns] = useState<string[]>(COVERS.map((c) => c.id))
23
+ const [previews, setPreviews] = useState<Record<string, string>>({})
24
+ const [busy, setBusy] = useState(false)
25
+
26
+ useEffect(() => {
27
+ if (!assets.fonts) return
28
+ let cancelled = false
29
+ ;(async () => {
30
+ const out: Record<string, string> = {}
31
+ for (const d of COVERS) for (const { r } of RATIOS) {
32
+ if (cancelled) return
33
+ out[`${d.id}_${r}`] = renderCover(d, r, 0.36).toDataURL('image/jpeg', 0.86)
34
+ setPreviews({ ...out })
35
+ await new Promise((res) => setTimeout(res, 0))
36
+ }
37
+ })()
38
+ return () => { cancelled = true }
39
+ }, [assets.fonts])
40
+
41
+ const toggle = <T,>(arr: T[], v: T) => (arr.includes(v) ? arr.filter((x) => x !== v) : [...arr, v])
42
+ const selected = COVERS.filter((d) => designs.includes(d.id)).flatMap((d) => ratios.map((r) => ({ d, r })))
43
+
44
+ const dlAll = async () => {
45
+ setBusy(true)
46
+ for (const { d, r } of selected) { await download(renderCover(d, r), `劝学封面_${d.name.replace(/\s|·/g, '')}_${r.replace(':', 'x')}.png`); await new Promise((res) => setTimeout(res, 350)) }
47
+ setBusy(false)
48
+ }
49
+
50
+ return (
51
+ <div className="flex flex-col gap-5">
52
+ <div className="flex flex-col md:flex-row md:items-end gap-4 md:gap-8">
53
+ <div className="flex flex-col gap-2">
54
+ <div className="text-xs tracking-[0.2em] text-[#9d927f]">比例(可多选)</div>
55
+ <div className="flex flex-wrap gap-2">
56
+ {RATIOS.map(({ r, t, tip }) => (
57
+ <button key={r} onClick={() => setRatios(toggle(ratios, r))} className={`flex items-center gap-1.5 px-3 py-2 rounded-md border text-sm transition ${ratios.includes(r) ? 'border-[#cfa961] bg-[#cfa961]/12 text-[#f3e3bd]' : 'border-white/10 text-[#9d927f] hover:border-white/30'}`}>
58
+ {ratios.includes(r) && <Check size={14} />}{t}<span className="text-[11px] opacity-70">{tip}</span>
59
+ </button>
60
+ ))}
61
+ </div>
62
+ </div>
63
+ <div className="flex flex-col gap-2 flex-1">
64
+ <div className="text-xs tracking-[0.2em] text-[#9d927f]">设计(可多选)</div>
65
+ <div className="flex flex-wrap gap-2">
66
+ {COVERS.map((d) => (
67
+ <button key={d.id} onClick={() => setDesigns(toggle(designs, d.id))} className={`flex items-center gap-1.5 px-3 py-2 rounded-md border text-sm transition ${designs.includes(d.id) ? 'border-[#cfa961] bg-[#cfa961]/12 text-[#f3e3bd]' : 'border-white/10 text-[#9d927f] hover:border-white/30'}`}>
68
+ {designs.includes(d.id) && <Check size={14} />}{d.name}
69
+ </button>
70
+ ))}
71
+ </div>
72
+ </div>
73
+ <button disabled={!selected.length || busy || !assets.fonts} onClick={dlAll} className="flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg bg-[#b8392b] hover:bg-[#c94434] disabled:opacity-40 text-white text-sm tracking-wider whitespace-nowrap">
74
+ <ImageDown size={16} />{busy ? '生成中…' : `下载选中 ${selected.length} 张`}
75
+ </button>
76
+ </div>
77
+ {ratios.map((r) => (
78
+ <div key={r} className="flex flex-col gap-3">
79
+ <div className="text-sm text-[#c9bfa9] flex items-center gap-2"><span className="w-1 h-4 bg-[#b8392b]" />{r} · {RATIO_DIM[r][0]}×{RATIO_DIM[r][1]}</div>
80
+ <div className={`grid gap-4 ${r === '3:4' ? 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5' : 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3'}`}>
81
+ {COVERS.filter((d) => designs.includes(d.id)).map((d) => (
82
+ <div key={d.id} className="group relative rounded-lg overflow-hidden ring-1 ring-white/10 bg-black" style={{ aspectRatio: r.replace(':', ' / ') }}>
83
+ {previews[`${d.id}_${r}`] ? <img src={previews[`${d.id}_${r}`]} alt={d.name} className="w-full h-full object-cover" /> : <div className="w-full h-full animate-pulse bg-white/5" />}
84
+ <div className="absolute inset-x-0 bottom-0 p-2 flex items-center justify-between bg-gradient-to-t from-black/80 to-transparent">
85
+ <span className="text-xs text-[#efe6d2]">{d.name}</span>
86
+ <button onClick={() => download(renderCover(d, r), `劝学封面_${d.name.replace(/\s|·/g, '')}_${r.replace(':', 'x')}.png`)} className="flex items-center gap-1 text-[11px] px-2 py-1 rounded bg-white/10 hover:bg-[#cfa961] hover:text-black text-[#efe6d2] transition"><Download size={12} />PNG</button>
87
+ </div>
88
+ </div>
89
+ ))}
90
+ </div>
91
+ </div>
92
+ ))}
93
+ </div>
94
+ )
95
+ }
quanxue-src/src/quanxue/ui/ExportPanel.tsx ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useEffect, useRef, useState } from 'react'
2
+ import { Download, Film, Loader2, X } from 'lucide-react'
3
+ import { DURATION } from '../timeline'
4
+ import { dims, estimateMB, exportMp4, pickCodecs, webCodecsSupported, type ExportOpts, type Progress, type Res } from '../exporter'
5
+ import { engine, fmtTime, useAssets } from './store'
6
+
7
+ function Seg<T extends string | number>({ label, value, options, onChange, disabled }: { label: string; value: T; options: { v: T; t: string; sub?: string }[]; onChange: (v: T) => void; disabled?: boolean }) {
8
+ return (
9
+ <div className="flex flex-col gap-2">
10
+ <div className="text-xs tracking-[0.2em] text-[#9d927f]">{label}</div>
11
+ <div className="flex flex-wrap gap-2">
12
+ {options.map((o) => (
13
+ <button key={String(o.v)} disabled={disabled} onClick={() => onChange(o.v)}
14
+ className={`px-3.5 py-2 rounded-md border text-sm transition disabled:opacity-50 ${value === o.v ? 'border-[#cfa961] bg-[#cfa961]/12 text-[#f3e3bd]' : 'border-white/10 text-[#c9bfa9] hover:border-white/30'}`}>
15
+ {o.t}{o.sub && <span className="ml-1.5 text-[11px] text-[#9d927f]">{o.sub}</span>}
16
+ </button>
17
+ ))}
18
+ </div>
19
+ </div>
20
+ )
21
+ }
22
+
23
+ export function ExportPanel({ defaultPortrait }: { defaultPortrait: boolean }) {
24
+ const assets = useAssets()
25
+ const [o, setO] = useState<ExportOpts>({ res: '1080P', fps: 30, portrait: defaultPortrait, music: true })
26
+ const [codecs, setCodecs] = useState<{ video: string | null; audio: string | null } | null>(null)
27
+ const [prog, setProg] = useState<Progress | null>(null)
28
+ const [busy, setBusy] = useState(false)
29
+ const [result, setResult] = useState<{ url?: string; name: string; size?: number; disk: boolean; codec: string; secs: number } | null>(null)
30
+ const [err, setErr] = useState('')
31
+ const sig = useRef({ cancelled: false })
32
+ const supported = webCodecsSupported()
33
+ useEffect(() => { setO((x) => ({ ...x, portrait: defaultPortrait })) }, [defaultPortrait])
34
+ useEffect(() => { if (supported) pickCodecs(o).then((c) => setCodecs(c)).catch(() => setCodecs({ video: null, audio: null })) }, [o.res, o.fps, o.portrait, supported])
35
+
36
+ const [w, h] = dims(o)
37
+ const name = `劝学_荀子_${o.res}_${o.fps}fps_${o.portrait ? '竖屏' : '横屏'}${o.music ? '' : '_无背景音乐'}.mp4`
38
+
39
+ const start = async () => {
40
+ setErr(''); setResult(null)
41
+ if (engine.playing) engine.pause()
42
+ let handle: any = null
43
+ const w = window as any
44
+ if (typeof w.showSaveFilePicker === 'function' && estimateMB(o) > 300) {
45
+ try { handle = await w.showSaveFilePicker({ suggestedName: name, types: [{ description: 'MP4 视频', accept: { 'video/mp4': ['.mp4'] } }] }) } catch (e: any) { if (e?.name === 'AbortError') return; handle = null }
46
+ }
47
+ sig.current = { cancelled: false }
48
+ setBusy(true)
49
+ const t0 = performance.now()
50
+ try {
51
+ const r = await exportMp4(engine, o, setProg, sig.current, handle)
52
+ const secs = (performance.now() - t0) / 1000
53
+ if (r.blob) {
54
+ const url = URL.createObjectURL(r.blob)
55
+ setResult({ url, name, size: r.blob.size, disk: false, codec: r.codec, secs })
56
+ const a = document.createElement('a'); a.href = url; a.download = name; document.body.appendChild(a); a.click(); a.remove()
57
+ } else setResult({ name, disk: true, codec: r.codec, secs })
58
+ } catch (e: any) {
59
+ setErr(e?.message === 'cancelled' ? '已取消导出。' : '导出失败:' + (e?.message || e))
60
+ } finally { setBusy(false); setProg(null) }
61
+ }
62
+
63
+ const ready = assets.fonts && assets.voice >= 1
64
+ return (
65
+ <div className="grid lg:grid-cols-[1.2fr_1fr] gap-6">
66
+ <div className="flex flex-col gap-5">
67
+ <Seg label="画幅" value={o.portrait ? 'p' : 'l'} disabled={busy} onChange={(v) => setO({ ...o, portrait: v === 'p' })} options={[{ v: 'l', t: '横屏', sub: '16:9' }, { v: 'p', t: '竖屏', sub: '9:16 手机' }]} />
68
+ <Seg<Res> label="分辨率" value={o.res} disabled={busy} onChange={(v) => setO({ ...o, res: v })} options={[{ v: '2K', t: '2K', sub: '1440p' }, { v: '1080P', t: '1080P', sub: '全高清' }, { v: '720P', t: '720P', sub: '高清' }]} />
69
+ <Seg<number> label="帧率" value={o.fps} disabled={busy} onChange={(v) => setO({ ...o, fps: v as 24 | 30 | 60 })} options={[{ v: 24, t: '24 fps', sub: '电影感' }, { v: 30, t: '30 fps', sub: '标准' }, { v: 60, t: '60 fps', sub: '丝滑' }]} />
70
+ <Seg label="背景音乐" value={o.music ? 'y' : 'n'} disabled={busy} onChange={(v) => setO({ ...o, music: v === 'y' })} options={[{ v: 'y', t: '导出背景音乐' }, { v: 'n', t: '不导出', sub: '仅旁白 + 音效' }]} />
71
+ </div>
72
+ <div className="rounded-xl border border-white/10 bg-white/[0.02] p-5 flex flex-col gap-4">
73
+ <div className="flex items-center gap-2 text-[#efe6d2]"><Film size={18} className="text-[#cfa961]" /><span className="qx-song font-semibold tracking-wider">导出设置</span></div>
74
+ <dl className="grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm">
75
+ <dt className="text-[#9d927f]">输出尺寸</dt><dd className="text-[#efe6d2] tabular-nums">{w} × {h}</dd>
76
+ <dt className="text-[#9d927f]">时长 / 帧数</dt><dd className="text-[#efe6d2] tabular-nums">{fmtTime(DURATION)} · {Math.ceil(DURATION * o.fps).toLocaleString()} 帧</dd>
77
+ <dt className="text-[#9d927f]">预计大小</dt><dd className="text-[#efe6d2] tabular-nums">约 {estimateMB(o)} MB</dd>
78
+ <dt className="text-[#9d927f]">编码</dt><dd className="text-[#efe6d2]">{!supported ? '—' : codecs ? `${codecs.video ? (codecs.video === 'avc' ? 'H.264' : codecs.video.toUpperCase()) : '不支持'} + ${codecs.audio ? codecs.audio.toUpperCase() : '无音轨'}` : '检测中…'}</dd>
79
+ </dl>
80
+ {!supported && <div className="text-sm text-amber-300/90 leading-relaxed">当前浏览器不支持 WebCodecs,无法本地导出。请使用最新版 Chrome / Edge(电脑端效果最佳)。</div>}
81
+ {supported && codecs && !codecs.video && <div className="text-sm text-amber-300/90">该分辨率 / 帧率组合超出本机编码能力,请降低分辨率或帧率。</div>}
82
+ {!busy ? (
83
+ <button disabled={!supported || !ready || (codecs !== null && !codecs.video)} onClick={start} className="mt-1 flex items-center justify-center gap-2 py-3 rounded-lg bg-[#b8392b] hover:bg-[#c94434] disabled:opacity-40 disabled:hover:bg-[#b8392b] text-white tracking-widest transition">
84
+ <Download size={18} /> 开始导出 MP4
85
+ </button>
86
+ ) : (
87
+ <div className="flex flex-col gap-2">
88
+ <div className="flex items-center justify-between text-sm text-[#efe6d2]"><span className="flex items-center gap-2"><Loader2 size={15} className="animate-spin text-[#cfa961]" />{prog?.phase ?? '准备中'}</span><span className="tabular-nums">{Math.round((prog?.p ?? 0) * 100)}%</span></div>
89
+ <div className="h-2 rounded bg-white/10 overflow-hidden"><div className="h-full bg-gradient-to-r from-[#b8392b] to-[#cfa961] transition-[width]" style={{ width: `${(prog?.p ?? 0) * 100}%` }} /></div>
90
+ <div className="text-xs text-[#9d927f] tabular-nums">{prog?.total ? `${prog.frame.toLocaleString()} / ${prog.total.toLocaleString()} 帧 · ${prog.fps.toFixed(1)} 帧/秒 · 剩余约 ${fmtTime(prog.eta)}` : ''}</div>
91
+ <button onClick={() => { sig.current.cancelled = true }} className="self-start flex items-center gap-1 text-xs text-[#c9bfa9] hover:text-white border border-white/15 rounded px-2.5 py-1"><X size={13} />取消</button>
92
+ </div>
93
+ )}
94
+ {result && (
95
+ <div className="rounded-lg border border-[#cfa961]/30 bg-[#cfa961]/5 p-3 text-sm text-[#efe6d2] leading-relaxed">
96
+ ✓ 导出完成({result.codec},用时 {fmtTime(result.secs)}){result.disk ? ',已直接保存到你选择的位置。' : `,${((result.size ?? 0) / 1024 / 1024).toFixed(1)} MB。`}
97
+ {result.url && <a href={result.url} download={result.name} className="block mt-1 text-[#cfa961] underline underline-offset-4">若未自动下载,点此保存 {result.name}</a>}
98
+ </div>
99
+ )}
100
+ {err && <div className="text-sm text-red-300">{err}</div>}
101
+ <ul className="text-xs text-[#9d927f] leading-relaxed list-disc pl-4 space-y-0.5">
102
+ <li>全程在本机浏览器渲染编码,不上传任何数据。</li>
103
+ <li>导出期间请保持本页在前台;2K / 60fps 耗时较长。</li>
104
+ <li>文件较大时(Chrome / Edge)会请你先选择保存位置,边渲染边写入磁盘。</li>
105
+ </ul>
106
+ </div>
107
+ </div>
108
+ )
109
+ }
quanxue-src/src/quanxue/ui/Player.tsx ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useCallback, useEffect, useRef, useState } from 'react'
2
+ import { Maximize2, Minimize2, Music, Music2, Pause, Play, RectangleHorizontal, RectangleVertical, RotateCcw } from 'lucide-react'
3
+ import { DURATION, TL, chapterAt } from '../timeline'
4
+ import { renderFrame } from '../render'
5
+ import { engine, fmtTime, useAssets } from './store'
6
+
7
+ export type Orient = 'landscape' | 'portrait'
8
+
9
+ export function Player({ orient, setOrient, seekReq }: { orient: Orient; setOrient: (o: Orient) => void; seekReq: { t: number; n: number } }) {
10
+ const assets = useAssets()
11
+ const ready = assets.fonts && assets.voice >= 1
12
+ const canvasRef = useRef<HTMLCanvasElement>(null)
13
+ const boxRef = useRef<HTMLDivElement>(null)
14
+ const wrapRef = useRef<HTMLDivElement>(null)
15
+ const [playing, setPlaying] = useState(false)
16
+ const [t, setT] = useState(0)
17
+ const [fs, setFs] = useState(false)
18
+ const [musicOn, setMusicOn] = useState(true)
19
+ const [hover, setHover] = useState(false)
20
+ const dirty = useRef(true)
21
+ const lastUi = useRef(0)
22
+ const P = orient === 'portrait'
23
+
24
+ // 画布尺寸:容器尺寸 × DPR,长边不超过 1920
25
+ useEffect(() => {
26
+ const box = boxRef.current, cv = canvasRef.current
27
+ if (!box || !cv) return
28
+ const ro = new ResizeObserver(() => {
29
+ const r = box.getBoundingClientRect()
30
+ const dpr = Math.min(2, window.devicePixelRatio || 1)
31
+ let w = r.width * dpr, h = r.height * dpr
32
+ const k = Math.min(1, 1920 / Math.max(w, h))
33
+ w = Math.round(w * k); h = Math.round(h * k)
34
+ if (w > 10 && h > 10 && (cv.width !== w || cv.height !== h)) { cv.width = w; cv.height = h; dirty.current = true }
35
+ })
36
+ ro.observe(box)
37
+ return () => ro.disconnect()
38
+ }, [orient, fs])
39
+
40
+ useEffect(() => { dirty.current = true }, [orient, ready])
41
+
42
+ // 渲染循环:播放时以音频时钟为准
43
+ useEffect(() => {
44
+ let raf = 0
45
+ const loop = () => {
46
+ raf = requestAnimationFrame(loop)
47
+ const cv = canvasRef.current
48
+ if (!cv || !assets.fonts) return
49
+ let now = engine.time()
50
+ if (engine.playing && now >= DURATION - 0.01) { engine.pause(); engine.seek(DURATION); setPlaying(false); now = DURATION }
51
+ if (engine.playing || dirty.current) {
52
+ renderFrame(cv.getContext('2d')!, cv.width, cv.height, now)
53
+ dirty.current = false
54
+ }
55
+ const ms = performance.now()
56
+ if (ms - lastUi.current > 120) { lastUi.current = ms; setT(now) }
57
+ }
58
+ raf = requestAnimationFrame(loop)
59
+ return () => cancelAnimationFrame(raf)
60
+ }, [assets.fonts])
61
+
62
+ const toggle = useCallback(async () => {
63
+ if (!ready) return
64
+ if (engine.playing) { engine.pause(); setPlaying(false) }
65
+ else {
66
+ const from = engine.time() >= DURATION - 0.1 ? 0 : engine.time()
67
+ await engine.play(from); setPlaying(true)
68
+ }
69
+ }, [ready])
70
+
71
+ const seek = useCallback((x: number) => { engine.seek(Math.max(0, Math.min(DURATION, x))); dirty.current = true; setT(engine.time()) }, [])
72
+ useEffect(() => { if (seekReq.n > 0) seek(seekReq.t) }, [seekReq, seek])
73
+
74
+ // 键盘:空格播放 / 左右快进
75
+ useEffect(() => {
76
+ const onKey = (e: KeyboardEvent) => {
77
+ if ((e.target as HTMLElement)?.tagName === 'TEXTAREA' || (e.target as HTMLElement)?.tagName === 'INPUT') return
78
+ if (e.code === 'Space') { e.preventDefault(); toggle() }
79
+ if (e.code === 'ArrowRight') seek(engine.time() + 5)
80
+ if (e.code === 'ArrowLeft') seek(engine.time() - 5)
81
+ if (e.code === 'Escape' && fs) exitFs()
82
+ }
83
+ window.addEventListener('keydown', onKey)
84
+ return () => window.removeEventListener('keydown', onKey)
85
+ })
86
+
87
+ const enterFs = async () => {
88
+ setFs(true)
89
+ try { await wrapRef.current?.requestFullscreen?.() } catch { /* 伪全屏 */ }
90
+ try { await (screen.orientation as any)?.lock?.(P ? 'portrait' : 'landscape') } catch { /* ignore */ }
91
+ }
92
+ const exitFs = async () => {
93
+ setFs(false)
94
+ try { if (document.fullscreenElement) await document.exitFullscreen() } catch { /* ignore */ }
95
+ }
96
+ useEffect(() => {
97
+ const f = () => { if (!document.fullscreenElement) setFs(false) }
98
+ document.addEventListener('fullscreenchange', f)
99
+ return () => document.removeEventListener('fullscreenchange', f)
100
+ }, [])
101
+
102
+ const barRef = useRef<HTMLDivElement>(null)
103
+ const scrub = (e: React.PointerEvent) => {
104
+ const r = barRef.current!.getBoundingClientRect()
105
+ seek(((e.clientX - r.left) / r.width) * DURATION)
106
+ }
107
+ const ci = chapterAt(t)
108
+ const showCtl = !playing || hover
109
+
110
+ const boxStyle: React.CSSProperties = fs
111
+ ? (P ? { height: '100%', maxWidth: '100vw', aspectRatio: '9 / 16', maxHeight: '100vh' } : { width: '100%', maxHeight: '100vh', aspectRatio: '16 / 9', maxWidth: 'calc(100vh * 16 / 9)' })
112
+ : (P ? { height: 'min(78vh, 900px)', aspectRatio: '9 / 16', maxWidth: '100%' } : { width: '100%', aspectRatio: '16 / 9' })
113
+
114
+ return (
115
+ <div ref={wrapRef} className={fs ? 'fixed inset-0 z-[100] bg-black flex items-center justify-center' : 'w-full flex justify-center'}>
116
+ <div ref={boxRef} style={boxStyle} className="relative overflow-hidden bg-black select-none shadow-[0_30px_80px_-20px_rgba(0,0,0,0.9)] ring-1 ring-[#cfa961]/15"
117
+ onMouseMove={() => { setHover(true) }} onMouseLeave={() => setHover(false)}>
118
+ <canvas ref={canvasRef} className="absolute inset-0 w-full h-full cursor-pointer" onClick={toggle} />
119
+ {!ready && (
120
+ <div className="absolute inset-0 flex flex-col items-center justify-center gap-4 bg-black/70 text-[#efe6d2]">
121
+ <div className="qx-brush text-5xl tracking-[0.3em]">劝学</div>
122
+ <div className="w-56 h-[2px] bg-white/10 overflow-hidden"><div className="h-full bg-[#cfa961] transition-all" style={{ width: `${Math.round((assets.voice * 0.8 + (assets.fonts ? 0.2 : 0)) * 100)}%` }} /></div>
123
+ <div className="text-xs text-[#9d927f] tracking-widest">正在加载字体与旁白…</div>
124
+ {assets.error && <div className="text-xs text-red-400 px-6 text-center">{assets.error}</div>}
125
+ </div>
126
+ )}
127
+ {ready && !playing && (
128
+ <button onClick={toggle} className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-20 h-20 rounded-full border border-[#cfa961]/60 bg-black/40 backdrop-blur-sm flex items-center justify-center text-[#efe6d2] hover:scale-105 hover:bg-black/60 transition" aria-label="播放">
129
+ {t >= DURATION - 0.1 ? <RotateCcw size={30} /> : <Play size={32} className="ml-1" />}
130
+ </button>
131
+ )}
132
+ <div className={`absolute inset-x-0 bottom-0 px-3 sm:px-4 pb-2 pt-10 bg-gradient-to-t from-black/85 via-black/40 to-transparent transition-opacity duration-300 ${showCtl ? 'opacity-100' : 'opacity-0'}`}>
133
+ <div ref={barRef} className="relative h-5 flex items-center cursor-pointer group" onPointerDown={(e) => { (e.target as HTMLElement).setPointerCapture(e.pointerId); scrub(e) }} onPointerMove={(e) => { if (e.buttons) scrub(e) }}>
134
+ <div className="absolute inset-x-0 h-[3px] bg-white/15 rounded" />
135
+ <div className="absolute left-0 h-[3px] bg-[#cfa961] rounded" style={{ width: `${(t / DURATION) * 100}%` }} />
136
+ {TL.chapters.map((c) => <div key={c.id} title={c.title} className="absolute w-[2px] h-[9px] bg-[#b8392b]" style={{ left: `${(c.start / DURATION) * 100}%` }} />)}
137
+ <div className="absolute w-3 h-3 rounded-full bg-[#efe6d2] -translate-x-1/2 shadow group-hover:scale-125 transition" style={{ left: `${(t / DURATION) * 100}%` }} />
138
+ </div>
139
+ <div className="flex items-center gap-2 sm:gap-3 text-[#efe6d2] text-xs sm:text-sm">
140
+ <button onClick={toggle} className="p-1.5 hover:text-[#cfa961]" aria-label="播放/暂停">{playing ? <Pause size={18} /> : <Play size={18} />}</button>
141
+ <span className="tabular-nums text-[#c9bfa9]">{fmtTime(t)} / {fmtTime(DURATION)}</span>
142
+ <span className="hidden sm:inline text-[#9d927f] truncate">{ci >= 0 ? `· ${TL.chapters[ci].title}` : ''}</span>
143
+ <div className="flex-1" />
144
+ {!assets.music && <span className="text-[10px] sm:text-xs text-[#9d927f] animate-pulse">配乐加载中</span>}
145
+ <button onClick={() => { const v = !musicOn; setMusicOn(v); engine.setMusic(v) }} className="p-1.5 hover:text-[#cfa961]" title={musicOn ? '关闭背景音乐' : '开启背景音乐'}>{musicOn ? <Music size={17} /> : <Music2 size={17} className="opacity-40" />}</button>
146
+ <button onClick={() => setOrient(P ? 'landscape' : 'portrait')} className="flex items-center gap-1 px-2 py-1 rounded border border-white/15 hover:border-[#cfa961]/60 hover:text-[#cfa961]" title="切换横屏 / 竖屏">
147
+ {P ? <RectangleVertical size={15} /> : <RectangleHorizontal size={15} />}<span className="text-[11px]">{P ? '竖屏 9:16' : '横屏 16:9'}</span>
148
+ </button>
149
+ <button onClick={fs ? exitFs : enterFs} className="p-1.5 hover:text-[#cfa961]" title="全屏">{fs ? <Minimize2 size={17} /> : <Maximize2 size={17} />}</button>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ )
155
+ }
quanxue-src/src/quanxue/ui/PublishPanel.tsx ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useState } from 'react'
2
+ import { Check, Copy } from 'lucide-react'
3
+ import { PLATFORMS, countChars, tagText } from '../publish'
4
+ import { copyText } from './store'
5
+
6
+ function CopyBtn({ text, label = '复制' }: { text: string; label?: string }) {
7
+ const [ok, setOk] = useState(false)
8
+ return (
9
+ <button onClick={async () => { if (await copyText(text)) { setOk(true); setTimeout(() => setOk(false), 1400) } }}
10
+ className={`shrink-0 flex items-center gap-1 text-xs px-2.5 py-1.5 rounded border transition ${ok ? 'border-emerald-400/60 text-emerald-300' : 'border-white/15 text-[#c9bfa9] hover:border-[#cfa961] hover:text-[#f3e3bd]'}`}>
11
+ {ok ? <Check size={13} /> : <Copy size={13} />}{ok ? '已复制' : label}
12
+ </button>
13
+ )
14
+ }
15
+
16
+ export function PublishPanel() {
17
+ const [pid, setPid] = useState(PLATFORMS[0].id)
18
+ const p = PLATFORMS.find((x) => x.id === pid)!
19
+ const tags = tagText(p)
20
+ return (
21
+ <div className="flex flex-col gap-5">
22
+ <div className="flex flex-wrap gap-2">
23
+ {PLATFORMS.map((x) => (
24
+ <button key={x.id} onClick={() => setPid(x.id)} className={`px-4 py-2 rounded-full border text-sm transition ${pid === x.id ? 'text-white' : 'border-white/10 text-[#9d927f] hover:text-[#efe6d2]'}`}
25
+ style={pid === x.id ? { borderColor: x.color, background: x.color + '22' } : undefined}>
26
+ <span className="inline-block w-2 h-2 rounded-full mr-2 align-middle" style={{ background: x.color }} />{x.name}
27
+ </button>
28
+ ))}
29
+ </div>
30
+ <div className="text-xs text-[#9d927f]">规则:标题 ≤ {p.titleMax} 字 · 话题 {p.tagMax ? `≤ ${p.tagMax} 个` : '不限数量'}</div>
31
+ <section className="flex flex-col gap-2">
32
+ <div className="text-sm text-[#efe6d2] qx-song font-semibold tracking-wider">标题(任选其一)</div>
33
+ {p.titles.map((t) => {
34
+ const n = countChars(t), ok = n <= p.titleMax
35
+ return (
36
+ <div key={t} className="flex items-center gap-3 rounded-lg border border-white/10 bg-white/[0.02] px-3 py-2.5">
37
+ <div className="flex-1 text-[15px] text-[#efe6d2] leading-relaxed">{t}</div>
38
+ <span className={`text-[11px] tabular-nums px-1.5 py-0.5 rounded ${ok ? 'bg-emerald-500/10 text-emerald-300' : 'bg-red-500/15 text-red-300'}`}>{n}/{p.titleMax}</span>
39
+ <CopyBtn text={t} />
40
+ </div>
41
+ )
42
+ })}
43
+ </section>
44
+ <section className="flex flex-col gap-2">
45
+ <div className="flex items-center justify-between"><div className="text-sm text-[#efe6d2] qx-song font-semibold tracking-wider">描述</div><CopyBtn text={p.desc} /></div>
46
+ <textarea readOnly value={p.desc} rows={p.id === 'bili' ? 16 : 9} className="w-full rounded-lg border border-white/10 bg-black/30 p-3 text-sm text-[#d9cfb9] leading-relaxed resize-y focus:outline-none focus:border-[#cfa961]/50" />
47
+ </section>
48
+ <section className="flex flex-col gap-2">
49
+ <div className="flex items-center justify-between">
50
+ <div className="text-sm text-[#efe6d2] qx-song font-semibold tracking-wider">话题 <span className="ml-2 text-[11px] text-[#9d927f] font-normal tabular-nums">{p.tags.length}{p.tagMax ? `/${p.tagMax}` : ' 个'}</span></div>
51
+ <CopyBtn text={tags} />
52
+ </div>
53
+ <div className="flex flex-wrap gap-2">{p.tags.map((t) => <span key={t} className="text-sm px-2.5 py-1 rounded-full bg-white/5 text-[#e5d6b5]">{p.hashTag ? '#' : ''}{t}</span>)}</div>
54
+ </section>
55
+ <div className="flex justify-end"><CopyBtn label="一键复制(标题 + 描述 + 话题)" text={`${p.titles[0]}\n\n${p.desc}\n\n${tags}`} /></div>
56
+ </div>
57
+ )
58
+ }
quanxue-src/src/quanxue/ui/Transcript.tsx ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { TL } from '../timeline'
2
+ import { fmtTime } from './store'
3
+
4
+ export function Transcript({ onSeek }: { onSeek: (t: number) => void }) {
5
+ return (
6
+ <div className="grid md:grid-cols-2 gap-x-10 gap-y-8">
7
+ {TL.chapters.map((c, ci) => (
8
+ <div key={c.id} className="flex flex-col gap-3">
9
+ <button onClick={() => onSeek(c.start + 0.01)} className="flex items-baseline gap-3 text-left group">
10
+ <span className="qx-brush text-2xl text-[#b8392b]">{c.no}</span>
11
+ <span className="qx-song text-lg text-[#efe6d2] group-hover:text-[#cfa961] tracking-wider">{c.title.replace(/\s/g, '')}</span>
12
+ <span className="text-xs text-[#9d927f] tabular-nums">{fmtTime(c.start)}</span>
13
+ </button>
14
+ <div className="flex flex-col gap-2 border-l border-white/10 pl-4">
15
+ {TL.lines.filter((l) => l.chapter === ci).map((l) => (
16
+ <button key={l.id} onClick={() => onSeek(l.start - 0.3)} className="text-left group">
17
+ {l.kind === 'quote'
18
+ ? <span className="qx-kai text-[15px] leading-relaxed text-[#e9d7a8] group-hover:text-white">{l.text}</span>
19
+ : <span className="text-sm leading-relaxed text-[#b9ae98] group-hover:text-[#efe6d2]">{l.text}</span>}
20
+ <span className="ml-2 text-[10px] text-[#6f6656] tabular-nums">{fmtTime(l.start)}</span>
21
+ </button>
22
+ ))}
23
+ </div>
24
+ </div>
25
+ ))}
26
+ </div>
27
+ )
28
+ }
quanxue-src/src/quanxue/ui/store.ts ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useEffect, useState } from 'react'
2
+ import { AudioEngine } from '../audio/engine'
3
+ import { loadFonts } from '../fonts'
4
+
5
+ export const engine = new AudioEngine()
6
+
7
+ type Status = { fonts: boolean; voice: number; music: boolean; error?: string }
8
+ let status: Status = { fonts: false, voice: 0, music: false }
9
+ const subs = new Set<(s: Status) => void>()
10
+ const set = (p: Partial<Status>) => { status = { ...status, ...p }; subs.forEach((f) => f(status)) }
11
+
12
+ let started = false
13
+ export function bootAssets() {
14
+ if (started) return
15
+ started = true
16
+ loadFonts().then(() => set({ fonts: true })).catch((e) => set({ error: '字体加载失败:' + e }))
17
+ engine.loadVoices((p) => set({ voice: p })).catch((e) => set({ error: '旁白加载失败:' + e }))
18
+ engine.loadMusic().then(() => set({ music: true })).catch((e) => set({ error: '配乐加载失败:' + e }))
19
+ }
20
+
21
+ export function useAssets() {
22
+ const [s, setS] = useState(status)
23
+ useEffect(() => { subs.add(setS); bootAssets(); return () => { subs.delete(setS) } }, [])
24
+ return s
25
+ }
26
+
27
+ export async function copyText(s: string) {
28
+ try { await navigator.clipboard.writeText(s); return true } catch {
29
+ const ta = document.createElement('textarea'); ta.value = s; ta.style.position = 'fixed'; ta.style.opacity = '0'
30
+ document.body.appendChild(ta); ta.select()
31
+ let ok = false
32
+ try { ok = document.execCommand('copy') } catch { ok = false }
33
+ ta.remove(); return ok
34
+ }
35
+ }
36
+
37
+ export const fmtTime = (t: number) => `${Math.floor(t / 60)}:${String(Math.floor(t % 60)).padStart(2, '0')}`
quanxue-src/src/quanxue/voice.json ADDED
@@ -0,0 +1,3172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "c1l1": {
3
+ "dur": 8.088,
4
+ "words": [
5
+ {
6
+ "o": 0.103,
7
+ "d": 0.944,
8
+ "t": "两千两百多"
9
+ },
10
+ {
11
+ "o": 1.061,
12
+ "d": 0.199,
13
+ "t": "年"
14
+ },
15
+ {
16
+ "o": 1.26,
17
+ "d": 0.306,
18
+ "t": "前"
19
+ },
20
+ {
21
+ "o": 1.739,
22
+ "d": 0.452,
23
+ "t": "战国"
24
+ },
25
+ {
26
+ "o": 2.204,
27
+ "d": 0.479,
28
+ "t": "末年"
29
+ },
30
+ {
31
+ "o": 3.002,
32
+ "d": 0.133,
33
+ "t": "一"
34
+ },
35
+ {
36
+ "o": 3.135,
37
+ "d": 0.199,
38
+ "t": "位"
39
+ },
40
+ {
41
+ "o": 3.348,
42
+ "d": 0.984,
43
+ "t": "年过半百"
44
+ },
45
+ {
46
+ "o": 4.332,
47
+ "d": 0.08,
48
+ "t": "的"
49
+ },
50
+ {
51
+ "o": 4.425,
52
+ "d": 0.452,
53
+ "t": "学者"
54
+ },
55
+ {
56
+ "o": 5.17,
57
+ "d": 0.306,
58
+ "t": "来到"
59
+ },
60
+ {
61
+ "o": 5.502,
62
+ "d": 0.359,
63
+ "t": "齐"
64
+ },
65
+ {
66
+ "o": 5.861,
67
+ "d": 0.226,
68
+ "t": "国"
69
+ },
70
+ {
71
+ "o": 6.087,
72
+ "d": 0.133,
73
+ "t": "的"
74
+ },
75
+ {
76
+ "o": 6.247,
77
+ "d": 0.239,
78
+ "t": "稷"
79
+ },
80
+ {
81
+ "o": 6.486,
82
+ "d": 0.665,
83
+ "t": "下学宫"
84
+ }
85
+ ]
86
+ },
87
+ "c1l2": {
88
+ "dur": 12.768,
89
+ "words": [
90
+ {
91
+ "o": 0.103,
92
+ "d": 0.186,
93
+ "t": "他"
94
+ },
95
+ {
96
+ "o": 0.289,
97
+ "d": 0.146,
98
+ "t": "叫"
99
+ },
100
+ {
101
+ "o": 0.449,
102
+ "d": 0.532,
103
+ "t": "荀况"
104
+ },
105
+ {
106
+ "o": 1.22,
107
+ "d": 0.692,
108
+ "t": "赵国人"
109
+ },
110
+ {
111
+ "o": 2.204,
112
+ "d": 0.452,
113
+ "t": "世人"
114
+ },
115
+ {
116
+ "o": 2.67,
117
+ "d": 0.532,
118
+ "t": "尊称"
119
+ },
120
+ {
121
+ "o": 3.228,
122
+ "d": 0.558,
123
+ "t": "荀卿"
124
+ },
125
+ {
126
+ "o": 4.402,
127
+ "d": 0.173,
128
+ "t": "他"
129
+ },
130
+ {
131
+ "o": 4.574,
132
+ "d": 0.386,
133
+ "t": "三次"
134
+ },
135
+ {
136
+ "o": 4.973,
137
+ "d": 0.332,
138
+ "t": "出任"
139
+ },
140
+ {
141
+ "o": 5.332,
142
+ "d": 0.372,
143
+ "t": "学宫"
144
+ },
145
+ {
146
+ "o": 5.718,
147
+ "d": 0.492,
148
+ "t": "祭酒"
149
+ },
150
+ {
151
+ "o": 6.476,
152
+ "d": 0.146,
153
+ "t": "是"
154
+ },
155
+ {
156
+ "o": 6.636,
157
+ "d": 0.266,
158
+ "t": "那个"
159
+ },
160
+ {
161
+ "o": 6.915,
162
+ "d": 0.439,
163
+ "t": "时代"
164
+ },
165
+ {
166
+ "o": 7.38,
167
+ "d": 0.186,
168
+ "t": "最"
169
+ },
170
+ {
171
+ "o": 7.566,
172
+ "d": 0.16,
173
+ "t": "有"
174
+ },
175
+ {
176
+ "o": 7.739,
177
+ "d": 0.465,
178
+ "t": "分量"
179
+ },
180
+ {
181
+ "o": 8.205,
182
+ "d": 0.067,
183
+ "t": "的"
184
+ },
185
+ {
186
+ "o": 8.285,
187
+ "d": 0.452,
188
+ "t": "学者"
189
+ },
190
+ {
191
+ "o": 9.136,
192
+ "d": 0.439,
193
+ "t": "韩非"
194
+ },
195
+ {
196
+ "o": 9.588,
197
+ "d": 0.133,
198
+ "t": "与"
199
+ },
200
+ {
201
+ "o": 9.734,
202
+ "d": 0.479,
203
+ "t": "李斯"
204
+ },
205
+ {
206
+ "o": 10.372,
207
+ "d": 0.253,
208
+ "t": "都"
209
+ },
210
+ {
211
+ "o": 10.625,
212
+ "d": 0.412,
213
+ "t": "出自"
214
+ },
215
+ {
216
+ "o": 11.077,
217
+ "d": 0.186,
218
+ "t": "他"
219
+ },
220
+ {
221
+ "o": 11.263,
222
+ "d": 0.08,
223
+ "t": "的"
224
+ },
225
+ {
226
+ "o": 11.356,
227
+ "d": 0.465,
228
+ "t": "门下"
229
+ }
230
+ ]
231
+ },
232
+ "c1l3": {
233
+ "dur": 6.624,
234
+ "words": [
235
+ {
236
+ "o": 0.103,
237
+ "d": 0.465,
238
+ "t": "后人"
239
+ },
240
+ {
241
+ "o": 0.582,
242
+ "d": 0.426,
243
+ "t": "整理"
244
+ },
245
+ {
246
+ "o": 1.007,
247
+ "d": 0.106,
248
+ "t": "的"
249
+ },
250
+ {
251
+ "o": 1.167,
252
+ "d": 0.572,
253
+ "t": "荀子"
254
+ },
255
+ {
256
+ "o": 1.912,
257
+ "d": 0.226,
258
+ "t": "共"
259
+ },
260
+ {
261
+ "o": 2.151,
262
+ "d": 0.625,
263
+ "t": "三十二"
264
+ },
265
+ {
266
+ "o": 2.776,
267
+ "d": 0.226,
268
+ "t": "篇"
269
+ },
270
+ {
271
+ "o": 3.202,
272
+ "d": 0.492,
273
+ "t": "开卷"
274
+ },
275
+ {
276
+ "o": 3.707,
277
+ "d": 0.505,
278
+ "t": "第一篇"
279
+ },
280
+ {
281
+ "o": 4.452,
282
+ "d": 0.479,
283
+ "t": "便是"
284
+ },
285
+ {
286
+ "o": 4.997,
287
+ "d": 0.705,
288
+ "t": "劝学"
289
+ }
290
+ ]
291
+ },
292
+ "c1l4": {
293
+ "dur": 6.888,
294
+ "words": [
295
+ {
296
+ "o": 0.103,
297
+ "d": 0.173,
298
+ "t": "把"
299
+ },
300
+ {
301
+ "o": 0.289,
302
+ "d": 0.306,
303
+ "t": "学"
304
+ },
305
+ {
306
+ "o": 0.688,
307
+ "d": 0.253,
308
+ "t": "放"
309
+ },
310
+ {
311
+ "o": 0.941,
312
+ "d": 0.146,
313
+ "t": "在"
314
+ },
315
+ {
316
+ "o": 1.114,
317
+ "d": 0.332,
318
+ "t": "一切"
319
+ },
320
+ {
321
+ "o": 1.46,
322
+ "d": 0.479,
323
+ "t": "之前"
324
+ },
325
+ {
326
+ "o": 2.218,
327
+ "d": 0.186,
328
+ "t": "这"
329
+ },
330
+ {
331
+ "o": 2.404,
332
+ "d": 0.426,
333
+ "t": "不是"
334
+ },
335
+ {
336
+ "o": 2.843,
337
+ "d": 0.412,
338
+ "t": "偶然"
339
+ },
340
+ {
341
+ "o": 3.255,
342
+ "d": 0.093,
343
+ "t": "的"
344
+ },
345
+ {
346
+ "o": 3.361,
347
+ "d": 0.492,
348
+ "t": "编排"
349
+ },
350
+ {
351
+ "o": 4.053,
352
+ "d": 0.359,
353
+ "t": "而是"
354
+ },
355
+ {
356
+ "o": 4.425,
357
+ "d": 0.332,
358
+ "t": "一种"
359
+ },
360
+ {
361
+ "o": 4.784,
362
+ "d": 0.545,
363
+ "t": "思想"
364
+ },
365
+ {
366
+ "o": 5.329,
367
+ "d": 0.08,
368
+ "t": "的"
369
+ },
370
+ {
371
+ "o": 5.422,
372
+ "d": 0.519,
373
+ "t": "宣言"
374
+ }
375
+ ]
376
+ },
377
+ "c2l1": {
378
+ "dur": 5.04,
379
+ "words": [
380
+ {
381
+ "o": 0.103,
382
+ "d": 0.253,
383
+ "t": "要"
384
+ },
385
+ {
386
+ "o": 0.369,
387
+ "d": 0.519,
388
+ "t": "读懂"
389
+ },
390
+ {
391
+ "o": 0.981,
392
+ "d": 0.612,
393
+ "t": "劝学"
394
+ },
395
+ {
396
+ "o": 1.938,
397
+ "d": 0.186,
398
+ "t": "先"
399
+ },
400
+ {
401
+ "o": 2.124,
402
+ "d": 0.186,
403
+ "t": "要"
404
+ },
405
+ {
406
+ "o": 2.324,
407
+ "d": 0.213,
408
+ "t": "读"
409
+ },
410
+ {
411
+ "o": 2.537,
412
+ "d": 0.16,
413
+ "t": "懂"
414
+ },
415
+ {
416
+ "o": 2.723,
417
+ "d": 0.439,
418
+ "t": "荀子"
419
+ },
420
+ {
421
+ "o": 3.162,
422
+ "d": 0.199,
423
+ "t": "对"
424
+ },
425
+ {
426
+ "o": 3.374,
427
+ "d": 0.12,
428
+ "t": "人"
429
+ },
430
+ {
431
+ "o": 3.494,
432
+ "d": 0.08,
433
+ "t": "的"
434
+ },
435
+ {
436
+ "o": 3.587,
437
+ "d": 0.505,
438
+ "t": "判断"
439
+ }
440
+ ]
441
+ },
442
+ "c2l2": {
443
+ "dur": 4.224,
444
+ "words": [
445
+ {
446
+ "o": 0.113,
447
+ "d": 0.312,
448
+ "t": "人"
449
+ },
450
+ {
451
+ "o": 0.425,
452
+ "d": 0.188,
453
+ "t": "之"
454
+ },
455
+ {
456
+ "o": 0.613,
457
+ "d": 0.594,
458
+ "t": "性恶"
459
+ },
460
+ {
461
+ "o": 1.55,
462
+ "d": 0.297,
463
+ "t": "其"
464
+ },
465
+ {
466
+ "o": 1.863,
467
+ "d": 0.719,
468
+ "t": "善者"
469
+ },
470
+ {
471
+ "o": 2.581,
472
+ "d": 0.25,
473
+ "t": "伪"
474
+ },
475
+ {
476
+ "o": 2.831,
477
+ "d": 0.297,
478
+ "t": "也"
479
+ }
480
+ ]
481
+ },
482
+ "c2l3": {
483
+ "dur": 6.432,
484
+ "words": [
485
+ {
486
+ "o": 0.103,
487
+ "d": 0.425,
488
+ "t": "这里"
489
+ },
490
+ {
491
+ "o": 0.529,
492
+ "d": 0.133,
493
+ "t": "的"
494
+ },
495
+ {
496
+ "o": 0.675,
497
+ "d": 0.293,
498
+ "t": "伪"
499
+ },
500
+ {
501
+ "o": 1.207,
502
+ "d": 0.372,
503
+ "t": "不是"
504
+ },
505
+ {
506
+ "o": 1.593,
507
+ "d": 0.452,
508
+ "t": "虚伪"
509
+ },
510
+ {
511
+ "o": 2.297,
512
+ "d": 0.372,
513
+ "t": "而是"
514
+ },
515
+ {
516
+ "o": 2.683,
517
+ "d": 0.412,
518
+ "t": "人为"
519
+ },
520
+ {
521
+ "o": 3.361,
522
+ "d": 0.279,
523
+ "t": "人"
524
+ },
525
+ {
526
+ "o": 3.64,
527
+ "d": 0.519,
528
+ "t": "后天"
529
+ },
530
+ {
531
+ "o": 4.159,
532
+ "d": 0.133,
533
+ "t": "的"
534
+ },
535
+ {
536
+ "o": 4.305,
537
+ "d": 0.492,
538
+ "t": "努力"
539
+ },
540
+ {
541
+ "o": 4.824,
542
+ "d": 0.133,
543
+ "t": "与"
544
+ },
545
+ {
546
+ "o": 4.97,
547
+ "d": 0.519,
548
+ "t": "塑造"
549
+ }
550
+ ]
551
+ },
552
+ "c2l4": {
553
+ "dur": 12.36,
554
+ "words": [
555
+ {
556
+ "o": 0.103,
557
+ "d": 0.332,
558
+ "t": "孟子"
559
+ },
560
+ {
561
+ "o": 0.449,
562
+ "d": 0.426,
563
+ "t": "相信"
564
+ },
565
+ {
566
+ "o": 1.194,
567
+ "d": 0.532,
568
+ "t": "善端"
569
+ },
570
+ {
571
+ "o": 1.726,
572
+ "d": 0.944,
573
+ "t": "本自具足"
574
+ },
575
+ {
576
+ "o": 2.856,
577
+ "d": 0.372,
578
+ "t": "只需"
579
+ },
580
+ {
581
+ "o": 3.241,
582
+ "d": 0.226,
583
+ "t": "向"
584
+ },
585
+ {
586
+ "o": 3.468,
587
+ "d": 0.146,
588
+ "t": "内"
589
+ },
590
+ {
591
+ "o": 3.627,
592
+ "d": 0.279,
593
+ "t": "寻"
594
+ },
595
+ {
596
+ "o": 3.906,
597
+ "d": 0.266,
598
+ "t": "回"
599
+ },
600
+ {
601
+ "o": 4.438,
602
+ "d": 0.439,
603
+ "t": "荀子"
604
+ },
605
+ {
606
+ "o": 4.89,
607
+ "d": 0.16,
608
+ "t": "却"
609
+ },
610
+ {
611
+ "o": 5.063,
612
+ "d": 0.332,
613
+ "t": "认为"
614
+ },
615
+ {
616
+ "o": 5.715,
617
+ "d": 0.412,
618
+ "t": "人生"
619
+ },
620
+ {
621
+ "o": 6.127,
622
+ "d": 0.213,
623
+ "t": "来"
624
+ },
625
+ {
626
+ "o": 6.353,
627
+ "d": 0.346,
628
+ "t": "只有"
629
+ },
630
+ {
631
+ "o": 6.712,
632
+ "d": 0.426,
633
+ "t": "欲望"
634
+ },
635
+ {
636
+ "o": 7.164,
637
+ "d": 0.133,
638
+ "t": "与"
639
+ },
640
+ {
641
+ "o": 7.311,
642
+ "d": 0.452,
643
+ "t": "本能"
644
+ },
645
+ {
646
+ "o": 8.029,
647
+ "d": 0.319,
648
+ "t": "善"
649
+ },
650
+ {
651
+ "o": 8.614,
652
+ "d": 0.439,
653
+ "t": "必须"
654
+ },
655
+ {
656
+ "o": 9.079,
657
+ "d": 0.186,
658
+ "t": "向"
659
+ },
660
+ {
661
+ "o": 9.265,
662
+ "d": 0.173,
663
+ "t": "外"
664
+ },
665
+ {
666
+ "o": 9.438,
667
+ "d": 0.465,
668
+ "t": "求取"
669
+ },
670
+ {
671
+ "o": 10.196,
672
+ "d": 0.479,
673
+ "t": "一点"
674
+ },
675
+ {
676
+ "o": 10.688,
677
+ "d": 0.306,
678
+ "t": "一点"
679
+ },
680
+ {
681
+ "o": 11.007,
682
+ "d": 0.199,
683
+ "t": "筑"
684
+ },
685
+ {
686
+ "o": 11.207,
687
+ "d": 0.239,
688
+ "t": "起"
689
+ }
690
+ ]
691
+ },
692
+ "c2l5": {
693
+ "dur": 9.48,
694
+ "words": [
695
+ {
696
+ "o": 0.103,
697
+ "d": 0.439,
698
+ "t": "所以"
699
+ },
700
+ {
701
+ "o": 0.675,
702
+ "d": 0.226,
703
+ "t": "在"
704
+ },
705
+ {
706
+ "o": 0.901,
707
+ "d": 0.452,
708
+ "t": "荀子"
709
+ },
710
+ {
711
+ "o": 1.367,
712
+ "d": 0.399,
713
+ "t": "这里"
714
+ },
715
+ {
716
+ "o": 1.992,
717
+ "d": 0.492,
718
+ "t": "学习"
719
+ },
720
+ {
721
+ "o": 2.497,
722
+ "d": 0.372,
723
+ "t": "不是"
724
+ },
725
+ {
726
+ "o": 2.882,
727
+ "d": 0.918,
728
+ "t": "锦上添花"
729
+ },
730
+ {
731
+ "o": 4.093,
732
+ "d": 0.346,
733
+ "t": "而是"
734
+ },
735
+ {
736
+ "o": 4.452,
737
+ "d": 0.319,
738
+ "t": "一个"
739
+ },
740
+ {
741
+ "o": 4.771,
742
+ "d": 0.279,
743
+ "t": "人"
744
+ },
745
+ {
746
+ "o": 5.17,
747
+ "d": 0.279,
748
+ "t": "从"
749
+ },
750
+ {
751
+ "o": 5.462,
752
+ "d": 0.426,
753
+ "t": "自然"
754
+ },
755
+ {
756
+ "o": 5.901,
757
+ "d": 0.173,
758
+ "t": "之"
759
+ },
760
+ {
761
+ "o": 6.074,
762
+ "d": 0.213,
763
+ "t": "人"
764
+ },
765
+ {
766
+ "o": 6.313,
767
+ "d": 0.452,
768
+ "t": "走向"
769
+ },
770
+ {
771
+ "o": 6.792,
772
+ "d": 0.439,
773
+ "t": "文明"
774
+ },
775
+ {
776
+ "o": 7.244,
777
+ "d": 0.199,
778
+ "t": "之"
779
+ },
780
+ {
781
+ "o": 7.444,
782
+ "d": 0.133,
783
+ "t": "人"
784
+ },
785
+ {
786
+ "o": 7.603,
787
+ "d": 0.146,
788
+ "t": "的"
789
+ },
790
+ {
791
+ "o": 7.776,
792
+ "d": 0.372,
793
+ "t": "唯一"
794
+ },
795
+ {
796
+ "o": 8.162,
797
+ "d": 0.372,
798
+ "t": "道路"
799
+ }
800
+ ]
801
+ },
802
+ "c2l6": {
803
+ "dur": 6.48,
804
+ "words": [
805
+ {
806
+ "o": 0.103,
807
+ "d": 0.279,
808
+ "t": "这"
809
+ },
810
+ {
811
+ "o": 0.382,
812
+ "d": 0.16,
813
+ "t": "就"
814
+ },
815
+ {
816
+ "o": 0.542,
817
+ "d": 0.173,
818
+ "t": "是"
819
+ },
820
+ {
821
+ "o": 0.742,
822
+ "d": 0.931,
823
+ "t": "化性起伪"
824
+ },
825
+ {
826
+ "o": 2.287,
827
+ "d": 0.266,
828
+ "t": "而"
829
+ },
830
+ {
831
+ "o": 2.673,
832
+ "d": 0.625,
833
+ "t": "劝学"
834
+ },
835
+ {
836
+ "o": 3.524,
837
+ "d": 0.439,
838
+ "t": "正是"
839
+ },
840
+ {
841
+ "o": 3.976,
842
+ "d": 0.213,
843
+ "t": "这"
844
+ },
845
+ {
846
+ "o": 4.189,
847
+ "d": 0.199,
848
+ "t": "条"
849
+ },
850
+ {
851
+ "o": 4.402,
852
+ "d": 0.479,
853
+ "t": "道路"
854
+ },
855
+ {
856
+ "o": 4.88,
857
+ "d": 0.093,
858
+ "t": "的"
859
+ },
860
+ {
861
+ "o": 4.987,
862
+ "d": 0.558,
863
+ "t": "总纲"
864
+ }
865
+ ]
866
+ },
867
+ "c3l1": {
868
+ "dur": 3.864,
869
+ "words": [
870
+ {
871
+ "o": 0.113,
872
+ "d": 0.484,
873
+ "t": "君子"
874
+ },
875
+ {
876
+ "o": 0.597,
877
+ "d": 0.297,
878
+ "t": "曰"
879
+ },
880
+ {
881
+ "o": 1.331,
882
+ "d": 1.438,
883
+ "t": "学不可以已"
884
+ }
885
+ ]
886
+ },
887
+ "c3l2": {
888
+ "dur": 5.328,
889
+ "words": [
890
+ {
891
+ "o": 0.103,
892
+ "d": 0.465,
893
+ "t": "开篇"
894
+ },
895
+ {
896
+ "o": 0.595,
897
+ "d": 0.186,
898
+ "t": "五"
899
+ },
900
+ {
901
+ "o": 0.781,
902
+ "d": 0.12,
903
+ "t": "个"
904
+ },
905
+ {
906
+ "o": 0.901,
907
+ "d": 0.239,
908
+ "t": "字"
909
+ },
910
+ {
911
+ "o": 1.327,
912
+ "d": 0.997,
913
+ "t": "斩钉截铁"
914
+ },
915
+ {
916
+ "o": 2.55,
917
+ "d": 0.532,
918
+ "t": "学习"
919
+ },
920
+ {
921
+ "o": 3.255,
922
+ "d": 0.239,
923
+ "t": "不"
924
+ },
925
+ {
926
+ "o": 3.494,
927
+ "d": 0.319,
928
+ "t": "可以"
929
+ },
930
+ {
931
+ "o": 3.827,
932
+ "d": 0.558,
933
+ "t": "停止"
934
+ }
935
+ ]
936
+ },
937
+ "c3l3": {
938
+ "dur": 7.632,
939
+ "words": [
940
+ {
941
+ "o": 0.113,
942
+ "d": 0.469,
943
+ "t": "青"
944
+ },
945
+ {
946
+ "o": 0.863,
947
+ "d": 1.047,
948
+ "t": "取之于蓝"
949
+ },
950
+ {
951
+ "o": 2.159,
952
+ "d": 1.141,
953
+ "t": "而青于蓝"
954
+ },
955
+ {
956
+ "o": 3.659,
957
+ "d": 0.297,
958
+ "t": "冰"
959
+ },
960
+ {
961
+ "o": 4.269,
962
+ "d": 0.297,
963
+ "t": "水"
964
+ },
965
+ {
966
+ "o": 4.581,
967
+ "d": 0.234,
968
+ "t": "为"
969
+ },
970
+ {
971
+ "o": 4.816,
972
+ "d": 0.312,
973
+ "t": "之"
974
+ },
975
+ {
976
+ "o": 5.378,
977
+ "d": 1.141,
978
+ "t": "而寒于水"
979
+ }
980
+ ]
981
+ },
982
+ "c3l4": {
983
+ "dur": 7.752,
984
+ "words": [
985
+ {
986
+ "o": 0.103,
987
+ "d": 0.426,
988
+ "t": "靛青"
989
+ },
990
+ {
991
+ "o": 0.555,
992
+ "d": 0.186,
993
+ "t": "从"
994
+ },
995
+ {
996
+ "o": 0.755,
997
+ "d": 0.346,
998
+ "t": "蓼蓝"
999
+ },
1000
+ {
1001
+ "o": 1.101,
1002
+ "d": 0.16,
1003
+ "t": "中"
1004
+ },
1005
+ {
1006
+ "o": 1.273,
1007
+ "d": 0.426,
1008
+ "t": "提炼"
1009
+ },
1010
+ {
1011
+ "o": 2.031,
1012
+ "d": 0.386,
1013
+ "t": "颜色"
1014
+ },
1015
+ {
1016
+ "o": 2.444,
1017
+ "d": 0.199,
1018
+ "t": "却"
1019
+ },
1020
+ {
1021
+ "o": 2.643,
1022
+ "d": 0.173,
1023
+ "t": "比"
1024
+ },
1025
+ {
1026
+ "o": 2.829,
1027
+ "d": 0.386,
1028
+ "t": "蓼蓝"
1029
+ },
1030
+ {
1031
+ "o": 3.228,
1032
+ "d": 0.465,
1033
+ "t": "更深"
1034
+ },
1035
+ {
1036
+ "o": 4.106,
1037
+ "d": 0.173,
1038
+ "t": "冰"
1039
+ },
1040
+ {
1041
+ "o": 4.292,
1042
+ "d": 0.213,
1043
+ "t": "由"
1044
+ },
1045
+ {
1046
+ "o": 4.505,
1047
+ "d": 0.199,
1048
+ "t": "水"
1049
+ },
1050
+ {
1051
+ "o": 4.718,
1052
+ "d": 0.465,
1053
+ "t": "凝结"
1054
+ },
1055
+ {
1056
+ "o": 5.369,
1057
+ "d": 0.226,
1058
+ "t": "却"
1059
+ },
1060
+ {
1061
+ "o": 5.595,
1062
+ "d": 0.532,
1063
+ "t": "比水"
1064
+ },
1065
+ {
1066
+ "o": 6.154,
1067
+ "d": 0.186,
1068
+ "t": "更"
1069
+ },
1070
+ {
1071
+ "o": 6.34,
1072
+ "d": 0.492,
1073
+ "t": "寒冷"
1074
+ }
1075
+ ]
1076
+ },
1077
+ "c3l5": {
1078
+ "dur": 9.384,
1079
+ "words": [
1080
+ {
1081
+ "o": 0.103,
1082
+ "d": 0.545,
1083
+ "t": "荀子"
1084
+ },
1085
+ {
1086
+ "o": 0.675,
1087
+ "d": 0.213,
1088
+ "t": "借"
1089
+ },
1090
+ {
1091
+ "o": 0.888,
1092
+ "d": 0.146,
1093
+ "t": "此"
1094
+ },
1095
+ {
1096
+ "o": 1.047,
1097
+ "d": 0.439,
1098
+ "t": "说明"
1099
+ },
1100
+ {
1101
+ "o": 1.898,
1102
+ "d": 0.412,
1103
+ "t": "经过"
1104
+ },
1105
+ {
1106
+ "o": 2.324,
1107
+ "d": 0.505,
1108
+ "t": "学习"
1109
+ },
1110
+ {
1111
+ "o": 2.829,
1112
+ "d": 0.106,
1113
+ "t": "的"
1114
+ },
1115
+ {
1116
+ "o": 2.936,
1117
+ "d": 0.239,
1118
+ "t": "人"
1119
+ },
1120
+ {
1121
+ "o": 3.414,
1122
+ "d": 0.319,
1123
+ "t": "可以"
1124
+ },
1125
+ {
1126
+ "o": 3.747,
1127
+ "d": 0.465,
1128
+ "t": "超越"
1129
+ },
1130
+ {
1131
+ "o": 4.239,
1132
+ "d": 0.359,
1133
+ "t": "自己"
1134
+ },
1135
+ {
1136
+ "o": 4.598,
1137
+ "d": 0.12,
1138
+ "t": "的"
1139
+ },
1140
+ {
1141
+ "o": 4.731,
1142
+ "d": 0.864,
1143
+ "t": "本来面目"
1144
+ },
1145
+ {
1146
+ "o": 6.21,
1147
+ "d": 0.572,
1148
+ "t": "后天"
1149
+ },
1150
+ {
1151
+ "o": 7.114,
1152
+ "d": 0.332,
1153
+ "t": "能够"
1154
+ },
1155
+ {
1156
+ "o": 7.46,
1157
+ "d": 0.452,
1158
+ "t": "胜过"
1159
+ },
1160
+ {
1161
+ "o": 7.926,
1162
+ "d": 0.532,
1163
+ "t": "先天"
1164
+ }
1165
+ ]
1166
+ },
1167
+ "c3l6": {
1168
+ "dur": 9.864,
1169
+ "words": [
1170
+ {
1171
+ "o": 0.113,
1172
+ "d": 0.578,
1173
+ "t": "木直"
1174
+ },
1175
+ {
1176
+ "o": 0.706,
1177
+ "d": 0.281,
1178
+ "t": "众"
1179
+ },
1180
+ {
1181
+ "o": 0.988,
1182
+ "d": 0.375,
1183
+ "t": "绳"
1184
+ },
1185
+ {
1186
+ "o": 1.644,
1187
+ "d": 0.953,
1188
+ "t": "柔以为轮"
1189
+ },
1190
+ {
1191
+ "o": 2.784,
1192
+ "d": 0.375,
1193
+ "t": "其"
1194
+ },
1195
+ {
1196
+ "o": 3.175,
1197
+ "d": 0.281,
1198
+ "t": "曲"
1199
+ },
1200
+ {
1201
+ "o": 3.456,
1202
+ "d": 0.578,
1203
+ "t": "众规"
1204
+ },
1205
+ {
1206
+ "o": 4.75,
1207
+ "d": 0.266,
1208
+ "t": "虽"
1209
+ },
1210
+ {
1211
+ "o": 5.016,
1212
+ "d": 0.188,
1213
+ "t": "有"
1214
+ },
1215
+ {
1216
+ "o": 5.219,
1217
+ "d": 0.281,
1218
+ "t": "搞"
1219
+ },
1220
+ {
1221
+ "o": 5.5,
1222
+ "d": 0.312,
1223
+ "t": "瀑"
1224
+ },
1225
+ {
1226
+ "o": 6.031,
1227
+ "d": 1.031,
1228
+ "t": "不复挺者"
1229
+ },
1230
+ {
1231
+ "o": 7.328,
1232
+ "d": 0.719,
1233
+ "t": "柔使"
1234
+ },
1235
+ {
1236
+ "o": 8.047,
1237
+ "d": 0.219,
1238
+ "t": "之"
1239
+ },
1240
+ {
1241
+ "o": 8.266,
1242
+ "d": 0.234,
1243
+ "t": "然"
1244
+ },
1245
+ {
1246
+ "o": 8.5,
1247
+ "d": 0.297,
1248
+ "t": "也"
1249
+ }
1250
+ ]
1251
+ },
1252
+ "c3l7": {
1253
+ "dur": 8.88,
1254
+ "words": [
1255
+ {
1256
+ "o": 0.103,
1257
+ "d": 0.239,
1258
+ "t": "一"
1259
+ },
1260
+ {
1261
+ "o": 0.343,
1262
+ "d": 0.199,
1263
+ "t": "根"
1264
+ },
1265
+ {
1266
+ "o": 0.555,
1267
+ "d": 0.439,
1268
+ "t": "笔直"
1269
+ },
1270
+ {
1271
+ "o": 0.994,
1272
+ "d": 0.093,
1273
+ "t": "的"
1274
+ },
1275
+ {
1276
+ "o": 1.101,
1277
+ "d": 0.545,
1278
+ "t": "木头"
1279
+ },
1280
+ {
1281
+ "o": 1.819,
1282
+ "d": 0.239,
1283
+ "t": "用"
1284
+ },
1285
+ {
1286
+ "o": 2.058,
1287
+ "d": 0.186,
1288
+ "t": "火"
1289
+ },
1290
+ {
1291
+ "o": 2.257,
1292
+ "d": 0.479,
1293
+ "t": "烘烤"
1294
+ },
1295
+ {
1296
+ "o": 2.936,
1297
+ "d": 0.253,
1298
+ "t": "弯"
1299
+ },
1300
+ {
1301
+ "o": 3.188,
1302
+ "d": 0.199,
1303
+ "t": "成"
1304
+ },
1305
+ {
1306
+ "o": 3.401,
1307
+ "d": 0.465,
1308
+ "t": "车轮"
1309
+ },
1310
+ {
1311
+ "o": 4.212,
1312
+ "d": 0.412,
1313
+ "t": "即便"
1314
+ },
1315
+ {
1316
+ "o": 4.638,
1317
+ "d": 0.213,
1318
+ "t": "再"
1319
+ },
1320
+ {
1321
+ "o": 4.851,
1322
+ "d": 0.226,
1323
+ "t": "经"
1324
+ },
1325
+ {
1326
+ "o": 5.103,
1327
+ "d": 0.386,
1328
+ "t": "日晒"
1329
+ },
1330
+ {
1331
+ "o": 5.502,
1332
+ "d": 0.439,
1333
+ "t": "风干"
1334
+ },
1335
+ {
1336
+ "o": 6.207,
1337
+ "d": 0.173,
1338
+ "t": "也"
1339
+ },
1340
+ {
1341
+ "o": 6.38,
1342
+ "d": 0.532,
1343
+ "t": "不会"
1344
+ },
1345
+ {
1346
+ "o": 6.938,
1347
+ "d": 0.479,
1348
+ "t": "重新"
1349
+ },
1350
+ {
1351
+ "o": 7.43,
1352
+ "d": 0.519,
1353
+ "t": "挺直"
1354
+ }
1355
+ ]
1356
+ },
1357
+ "c3l8": {
1358
+ "dur": 11.544,
1359
+ "words": [
1360
+ {
1361
+ "o": 0.103,
1362
+ "d": 0.279,
1363
+ "t": "这是"
1364
+ },
1365
+ {
1366
+ "o": 0.396,
1367
+ "d": 0.465,
1368
+ "t": "全篇"
1369
+ },
1370
+ {
1371
+ "o": 0.874,
1372
+ "d": 0.266,
1373
+ "t": "最"
1374
+ },
1375
+ {
1376
+ "o": 1.14,
1377
+ "d": 0.452,
1378
+ "t": "深刻"
1379
+ },
1380
+ {
1381
+ "o": 1.593,
1382
+ "d": 0.106,
1383
+ "t": "的"
1384
+ },
1385
+ {
1386
+ "o": 1.712,
1387
+ "d": 0.346,
1388
+ "t": "比喻"
1389
+ },
1390
+ {
1391
+ "o": 2.297,
1392
+ "d": 0.439,
1393
+ "t": "学习"
1394
+ },
1395
+ {
1396
+ "o": 2.749,
1397
+ "d": 0.346,
1398
+ "t": "带来"
1399
+ },
1400
+ {
1401
+ "o": 3.095,
1402
+ "d": 0.08,
1403
+ "t": "的"
1404
+ },
1405
+ {
1406
+ "o": 3.188,
1407
+ "d": 0.439,
1408
+ "t": "改变"
1409
+ },
1410
+ {
1411
+ "o": 3.853,
1412
+ "d": 0.186,
1413
+ "t": "是"
1414
+ },
1415
+ {
1416
+ "o": 4.039,
1417
+ "d": 0.545,
1418
+ "t": "根本"
1419
+ },
1420
+ {
1421
+ "o": 4.585,
1422
+ "d": 0.16,
1423
+ "t": "的"
1424
+ },
1425
+ {
1426
+ "o": 5.05,
1427
+ "d": 0.133,
1428
+ "t": "不"
1429
+ },
1430
+ {
1431
+ "o": 5.183,
1432
+ "d": 0.479,
1433
+ "t": "可逆"
1434
+ },
1435
+ {
1436
+ "o": 5.662,
1437
+ "d": 0.186,
1438
+ "t": "的"
1439
+ },
1440
+ {
1441
+ "o": 6.436,
1442
+ "d": 0.146,
1443
+ "t": "它"
1444
+ },
1445
+ {
1446
+ "o": 6.596,
1447
+ "d": 0.399,
1448
+ "t": "不是"
1449
+ },
1450
+ {
1451
+ "o": 7.008,
1452
+ "d": 0.186,
1453
+ "t": "给"
1454
+ },
1455
+ {
1456
+ "o": 7.194,
1457
+ "d": 0.146,
1458
+ "t": "人"
1459
+ },
1460
+ {
1461
+ "o": 7.367,
1462
+ "d": 0.266,
1463
+ "t": "涂"
1464
+ },
1465
+ {
1466
+ "o": 7.633,
1467
+ "d": 0.133,
1468
+ "t": "上"
1469
+ },
1470
+ {
1471
+ "o": 7.779,
1472
+ "d": 0.146,
1473
+ "t": "一"
1474
+ },
1475
+ {
1476
+ "o": 7.926,
1477
+ "d": 0.199,
1478
+ "t": "层"
1479
+ },
1480
+ {
1481
+ "o": 8.138,
1482
+ "d": 0.465,
1483
+ "t": "颜色"
1484
+ },
1485
+ {
1486
+ "o": 8.843,
1487
+ "d": 0.372,
1488
+ "t": "而是"
1489
+ },
1490
+ {
1491
+ "o": 9.229,
1492
+ "d": 0.798,
1493
+ "t": "重塑人"
1494
+ },
1495
+ {
1496
+ "o": 10.027,
1497
+ "d": 0.093,
1498
+ "t": "的"
1499
+ },
1500
+ {
1501
+ "o": 10.133,
1502
+ "d": 0.479,
1503
+ "t": "形状"
1504
+ }
1505
+ ]
1506
+ },
1507
+ "c3l9": {
1508
+ "dur": 10.488,
1509
+ "words": [
1510
+ {
1511
+ "o": 0.113,
1512
+ "d": 1.562,
1513
+ "t": "故木受绳则直"
1514
+ },
1515
+ {
1516
+ "o": 1.925,
1517
+ "d": 1.297,
1518
+ "t": "金就砺则利"
1519
+ },
1520
+ {
1521
+ "o": 3.472,
1522
+ "d": 0.531,
1523
+ "t": "君子"
1524
+ },
1525
+ {
1526
+ "o": 4.019,
1527
+ "d": 0.625,
1528
+ "t": "博学"
1529
+ },
1530
+ {
1531
+ "o": 4.769,
1532
+ "d": 0.234,
1533
+ "t": "而"
1534
+ },
1535
+ {
1536
+ "o": 5.019,
1537
+ "d": 0.234,
1538
+ "t": "日"
1539
+ },
1540
+ {
1541
+ "o": 5.253,
1542
+ "d": 0.328,
1543
+ "t": "餐"
1544
+ },
1545
+ {
1546
+ "o": 5.597,
1547
+ "d": 0.938,
1548
+ "t": "醒乎己"
1549
+ },
1550
+ {
1551
+ "o": 6.784,
1552
+ "d": 0.25,
1553
+ "t": "则"
1554
+ },
1555
+ {
1556
+ "o": 7.034,
1557
+ "d": 0.656,
1558
+ "t": "智明"
1559
+ },
1560
+ {
1561
+ "o": 7.816,
1562
+ "d": 0.297,
1563
+ "t": "而"
1564
+ },
1565
+ {
1566
+ "o": 8.128,
1567
+ "d": 0.469,
1568
+ "t": "行"
1569
+ },
1570
+ {
1571
+ "o": 8.597,
1572
+ "d": 0.312,
1573
+ "t": "无"
1574
+ },
1575
+ {
1576
+ "o": 8.909,
1577
+ "d": 0.25,
1578
+ "t": "过"
1579
+ },
1580
+ {
1581
+ "o": 9.159,
1582
+ "d": 0.234,
1583
+ "t": "矣"
1584
+ }
1585
+ ]
1586
+ },
1587
+ "c3l10": {
1588
+ "dur": 10.968,
1589
+ "words": [
1590
+ {
1591
+ "o": 0.103,
1592
+ "d": 0.492,
1593
+ "t": "绳墨"
1594
+ },
1595
+ {
1596
+ "o": 0.622,
1597
+ "d": 0.133,
1598
+ "t": "与"
1599
+ },
1600
+ {
1601
+ "o": 0.768,
1602
+ "d": 0.213,
1603
+ "t": "砺"
1604
+ },
1605
+ {
1606
+ "o": 0.981,
1607
+ "d": 0.332,
1608
+ "t": "石"
1609
+ },
1610
+ {
1611
+ "o": 1.593,
1612
+ "d": 0.173,
1613
+ "t": "是"
1614
+ },
1615
+ {
1616
+ "o": 1.779,
1617
+ "d": 0.439,
1618
+ "t": "外在"
1619
+ },
1620
+ {
1621
+ "o": 2.218,
1622
+ "d": 0.106,
1623
+ "t": "的"
1624
+ },
1625
+ {
1626
+ "o": 2.337,
1627
+ "d": 0.439,
1628
+ "t": "规范"
1629
+ },
1630
+ {
1631
+ "o": 3.095,
1632
+ "d": 0.452,
1633
+ "t": "博学"
1634
+ },
1635
+ {
1636
+ "o": 3.574,
1637
+ "d": 0.146,
1638
+ "t": "与"
1639
+ },
1640
+ {
1641
+ "o": 3.733,
1642
+ "d": 0.545,
1643
+ "t": "���醒"
1644
+ },
1645
+ {
1646
+ "o": 4.598,
1647
+ "d": 0.133,
1648
+ "t": "是"
1649
+ },
1650
+ {
1651
+ "o": 4.744,
1652
+ "d": 0.173,
1653
+ "t": "向"
1654
+ },
1655
+ {
1656
+ "o": 4.917,
1657
+ "d": 0.199,
1658
+ "t": "外"
1659
+ },
1660
+ {
1661
+ "o": 5.13,
1662
+ "d": 0.519,
1663
+ "t": "求知"
1664
+ },
1665
+ {
1666
+ "o": 5.728,
1667
+ "d": 0.16,
1668
+ "t": "与"
1669
+ },
1670
+ {
1671
+ "o": 5.901,
1672
+ "d": 0.399,
1673
+ "t": "向内"
1674
+ },
1675
+ {
1676
+ "o": 6.313,
1677
+ "d": 0.598,
1678
+ "t": "反省"
1679
+ },
1680
+ {
1681
+ "o": 6.912,
1682
+ "d": 0.08,
1683
+ "t": "的"
1684
+ },
1685
+ {
1686
+ "o": 7.005,
1687
+ "d": 0.479,
1688
+ "t": "结合"
1689
+ },
1690
+ {
1691
+ "o": 8.085,
1692
+ "d": 0.213,
1693
+ "t": "知"
1694
+ },
1695
+ {
1696
+ "o": 8.311,
1697
+ "d": 0.133,
1698
+ "t": "与"
1699
+ },
1700
+ {
1701
+ "o": 8.444,
1702
+ "d": 0.359,
1703
+ "t": "行"
1704
+ },
1705
+ {
1706
+ "o": 9.056,
1707
+ "d": 0.479,
1708
+ "t": "由此"
1709
+ },
1710
+ {
1711
+ "o": 9.548,
1712
+ "d": 0.479,
1713
+ "t": "统一"
1714
+ }
1715
+ ]
1716
+ },
1717
+ "c4l1": {
1718
+ "dur": 9.912,
1719
+ "words": [
1720
+ {
1721
+ "o": 0.113,
1722
+ "d": 1.828,
1723
+ "t": "吾尝终日而思矣"
1724
+ },
1725
+ {
1726
+ "o": 2.284,
1727
+ "d": 1.984,
1728
+ "t": "不如须臾之所学也"
1729
+ },
1730
+ {
1731
+ "o": 4.675,
1732
+ "d": 0.219,
1733
+ "t": "吾"
1734
+ },
1735
+ {
1736
+ "o": 4.894,
1737
+ "d": 0.438,
1738
+ "t": "尝"
1739
+ },
1740
+ {
1741
+ "o": 5.331,
1742
+ "d": 0.219,
1743
+ "t": "企"
1744
+ },
1745
+ {
1746
+ "o": 5.566,
1747
+ "d": 0.188,
1748
+ "t": "而"
1749
+ },
1750
+ {
1751
+ "o": 5.769,
1752
+ "d": 0.297,
1753
+ "t": "望"
1754
+ },
1755
+ {
1756
+ "o": 6.066,
1757
+ "d": 0.219,
1758
+ "t": "矣"
1759
+ },
1760
+ {
1761
+ "o": 6.597,
1762
+ "d": 2.203,
1763
+ "t": "不如登高之博见也"
1764
+ }
1765
+ ]
1766
+ },
1767
+ "c4l2": {
1768
+ "dur": 13.368,
1769
+ "words": [
1770
+ {
1771
+ "o": 0.103,
1772
+ "d": 0.399,
1773
+ "t": "空想"
1774
+ },
1775
+ {
1776
+ "o": 0.515,
1777
+ "d": 0.12,
1778
+ "t": "一"
1779
+ },
1780
+ {
1781
+ "o": 0.635,
1782
+ "d": 0.452,
1783
+ "t": "整天"
1784
+ },
1785
+ {
1786
+ "o": 1.406,
1787
+ "d": 0.519,
1788
+ "t": "比不上"
1789
+ },
1790
+ {
1791
+ "o": 1.952,
1792
+ "d": 0.465,
1793
+ "t": "片刻"
1794
+ },
1795
+ {
1796
+ "o": 2.417,
1797
+ "d": 0.067,
1798
+ "t": "的"
1799
+ },
1800
+ {
1801
+ "o": 2.497,
1802
+ "d": 0.479,
1803
+ "t": "学习"
1804
+ },
1805
+ {
1806
+ "o": 3.268,
1807
+ "d": 0.239,
1808
+ "t": "踮"
1809
+ },
1810
+ {
1811
+ "o": 3.507,
1812
+ "d": 0.16,
1813
+ "t": "起"
1814
+ },
1815
+ {
1816
+ "o": 3.68,
1817
+ "d": 0.452,
1818
+ "t": "脚尖"
1819
+ },
1820
+ {
1821
+ "o": 4.146,
1822
+ "d": 0.439,
1823
+ "t": "眺望"
1824
+ },
1825
+ {
1826
+ "o": 4.877,
1827
+ "d": 0.479,
1828
+ "t": "比不上"
1829
+ },
1830
+ {
1831
+ "o": 5.382,
1832
+ "d": 0.386,
1833
+ "t": "登上"
1834
+ },
1835
+ {
1836
+ "o": 5.781,
1837
+ "d": 0.452,
1838
+ "t": "高处"
1839
+ },
1840
+ {
1841
+ "o": 6.273,
1842
+ "d": 0.186,
1843
+ "t": "看"
1844
+ },
1845
+ {
1846
+ "o": 6.46,
1847
+ "d": 0.093,
1848
+ "t": "得"
1849
+ },
1850
+ {
1851
+ "o": 6.566,
1852
+ "d": 0.492,
1853
+ "t": "辽阔"
1854
+ },
1855
+ {
1856
+ "o": 7.673,
1857
+ "d": 0.519,
1858
+ "t": "荀子"
1859
+ },
1860
+ {
1861
+ "o": 8.205,
1862
+ "d": 0.239,
1863
+ "t": "并"
1864
+ },
1865
+ {
1866
+ "o": 8.444,
1867
+ "d": 0.133,
1868
+ "t": "不"
1869
+ },
1870
+ {
1871
+ "o": 8.59,
1872
+ "d": 0.399,
1873
+ "t": "轻视"
1874
+ },
1875
+ {
1876
+ "o": 9.003,
1877
+ "d": 0.479,
1878
+ "t": "思考"
1879
+ },
1880
+ {
1881
+ "o": 9.747,
1882
+ "d": 0.173,
1883
+ "t": "他"
1884
+ },
1885
+ {
1886
+ "o": 9.934,
1887
+ "d": 0.505,
1888
+ "t": "反对"
1889
+ },
1890
+ {
1891
+ "o": 10.439,
1892
+ "d": 0.146,
1893
+ "t": "的"
1894
+ },
1895
+ {
1896
+ "o": 10.824,
1897
+ "d": 0.186,
1898
+ "t": "是"
1899
+ },
1900
+ {
1901
+ "o": 11.024,
1902
+ "d": 0.452,
1903
+ "t": "脱离"
1904
+ },
1905
+ {
1906
+ "o": 11.503,
1907
+ "d": 0.386,
1908
+ "t": "积累"
1909
+ },
1910
+ {
1911
+ "o": 11.888,
1912
+ "d": 0.067,
1913
+ "t": "的"
1914
+ },
1915
+ {
1916
+ "o": 11.968,
1917
+ "d": 0.465,
1918
+ "t": "空想"
1919
+ }
1920
+ ]
1921
+ },
1922
+ "c4l3": {
1923
+ "dur": 9.696,
1924
+ "words": [
1925
+ {
1926
+ "o": 0.113,
1927
+ "d": 1.0,
1928
+ "t": "登高而招"
1929
+ },
1930
+ {
1931
+ "o": 1.378,
1932
+ "d": 1.438,
1933
+ "t": "臂非加长也"
1934
+ },
1935
+ {
1936
+ "o": 3.081,
1937
+ "d": 1.078,
1938
+ "t": "而见者远"
1939
+ },
1940
+ {
1941
+ "o": 4.487,
1942
+ "d": 1.047,
1943
+ "t": "顺风而呼"
1944
+ },
1945
+ {
1946
+ "o": 5.769,
1947
+ "d": 1.375,
1948
+ "t": "声非加疾也"
1949
+ },
1950
+ {
1951
+ "o": 7.378,
1952
+ "d": 1.203,
1953
+ "t": "而闻者彰"
1954
+ }
1955
+ ]
1956
+ },
1957
+ "c4l4": {
1958
+ "dur": 9.36,
1959
+ "words": [
1960
+ {
1961
+ "o": 0.113,
1962
+ "d": 1.016,
1963
+ "t": "假舆马者"
1964
+ },
1965
+ {
1966
+ "o": 1.331,
1967
+ "d": 1.109,
1968
+ "t": "非利足也"
1969
+ },
1970
+ {
1971
+ "o": 2.675,
1972
+ "d": 1.047,
1973
+ "t": "而致千里"
1974
+ },
1975
+ {
1976
+ "o": 4.097,
1977
+ "d": 1.156,
1978
+ "t": "假舟楫者"
1979
+ },
1980
+ {
1981
+ "o": 5.472,
1982
+ "d": 1.188,
1983
+ "t": "非能水也"
1984
+ },
1985
+ {
1986
+ "o": 6.878,
1987
+ "d": 1.391,
1988
+ "t": "而绝江河"
1989
+ }
1990
+ ]
1991
+ },
1992
+ "c4l5": {
1993
+ "dur": 4.752,
1994
+ "words": [
1995
+ {
1996
+ "o": 0.113,
1997
+ "d": 1.641,
1998
+ "t": "君子生非异也"
1999
+ },
2000
+ {
2001
+ "o": 2.097,
2002
+ "d": 1.562,
2003
+ "t": "善假于物也"
2004
+ }
2005
+ ]
2006
+ },
2007
+ "c4l6": {
2008
+ "dur": 7.416,
2009
+ "words": [
2010
+ {
2011
+ "o": 0.103,
2012
+ "d": 0.452,
2013
+ "t": "君子"
2014
+ },
2015
+ {
2016
+ "o": 0.569,
2017
+ "d": 0.16,
2018
+ "t": "与"
2019
+ },
2020
+ {
2021
+ "o": 0.742,
2022
+ "d": 0.505,
2023
+ "t": "常人"
2024
+ },
2025
+ {
2026
+ "o": 1.526,
2027
+ "d": 0.399,
2028
+ "t": "生来"
2029
+ },
2030
+ {
2031
+ "o": 1.952,
2032
+ "d": 0.266,
2033
+ "t": "并"
2034
+ },
2035
+ {
2036
+ "o": 2.218,
2037
+ "d": 0.239,
2038
+ "t": "没有"
2039
+ },
2040
+ {
2041
+ "o": 2.47,
2042
+ "d": 0.226,
2043
+ "t": "什么"
2044
+ },
2045
+ {
2046
+ "o": 2.71,
2047
+ "d": 0.412,
2048
+ "t": "不同"
2049
+ },
2050
+ {
2051
+ "o": 3.468,
2052
+ "d": 0.492,
2053
+ "t": "差别"
2054
+ },
2055
+ {
2056
+ "o": 3.973,
2057
+ "d": 0.239,
2058
+ "t": "只"
2059
+ },
2060
+ {
2061
+ "o": 4.226,
2062
+ "d": 0.399,
2063
+ "t": "在于"
2064
+ },
2065
+ {
2066
+ "o": 4.851,
2067
+ "d": 0.412,
2068
+ "t": "是否"
2069
+ },
2070
+ {
2071
+ "o": 5.276,
2072
+ "d": 0.372,
2073
+ "t": "善于"
2074
+ },
2075
+ {
2076
+ "o": 5.662,
2077
+ "d": 0.386,
2078
+ "t": "借助"
2079
+ },
2080
+ {
2081
+ "o": 6.061,
2082
+ "d": 0.412,
2083
+ "t": "外物"
2084
+ }
2085
+ ]
2086
+ },
2087
+ "c4l7": {
2088
+ "dur": 12.792,
2089
+ "words": [
2090
+ {
2091
+ "o": 0.103,
2092
+ "d": 0.213,
2093
+ "t": "而"
2094
+ },
2095
+ {
2096
+ "o": 0.316,
2097
+ "d": 0.173,
2098
+ "t": "人"
2099
+ },
2100
+ {
2101
+ "o": 0.502,
2102
+ "d": 0.213,
2103
+ "t": "所"
2104
+ },
2105
+ {
2106
+ "o": 0.715,
2107
+ "d": 0.16,
2108
+ "t": "能"
2109
+ },
2110
+ {
2111
+ "o": 0.888,
2112
+ "d": 0.439,
2113
+ "t": "借助"
2114
+ },
2115
+ {
2116
+ "o": 1.327,
2117
+ "d": 0.146,
2118
+ "t": "的"
2119
+ },
2120
+ {
2121
+ "o": 1.486,
2122
+ "d": 0.771,
2123
+ "t": "最伟大的"
2124
+ },
2125
+ {
2126
+ "o": 2.257,
2127
+ "d": 0.16,
2128
+ "t": "物"
2129
+ },
2130
+ {
2131
+ "o": 2.656,
2132
+ "d": 0.386,
2133
+ "t": "正是"
2134
+ },
2135
+ {
2136
+ "o": 3.055,
2137
+ "d": 0.479,
2138
+ "t": "前人"
2139
+ },
2140
+ {
2141
+ "o": 3.561,
2142
+ "d": 0.359,
2143
+ "t": "积累"
2144
+ },
2145
+ {
2146
+ "o": 3.933,
2147
+ "d": 0.346,
2148
+ "t": "下来"
2149
+ },
2150
+ {
2151
+ "o": 4.279,
2152
+ "d": 0.106,
2153
+ "t": "的"
2154
+ },
2155
+ {
2156
+ "o": 4.398,
2157
+ "d": 0.532,
2158
+ "t": "知识"
2159
+ },
2160
+ {
2161
+ "o": 4.957,
2162
+ "d": 0.16,
2163
+ "t": "与"
2164
+ },
2165
+ {
2166
+ "o": 5.13,
2167
+ "d": 0.412,
2168
+ "t": "经验"
2169
+ },
2170
+ {
2171
+ "o": 6.157,
2172
+ "d": 0.173,
2173
+ "t": "读"
2174
+ },
2175
+ {
2176
+ "o": 6.343,
2177
+ "d": 0.319,
2178
+ "t": "一本"
2179
+ },
2180
+ {
2181
+ "o": 6.662,
2182
+ "d": 0.279,
2183
+ "t": "书"
2184
+ },
2185
+ {
2186
+ "o": 7.141,
2187
+ "d": 0.213,
2188
+ "t": "就"
2189
+ },
2190
+ {
2191
+ "o": 7.354,
2192
+ "d": 0.12,
2193
+ "t": "是"
2194
+ },
2195
+ {
2196
+ "o": 7.487,
2197
+ "d": 0.372,
2198
+ "t": "登上"
2199
+ },
2200
+ {
2201
+ "o": 7.886,
2202
+ "d": 0.16,
2203
+ "t": "一"
2204
+ },
2205
+ {
2206
+ "o": 8.045,
2207
+ "d": 0.199,
2208
+ "t": "处"
2209
+ },
2210
+ {
2211
+ "o": 8.258,
2212
+ "d": 0.399,
2213
+ "t": "高地"
2214
+ },
2215
+ {
2216
+ "o": 9.056,
2217
+ "d": 0.213,
2218
+ "t": "学"
2219
+ },
2220
+ {
2221
+ "o": 9.269,
2222
+ "d": 0.146,
2223
+ "t": "一"
2224
+ },
2225
+ {
2226
+ "o": 9.415,
2227
+ "d": 0.146,
2228
+ "t": "门"
2229
+ },
2230
+ {
2231
+ "o": 9.574,
2232
+ "d": 0.452,
2233
+ "t": "学问"
2234
+ },
2235
+ {
2236
+ "o": 10.253,
2237
+ "d": 0.226,
2238
+ "t": "就"
2239
+ },
2240
+ {
2241
+ "o": 10.479,
2242
+ "d": 0.12,
2243
+ "t": "是"
2244
+ },
2245
+ {
2246
+ "o": 10.612,
2247
+ "d": 0.306,
2248
+ "t": "乘"
2249
+ },
2250
+ {
2251
+ "o": 10.918,
2252
+ "d": 0.173,
2253
+ "t": "上"
2254
+ },
2255
+ {
2256
+ "o": 11.104,
2257
+ "d": 0.133,
2258
+ "t": "一"
2259
+ },
2260
+ {
2261
+ "o": 11.237,
2262
+ "d": 0.16,
2263
+ "t": "辆"
2264
+ },
2265
+ {
2266
+ "o": 11.41,
2267
+ "d": 0.439,
2268
+ "t": "车马"
2269
+ }
2270
+ ]
2271
+ },
2272
+ "c5l1": {
2273
+ "dur": 11.136,
2274
+ "words": [
2275
+ {
2276
+ "o": 0.113,
2277
+ "d": 1.156,
2278
+ "t": "积土成山"
2279
+ },
2280
+ {
2281
+ "o": 1.566,
2282
+ "d": 1.125,
2283
+ "t": "风雨兴焉"
2284
+ },
2285
+ {
2286
+ "o": 3.05,
2287
+ "d": 1.125,
2288
+ "t": "积水成渊"
2289
+ },
2290
+ {
2291
+ "o": 4.425,
2292
+ "d": 1.156,
2293
+ "t": "蛟龙生焉"
2294
+ },
2295
+ {
2296
+ "o": 5.878,
2297
+ "d": 1.047,
2298
+ "t": "积善成德"
2299
+ },
2300
+ {
2301
+ "o": 7.159,
2302
+ "d": 1.344,
2303
+ "t": "而神明自得"
2304
+ },
2305
+ {
2306
+ "o": 8.722,
2307
+ "d": 1.312,
2308
+ "t": "圣心备焉"
2309
+ }
2310
+ ]
2311
+ },
2312
+ "c5l2": {
2313
+ "dur": 10.008,
2314
+ "words": [
2315
+ {
2316
+ "o": 0.103,
2317
+ "d": 0.878,
2318
+ "t": "土积成山"
2319
+ },
2320
+ {
2321
+ "o": 1.234,
2322
+ "d": 0.293,
2323
+ "t": "才"
2324
+ },
2325
+ {
2326
+ "o": 1.526,
2327
+ "d": 0.16,
2328
+ "t": "会"
2329
+ },
2330
+ {
2331
+ "o": 1.712,
2332
+ "d": 0.465,
2333
+ "t": "兴起"
2334
+ },
2335
+ {
2336
+ "o": 2.191,
2337
+ "d": 0.439,
2338
+ "t": "风雨"
2339
+ },
2340
+ {
2341
+ "o": 2.936,
2342
+ "d": 0.319,
2343
+ "t": "水"
2344
+ },
2345
+ {
2346
+ "o": 3.255,
2347
+ "d": 0.665,
2348
+ "t": "积成渊"
2349
+ },
2350
+ {
2351
+ "o": 4.132,
2352
+ "d": 0.306,
2353
+ "t": "才"
2354
+ },
2355
+ {
2356
+ "o": 4.438,
2357
+ "d": 0.253,
2358
+ "t": "会"
2359
+ },
2360
+ {
2361
+ "o": 4.718,
2362
+ "d": 0.386,
2363
+ "t": "孕育"
2364
+ },
2365
+ {
2366
+ "o": 5.117,
2367
+ "d": 0.519,
2368
+ "t": "蛟龙"
2369
+ },
2370
+ {
2371
+ "o": 6.25,
2372
+ "d": 0.253,
2373
+ "t": "量"
2374
+ },
2375
+ {
2376
+ "o": 6.503,
2377
+ "d": 0.106,
2378
+ "t": "的"
2379
+ },
2380
+ {
2381
+ "o": 6.622,
2382
+ "d": 0.399,
2383
+ "t": "积累"
2384
+ },
2385
+ {
2386
+ "o": 7.287,
2387
+ "d": 0.465,
2388
+ "t": "终将"
2389
+ },
2390
+ {
2391
+ "o": 7.766,
2392
+ "d": 0.479,
2393
+ "t": "引发"
2394
+ },
2395
+ {
2396
+ "o": 8.271,
2397
+ "d": 0.798,
2398
+ "t": "质的飞跃"
2399
+ }
2400
+ ]
2401
+ },
2402
+ "c5l3": {
2403
+ "dur": 7.056,
2404
+ "words": [
2405
+ {
2406
+ "o": 0.113,
2407
+ "d": 1.266,
2408
+ "t": "故不积跬步"
2409
+ },
2410
+ {
2411
+ "o": 1.628,
2412
+ "d": 1.328,
2413
+ "t": "无以至千里"
2414
+ },
2415
+ {
2416
+ "o": 3.237,
2417
+ "d": 1.016,
2418
+ "t": "不积小流"
2419
+ },
2420
+ {
2421
+ "o": 4.503,
2422
+ "d": 1.453,
2423
+ "t": "无以成江海"
2424
+ }
2425
+ ]
2426
+ },
2427
+ "c5l4": {
2428
+ "dur": 6.432,
2429
+ "words": [
2430
+ {
2431
+ "o": 0.113,
2432
+ "d": 1.031,
2433
+ "t": "骐骥一跃"
2434
+ },
2435
+ {
2436
+ "o": 1.441,
2437
+ "d": 1.062,
2438
+ "t": "不能十步"
2439
+ },
2440
+ {
2441
+ "o": 2.847,
2442
+ "d": 1.094,
2443
+ "t": "驽马十驾"
2444
+ },
2445
+ {
2446
+ "o": 4.206,
2447
+ "d": 1.109,
2448
+ "t": "功在不舍"
2449
+ }
2450
+ ]
2451
+ },
2452
+ "c5l5": {
2453
+ "dur": 12.024,
2454
+ "words": [
2455
+ {
2456
+ "o": 0.103,
2457
+ "d": 0.652,
2458
+ "t": "千里马"
2459
+ },
2460
+ {
2461
+ "o": 0.781,
2462
+ "d": 0.798,
2463
+ "t": "纵身一跃"
2464
+ },
2465
+ {
2466
+ "o": 1.819,
2467
+ "d": 0.12,
2468
+ "t": "也"
2469
+ },
2470
+ {
2471
+ "o": 1.952,
2472
+ "d": 0.266,
2473
+ "t": "跳"
2474
+ },
2475
+ {
2476
+ "o": 2.218,
2477
+ "d": 0.093,
2478
+ "t": "不"
2479
+ },
2480
+ {
2481
+ "o": 2.311,
2482
+ "d": 0.16,
2483
+ "t": "出"
2484
+ },
2485
+ {
2486
+ "o": 2.483,
2487
+ "d": 0.266,
2488
+ "t": "十"
2489
+ },
2490
+ {
2491
+ "o": 2.749,
2492
+ "d": 0.173,
2493
+ "t": "步"
2494
+ },
2495
+ {
2496
+ "o": 3.308,
2497
+ "d": 0.306,
2498
+ "t": "劣马"
2499
+ },
2500
+ {
2501
+ "o": 3.627,
2502
+ "d": 0.372,
2503
+ "t": "拉车"
2504
+ },
2505
+ {
2506
+ "o": 4.026,
2507
+ "d": 0.346,
2508
+ "t": "走上"
2509
+ },
2510
+ {
2511
+ "o": 4.385,
2512
+ "d": 0.226,
2513
+ "t": "十"
2514
+ },
2515
+ {
2516
+ "o": 4.611,
2517
+ "d": 0.226,
2518
+ "t": "天"
2519
+ },
2520
+ {
2521
+ "o": 5.023,
2522
+ "d": 0.598,
2523
+ "t": "同样"
2524
+ },
2525
+ {
2526
+ "o": 5.635,
2527
+ "d": 0.186,
2528
+ "t": "能"
2529
+ },
2530
+ {
2531
+ "o": 5.848,
2532
+ "d": 0.359,
2533
+ "t": "抵达"
2534
+ },
2535
+ {
2536
+ "o": 6.22,
2537
+ "d": 0.505,
2538
+ "t": "远方"
2539
+ },
2540
+ {
2541
+ "o": 7.34,
2542
+ "d": 0.372,
2543
+ "t": "决定"
2544
+ },
2545
+ {
2546
+ "o": 7.726,
2547
+ "d": 0.532,
2548
+ "t": "成败"
2549
+ },
2550
+ {
2551
+ "o": 8.258,
2552
+ "d": 0.186,
2553
+ "t": "的"
2554
+ },
2555
+ {
2556
+ "o": 8.75,
2557
+ "d": 0.346,
2558
+ "t": "不是"
2559
+ },
2560
+ {
2561
+ "o": 9.109,
2562
+ "d": 0.519,
2563
+ "t": "天赋"
2564
+ },
2565
+ {
2566
+ "o": 9.854,
2567
+ "d": 0.359,
2568
+ "t": "而是"
2569
+ },
2570
+ {
2571
+ "o": 10.239,
2572
+ "d": 0.319,
2573
+ "t": "不肯"
2574
+ },
2575
+ {
2576
+ "o": 10.572,
2577
+ "d": 0.505,
2578
+ "t": "停下"
2579
+ }
2580
+ ]
2581
+ },
2582
+ "c5l6": {
2583
+ "dur": 6.336,
2584
+ "words": [
2585
+ {
2586
+ "o": 0.113,
2587
+ "d": 1.016,
2588
+ "t": "锲而舍之"
2589
+ },
2590
+ {
2591
+ "o": 1.456,
2592
+ "d": 1.047,
2593
+ "t": "朽木不折"
2594
+ },
2595
+ {
2596
+ "o": 2.753,
2597
+ "d": 1.062,
2598
+ "t": "锲而不舍"
2599
+ },
2600
+ {
2601
+ "o": 4.019,
2602
+ "d": 1.219,
2603
+ "t": "金石可镂"
2604
+ }
2605
+ ]
2606
+ },
2607
+ "c5l7": {
2608
+ "dur": 15.144,
2609
+ "words": [
2610
+ {
2611
+ "o": 0.113,
2612
+ "d": 1.484,
2613
+ "t": "蚓无爪牙之利"
2614
+ },
2615
+ {
2616
+ "o": 1.847,
2617
+ "d": 1.141,
2618
+ "t": "筋骨之强"
2619
+ },
2620
+ {
2621
+ "o": 3.206,
2622
+ "d": 1.125,
2623
+ "t": "上食埃土"
2624
+ },
2625
+ {
2626
+ "o": 4.534,
2627
+ "d": 1.266,
2628
+ "t": "下饮黄泉"
2629
+ },
2630
+ {
2631
+ "o": 6.05,
2632
+ "d": 1.219,
2633
+ "t": "用心一也"
2634
+ },
2635
+ {
2636
+ "o": 8.0,
2637
+ "d": 1.625,
2638
+ "t": "蟹六跪而二螯"
2639
+ },
2640
+ {
2641
+ "o": 9.938,
2642
+ "d": 2.656,
2643
+ "t": "非蛇鳝之穴无可寄托者"
2644
+ },
2645
+ {
2646
+ "o": 12.812,
2647
+ "d": 1.234,
2648
+ "t": "用心躁也"
2649
+ }
2650
+ ]
2651
+ },
2652
+ "c5l8": {
2653
+ "dur": 7.968,
2654
+ "words": [
2655
+ {
2656
+ "o": 0.103,
2657
+ "d": 0.452,
2658
+ "t": "蚯蚓"
2659
+ },
2660
+ {
2661
+ "o": 0.569,
2662
+ "d": 0.399,
2663
+ "t": "柔弱"
2664
+ },
2665
+ {
2666
+ "o": 1.247,
2667
+ "d": 0.199,
2668
+ "t": "却"
2669
+ },
2670
+ {
2671
+ "o": 1.446,
2672
+ "d": 0.213,
2673
+ "t": "因"
2674
+ },
2675
+ {
2676
+ "o": 1.672,
2677
+ "d": 0.439,
2678
+ "t": "专一"
2679
+ },
2680
+ {
2681
+ "o": 2.124,
2682
+ "d": 0.16,
2683
+ "t": "而"
2684
+ },
2685
+ {
2686
+ "o": 2.297,
2687
+ "d": 0.519,
2688
+ "t": "上下"
2689
+ },
2690
+ {
2691
+ "o": 2.829,
2692
+ "d": 0.465,
2693
+ "t": "自如"
2694
+ },
2695
+ {
2696
+ "o": 3.64,
2697
+ "d": 0.426,
2698
+ "t": "螃蟹"
2699
+ },
2700
+ {
2701
+ "o": 4.079,
2702
+ "d": 0.558,
2703
+ "t": "强悍"
2704
+ },
2705
+ {
2706
+ "o": 4.97,
2707
+ "d": 0.186,
2708
+ "t": "却"
2709
+ },
2710
+ {
2711
+ "o": 5.156,
2712
+ "d": 0.173,
2713
+ "t": "因"
2714
+ },
2715
+ {
2716
+ "o": 5.343,
2717
+ "d": 0.545,
2718
+ "t": "浮躁"
2719
+ },
2720
+ {
2721
+ "o": 5.914,
2722
+ "d": 0.173,
2723
+ "t": "而"
2724
+ },
2725
+ {
2726
+ "o": 6.101,
2727
+ "d": 0.452,
2728
+ "t": "无处"
2729
+ },
2730
+ {
2731
+ "o": 6.566,
2732
+ "d": 0.465,
2733
+ "t": "安身"
2734
+ }
2735
+ ]
2736
+ },
2737
+ "c5l9": {
2738
+ "dur": 5.616,
2739
+ "words": [
2740
+ {
2741
+ "o": 0.103,
2742
+ "d": 0.465,
2743
+ "t": "积累"
2744
+ },
2745
+ {
2746
+ "o": 0.768,
2747
+ "d": 0.585,
2748
+ "t": "坚持"
2749
+ },
2750
+ {
2751
+ "o": 1.539,
2752
+ "d": 0.412,
2753
+ "t": "专一"
2754
+ },
2755
+ {
2756
+ "o": 2.257,
2757
+ "d": 0.16,
2758
+ "t": "这"
2759
+ },
2760
+ {
2761
+ "o": 2.417,
2762
+ "d": 0.106,
2763
+ "t": "是"
2764
+ },
2765
+ {
2766
+ "o": 2.537,
2767
+ "d": 0.386,
2768
+ "t": "荀子"
2769
+ },
2770
+ {
2771
+ "o": 2.949,
2772
+ "d": 0.372,
2773
+ "t": "交给"
2774
+ },
2775
+ {
2776
+ "o": 3.335,
2777
+ "d": 0.253,
2778
+ "t": "我们"
2779
+ },
2780
+ {
2781
+ "o": 3.587,
2782
+ "d": 0.093,
2783
+ "t": "的"
2784
+ },
2785
+ {
2786
+ "o": 3.707,
2787
+ "d": 0.346,
2788
+ "t": "三"
2789
+ },
2790
+ {
2791
+ "o": 4.053,
2792
+ "d": 0.16,
2793
+ "t": "把"
2794
+ },
2795
+ {
2796
+ "o": 4.226,
2797
+ "d": 0.439,
2798
+ "t": "钥匙"
2799
+ }
2800
+ ]
2801
+ },
2802
+ "c6l1": {
2803
+ "dur": 8.328,
2804
+ "words": [
2805
+ {
2806
+ "o": 0.103,
2807
+ "d": 0.519,
2808
+ "t": "荀子"
2809
+ },
2810
+ {
2811
+ "o": 0.648,
2812
+ "d": 0.16,
2813
+ "t": "在"
2814
+ },
2815
+ {
2816
+ "o": 0.821,
2817
+ "d": 0.359,
2818
+ "t": "后文"
2819
+ },
2820
+ {
2821
+ "o": 1.18,
2822
+ "d": 0.465,
2823
+ "t": "写道"
2824
+ },
2825
+ {
2826
+ "o": 1.978,
2827
+ "d": 0.293,
2828
+ "t": "学"
2829
+ },
2830
+ {
2831
+ "o": 2.271,
2832
+ "d": 0.492,
2833
+ "t": "至乎"
2834
+ },
2835
+ {
2836
+ "o": 2.789,
2837
+ "d": 0.638,
2838
+ "t": "末而后"
2839
+ },
2840
+ {
2841
+ "o": 3.428,
2842
+ "d": 0.293,
2843
+ "t": "止"
2844
+ },
2845
+ {
2846
+ "o": 3.72,
2847
+ "d": 0.279,
2848
+ "t": "也"
2849
+ },
2850
+ {
2851
+ "o": 4.601,
2852
+ "d": 0.519,
2853
+ "t": "学习"
2854
+ },
2855
+ {
2856
+ "o": 5.319,
2857
+ "d": 0.213,
2858
+ "t": "要"
2859
+ },
2860
+ {
2861
+ "o": 5.532,
2862
+ "d": 0.146,
2863
+ "t": "到"
2864
+ },
2865
+ {
2866
+ "o": 5.691,
2867
+ "d": 0.439,
2868
+ "t": "生命"
2869
+ },
2870
+ {
2871
+ "o": 6.144,
2872
+ "d": 0.479,
2873
+ "t": "终结"
2874
+ },
2875
+ {
2876
+ "o": 6.636,
2877
+ "d": 0.199,
2878
+ "t": "才"
2879
+ },
2880
+ {
2881
+ "o": 6.848,
2882
+ "d": 0.532,
2883
+ "t": "停止"
2884
+ }
2885
+ ]
2886
+ },
2887
+ "c6l2": {
2888
+ "dur": 11.16,
2889
+ "words": [
2890
+ {
2891
+ "o": 0.103,
2892
+ "d": 0.173,
2893
+ "t": "在"
2894
+ },
2895
+ {
2896
+ "o": 0.276,
2897
+ "d": 0.106,
2898
+ "t": "他"
2899
+ },
2900
+ {
2901
+ "o": 0.396,
2902
+ "d": 0.359,
2903
+ "t": "看来"
2904
+ },
2905
+ {
2906
+ "o": 1.101,
2907
+ "d": 0.505,
2908
+ "t": "学习"
2909
+ },
2910
+ {
2911
+ "o": 1.632,
2912
+ "d": 0.186,
2913
+ "t": "不"
2914
+ },
2915
+ {
2916
+ "o": 1.819,
2917
+ "d": 0.346,
2918
+ "t": "只是"
2919
+ },
2920
+ {
2921
+ "o": 2.191,
2922
+ "d": 0.372,
2923
+ "t": "获取"
2924
+ },
2925
+ {
2926
+ "o": 2.577,
2927
+ "d": 0.479,
2928
+ "t": "知识"
2929
+ },
2930
+ {
2931
+ "o": 3.281,
2932
+ "d": 0.372,
2933
+ "t": "而是"
2934
+ },
2935
+ {
2936
+ "o": 3.667,
2937
+ "d": 0.319,
2938
+ "t": "一个"
2939
+ },
2940
+ {
2941
+ "o": 3.986,
2942
+ "d": 0.239,
2943
+ "t": "人"
2944
+ },
2945
+ {
2946
+ "o": 4.345,
2947
+ "d": 0.173,
2948
+ "t": "以"
2949
+ },
2950
+ {
2951
+ "o": 4.531,
2952
+ "d": 0.412,
2953
+ "t": "自身"
2954
+ },
2955
+ {
2956
+ "o": 4.957,
2957
+ "d": 0.173,
2958
+ "t": "为"
2959
+ },
2960
+ {
2961
+ "o": 5.143,
2962
+ "d": 0.532,
2963
+ "t": "材料"
2964
+ },
2965
+ {
2966
+ "o": 5.901,
2967
+ "d": 0.731,
2968
+ "t": "日复一日"
2969
+ },
2970
+ {
2971
+ "o": 6.632,
2972
+ "d": 0.12,
2973
+ "t": "地"
2974
+ },
2975
+ {
2976
+ "o": 6.765,
2977
+ "d": 0.519,
2978
+ "t": "雕琢"
2979
+ },
2980
+ {
2981
+ "o": 7.537,
2982
+ "d": 0.519,
2983
+ "t": "塑形"
2984
+ },
2985
+ {
2986
+ "o": 8.295,
2987
+ "d": 0.439,
2988
+ "t": "最终"
2989
+ },
2990
+ {
2991
+ "o": 8.747,
2992
+ "d": 0.359,
2993
+ "t": "成为"
2994
+ },
2995
+ {
2996
+ "o": 9.119,
2997
+ "d": 0.266,
2998
+ "t": "一个"
2999
+ },
3000
+ {
3001
+ "o": 9.412,
3002
+ "d": 0.505,
3003
+ "t": "完整"
3004
+ },
3005
+ {
3006
+ "o": 9.917,
3007
+ "d": 0.12,
3008
+ "t": "的"
3009
+ },
3010
+ {
3011
+ "o": 10.037,
3012
+ "d": 0.186,
3013
+ "t": "人"
3014
+ }
3015
+ ]
3016
+ },
3017
+ "c6l3": {
3018
+ "dur": 9.768,
3019
+ "words": [
3020
+ {
3021
+ "o": 0.103,
3022
+ "d": 0.545,
3023
+ "t": "两千多"
3024
+ },
3025
+ {
3026
+ "o": 0.662,
3027
+ "d": 0.186,
3028
+ "t": "年"
3029
+ },
3030
+ {
3031
+ "o": 0.848,
3032
+ "d": 0.226,
3033
+ "t": "后"
3034
+ },
3035
+ {
3036
+ "o": 1.406,
3037
+ "d": 0.239,
3038
+ "t": "我们"
3039
+ },
3040
+ {
3041
+ "o": 1.659,
3042
+ "d": 0.359,
3043
+ "t": "依然"
3044
+ },
3045
+ {
3046
+ "o": 2.031,
3047
+ "d": 0.213,
3048
+ "t": "站"
3049
+ },
3050
+ {
3051
+ "o": 2.244,
3052
+ "d": 0.16,
3053
+ "t": "在"
3054
+ },
3055
+ {
3056
+ "o": 2.43,
3057
+ "d": 0.505,
3058
+ "t": "同样"
3059
+ },
3060
+ {
3061
+ "o": 2.936,
3062
+ "d": 0.093,
3063
+ "t": "的"
3064
+ },
3065
+ {
3066
+ "o": 3.042,
3067
+ "d": 0.425,
3068
+ "t": "起点"
3069
+ },
3070
+ {
3071
+ "o": 3.468,
3072
+ "d": 0.186,
3073
+ "t": "上"
3074
+ },
3075
+ {
3076
+ "o": 3.999,
3077
+ "d": 0.505,
3078
+ "t": "天性"
3079
+ },
3080
+ {
3081
+ "o": 4.531,
3082
+ "d": 0.146,
3083
+ "t": "给"
3084
+ },
3085
+ {
3086
+ "o": 4.678,
3087
+ "d": 0.08,
3088
+ "t": "了"
3089
+ },
3090
+ {
3091
+ "o": 4.771,
3092
+ "d": 0.226,
3093
+ "t": "我们"
3094
+ },
3095
+ {
3096
+ "o": 5.01,
3097
+ "d": 0.439,
3098
+ "t": "出发"
3099
+ },
3100
+ {
3101
+ "o": 5.449,
3102
+ "d": 0.093,
3103
+ "t": "的"
3104
+ },
3105
+ {
3106
+ "o": 5.555,
3107
+ "d": 0.386,
3108
+ "t": "地方"
3109
+ },
3110
+ {
3111
+ "o": 6.207,
3112
+ "d": 0.16,
3113
+ "t": "而"
3114
+ },
3115
+ {
3116
+ "o": 6.38,
3117
+ "d": 0.545,
3118
+ "t": "学习"
3119
+ },
3120
+ {
3121
+ "o": 7.178,
3122
+ "d": 0.426,
3123
+ "t": "决定"
3124
+ },
3125
+ {
3126
+ "o": 7.617,
3127
+ "d": 0.293,
3128
+ "t": "我们"
3129
+ },
3130
+ {
3131
+ "o": 7.949,
3132
+ "d": 0.186,
3133
+ "t": "能"
3134
+ },
3135
+ {
3136
+ "o": 8.135,
3137
+ "d": 0.199,
3138
+ "t": "走"
3139
+ },
3140
+ {
3141
+ "o": 8.348,
3142
+ "d": 0.239,
3143
+ "t": "多"
3144
+ },
3145
+ {
3146
+ "o": 8.587,
3147
+ "d": 0.253,
3148
+ "t": "远"
3149
+ }
3150
+ ]
3151
+ },
3152
+ "c6l4": {
3153
+ "dur": 3.864,
3154
+ "words": [
3155
+ {
3156
+ "o": 0.113,
3157
+ "d": 0.484,
3158
+ "t": "君子"
3159
+ },
3160
+ {
3161
+ "o": 0.597,
3162
+ "d": 0.297,
3163
+ "t": "曰"
3164
+ },
3165
+ {
3166
+ "o": 1.331,
3167
+ "d": 1.438,
3168
+ "t": "学不可以已"
3169
+ }
3170
+ ]
3171
+ }
3172
+ }
quanxue-src/tsconfig.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "isolatedModules": true,
11
+ "noEmit": true,
12
+ "jsx": "react-jsx",
13
+ "strict": true,
14
+ "noUnusedLocals": false,
15
+ "noUnusedParameters": false,
16
+ "noFallthroughCasesInSwitch": true,
17
+ "paths": {
18
+ "@/*": ["./src/*"]
19
+ }
20
+ },
21
+ "include": ["src"]
22
+ }
quanxue-src/vite.hf.config.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // 构建 Hugging Face 静态 Space 版本:相对路径、独立入口(不含平台角标)
2
+ import path from 'path'
3
+ import { defineConfig } from 'vite'
4
+ import react from '@vitejs/plugin-react'
5
+ import tailwindcss from '@tailwindcss/vite'
6
+
7
+ export default defineConfig({
8
+ plugins: [react(), tailwindcss()],
9
+ base: './',
10
+ resolve: { alias: { '@': path.resolve(__dirname, './src') }, dedupe: ['react', 'react-dom'] },
11
+ build: {
12
+ outDir: process.env.HF_OUT || 'dist-hf',
13
+ emptyOutDir: true,
14
+ chunkSizeWarningLimit: 4000,
15
+ rollupOptions: { input: path.resolve(__dirname, 'quanxue.html') },
16
+ },
17
+ })
quanxue/assets/App-AJceFVqW.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .qx-root{background:radial-gradient(1200px 600px at 50% -10%,rgba(120,92,52,.18),transparent 60%),radial-gradient(900px 500px at 100% 100%,rgba(184,57,43,.06),transparent 60%),#0b0a08;font-family:qx-song,"Noto Serif SC",Songti SC,serif}.qx-brush{font-family:qx-brush,qx-kai,Kaiti SC,STKaiti,serif;font-weight:400}.qx-kai{font-family:qx-kai,Kaiti SC,STKaiti,serif}.qx-song{font-family:qx-song,"Noto Serif SC",Songti SC,serif}.qx-seal{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;background:#b8392b;color:#f3e6d6;border-radius:3px;font-family:qx-brush,serif;font-size:20px;line-height:1;box-shadow:inset 0 0 0 2px #0000001f}.qx-noscroll::-webkit-scrollbar{display:none}.qx-noscroll{scrollbar-width:none}.qx-root ::selection{background:#cfa96159}
quanxue/assets/App-BVPCfY98.js ADDED
The diff for this file is too large to render. See raw diff
 
quanxue/assets/ErrorBoundary-DwultlP_.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var m=Object.defineProperty;var p=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var i=(e,r,t)=>p(e,typeof r!="symbol"?r+"":r,t);import{j as o}from"./jsx-dev-runtime-Czb3f8pQ.js";import{r as f}from"./index-Br42UDbl.js";import"./index-BlGQAcOD.js";const u="__dep_reload",a=6,c=6e4,g=["reading 'useState'","reading 'useEffect'","reading 'useRef'","reading 'useCallback'","reading 'useMemo'","reading 'useContext'","reading 'useReducer'"];function d(e){return g.some(r=>e.includes(r))}function l(){try{const e=sessionStorage.getItem(u);if(e)return JSON.parse(e)}catch{}return{c:0,t:0}}class N extends f.Component{constructor(){super(...arguments);i(this,"state",{error:null})}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){if(!d(t.message))return;const s=l(),n=Date.now()-s.t>c?0:s.c;n<a&&(sessionStorage.setItem(u,JSON.stringify({c:n+1,t:Date.now()})),setTimeout(()=>location.reload(),3e3))}render(){if(this.state.error){if(this.props.fallback)return this.props.fallback;if(d(this.state.error.message)){const{c:t,t:s}=l();if(!(Date.now()-s<=c)||t<a)return o.jsxDEV("div",{style:{padding:"24px",margin:"16px",borderRadius:"12px",background:"rgba(59,130,246,0.06)",border:"1px solid rgba(59,130,246,0.15)",color:"#3b82f6",fontSize:"13px",fontFamily:"system-ui, sans-serif",textAlign:"center"},children:[o.jsxDEV("p",{style:{fontWeight:600,marginBottom:"4px"},children:"Loading dependencies..."},void 0,!1,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:81,columnNumber:15},this),o.jsxDEV("p",{style:{opacity:.7,fontSize:"12px"},children:"Reloading automatically"},void 0,!1,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:82,columnNumber:15},this)]},void 0,!0,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:70,columnNumber:13},this)}return o.jsxDEV("div",{style:{padding:"24px",margin:"16px",borderRadius:"12px",background:"rgba(245,34,45,0.06)",border:"1px solid rgba(245,34,45,0.15)",color:"#c0392b",fontSize:"13px",fontFamily:"monospace"},children:[o.jsxDEV("p",{style:{fontWeight:600,marginBottom:"8px"},children:"Component Error"},void 0,!1,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:99,columnNumber:11},this),o.jsxDEV("p",{style:{opacity:.8},children:this.state.error.message},void 0,!1,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:100,columnNumber:11},this)]},void 0,!0,{fileName:"/workspaces/frontend/src/ErrorBoundary.tsx",lineNumber:89,columnNumber:9},this)}return this.props.children}}export{N as default};
quanxue/assets/client-BlQxAbrl.js ADDED
The diff for this file is too large to render. See raw diff
 
quanxue/assets/index-BlGQAcOD.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function Ue(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var Q={exports:{}},b={exports:{}};b.exports;var Ee;function Ye(){return Ee||(Ee=1,(function(p,u){/**
2
+ * @license React
3
+ * react.development.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */(function(){function Re(e,t){Object.defineProperty(m.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}function Te(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}function M(e,t){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var r=e+"."+t;ie[r]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),ie[r]=!0)}function m(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||ce}function B(){}function N(e,t,r){this.props=e,this.context=t,this.refs=H,this.updater=r||ce}function L(){}function K(e){return""+e}function R(e){try{K(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),K(e)}}function T(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case re:return"Profiler";case te:return"StrictMode";case ue:return"Suspense";case Pe:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ee:return"Portal";case ne:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case oe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:T(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return T(e(t))}catch{}}return null}function F(e){if(e===q)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===w)return"<...>";try{var t=T(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function X(){var e=s.A;return e===null?null:e.getOwner()}function V(){return Error("react-stack-top-frame")}function Z(e){if(A.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Oe(e,t){function r(){pe||(pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}function ke(){var e=T(this.type);return me[e]||(me[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function $(e,t,r,n,o,i){var a=r.ref;return e={$$typeof:I,type:e,key:t,props:r,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:ke}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Se(e,t){return t=$(e.type,t,e.props,e._owner,e._debugStack,e._debugTask),e._store&&(t._store.validated=e._store.validated),t}function J(e){y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===w&&(e._payload.status==="fulfilled"?y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function y(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}function Ae(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}function D(e,t){return typeof e=="object"&&e!==null&&e.key!=null?(R(e.key),Ae(""+e.key)):t.toString(36)}function Ce(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(L,L):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function g(e,t,r,n,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case I:case ee:a=!0;break;case w:return a=e._init,g(a(e._payload),t,r,n,o)}}if(a){a=e,o=o(a);var f=n===""?"."+D(a,0):n;return le(o)?(r="",f!=null&&(r=f.replace(ge,"$&/")+"/"),g(o,t,r,"",function(h){return h})):o!=null&&(y(o)&&(o.key!=null&&(a&&a.key===o.key||R(o.key)),r=Se(o,r+(o.key==null||a&&a.key===o.key?"":(""+o.key).replace(ge,"$&/")+"/")+f),n!==""&&a!=null&&y(a)&&a.key==null&&a._store&&!a._store.validated&&(r._store.validated=2),o=r),t.push(o)),1}if(a=0,f=n===""?".":n+":",le(e))for(var c=0;c<e.length;c++)n=e[c],i=f+D(n,c),a+=g(n,t,r,i,o);else if(c=Te(e),typeof c=="function")for(c===e.entries&&(ye||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ye=!0),e=c.call(e),c=0;!(n=e.next()).done;)n=n.value,i=f+D(n,c++),a+=g(n,t,r,i,o);else if(i==="object"){if(typeof e.then=="function")return g(Ce(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function O(e,t,r){if(e==null)return e;var n=[],o=0;return g(e,n,"","",function(i){return t.call(r,i,o++)}),n}function je(e){if(e._status===-1){var t=e._ioInfo;t!=null&&(t.start=t.end=performance.now()),t=e._result;var r=t();if(r.then(function(o){if(e._status===0||e._status===-1){e._status=1,e._result=o;var i=e._ioInfo;i!=null&&(i.end=performance.now()),r.status===void 0&&(r.status="fulfilled",r.value=o)}},function(o){if(e._status===0||e._status===-1){e._status=2,e._result=o;var i=e._ioInfo;i!=null&&(i.end=performance.now()),r.status===void 0&&(r.status="rejected",r.reason=o)}}),t=e._ioInfo,t!=null){t.value=r;var n=r.displayName;typeof n=="string"&&(t.name=n)}e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return t=e._result,t===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
10
+
11
+ Your code should look like:
12
+ const MyComponent = lazy(() => import('./MyComponent'))
13
+
14
+ Did you accidentally put curly braces around the import?`,t),"default"in t||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
15
+
16
+ Your code should look like:
17
+ const MyComponent = lazy(() => import('./MyComponent'))`,t),t.default;throw e._result}function l(){var e=s.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
18
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
19
+ 2. You might be breaking the Rules of Hooks
20
+ 3. You might have more than one copy of React in the same app
21
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function x(){s.asyncTransitions--}function k(e){if(C===null)try{var t=("require"+Math.random()).slice(0,7);C=(p&&p[t]).call(p,"timers").setImmediate}catch{C=function(n){ve===!1&&(ve=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var o=new MessageChannel;o.port1.onmessage=n,o.port2.postMessage(void 0)}}return C(e)}function v(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function S(e,t){t!==j-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),j=t}function Y(e,t,r){var n=s.actQueue;if(n!==null)if(n.length!==0)try{U(n),k(function(){return Y(e,t,r)});return}catch(o){s.thrownErrors.push(o)}else s.actQueue=null;0<s.thrownErrors.length?(n=v(s.thrownErrors),s.thrownErrors.length=0,r(n)):t(e)}function U(e){if(!G){G=!0;var t=0;try{for(;t<e.length;t++){var r=e[t];do{s.didUsePromise=!1;var n=r(!1);if(n!==null){if(s.didUsePromise){e[t]=r,e.splice(0,t);return}r=n}else break}while(!0)}e.length=0}catch(o){e.splice(0,t+1),s.thrownErrors.push(o)}finally{G=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var I=Symbol.for("react.transitional.element"),ee=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),Pe=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),se=Symbol.iterator,ie={},ce={isMounted:function(){return!1},enqueueForceUpdate:function(e){M(e,"forceUpdate")},enqueueReplaceState:function(e){M(e,"replaceState")},enqueueSetState:function(e){M(e,"setState")}},fe=Object.assign,H={};Object.freeze(H),m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var d={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(E in d)d.hasOwnProperty(E)&&Re(E,d[E]);B.prototype=m.prototype,d=N.prototype=new B,d.constructor=N,fe(d,m.prototype),d.isPureReactComponent=!0;var le=Array.isArray,Me=Symbol.for("react.client.reference"),s={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},A=Object.prototype.hasOwnProperty,de=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(e){return e()}};var pe,he,me={},Ne=d.react_stack_bottom_frame.bind(d,V)(),Le=de(F(V)),ye=!1,ge=/\/+/g,_e=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ve=!1,C=null,j=0,P=!1,G=!1,we=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:k;d=Object.freeze({__proto__:null,c:function(e){return l().useMemoCache(e)}});var E={map:O,forEach:function(e,t,r){O(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(t){return t})||[]},only:function(e){if(!y(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};u.Activity=ae,u.Children=E,u.Component=m,u.Fragment=q,u.Profiler=re,u.PureComponent=N,u.StrictMode=te,u.Suspense=ue,u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,u.__COMPILER_RUNTIME=d,u.act=function(e){var t=s.actQueue,r=j;j++;var n=s.actQueue=t!==null?t:[],o=!1;try{var i=e()}catch(c){s.thrownErrors.push(c)}if(0<s.thrownErrors.length)throw S(t,r),e=v(s.thrownErrors),s.thrownErrors.length=0,e;if(i!==null&&typeof i=="object"&&typeof i.then=="function"){var a=i;return we(function(){o||P||(P=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(c,h){o=!0,a.then(function(_){if(S(t,r),r===0){try{U(n),k(function(){return Y(_,c,h)})}catch(De){s.thrownErrors.push(De)}if(0<s.thrownErrors.length){var $e=v(s.thrownErrors);s.thrownErrors.length=0,h($e)}}else c(_)},function(_){S(t,r),0<s.thrownErrors.length&&(_=v(s.thrownErrors),s.thrownErrors.length=0),h(_)})}}}var f=i;if(S(t,r),r===0&&(U(n),n.length!==0&&we(function(){o||P||(P=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),s.actQueue=null),0<s.thrownErrors.length)throw e=v(s.thrownErrors),s.thrownErrors.length=0,e;return{then:function(c,h){o=!0,r===0?(s.actQueue=n,k(function(){return Y(f,c,h)})):c(f)}}},u.cache=function(e){return function(){return e.apply(null,arguments)}},u.cacheSignal=function(){return null},u.captureOwnerStack=function(){var e=s.getCurrentStack;return e===null?null:e()},u.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=fe({},e.props),o=e.key,i=e._owner;if(t!=null){var a;e:{if(A.call(t,"ref")&&(a=Object.getOwnPropertyDescriptor(t,"ref").get)&&a.isReactWarning){a=!1;break e}a=t.ref!==void 0}a&&(i=X()),Z(t)&&(R(t.key),o=""+t.key);for(f in t)!A.call(t,f)||f==="key"||f==="__self"||f==="__source"||f==="ref"&&t.ref===void 0||(n[f]=t[f])}var f=arguments.length-2;if(f===1)n.children=r;else if(1<f){a=Array(f);for(var c=0;c<f;c++)a[c]=arguments[c+2];n.children=a}for(n=$(e.type,o,n,i,e._debugStack,e._debugTask),o=2;o<arguments.length;o++)J(arguments[o]);return n},u.createContext=function(e){return e={$$typeof:ne,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:W,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},u.createElement=function(e,t,r){for(var n=2;n<arguments.length;n++)J(arguments[n]);n={};var o=null;if(t!=null)for(c in he||!("__self"in t)||"key"in t||(he=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),Z(t)&&(R(t.key),o=""+t.key),t)A.call(t,c)&&c!=="key"&&c!=="__self"&&c!=="__source"&&(n[c]=t[c]);var i=arguments.length-2;if(i===1)n.children=r;else if(1<i){for(var a=Array(i),f=0;f<i;f++)a[f]=arguments[f+2];Object.freeze&&Object.freeze(a),n.children=a}if(e&&e.defaultProps)for(c in i=e.defaultProps,i)n[c]===void 0&&(n[c]=i[c]);o&&Oe(n,typeof e=="function"?e.displayName||e.name||"Unknown":e);var c=1e4>s.recentlyCreatedOwnerStacks++;return $(e,o,n,X(),c?Error("react-stack-top-frame"):Ne,c?de(F(e)):Le)},u.createRef=function(){var e={current:null};return Object.seal(e),e},u.forwardRef=function(e){e!=null&&e.$$typeof===z?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var t={$$typeof:oe,render:e},r;return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(n){r=n,e.name||e.displayName||(Object.defineProperty(e,"name",{value:n}),e.displayName=n)}}),t},u.isValidElement=y,u.lazy=function(e){e={_status:-1,_result:e};var t={$$typeof:w,_payload:e,_init:je},r={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=r,t._debugInfo=[{awaited:r}],t},u.memo=function(e,t){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),t={$$typeof:z,type:e,compare:t===void 0?null:t};var r;return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(n){r=n,e.name||e.displayName||(Object.defineProperty(e,"name",{value:n}),e.displayName=n)}}),t},u.startTransition=function(e){var t=s.T,r={};r._updatedFibers=new Set,s.T=r;try{var n=e(),o=s.S;o!==null&&o(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&(s.asyncTransitions++,n.then(x,x),n.then(L,_e))}catch(i){_e(i)}finally{t===null&&r._updatedFibers&&(e=r._updatedFibers.size,r._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),t!==null&&r.types!==null&&(t.types!==null&&t.types!==r.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),t.types=r.types),s.T=t}},u.unstable_useCacheRefresh=function(){return l().useCacheRefresh()},u.use=function(e){return l().use(e)},u.useActionState=function(e,t,r){return l().useActionState(e,t,r)},u.useCallback=function(e,t){return l().useCallback(e,t)},u.useContext=function(e){var t=l();return e.$$typeof===W&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),t.useContext(e)},u.useDebugValue=function(e,t){return l().useDebugValue(e,t)},u.useDeferredValue=function(e,t){return l().useDeferredValue(e,t)},u.useEffect=function(e,t){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),l().useEffect(e,t)},u.useEffectEvent=function(e){return l().useEffectEvent(e)},u.useId=function(){return l().useId()},u.useImperativeHandle=function(e,t,r){return l().useImperativeHandle(e,t,r)},u.useInsertionEffect=function(e,t){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),l().useInsertionEffect(e,t)},u.useLayoutEffect=function(e,t){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),l().useLayoutEffect(e,t)},u.useMemo=function(e,t){return l().useMemo(e,t)},u.useOptimistic=function(e,t){return l().useOptimistic(e,t)},u.useReducer=function(e,t,r){return l().useReducer(e,t,r)},u.useRef=function(e){return l().useRef(e)},u.useState=function(e){return l().useState(e)},u.useSyncExternalStore=function(e,t,r){return l().useSyncExternalStore(e,t,r)},u.useTransition=function(){return l().useTransition()},u.version="19.2.4",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(b,b.exports)),b.exports}var be;function Ie(){return be||(be=1,Q.exports=Ye()),Q.exports}export{Ue as g,Ie as r};
quanxue/assets/index-Br42UDbl.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{g as i,r as c}from"./index-BlGQAcOD.js";function f(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=c();const p=i(s),g=f({__proto__:null,default:p},[s]);export{g as i,s as r};
quanxue/assets/index-tKuM8enU.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var us=t=>{throw TypeError(t)};var Ft=(t,e,s)=>e.has(t)||us("Cannot "+s);var i=(t,e,s)=>(Ft(t,e,"read from private field"),s?s.call(t):e.get(t)),f=(t,e,s)=>e.has(t)?us("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),h=(t,e,s,r)=>(Ft(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),w=(t,e,s)=>(Ft(t,e,"access private method"),s);var St=(t,e,s,r)=>({set _(n){h(t,e,n,s)},get _(){return i(t,e,r)}});import{r as Q}from"./index-Br42UDbl.js";import{r as ar}from"./index-BlGQAcOD.js";var Ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ce,pe,Le,Os,or=(Os=class extends Ue{constructor(){super();f(this,Ce);f(this,pe);f(this,Le);h(this,Le,e=>{if(typeof window<"u"&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,pe)||this.setEventListener(i(this,Le))}onUnsubscribe(){var e;this.hasListeners()||((e=i(this,pe))==null||e.call(this),h(this,pe,void 0))}setEventListener(e){var s;h(this,Le,e),(s=i(this,pe))==null||s.call(this),h(this,pe,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){i(this,Ce)!==e&&(h(this,Ce,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof i(this,Ce)=="boolean"?i(this,Ce):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ce=new WeakMap,pe=new WeakMap,Le=new WeakMap,Os),Xt=new or,ur={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},te,Qe,Rs,cr=(Rs=class{constructor(){f(this,te,ur);f(this,Qe,!1)}setTimeoutProvider(t){i(this,Qe)&&t!==i(this,te)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:i(this,te),provider:t}),h(this,te,t),h(this,Qe,!1)}setTimeout(t,e){return h(this,Qe,!0),i(this,te).setTimeout(t,e)}clearTimeout(t){i(this,te).clearTimeout(t)}setInterval(t,e){return h(this,Qe,!0),i(this,te).setInterval(t,e)}clearInterval(t){i(this,te).clearInterval(t)}},te=new WeakMap,Qe=new WeakMap,Rs),Ee=new cr;function hr(t){setTimeout(t,0)}var lr=typeof window>"u"||"Deno"in globalThis;function _(){}function fr(t,e){return typeof t=="function"?t(e):t}function At(t){return typeof t=="number"&&t>=0&&t!==1/0}function ks(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Pe(t,e){return typeof t=="function"?t(e):t}function X(t,e){return typeof t=="function"?t(e):t}function cs(t,e){const{type:s="all",exact:r,fetchStatus:n,predicate:a,queryKey:o,stale:c}=t;if(o){if(r){if(e.queryHash!==Zt(o,e.options))return!1}else if(!nt(e.queryKey,o))return!1}if(s!=="all"){const y=e.isActive();if(s==="active"&&!y||s==="inactive"&&y)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||n&&n!==e.state.fetchStatus||a&&!a(e))}function hs(t,e){const{exact:s,status:r,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(je(e.options.mutationKey)!==je(a))return!1}else if(!nt(e.options.mutationKey,a))return!1}return!(r&&e.state.status!==r||n&&!n(e))}function Zt(t,e){return((e==null?void 0:e.queryKeyHashFn)||je)(t)}function je(t){return JSON.stringify(t,(e,s)=>xt(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function nt(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>nt(t[s],e[s])):!1}var dr=Object.prototype.hasOwnProperty;function at(t,e,s=0){if(t===e)return t;if(s>500)return e;const r=ls(t)&&ls(e);if(!r&&!(xt(t)&&xt(e)))return e;const a=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),c=o.length,y=r?new Array(c):{};let m=0;for(let v=0;v<c;v++){const l=r?v:o[v],d=t[l],p=e[l];if(d===p){y[l]=d,(r?v<a:dr.call(t,l))&&m++;continue}if(d===null||p===null||typeof d!="object"||typeof p!="object"){y[l]=p;continue}const P=at(d,p,s+1);y[l]=P,P===d&&m++}return a===c&&m===a?t:y}function ot(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function ls(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function xt(t){if(!fs(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!fs(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function fs(t){return Object.prototype.toString.call(t)==="[object Object]"}function yr(t){return new Promise(e=>{Ee.setTimeout(e,t)})}function Dt(t,e,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(t,e);if(s.structuralSharing!==!1){try{return at(t,e)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`),r}return at(t,e)}return e}function $r(t){return t}function Is(t,e,s=0){const r=[...t,e];return s&&r.length>s?r.slice(1):r}function pr(t,e,s=0){const r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var qe=Symbol();function _s(t,e){return t.queryFn===qe&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`),!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===qe?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function es(t,e){return typeof t=="function"?t(...e):!!t}function js(t,e,s){let r=!1,n;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(n??(n=e()),r||(r=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),t}var ut=(()=>{let t=()=>lr;return{isServer(){return t()},setIsServer(e){t=e}}})();function kt(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function r(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{r({status:"fulfilled",value:n}),t(n)},s.reject=n=>{r({status:"rejected",reason:n}),e(n)},s}function mr(t){var s;let e;if((s=t.then(r=>(e=r,r),_))==null||s.catch(_),e!==void 0)return{data:e}}function qs(t){return t}function vr(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function gr(t,e,s){const r=()=>{var a;const n=(a=t.promise)==null?void 0:a.then(e).catch(o=>s(o)?(console.error(`A query that was dehydrated as pending ended up rejecting. [${t.queryHash}]: ${o}; The error will be redacted in production builds`),Promise.reject(new Error("redacted"))):Promise.reject(o));return n==null||n.catch(_),n};return{dehydratedAt:Date.now(),state:{...t.state,...t.state.data!==void 0&&{data:e(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,...t.state.status==="pending"&&{promise:r()},...t.meta&&{meta:t.meta}}}function br(t){return t.state.isPaused}function Sr(t){return t.state.status==="success"}function wr(t){return!0}function Gr(t,e={}){var y,m,v,l;const s=e.shouldDehydrateMutation??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateMutation)??br,r=t.getMutationCache().getAll().flatMap(d=>s(d)?[vr(d)]:[]),n=e.shouldDehydrateQuery??((m=t.getDefaultOptions().dehydrate)==null?void 0:m.shouldDehydrateQuery)??Sr,a=e.shouldRedactErrors??((v=t.getDefaultOptions().dehydrate)==null?void 0:v.shouldRedactErrors)??wr,o=e.serializeData??((l=t.getDefaultOptions().dehydrate)==null?void 0:l.serializeData)??qs,c=t.getQueryCache().getAll().flatMap(d=>n(d)?[gr(d,o,a)]:[]);return{mutations:r,queries:c}}function ds(t,e,s){var y,m;if(typeof e!="object"||e===null)return;const r=t.getMutationCache(),n=t.getQueryCache(),a=((y=s==null?void 0:s.defaultOptions)==null?void 0:y.deserializeData)??((m=t.getDefaultOptions().hydrate)==null?void 0:m.deserializeData)??qs,o=e.mutations||[],c=e.queries||[];o.forEach(({state:v,...l})=>{var d,p;r.build(t,{...(d=t.getDefaultOptions().hydrate)==null?void 0:d.mutations,...(p=s==null?void 0:s.defaultOptions)==null?void 0:p.mutations,...l},v)}),c.forEach(({queryKey:v,state:l,queryHash:d,meta:p,promise:P,dehydratedAt:g})=>{var j,B;const b=P?mr(P):void 0,O=l.data===void 0?b==null?void 0:b.data:l.data,M=O===void 0?O:a(O);let R=n.get(d);const S=(R==null?void 0:R.state.status)==="pending",D=(R==null?void 0:R.state.fetchStatus)==="fetching";if(R){const T=b&&g!==void 0&&g>R.state.dataUpdatedAt;if(l.dataUpdatedAt>R.state.dataUpdatedAt||T){const{fetchStatus:x,...q}=l;R.setState({...q,data:M})}}else R=n.build(t,{...(j=t.getDefaultOptions().hydrate)==null?void 0:j.queries,...(B=s==null?void 0:s.defaultOptions)==null?void 0:B.queries,queryKey:v,queryHash:d,meta:p},{...l,data:M,fetchStatus:"idle",status:M!==void 0?"success":l.status});P&&!S&&!D&&(g===void 0||g>R.state.dataUpdatedAt)&&R.fetch(void 0,{initialPromise:Promise.resolve(P).then(a)}).catch(_)})}var Or=hr;function Rr(){let t=[],e=0,s=c=>{c()},r=c=>{c()},n=Or;const a=c=>{e?t.push(c):n(()=>{s(c)})},o=()=>{const c=t;t=[],c.length&&n(()=>{r(()=>{c.forEach(y=>{s(y)})})})};return{batch:c=>{let y;e++;try{y=c()}finally{e--,e||o()}return y},batchCalls:c=>(...y)=>{a(()=>{c(...y)})},schedule:a,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{n=c}}}var A=Rr(),He,me,ze,Ps,Pr=(Ps=class extends Ue{constructor(){super();f(this,He,!0);f(this,me);f(this,ze);h(this,ze,e=>{if(typeof window<"u"&&window.addEventListener){const s=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,me)||this.setEventListener(i(this,ze))}onUnsubscribe(){var e;this.hasListeners()||((e=i(this,me))==null||e.call(this),h(this,me,void 0))}setEventListener(e){var s;h(this,ze,e),(s=i(this,me))==null||s.call(this),h(this,me,e(this.setOnline.bind(this)))}setOnline(e){i(this,He)!==e&&(h(this,He,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return i(this,He)}},He=new WeakMap,me=new WeakMap,ze=new WeakMap,Ps),Rt=new Pr;function Er(t){return Math.min(1e3*2**t,3e4)}function Us(t){return(t??"online")==="online"?Rt.isOnline():!0}var Pt=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Br(t){return t instanceof Pt}function Ns(t){let e=!1,s=0,r;const n=kt(),a=()=>n.status!=="pending",o=g=>{var b;if(!a()){const O=new Pt(g);d(O),(b=t.onCancel)==null||b.call(t,O)}},c=()=>{e=!0},y=()=>{e=!1},m=()=>Xt.isFocused()&&(t.networkMode==="always"||Rt.isOnline())&&t.canRun(),v=()=>Us(t.networkMode)&&t.canRun(),l=g=>{a()||(r==null||r(),n.resolve(g))},d=g=>{a()||(r==null||r(),n.reject(g))},p=()=>new Promise(g=>{var b;r=O=>{(a()||m())&&g(O)},(b=t.onPause)==null||b.call(t)}).then(()=>{var g;r=void 0,a()||(g=t.onContinue)==null||g.call(t)}),P=()=>{if(a())return;let g;const b=s===0?t.initialPromise:void 0;try{g=b??t.fn()}catch(O){g=Promise.reject(O)}Promise.resolve(g).then(l).catch(O=>{var j;if(a())return;const M=t.retry??(ut.isServer()?0:3),R=t.retryDelay??Er,S=typeof R=="function"?R(s,O):R,D=M===!0||typeof M=="number"&&s<M||typeof M=="function"&&M(s,O);if(e||!D){d(O);return}s++,(j=t.onFail)==null||j.call(t,s,O),yr(S).then(()=>m()?void 0:p()).then(()=>{e?d(O):P()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(r==null||r(),n),cancelRetry:c,continueRetry:y,canStart:v,start:()=>(v()?P():p().then(P),n)}}var Te,Es,Ks=(Es=class{constructor(){f(this,Te)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),At(this.gcTime)&&h(this,Te,Ee.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ut.isServer()?1/0:300*1e3))}clearGcTimeout(){i(this,Te)&&(Ee.clearTimeout(i(this,Te)),h(this,Te,void 0))}},Te=new WeakMap,Es),Fe,$e,J,Me,K,ct,Ae,W,Ls,ne,Cs,Cr=(Cs=class extends Ks{constructor(e){super();f(this,W);f(this,Fe);f(this,$e);f(this,J);f(this,Me);f(this,K);f(this,ct);f(this,Ae);h(this,Ae,!1),h(this,ct,e.defaultOptions),this.setOptions(e.options),this.observers=[],h(this,Me,e.client),h(this,J,i(this,Me).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,h(this,Fe,ps(this.options)),this.state=e.state??i(this,Fe),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=i(this,K))==null?void 0:e.promise}setOptions(e){if(this.options={...i(this,ct),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=ps(this.options);s.data!==void 0&&(this.setState(ys(s.data,s.dataUpdatedAt)),h(this,Fe,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,J).remove(this)}setData(e,s){const r=Dt(this.state.data,e,this.options);return w(this,W,ne).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(e,s){w(this,W,ne).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var r,n;const s=(r=i(this,K))==null?void 0:r.promise;return(n=i(this,K))==null||n.cancel(e),s?s.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return i(this,Fe)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>X(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Pe(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ks(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=i(this,K))==null||s.continue()}onOnline(){var s;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=i(this,K))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),i(this,J).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(i(this,K)&&(i(this,Ae)||w(this,W,Ls).call(this)?i(this,K).cancel({revert:!0}):i(this,K).cancelRetry()),this.scheduleGc()),i(this,J).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||w(this,W,ne).call(this,{type:"invalidate"})}async fetch(e,s){var y,m,v,l,d,p,P,g,b,O,M,R;if(this.state.fetchStatus!=="idle"&&((y=i(this,K))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(i(this,K))return i(this,K).continueRetry(),i(this,K).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(D=>D.options.queryFn);S&&this.setOptions(S.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,n=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(h(this,Ae,!0),r.signal)})},a=()=>{const S=_s(this.options,s),j=(()=>{const B={client:i(this,Me),queryKey:this.queryKey,meta:this.meta};return n(B),B})();return h(this,Ae,!1),this.options.persister?this.options.persister(S,j,this):S(j)},c=(()=>{const S={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:i(this,Me),state:this.state,fetchFn:a};return n(S),S})();(m=this.options.behavior)==null||m.onFetch(c,this),h(this,$e,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=c.fetchOptions)==null?void 0:v.meta))&&w(this,W,ne).call(this,{type:"fetch",meta:(l=c.fetchOptions)==null?void 0:l.meta}),h(this,K,Ns({initialPromise:s==null?void 0:s.initialPromise,fn:c.fetchFn,onCancel:S=>{S instanceof Pt&&S.revert&&this.setState({...i(this,$e),fetchStatus:"idle"}),r.abort()},onFail:(S,D)=>{w(this,W,ne).call(this,{type:"failed",failureCount:S,error:D})},onPause:()=>{w(this,W,ne).call(this,{type:"pause"})},onContinue:()=>{w(this,W,ne).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const S=await i(this,K).start();if(S===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(d=i(this,J).config).onSuccess)==null||p.call(d,S,this),(g=(P=i(this,J).config).onSettled)==null||g.call(P,S,this.state.error,this),S}catch(S){if(S instanceof Pt){if(S.silent)return i(this,K).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw w(this,W,ne).call(this,{type:"error",error:S}),(O=(b=i(this,J).config).onError)==null||O.call(b,S,this),(R=(M=i(this,J).config).onSettled)==null||R.call(M,this.state.data,S,this),S}finally{this.scheduleGc()}}},Fe=new WeakMap,$e=new WeakMap,J=new WeakMap,Me=new WeakMap,K=new WeakMap,ct=new WeakMap,Ae=new WeakMap,W=new WeakSet,Ls=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ne=function(e){const s=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Hs(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...ys(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return h(this,$e,e.manual?n:void 0),n;case"error":const a=e.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=s(this.state),A.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,J).notify({query:this,type:"updated",action:e})})},Cs);function Hs(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Us(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ys(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ps(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,r=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var $,C,ht,z,xe,Ge,ae,ve,lt,Be,Ye,De,ke,ge,We,F,it,It,_t,jt,qt,Ut,Nt,Kt,zs,Qs,gt=(Qs=class extends Ue{constructor(e,s){super();f(this,F);f(this,$);f(this,C);f(this,ht);f(this,z);f(this,xe);f(this,Ge);f(this,ae);f(this,ve);f(this,lt);f(this,Be);f(this,Ye);f(this,De);f(this,ke);f(this,ge);f(this,We,new Set);this.options=s,h(this,$,e),h(this,ve,null),h(this,ae,kt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,C).addObserver(this),ms(i(this,C),this.options)?w(this,F,it).call(this):this.updateResult(),w(this,F,qt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(i(this,C),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(i(this,C),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,w(this,F,Ut).call(this),w(this,F,Nt).call(this),i(this,C).removeObserver(this)}setOptions(e){const s=this.options,r=i(this,C);if(this.options=i(this,$).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof X(this.options.enabled,i(this,C))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");w(this,F,Kt).call(this),i(this,C).setOptions(this.options),s._defaulted&&!ot(this.options,s)&&i(this,$).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,C),observer:this});const n=this.hasListeners();n&&vs(i(this,C),r,this.options,s)&&w(this,F,it).call(this),this.updateResult(),n&&(i(this,C)!==r||X(this.options.enabled,i(this,C))!==X(s.enabled,i(this,C))||Pe(this.options.staleTime,i(this,C))!==Pe(s.staleTime,i(this,C)))&&w(this,F,It).call(this);const a=w(this,F,_t).call(this);n&&(i(this,C)!==r||X(this.options.enabled,i(this,C))!==X(s.enabled,i(this,C))||a!==i(this,ge))&&w(this,F,jt).call(this,a)}getOptimisticResult(e){const s=i(this,$).getQueryCache().build(i(this,$),e),r=this.createResult(s,e);return Tr(this,r)&&(h(this,z,r),h(this,Ge,this.options),h(this,xe,i(this,C).state)),r}getCurrentResult(){return i(this,z)}trackResult(e,s){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,ae).status==="pending"&&i(this,ae).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){i(this,We).add(e)}getCurrentQuery(){return i(this,C)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=i(this,$).defaultQueryOptions(e),r=i(this,$).getQueryCache().build(i(this,$),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(e){return w(this,F,it).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,z)))}createResult(e,s){var x;const r=i(this,C),n=this.options,a=i(this,z),o=i(this,xe),c=i(this,Ge),m=e!==r?e.state:i(this,ht),{state:v}=e;let l={...v},d=!1,p;if(s._optimisticResults){const q=this.hasListeners(),ee=!q&&ms(e,s),fe=q&&vs(e,r,s,n);(ee||fe)&&(l={...l,...Hs(v.data,e.options)}),s._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:P,errorUpdatedAt:g,status:b}=l;p=l.data;let O=!1;if(s.placeholderData!==void 0&&p===void 0&&b==="pending"){let q;a!=null&&a.isPlaceholderData&&s.placeholderData===(c==null?void 0:c.placeholderData)?(q=a.data,O=!0):q=typeof s.placeholderData=="function"?s.placeholderData((x=i(this,Ye))==null?void 0:x.state.data,i(this,Ye)):s.placeholderData,q!==void 0&&(b="success",p=Dt(a==null?void 0:a.data,q,s),d=!0)}if(s.select&&p!==void 0&&!O)if(a&&p===(o==null?void 0:o.data)&&s.select===i(this,lt))p=i(this,Be);else try{h(this,lt,s.select),p=s.select(p),p=Dt(a==null?void 0:a.data,p,s),h(this,Be,p),h(this,ve,null)}catch(q){h(this,ve,q)}i(this,ve)&&(P=i(this,ve),p=i(this,Be),g=Date.now(),b="error");const M=l.fetchStatus==="fetching",R=b==="pending",S=b==="error",D=R&&M,j=p!==void 0,T={status:b,fetchStatus:l.fetchStatus,isPending:R,isSuccess:b==="success",isError:S,isInitialLoading:D,isLoading:D,data:p,dataUpdatedAt:l.dataUpdatedAt,error:P,errorUpdatedAt:g,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>m.dataUpdateCount||l.errorUpdateCount>m.errorUpdateCount,isFetching:M,isRefetching:M&&!R,isLoadingError:S&&!j,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:S&&j,isStale:ts(e,s),refetch:this.refetch,promise:i(this,ae),isEnabled:X(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=T.data!==void 0,ee=T.status==="error"&&!q,fe=de=>{ee?de.reject(T.error):q&&de.resolve(T.data)},st=()=>{const de=h(this,ae,T.promise=kt());fe(de)},Ne=i(this,ae);switch(Ne.status){case"pending":e.queryHash===r.queryHash&&fe(Ne);break;case"fulfilled":(ee||T.data!==Ne.value)&&st();break;case"rejected":(!ee||T.error!==Ne.reason)&&st();break}}return T}updateResult(){const e=i(this,z),s=this.createResult(i(this,C),this.options);if(h(this,xe,i(this,C).state),h(this,Ge,this.options),i(this,xe).data!==void 0&&h(this,Ye,i(this,C)),ot(s,e))return;h(this,z,s);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!i(this,We).size)return!0;const o=new Set(a??i(this,We));return this.options.throwOnError&&o.add("error"),Object.keys(i(this,z)).some(c=>{const y=c;return i(this,z)[y]!==e[y]&&o.has(y)})};w(this,F,zs).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&w(this,F,qt).call(this)}},$=new WeakMap,C=new WeakMap,ht=new WeakMap,z=new WeakMap,xe=new WeakMap,Ge=new WeakMap,ae=new WeakMap,ve=new WeakMap,lt=new WeakMap,Be=new WeakMap,Ye=new WeakMap,De=new WeakMap,ke=new WeakMap,ge=new WeakMap,We=new WeakMap,F=new WeakSet,it=function(e){w(this,F,Kt).call(this);let s=i(this,C).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(_)),s},It=function(){w(this,F,Ut).call(this);const e=Pe(this.options.staleTime,i(this,C));if(ut.isServer()||i(this,z).isStale||!At(e))return;const r=ks(i(this,z).dataUpdatedAt,e)+1;h(this,De,Ee.setTimeout(()=>{i(this,z).isStale||this.updateResult()},r))},_t=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,C)):this.options.refetchInterval)??!1},jt=function(e){w(this,F,Nt).call(this),h(this,ge,e),!(ut.isServer()||X(this.options.enabled,i(this,C))===!1||!At(i(this,ge))||i(this,ge)===0)&&h(this,ke,Ee.setInterval(()=>{(this.options.refetchIntervalInBackground||Xt.isFocused())&&w(this,F,it).call(this)},i(this,ge)))},qt=function(){w(this,F,It).call(this),w(this,F,jt).call(this,w(this,F,_t).call(this))},Ut=function(){i(this,De)&&(Ee.clearTimeout(i(this,De)),h(this,De,void 0))},Nt=function(){i(this,ke)&&(Ee.clearInterval(i(this,ke)),h(this,ke,void 0))},Kt=function(){const e=i(this,$).getQueryCache().build(i(this,$),this.options);if(e===i(this,C))return;const s=i(this,C);h(this,C,e),h(this,ht,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},zs=function(e){A.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(i(this,z))}),i(this,$).getQueryCache().notify({query:i(this,C),type:"observerResultsUpdated"})})},Qs);function Qr(t,e){return X(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function ms(t,e){return Qr(t,e)||t.state.data!==void 0&&Lt(t,e,e.refetchOnMount)}function Lt(t,e,s){if(X(e.enabled,t)!==!1&&Pe(e.staleTime,t)!=="static"){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&ts(t,e)}return!1}function vs(t,e,s,r){return(t!==e||X(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&ts(t,s)}function ts(t,e){return X(e.enabled,t)!==!1&&t.isStaleByTime(Pe(e.staleTime,t))}function Tr(t,e){return!ot(t.getCurrentResult(),e)}function Et(t){return{onFetch:(e,s)=>{var v,l,d,p,P;const r=e.options,n=(d=(l=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:l.fetchMore)==null?void 0:d.direction,a=((p=e.state.data)==null?void 0:p.pages)||[],o=((P=e.state.data)==null?void 0:P.pageParams)||[];let c={pages:[],pageParams:[]},y=0;const m=async()=>{let g=!1;const b=R=>{js(R,()=>e.signal,()=>g=!0)},O=_s(e.options,e.fetchOptions),M=async(R,S,D)=>{if(g)return Promise.reject();if(S==null&&R.pages.length)return Promise.resolve(R);const B=(()=>{const ee={client:e.client,queryKey:e.queryKey,pageParam:S,direction:D?"backward":"forward",meta:e.options.meta};return b(ee),ee})(),T=await O(B),{maxPages:x}=e.options,q=D?pr:Is;return{pages:q(R.pages,T,x),pageParams:q(R.pageParams,S,x)}};if(n&&a.length){const R=n==="backward",S=R?$s:Ht,D={pages:a,pageParams:o},j=S(r,D);c=await M(D,j,R)}else{const R=t??a.length;do{const S=y===0?o[0]??r.initialPageParam:Ht(r,c);if(y>0&&S==null)break;c=await M(c,S),y++}while(y<R)}return c};e.options.persister?e.fetchFn=()=>{var g,b;return(b=(g=e.options).persister)==null?void 0:b.call(g,m,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=m}}}function Ht(t,{pages:e,pageParams:s}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function $s(t,{pages:e,pageParams:s}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,s[0],s):void 0}function Fr(t,e){return e?Ht(t,e)!=null:!1}function Mr(t,e){return!e||!t.getPreviousPageParam?!1:$s(t,e)!=null}var Gs=class extends gt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Et()})}getOptimisticResult(t){return t.behavior=Et(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var P,g;const{state:s}=t,r=super.createResult(t,e),{isFetching:n,isRefetching:a,isError:o,isRefetchError:c}=r,y=(g=(P=s.fetchMeta)==null?void 0:P.fetchMore)==null?void 0:g.direction,m=o&&y==="forward",v=n&&y==="forward",l=o&&y==="backward",d=n&&y==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Fr(e,s.data),hasPreviousPage:Mr(e,s.data),isFetchNextPageError:m,isFetchingNextPage:v,isFetchPreviousPageError:l,isFetchingPreviousPage:d,isRefetchError:c&&!m&&!l,isRefetching:a&&!v&&!d}}},ft,se,H,Ie,re,ye,Ts,Ar=(Ts=class extends Ks{constructor(e){super();f(this,re);f(this,ft);f(this,se);f(this,H);f(this,Ie);h(this,ft,e.client),this.mutationId=e.mutationId,h(this,H,e.mutationCache),h(this,se,[]),this.state=e.state||Bs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){i(this,se).includes(e)||(i(this,se).push(e),this.clearGcTimeout(),i(this,H).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){h(this,se,i(this,se).filter(s=>s!==e)),this.scheduleGc(),i(this,H).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){i(this,se).length||(this.state.status==="pending"?this.scheduleGc():i(this,H).remove(this))}continue(){var e;return((e=i(this,Ie))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,c,y,m,v,l,d,p,P,g,b,O,M,R,S,D,j,B;const s=()=>{w(this,re,ye).call(this,{type:"continue"})},r={client:i(this,ft),meta:this.options.meta,mutationKey:this.options.mutationKey};h(this,Ie,Ns({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,x)=>{w(this,re,ye).call(this,{type:"failed",failureCount:T,error:x})},onPause:()=>{w(this,re,ye).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,H).canRun(this)}));const n=this.state.status==="pending",a=!i(this,Ie).canStart();try{if(n)s();else{w(this,re,ye).call(this,{type:"pending",variables:e,isPaused:a}),i(this,H).config.onMutate&&await i(this,H).config.onMutate(e,this,r);const x=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,e,r));x!==this.state.context&&w(this,re,ye).call(this,{type:"pending",context:x,variables:e,isPaused:a})}const T=await i(this,Ie).start();return await((m=(y=i(this,H).config).onSuccess)==null?void 0:m.call(y,T,e,this.state.context,this,r)),await((l=(v=this.options).onSuccess)==null?void 0:l.call(v,T,e,this.state.context,r)),await((p=(d=i(this,H).config).onSettled)==null?void 0:p.call(d,T,null,this.state.variables,this.state.context,this,r)),await((g=(P=this.options).onSettled)==null?void 0:g.call(P,T,null,e,this.state.context,r)),w(this,re,ye).call(this,{type:"success",data:T}),T}catch(T){try{await((O=(b=i(this,H).config).onError)==null?void 0:O.call(b,T,e,this.state.context,this,r))}catch(x){Promise.reject(x)}try{await((R=(M=this.options).onError)==null?void 0:R.call(M,T,e,this.state.context,r))}catch(x){Promise.reject(x)}try{await((D=(S=i(this,H).config).onSettled)==null?void 0:D.call(S,void 0,T,this.state.variables,this.state.context,this,r))}catch(x){Promise.reject(x)}try{await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,T,e,this.state.context,r))}catch(x){Promise.reject(x)}throw w(this,re,ye).call(this,{type:"error",error:T}),T}finally{i(this,H).runNext(this)}}},ft=new WeakMap,se=new WeakMap,H=new WeakMap,Ie=new WeakMap,re=new WeakSet,ye=function(e){const s=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),A.batch(()=>{i(this,se).forEach(r=>{r.onMutationUpdate(e)}),i(this,H).notify({mutation:this,type:"updated",action:e})})},Ts);function Bs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oe,Z,dt,Fs,xr=(Fs=class extends Ue{constructor(e={}){super();f(this,oe);f(this,Z);f(this,dt);this.config=e,h(this,oe,new Set),h(this,Z,new Map),h(this,dt,0)}build(e,s,r){const n=new Ar({client:e,mutationCache:this,mutationId:++St(this,dt)._,options:e.defaultMutationOptions(s),state:r});return this.add(n),n}add(e){i(this,oe).add(e);const s=wt(e);if(typeof s=="string"){const r=i(this,Z).get(s);r?r.push(e):i(this,Z).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(i(this,oe).delete(e)){const s=wt(e);if(typeof s=="string"){const r=i(this,Z).get(s);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&i(this,Z).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=wt(e);if(typeof s=="string"){const r=i(this,Z).get(s),n=r==null?void 0:r.find(a=>a.state.status==="pending");return!n||n===e}else return!0}runNext(e){var r;const s=wt(e);if(typeof s=="string"){const n=(r=i(this,Z).get(s))==null?void 0:r.find(a=>a!==e&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){A.batch(()=>{i(this,oe).forEach(e=>{this.notify({type:"removed",mutation:e})}),i(this,oe).clear(),i(this,Z).clear()})}getAll(){return Array.from(i(this,oe))}find(e){const s={exact:!0,...e};return this.getAll().find(r=>hs(s,r))}findAll(e={}){return this.getAll().filter(s=>hs(e,s))}notify(e){A.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return A.batch(()=>Promise.all(e.map(s=>s.continue().catch(_))))}},oe=new WeakMap,Z=new WeakMap,dt=new WeakMap,Fs);function wt(t){var e;return(e=t.options.scope)==null?void 0:e.id}var ue,be,G,ce,he,Ot,zt,Ms,Dr=(Ms=class extends Ue{constructor(e,s){super();f(this,he);f(this,ue);f(this,be);f(this,G);f(this,ce);h(this,ue,e),this.setOptions(s),this.bindMethods(),w(this,he,Ot).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const s=this.options;this.options=i(this,ue).defaultMutationOptions(e),ot(this.options,s)||i(this,ue).getMutationCache().notify({type:"observerOptionsUpdated",mutation:i(this,G),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&je(s.mutationKey)!==je(this.options.mutationKey)?this.reset():((r=i(this,G))==null?void 0:r.state.status)==="pending"&&i(this,G).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=i(this,G))==null||e.removeObserver(this)}onMutationUpdate(e){w(this,he,Ot).call(this),w(this,he,zt).call(this,e)}getCurrentResult(){return i(this,be)}reset(){var e;(e=i(this,G))==null||e.removeObserver(this),h(this,G,void 0),w(this,he,Ot).call(this),w(this,he,zt).call(this)}mutate(e,s){var r;return h(this,ce,s),(r=i(this,G))==null||r.removeObserver(this),h(this,G,i(this,ue).getMutationCache().build(i(this,ue),this.options)),i(this,G).addObserver(this),i(this,G).execute(e)}},ue=new WeakMap,be=new WeakMap,G=new WeakMap,ce=new WeakMap,he=new WeakSet,Ot=function(){var s;const e=((s=i(this,G))==null?void 0:s.state)??Bs();h(this,be,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},zt=function(e){A.batch(()=>{var s,r,n,a,o,c,y,m;if(i(this,ce)&&this.hasListeners()){const v=i(this,be).variables,l=i(this,be).context,d={client:i(this,ue),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(r=(s=i(this,ce)).onSuccess)==null||r.call(s,e.data,v,l,d)}catch(p){Promise.reject(p)}try{(a=(n=i(this,ce)).onSettled)==null||a.call(n,e.data,null,v,l,d)}catch(p){Promise.reject(p)}}else if((e==null?void 0:e.type)==="error"){try{(c=(o=i(this,ce)).onError)==null||c.call(o,e.error,v,l,d)}catch(p){Promise.reject(p)}try{(m=(y=i(this,ce)).onSettled)==null||m.call(y,void 0,e.error,v,l,d)}catch(p){Promise.reject(p)}}}this.listeners.forEach(v=>{v(i(this,be))})})},Ms);function gs(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function kr(t,e,s){const r=t.slice(0);return r[e]=s,r}var _e,Y,Je,Ve,V,Se,yt,pt,mt,vt,L,$t,Gt,Bt,Yt,Wt,As,Ir=(As=class extends Ue{constructor(e,s,r){super();f(this,L);f(this,_e);f(this,Y);f(this,Je);f(this,Ve);f(this,V);f(this,Se);f(this,yt);f(this,pt);f(this,mt);f(this,vt,[]);h(this,_e,e),h(this,Ve,r),h(this,Je,[]),h(this,V,[]),h(this,Y,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&i(this,V).forEach(e=>{e.subscribe(s=>{w(this,L,Yt).call(this,e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,i(this,V).forEach(e=>{e.destroy()})}setQueries(e,s){h(this,Je,e),h(this,Ve,s);{const r=e.map(n=>i(this,_e).defaultQueryOptions(n).queryHash);new Set(r).size!==r.length&&console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.")}A.batch(()=>{const r=i(this,V),n=w(this,L,Bt).call(this,i(this,Je));n.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const a=n.map(l=>l.observer),o=a.map(l=>l.getCurrentResult()),c=r.length!==a.length,y=a.some((l,d)=>l!==r[d]),m=c||y,v=m?!0:o.some((l,d)=>{const p=i(this,Y)[d];return!p||!ot(l,p)});!m&&!v||(m&&(h(this,vt,n),h(this,V,a)),h(this,Y,o),this.hasListeners()&&(m&&(gs(r,a).forEach(l=>{l.destroy()}),gs(a,r).forEach(l=>{l.subscribe(d=>{w(this,L,Yt).call(this,l,d)})})),w(this,L,Wt).call(this)))})}getCurrentResult(){return i(this,Y)}getQueries(){return i(this,V).map(e=>e.getCurrentQuery())}getObservers(){return i(this,V)}getOptimisticResult(e,s){const r=w(this,L,Bt).call(this,e),n=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[n,o=>w(this,L,Gt).call(this,o??n,s,a),()=>w(this,L,$t).call(this,n,r)]}},_e=new WeakMap,Y=new WeakMap,Je=new WeakMap,Ve=new WeakMap,V=new WeakMap,Se=new WeakMap,yt=new WeakMap,pt=new WeakMap,mt=new WeakMap,vt=new WeakMap,L=new WeakSet,$t=function(e,s){return s.map((r,n)=>{const a=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,o=>{s.forEach(c=>{c.observer.trackProp(o)})})})},Gt=function(e,s,r){if(s){const n=i(this,mt),a=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((o,c)=>o!==n[c]));return(!i(this,Se)||i(this,Y)!==i(this,pt)||a||s!==i(this,yt))&&(h(this,yt,s),h(this,pt,i(this,Y)),r!==void 0&&h(this,mt,r),h(this,Se,at(i(this,Se),s(e)))),i(this,Se)}return e},Bt=function(e){const s=new Map;i(this,V).forEach(n=>{const a=n.options.queryHash;if(!a)return;const o=s.get(a);o?o.push(n):s.set(a,[n])});const r=[];return e.forEach(n=>{var y;const a=i(this,_e).defaultQueryOptions(n),c=((y=s.get(a.queryHash))==null?void 0:y.shift())??new gt(i(this,_e),a);r.push({defaultedQueryOptions:a,observer:c})}),r},Yt=function(e,s){const r=i(this,V).indexOf(e);r!==-1&&(h(this,Y,kr(i(this,Y),r,s)),w(this,L,Wt).call(this))},Wt=function(){var e;if(this.hasListeners()){const s=i(this,Se),r=w(this,L,$t).call(this,i(this,Y),i(this,vt)),n=w(this,L,Gt).call(this,r,(e=i(this,Ve))==null?void 0:e.combine);s!==n&&A.batch(()=>{this.listeners.forEach(a=>{a(i(this,Y))})})}},As),ie,xs,_r=(xs=class extends Ue{constructor(e={}){super();f(this,ie);this.config=e,h(this,ie,new Map)}build(e,s,r){const n=s.queryKey,a=s.queryHash??Zt(n,s);let o=this.get(a);return o||(o=new Cr({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(s),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){i(this,ie).has(e.queryHash)||(i(this,ie).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=i(this,ie).get(e.queryHash);s&&(e.destroy(),s===e&&i(this,ie).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){A.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return i(this,ie).get(e)}getAll(){return[...i(this,ie).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(r=>cs(s,r))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(r=>cs(e,r)):s}notify(e){A.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){A.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){A.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ie=new WeakMap,xs),I,we,Oe,Xe,Ze,Re,et,tt,Ds,Yr=(Ds=class{constructor(t={}){f(this,I);f(this,we);f(this,Oe);f(this,Xe);f(this,Ze);f(this,Re);f(this,et);f(this,tt);h(this,I,t.queryCache||new _r),h(this,we,t.mutationCache||new xr),h(this,Oe,t.defaultOptions||{}),h(this,Xe,new Map),h(this,Ze,new Map),h(this,Re,0)}mount(){St(this,Re)._++,i(this,Re)===1&&(h(this,et,Xt.subscribe(async t=>{t&&(await this.resumePausedMutations(),i(this,I).onFocus())})),h(this,tt,Rt.subscribe(async t=>{t&&(await this.resumePausedMutations(),i(this,I).onOnline())})))}unmount(){var t,e;St(this,Re)._--,i(this,Re)===0&&((t=i(this,et))==null||t.call(this),h(this,et,void 0),(e=i(this,tt))==null||e.call(this),h(this,tt,void 0))}isFetching(t){return i(this,I).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return i(this,we).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=i(this,I).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=i(this,I).build(this,e),r=s.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Pe(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return i(this,I).findAll(t).map(({queryKey:e,state:s})=>{const r=s.data;return[e,r]})}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),n=i(this,I).get(r.queryHash),a=n==null?void 0:n.state.data,o=fr(e,a);if(o!==void 0)return i(this,I).build(this,r).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return A.batch(()=>i(this,I).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=i(this,I).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=i(this,I);A.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=i(this,I);return A.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},r=A.batch(()=>i(this,I).findAll(t).map(n=>n.cancel(s)));return Promise.all(r).then(_).catch(_)}invalidateQueries(t,e={}){return A.batch(()=>(i(this,I).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},r=A.batch(()=>i(this,I).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(_)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(_)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=i(this,I).build(this,e);return s.isStaleByTime(Pe(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(_).catch(_)}fetchInfiniteQuery(t){return t.behavior=Et(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(_).catch(_)}ensureInfiniteQueryData(t){return t.behavior=Et(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Rt.isOnline()?i(this,we).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,I)}getMutationCache(){return i(this,we)}getDefaultOptions(){return i(this,Oe)}setDefaultOptions(t){h(this,Oe,t)}setQueryDefaults(t,e){i(this,Xe).set(je(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...i(this,Xe).values()],s={};return e.forEach(r=>{nt(t,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(t,e){i(this,Ze).set(je(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...i(this,Ze).values()],s={};return e.forEach(r=>{nt(t,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...i(this,Oe).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Zt(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===qe&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...i(this,Oe).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){i(this,I).clear(),i(this,we).clear()}},I=new WeakMap,we=new WeakMap,Oe=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,et=new WeakMap,tt=new WeakMap,Ds);function Wr({streamFn:t,refetchMode:e="reset",reducer:s=(n,a)=>Is(n,a),initialValue:r=[]}){return async n=>{const a=n.client.getQueryCache().find({queryKey:n.queryKey,exact:!0}),o=!!a&&a.isFetched();o&&e==="reset"&&a.setState({...a.resetState,fetchStatus:"fetching"});let c=r,y=!1;const m=js({client:n.client,meta:n.meta,queryKey:n.queryKey,pageParam:n.pageParam,direction:n.direction},()=>n.signal,()=>y=!0),v=await t(m),l=o&&e==="replace";for await(const d of v){if(y)break;l?c=s(c,d):n.client.setQueryData(n.queryKey,p=>s(p===void 0?r:p,d))}return l&&!y&&n.client.setQueryData(n.queryKey,c),n.client.getQueryData(n.queryKey)??r}}var Jr=Symbol("dataTagSymbol"),Vr=Symbol("dataTagErrorSymbol"),Xr=Symbol("unsetMarker"),Mt={exports:{}},rt={},bs;function jr(){if(bs)return rt;bs=1;/**
2
+ * @license React
3
+ * react-jsx-runtime.development.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */return(function(){function t(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===ee?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case b:return"Fragment";case M:return"Profiler";case O:return"StrictMode";case j:return"Suspense";case B:return"SuspenseList";case q:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case g:return"Portal";case S:return u.displayName||"Context";case R:return(u._context.displayName||"Context")+".Consumer";case D:var E=u.render;return u=u.displayName,u||(u=E.displayName||E.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case T:return E=u.displayName||null,E!==null?E:t(u.type)||"Memo";case x:E=u._payload,u=u._init;try{return t(u(E))}catch{}}return null}function e(u){return""+u}function s(u){try{e(u);var E=!1}catch{E=!0}if(E){E=console;var k=E.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return k.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),e(u)}}function r(u){if(u===b)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===x)return"<...>";try{var E=t(u);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function n(){var u=fe.A;return u===null?null:u.getOwner()}function a(){return Error("react-stack-top-frame")}function o(u){if(st.call(u,"key")){var E=Object.getOwnPropertyDescriptor(u,"key").get;if(E&&E.isReactWarning)return!1}return u.key!==void 0}function c(u,E){function k(){rs||(rs=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}k.isReactWarning=!0,Object.defineProperty(u,"key",{get:k,configurable:!0})}function y(){var u=t(this.type);return is[u]||(is[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function m(u,E,k,U,bt,Qt){var N=k.ref;return u={$$typeof:P,type:u,key:E,props:k,_owner:U},(N!==void 0?N:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:y}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:bt}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Qt}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function v(u,E,k,U,bt,Qt){var N=E.children;if(N!==void 0)if(U)if(Ne(N)){for(U=0;U<N.length;U++)l(N[U]);Object.freeze&&Object.freeze(N)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(N);if(st.call(E,"key")){N=t(u);var Ke=Object.keys(E).filter(function(nr){return nr!=="key"});U=0<Ke.length?"{key: someKey, "+Ke.join(": ..., ")+": ...}":"{key: someKey}",os[N+U]||(Ke=0<Ke.length?"{"+Ke.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
10
+ let props = %s;
11
+ <%s {...props} />
12
+ React keys must be passed directly to JSX without using spread:
13
+ let props = %s;
14
+ <%s key={someKey} {...props} />`,U,N,Ke,N),os[N+U]=!0)}if(N=null,k!==void 0&&(s(k),N=""+k),o(E)&&(s(E.key),N=""+E.key),"key"in E){k={};for(var Tt in E)Tt!=="key"&&(k[Tt]=E[Tt])}else k=E;return N&&c(k,typeof u=="function"?u.displayName||u.name||"Unknown":u),m(u,N,k,n(),bt,Qt)}function l(u){d(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===x&&(u._payload.status==="fulfilled"?d(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function d(u){return typeof u=="object"&&u!==null&&u.$$typeof===P}var p=ar(),P=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),ee=Symbol.for("react.client.reference"),fe=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,st=Object.prototype.hasOwnProperty,Ne=Array.isArray,de=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(u){return u()}};var rs,is={},ns=p.react_stack_bottom_frame.bind(p,a)(),as=de(r(a)),os={};rt.Fragment=b,rt.jsx=function(u,E,k){var U=1e4>fe.recentlyCreatedOwnerStacks++;return v(u,E,k,!1,U?Error("react-stack-top-frame"):ns,U?de(r(u)):as)},rt.jsxs=function(u,E,k){var U=1e4>fe.recentlyCreatedOwnerStacks++;return v(u,E,k,!0,U?Error("react-stack-top-frame"):ns,U?de(r(u)):as)}})(),rt}var Ss;function qr(){return Ss||(Ss=1,Mt.exports=jr()),Mt.exports}var Ys=qr(),Ws=Q.createContext(void 0),le=t=>{const e=Q.useContext(Ws);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Zr=({client:t,children:e})=>(Q.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Ys.jsx(Ws.Provider,{value:t,children:e})),Js=Q.createContext(!1),Vs=()=>Q.useContext(Js),ei=Js.Provider;function Xs(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Zs=Q.createContext(Xs()),er=()=>Q.useContext(Zs),ti=({children:t})=>{const[e]=Q.useState(()=>Xs());return Ys.jsx(Zs.Provider,{value:e,children:typeof t=="function"?t(e):t})},tr=(t,e,s)=>{const r=s!=null&&s.state.error&&typeof t.throwOnError=="function"?es(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},sr=t=>{Q.useEffect(()=>{t.clearReset()},[t])},rr=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(n&&t.data===void 0||es(s,[t.error,r])),ss=(t,e)=>e.state.data===void 0,ir=t=>{if(t.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...n)=>s(r(...n)):s(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Ur=(t,e)=>t.isLoading&&t.isFetching&&!e,Jt=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Vt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function Nr({queries:t,...e},s){const r=le(s),n=Vs(),a=er(),o=Q.useMemo(()=>t.map(g=>{const b=r.defaultQueryOptions(g);return b._optimisticResults=n?"isRestoring":"optimistic",b}),[t,r,n]);o.forEach(g=>{ir(g);const b=r.getQueryCache().get(g.queryHash);tr(g,a,b)}),sr(a);const[c]=Q.useState(()=>new Ir(r,o,e)),[y,m,v]=c.getOptimisticResult(o,e.combine),l=!n&&e.subscribed!==!1;Q.useSyncExternalStore(Q.useCallback(g=>l?c.subscribe(A.batchCalls(g)):_,[c,l]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const p=y.some((g,b)=>Jt(o[b],g))?y.flatMap((g,b)=>{const O=o[b];if(O&&Jt(O,g)){const M=new gt(r,O);return Vt(O,M,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const P=y.find((g,b)=>{const O=o[b];return O&&rr({result:g,errorResetBoundary:a,throwOnError:O.throwOnError,query:r.getQueryCache().get(O.queryHash),suspense:O.suspense})});if(P!=null&&P.error)throw P.error;return m(v())}function Ct(t,e,s){var d,p,P,g;if(typeof t!="object"||Array.isArray(t))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Vs(),n=er(),a=le(s),o=a.defaultQueryOptions(t);(p=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,o);const c=a.getQueryCache().get(o.queryHash);o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),o._optimisticResults=r?"isRestoring":"optimistic",ir(o),tr(o,n,c),sr(n);const y=!a.getQueryCache().get(o.queryHash),[m]=Q.useState(()=>new e(a,o)),v=m.getOptimisticResult(o),l=!r&&t.subscribed!==!1;if(Q.useSyncExternalStore(Q.useCallback(b=>{const O=l?m.subscribe(A.batchCalls(b)):_;return m.updateResult(),O},[m,l]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Q.useEffect(()=>{m.setOptions(o)},[o,m]),Jt(o,v))throw Vt(o,m,n);if(rr({result:v,errorResetBoundary:n,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw v.error;if((g=(P=a.getDefaultOptions().queries)==null?void 0:P._experimental_afterQuery)==null||g.call(P,o,v),o.experimental_prefetchInRender&&!ut.isServer()&&Ur(v,r)){const b=y?Vt(o,m,n):c==null?void 0:c.promise;b==null||b.catch(_).finally(()=>{m.updateResult()})}return o.notifyOnChangeProps?v:m.trackResult(v)}function si(t,e){return Ct(t,gt,e)}function ri(t,e){return t.queryFn===qe&&console.error("skipToken is not allowed for useSuspenseQuery"),Ct({...t,enabled:!0,suspense:!0,throwOnError:ss,placeholderData:void 0},gt,e)}function ii(t,e){return t.queryFn===qe&&console.error("skipToken is not allowed for useSuspenseInfiniteQuery"),Ct({...t,enabled:!0,suspense:!0,throwOnError:ss},Gs,e)}function ni(t,e){return Nr({...t,queries:t.queries.map(s=>(s.queryFn===qe&&console.error("skipToken is not allowed for useSuspenseQueries"),{...s,suspense:!0,throwOnError:ss,enabled:!0,placeholderData:void 0}))},e)}function ai(t,e){const s=le(e);s.getQueryState(t.queryKey)||s.prefetchQuery(t)}function oi(t,e){const s=le(e);s.getQueryState(t.queryKey)||s.prefetchInfiniteQuery(t)}function ui(t){return t}function ci(t){return t}var hi=({children:t,options:e={},state:s,queryClient:r})=>{const n=le(r),a=Q.useRef(e);Q.useEffect(()=>{a.current=e});const o=Q.useMemo(()=>{if(s){if(typeof s!="object")return;const c=n.getQueryCache(),y=s.queries||[],m=[],v=[];for(const l of y){const d=c.get(l.queryHash);d?(l.state.dataUpdatedAt>d.state.dataUpdatedAt||l.promise&&d.state.status!=="pending"&&d.state.fetchStatus!=="fetching"&&l.dehydratedAt!==void 0&&l.dehydratedAt>d.state.dataUpdatedAt)&&v.push(l):m.push(l)}if(m.length>0&&ds(n,{queries:m},a.current),v.length>0)return v}},[n,s]);return Q.useEffect(()=>{o&&ds(n,{queries:o},a.current)},[n,o]),t};function li(t,e){const s=le(e),r=s.getQueryCache();return Q.useSyncExternalStore(Q.useCallback(n=>r.subscribe(A.batchCalls(n)),[r]),()=>s.isFetching(t),()=>s.isFetching(t))}function fi(t,e){const s=le(e);return Kr({filters:{...t,status:"pending"}},s).length}function ws(t,e){return t.findAll(e.filters).map(s=>e.select?e.select(s):s.state)}function Kr(t={},e){const s=le(e).getMutationCache(),r=Q.useRef(t),n=Q.useRef(null);return n.current===null&&(n.current=ws(s,t)),Q.useEffect(()=>{r.current=t}),Q.useSyncExternalStore(Q.useCallback(a=>s.subscribe(()=>{const o=at(n.current,ws(s,r.current));n.current!==o&&(n.current=o,A.schedule(a))}),[s]),()=>n.current,()=>n.current)}function di(t,e){const s=le(e),[r]=Q.useState(()=>new Dr(s,t));Q.useEffect(()=>{r.setOptions(t)},[r,t]);const n=Q.useSyncExternalStore(Q.useCallback(o=>r.subscribe(A.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Q.useCallback((o,c)=>{r.mutate(o,c).catch(_)},[r]);if(n.error&&es(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}function yi(t){return t}function pi(t,e){return Ct(t,Gs,e)}export{Pt as CancelledError,hi as HydrationBoundary,Gs as InfiniteQueryObserver,ei as IsRestoringProvider,Ar as Mutation,xr as MutationCache,Dr as MutationObserver,Ir as QueriesObserver,Cr as Query,_r as QueryCache,Yr as QueryClient,Ws as QueryClientContext,Zr as QueryClientProvider,ti as QueryErrorResetBoundary,gt as QueryObserver,Vr as dataTagErrorSymbol,Jr as dataTagSymbol,Or as defaultScheduler,br as defaultShouldDehydrateMutation,Sr as defaultShouldDehydrateQuery,Gr as dehydrate,ut as environmentManager,Wr as experimental_streamedQuery,Xt as focusManager,je as hashKey,ds as hydrate,ci as infiniteQueryOptions,Br as isCancelledError,lr as isServer,$r as keepPreviousData,hs as matchMutation,cs as matchQuery,yi as mutationOptions,_ as noop,A as notifyManager,Rt as onlineManager,nt as partialMatchKey,ui as queryOptions,at as replaceEqualDeep,es as shouldThrowError,qe as skipToken,Ee as timeoutManager,Xr as unsetMarker,pi as useInfiniteQuery,li as useIsFetching,fi as useIsMutating,Vs as useIsRestoring,di as useMutation,Kr as useMutationState,oi as usePrefetchInfiniteQuery,ai as usePrefetchQuery,Nr as useQueries,si as useQuery,le as useQueryClient,er as useQueryErrorResetBoundary,ii as useSuspenseInfiniteQuery,ni as useSuspenseQueries,ri as useSuspenseQuery};
quanxue/assets/jsx-dev-runtime-Czb3f8pQ.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as H}from"./index-BlGQAcOD.js";var b={exports:{}},c={},w;function Z(){if(w)return c;w=1;/**
2
+ * @license React
3
+ * react-jsx-dev-runtime.development.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */return(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===G?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case i:return"Fragment";case F:return"Profiler";case $:return"StrictMode";case M:return"Suspense";case z:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case I:return"Portal";case L:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case U:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case f:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function _(e){return""+e}function E(e){try{_(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),_(e)}}function v(e){if(e===i)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===f)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function j(){var e=O.A;return e===null?null:e.getOwner()}function R(){return Error("react-stack-top-frame")}function x(e){if(k.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function N(e,r){function t(){A||(A=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function C(){var e=s(this.type);return S[e]||(S[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function D(e,r,t,n,o,m){var a=t.ref;return e={$$typeof:g,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:C}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:m}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Y(e,r,t,n,o,m){var a=r.children;if(a!==void 0)if(n)if(J(a)){for(n=0;n<a.length;n++)T(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(a);if(k.call(r,"key")){a=s(e);var l=Object.keys(r).filter(function(B){return B!=="key"});n=0<l.length?"{key: someKey, "+l.join(": ..., ")+": ...}":"{key: someKey}",P[a+n]||(l=0<l.length?"{"+l.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
10
+ let props = %s;
11
+ <%s {...props} />
12
+ React keys must be passed directly to JSX without using spread:
13
+ let props = %s;
14
+ <%s key={someKey} {...props} />`,n,a,l,a),P[a+n]=!0)}if(a=null,t!==void 0&&(E(t),a=""+t),x(r)&&(E(r.key),a=""+r.key),"key"in r){t={};for(var d in r)d!=="key"&&(t[d]=r[d])}else t=r;return a&&N(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),D(e,a,t,j(),o,m)}function T(e){p(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===f&&(e._payload.status==="fulfilled"?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}var u=H(),g=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),L=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),G=Symbol.for("react.client.reference"),O=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,J=Array.isArray,y=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(e){return e()}};var A,S={},X=u.react_stack_bottom_frame.bind(u,R)(),K=y(v(R)),P={};c.Fragment=i,c.jsxDEV=function(e,r,t,n){var o=1e4>O.recentlyCreatedOwnerStacks++;return Y(e,r,t,n,o?Error("react-stack-top-frame"):X,o?y(v(e)):K)}})(),c}var h;function Q(){return h||(h=1,b.exports=Z()),b.exports}var re=Q();export{re as j};
quanxue/assets/mediabunny-aac-encoder-Dc8poPeB.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:421951b77082d6f379c608fc4c236a1b285ace3b2099e2e629a812bfe6ef4513
3
+ size 992782
quanxue/assets/quanxue-CcHbJimF.css ADDED
@@ -0,0 +1 @@
 
 
1
+ @import"https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700;900&family=Roboto+Mono:wght@400;500&display=swap";/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-300:oklch(87.9% .169 91.605);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-lg:32rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--leading-loose:2;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-2xl:40px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before{border-color:var(--color-border)}body{background-color:var(--color-background);color:var(--color-foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Lato,PingFang SC,sans-serif}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-12{top:calc(var(--spacing) * -12)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.-right-12{right:calc(var(--spacing) * -12)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-12{bottom:calc(var(--spacing) * -12)}.bottom-0{bottom:calc(var(--spacing) * 0)}.-left-12{left:calc(var(--spacing) * -12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[100\]{z-index:100}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-14{margin-top:calc(var(--spacing) * 14)}.mt-24{margin-top:calc(var(--spacing) * 24)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-\[--cell-size\]{width:--cell-size;height:--cell-size}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-\[--cell-size\]{height:--cell-size}.h-\[1px\]{height:1px}.h-\[2px\]{height:2px}.h-\[3px\]{height:3px}.h-\[9px\]{height:9px}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-\[--radix-context-menu-content-available-height\]{max-height:--radix-context-menu-content-available-height}.max-h-\[--radix-select-content-available-height\]{max-height:--radix-select-content-available-height}.max-h-\[300px\]{max-height:300px}.max-h-\[var\(--radix-dropdown-menu-content-available-height\)\]{max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-screen{max-height:100vh}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-20{width:calc(var(--spacing) * 20)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[--cell-size\]{width:--cell-size}.w-\[1px\]{width:1px}.w-\[2px\]{width:2px}.w-\[100px\]{width:100px}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-\[--cell-size\]{min-width:--cell-size}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:--radix-context-menu-content-transform-origin}.origin-\[--radix-dropdown-menu-content-transform-origin\]{transform-origin:--radix-dropdown-menu-content-transform-origin}.origin-\[--radix-hover-card-content-transform-origin\]{transform-origin:--radix-hover-card-content-transform-origin}.origin-\[--radix-menubar-content-transform-origin\]{transform-origin:--radix-menubar-content-transform-origin}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:--radix-popover-content-transform-origin}.origin-\[--radix-select-content-transform-origin\]{transform-origin:--radix-select-content-transform-origin}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:--radix-tooltip-content-transform-origin}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-y{resize:vertical}.scroll-mt-20{scroll-margin-top:calc(var(--spacing) * 20)}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-10{column-gap:calc(var(--spacing) * 10)}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 1) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-8{row-gap:calc(var(--spacing) * 8)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[10px\]{border-radius:10px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#cfa961\]{border-color:#cfa961}.border-\[\#cfa961\]\/12{border-color:#cfa9611f}.border-\[\#cfa961\]\/30{border-color:#cfa9614d}.border-\[\#cfa961\]\/60{border-color:#cfa96199}.border-\[var\(--border-base\)\]{border-color:var(--border-base)}.border-destructive,.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.border-emerald-400\/60{border-color:#00d29499}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/60{border-color:color-mix(in oklab,var(--color-emerald-400) 60%,transparent)}}.border-input{border-color:var(--input)}.border-primary,.border-primary\/50{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,var(--primary) 50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\[\#0b0a08\]\/75{background-color:#0b0a08bf}.bg-\[\#b8392b\]{background-color:#b8392b}.bg-\[\#cfa961\]{background-color:#cfa961}.bg-\[\#cfa961\]\/5{background-color:#cfa9610d}.bg-\[\#cfa961\]\/12{background-color:#cfa9611f}.bg-\[\#efe6d2\]{background-color:#efe6d2}.bg-\[var\(--bg-subtle\)\]{background-color:var(--bg-subtle)}.bg-\[var\(--neutral-0\)\]{background-color:var(--neutral-0)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-foreground\/5{background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.bg-foreground\/5{background-color:color-mix(in oklab,var(--foreground) 5%,transparent)}}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary,.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#b8392b\]{--tw-gradient-from:#b8392b;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\/80{--tw-gradient-from:color-mix(in oklab, var(--color-black) 80%, transparent)}}.from-black\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\/85{--tw-gradient-from:#000000d9}@supports (color:color-mix(in lab,red,red)){.from-black\/85{--tw-gradient-from:color-mix(in oklab, var(--color-black) 85%, transparent)}}.from-black\/85{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/\[0\.035\]{--tw-gradient-from:#ffffff09}@supports (color:color-mix(in lab,red,red)){.from-white\/\[0\.035\]{--tw-gradient-from:color-mix(in oklab, var(--color-white) 3.5%, transparent)}}.from-white\/\[0\.035\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-black\/40{--tw-gradient-via:#0006}@supports (color:color-mix(in lab,red,red)){.via-black\/40{--tw-gradient-via:color-mix(in oklab, var(--color-black) 40%, transparent)}}.via-black\/40{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#cfa961\]{--tw-gradient-to:#cfa961;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white\/\[0\.01\]{--tw-gradient-to:#ffffff03}@supports (color:color-mix(in lab,red,red)){.to-white\/\[0\.01\]{--tw-gradient-to:color-mix(in oklab, var(--color-white) 1%, transparent)}}.to-white\/\[0\.01\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-\[1px\]{padding:1px}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[--cell-size\]{padding-inline:--cell-size}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.1em\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.3em\]{--tw-tracking:.3em;letter-spacing:.3em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\[0\.25em\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-\[\#6f6656\]{color:#6f6656}.text-\[\#7d7363\]{color:#7d7363}.text-\[\#9d927f\]{color:#9d927f}.text-\[\#b9ae98\]{color:#b9ae98}.text-\[\#b8392b\]{color:#b8392b}.text-\[\#c9bfa9\]{color:#c9bfa9}.text-\[\#cfa961\]{color:#cfa961}.text-\[\#d9cfb9\]{color:#d9cfb9}.text-\[\#e2d6bd\]{color:#e2d6bd}.text-\[\#e5d6b5\]{color:#e5d6b5}.text-\[\#e9d7a8\]{color:#e9d7a8}.text-\[\#efe6d2\]{color:#efe6d2}.text-\[\#f3e3bd\]{color:#f3e3bd}.text-\[var\(--fg-subtle\)\]{color:var(--fg-subtle)}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-300\/90{color:#ffd236e6}@supports (color:color-mix(in lab,red,red)){.text-amber-300\/90{color:color-mix(in oklab,var(--color-amber-300) 90%,transparent)}}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-emerald-300{color:var(--color-emerald-300)}.text-foreground,.text-foreground\/50{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/50{color:color-mix(in oklab,var(--foreground) 50%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_30px_80px_-20px_rgba\(0\,0\,0\,0\.9\)\]{--tw-shadow:0 30px 80px -20px var(--tw-shadow-color,#000000e6);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[\#cfa961\]\/15{--tw-ring-color:oklab(75.3824% .0137527 .100097/.15)}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-2xl{--tw-backdrop-blur:blur(var(--blur-2xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.\[--cell-size\:2rem\]{--cell-size:2rem}.running{animation-play-state:running}@media(hover:hover){.group-hover\:scale-125:is(:where(.group):hover *){--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:text-\[\#cfa961\]:is(:where(.group):hover *){color:#cfa961}.group-hover\:text-\[\#efe6d2\]:is(:where(.group):hover *){color:#efe6d2}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[focused\=true\]\/day\:relative:is(:where(.group\/day)[data-focused=true] *){position:relative}.group-data-\[focused\=true\]\/day\:z-10:is(:where(.group\/day)[data-focused=true] *){z-index:10}.group-data-\[focused\=true\]\/day\:border-ring:is(:where(.group\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\[focused\=true\]\/day\:ring-\[3px\]:is(:where(.group\/day)[data-focused=true] *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-\[\.destructive\]\:border-muted\/40:is(:where(.group).destructive *){border-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.group-\[\.destructive\]\:border-muted\/40:is(:where(.group).destructive *){border-color:color-mix(in oklab,var(--muted) 40%,transparent)}}.group-\[\.destructive\]\:text-red-300:is(:where(.group).destructive *){color:var(--color-red-300)}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing) * 0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing) * 1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}@media(hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-\[\#cfa961\]:hover{border-color:#cfa961}.hover\:border-\[\#cfa961\]\/50:hover{border-color:#cfa96180}.hover\:border-\[\#cfa961\]\/60:hover{border-color:#cfa96199}.hover\:border-white\/30:hover{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/30:hover{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.hover\:bg-\[\#c94434\]:hover{background-color:#c94434}.hover\:bg-\[\#cfa961\]:hover{background-color:#cfa961}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-black\/60:hover{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/60:hover{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.hover\:bg-destructive\/80:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/80:hover{background-color:color-mix(in oklab,var(--destructive) 80%,transparent)}}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}.hover\:bg-muted:hover,.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.hover\:bg-primary\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}.hover\:bg-secondary:hover,.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.hover\:text-\[\#cfa961\]:hover{color:#cfa961}.hover\:text-\[\#efe6d2\]:hover{color:#efe6d2}.hover\:text-\[\#f3e3bd\]:hover{color:#f3e3bd}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-black:hover{color:var(--color-black)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.group-\[\.destructive\]\:hover\:border-destructive\/30:is(:where(.group).destructive *):hover{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.group-\[\.destructive\]\:hover\:border-destructive\/30:is(:where(.group).destructive *):hover{border-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.group-\[\.destructive\]\:hover\:bg-destructive:is(:where(.group).destructive *):hover{background-color:var(--destructive)}.group-\[\.destructive\]\:hover\:text-destructive-foreground:is(:where(.group).destructive *):hover{color:var(--destructive-foreground)}.group-\[\.destructive\]\:hover\:text-red-50:is(:where(.group).destructive *):hover{color:var(--color-red-50)}}.focus\:border-\[\#cfa961\]\/50:focus{border-color:#cfa96180}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:opacity-100:focus{opacity:1}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.group-\[\.destructive\]\:focus\:ring-destructive:is(:where(.group).destructive *):focus{--tw-ring-color:var(--destructive)}.group-\[\.destructive\]\:focus\:ring-red-400:is(:where(.group).destructive *):focus{--tw-ring-color:var(--color-red-400)}.group-\[\.destructive\]\:focus\:ring-offset-red-600:is(:where(.group).destructive *):focus{--tw-ring-offset-color:var(--color-red-600)}.focus-visible\:border-\[var\(--fg-base\)\]:focus-visible{border-color:var(--fg-base)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color:var(--background)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(hover:hover){.disabled\:hover\:bg-\[\#b8392b\]:disabled:hover{background-color:#b8392b}}.has-focus\:border-ring:has(:focus){border-color:var(--ring)}.has-focus\:ring-\[3px\]:has(:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\:ring-ring\/50:has(:focus){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.has-focus\:ring-ring\/50:has(:focus){--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x:calc(52*var(--spacing))}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x:calc(52*var(--spacing)*-1)}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x:calc(52*var(--spacing))}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x:calc(52*var(--spacing)*-1)}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity:0}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-]{--tw-exit-opacity:0}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing) * 0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing) * 1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:.2s ease-out accordion-up}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity:.8}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50% }.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100% }.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48% }.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity:0}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:.2s ease-out accordion-down}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open],.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale:.9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50% }.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48% }.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100% }@media(hover:hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\[state\=visible\]\:animate-in[data-state=visible]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity:0}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x:var(--radix-toast-swipe-end-x);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x:var(--radix-toast-swipe-move-x);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}@media(min-width:40rem){.sm\:top-auto{top:auto}.sm\:right-0{right:calc(var(--spacing) * 0)}.sm\:bottom-0{bottom:calc(var(--spacing) * 0)}.sm\:inline{display:inline}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-col{flex-direction:column}.sm\:flex-row{flex-direction:row}.sm\:items-end{align-items:flex-end}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-7{padding:calc(var(--spacing) * 7)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:pt-10{padding-top:calc(var(--spacing) * 10)}.sm\:pb-2{padding-bottom:calc(var(--spacing) * 2)}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.sm\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100% }}@media(min-width:48rem){.md\:absolute{position:absolute}.md\:inline{display:inline}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-end{align-items:flex-end}.md\:gap-8{gap:calc(var(--spacing) * 8)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[1\.2fr_1fr\]{grid-template-columns:1.2fr 1fr}}@media(prefers-color-scheme:dark){.dark\:border-destructive{border-color:var(--destructive)}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing) * 0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\+div\]\:text-xs+div{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}:is(.rtl\:\*\*\:\[\.rdp-button\\_next\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg),:is(.rtl\:\*\*\:\[\.rdp-button\\_previous\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\>span\]\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:top-4>svg{top:calc(var(--spacing) * 4)}.\[\&\>svg\]\:left-4>svg{left:calc(var(--spacing) * 4)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-3\.5>svg{height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:w-3\.5>svg{width:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-foreground>svg{color:var(--foreground)}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:calc(var(--spacing) * 7)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:#0000}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto)))))}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto)))))}to{height:0}}:root{--background:#fff;--foreground:#212121;--card:#fff;--card-foreground:#212121;--popover:#fff;--popover-foreground:#212121;--primary:#ff2974;--primary-foreground:#fff;--secondary:#f3f2f2;--secondary-foreground:#212121;--muted:#f3f2f2;--muted-foreground:#7a7a7a;--accent:#f3f2f2;--accent-foreground:#212121;--destructive:#f5242e;--destructive-foreground:#fff;--border:#e8e8e8;--input:#e8e8e8;--ring:#212121;--radius:.5rem;--neutral-0:#fff;--neutral-50:#fafafa;--neutral-100:#f5f4f4;--neutral-200:#e7e7e7;--neutral-300:#d8d8d8;--neutral-400:#aaa;--neutral-500:#7a7a7a;--neutral-600:#5b5b5b;--neutral-700:#464646;--neutral-800:#2a2a2a;--neutral-900:#212121;--neutral-950:#1b1b1b;--neutral-1000:#101010;--brand-100:#ff2882;--brand-60:#ff288299;--brand-30:#ff28824d;--brand-10:#ff28821a;--brand-seafoam:#b6cfd0;--brand-dusty-teal:#6ba4b8;--brand-black-aqua:#002f38;--brand-deep-teal-blue:#07272d;--visualizer-rose-pop:#fd4b96;--visualizer-indigo-breeze:#6366f1;--visualizer-emerald-mint:#10b981;--visualizer-golden-amber:#f59e0b;--visualizer-royal-blue:#1d4ed8;--visualizer-crimson-spark:#ef4444;--visualizer-aqua-glow:#06b6d4;--visualizer-sunbeam-yellow:#facc15;--bg-subtle:#2a2a2a0a;--bg-subtle-hover:#2a2a2a0f;--bg-base:#ffffffe0;--bg-base-opaque:#fff;--bg-menu:#fff;--bg-chat:#fcfcfc;--bg-chat-nav:#f4f4f4;--fg-base:#212121;--fg-subtle:#7a7a7a;--fg-muted:#aaa;--fg-disabled:#d8d8d8;--border-base:#2a2a2a0a;--border-strong:#2a2a2a14;--border-contrast:#2a2a2a1f;--border-focus:#2a2a2a66;--tag-blue-10:#5bb5ff1a;--tag-blue-100:#5bb5ff;--tag-yellow-10:#dec3781a;--tag-yellow-100:#dec378;--tag-purple-10:#908eb81a;--tag-purple-100:#908eb8;--tag-cyan-10:#74ada41a;--tag-cyan-100:#74ada4;--tag-pink-10:#b88ea71a;--tag-pink-100:#b88ea7;--tag-orange-10:#b8a08e1a;--tag-orange-100:#b8a08e;--gradient-max-dark:linear-gradient(213deg, #8c421d 2%, #fbe67b 31%, #fcfbe7 53%, #f7d14e 77%, #d4a041 100%);--gradient-max-light:linear-gradient(125deg, #8c421d 22%, #d2af00 47%, #cd9124 67%, #d4a041 88%);--gradient-pro-dark:linear-gradient(213deg, #7a96ac 1%, #c5d6e2 27%, #eaeff3 47%, #c5d6e2 65%, #a3bccf 89%);--gradient-pro-light:linear-gradient(129deg, #7a96ac 4%, #6d7f8d 27%, #9fb9ce 55%, #6d7f8d 90%);--gradient-plus-dark:linear-gradient(214deg, #986732 0%, #a7825b 23%, #f6d0ab 45%, #a07043 66%, #9d774e 100%);--gradient-plus-light:linear-gradient(129deg, #9e8976 5%, #7a5e50 19%, #f6d0ab 35%, #9d774e 49%, #c99b70 65%, #795f52 78%);--gradient-upgrade-dark:linear-gradient(214deg, #ffedf3 0%, #ff9fbf 30%, #fd5d92 59%, #ffdab2 100%);--gradient-upgrade-light:linear-gradient(32deg, #fc3bb2 6%, #f7906e 79%);--gradient-new-function:linear-gradient(33deg, #6e86ff 17%, #ff2882 55%, #ff98a4 103%);--gradient-suggestion:linear-gradient(32deg, #fd538c 4%, #5aa6e0 47%, #ffdab2 98%);--gradient-g1:linear-gradient(189deg, #ffacc6 6%, #b6e0f5 99%);--gradient-g2:linear-gradient(34deg, #9796f0 9%, #fbc7d4 84%);--gradient-g3:linear-gradient(to right, #ed4264, #ffedbc);--gradient-g4:linear-gradient(232deg, #fedc2a 4%, #dd5789 56%, #7a2c9e 104%);--gradient-g5:linear-gradient(32deg, #fc3bb2 6%, #f7906e 79%);--gradient-max:var(--gradient-max-light);--gradient-pro:var(--gradient-pro-light);--gradient-plus:var(--gradient-plus-light);--gradient-upgrade:var(--gradient-upgrade-light);--spacing-2:2px;--spacing-4:4px;--spacing-6:6px;--spacing-8:8px;--spacing-10:10px;--spacing-12:12px;--spacing-16:16px;--spacing-24:24px;--spacing-32:32px;--spacing-40:40px;--spacing-64:64px;--spacing-96:96px;--spacing-128:128px;--radius-2:2px;--radius-4:4px;--radius-6:6px;--radius-8:8px;--radius-10:10px;--radius-12:12px;--radius-16:16px;--radius-20:20px;--radius-24:24px;--radius-full:999px;--font-family-header:"Lato", "PingFang SC", sans-serif;--font-family-body:"Lato", "PingFang SC", sans-serif;--font-family-code:"Roboto Mono", monospace}.dark{--background:#171717;--foreground:#e8e8e8;--card:#171717;--card-foreground:#e8e8e8;--popover:#262626;--popover-foreground:#e8e8e8;--primary:#ff2974;--primary-foreground:#fff;--secondary:#292929;--secondary-foreground:#e8e8e8;--muted:#292929;--muted-foreground:#ababab;--accent:#292929;--accent-foreground:#e8e8e8;--destructive:#ff4c4f;--destructive-foreground:#fff;--border:#333;--input:#333;--ring:#e7e7e7;--gradient-max:var(--gradient-max-dark);--gradient-pro:var(--gradient-pro-dark);--gradient-plus:var(--gradient-plus-dark);--gradient-upgrade:var(--gradient-upgrade-dark);--bg-subtle:#ffffff0a;--bg-subtle-hover:#ffffff1f;--bg-base:#2a2a2acc;--bg-base-opaque:#171717;--bg-menu:#252525;--bg-chat:#101010;--bg-chat-nav:#171717;--fg-base:#e7e7e7;--fg-subtle:#aaa;--fg-muted:#7a7a7a;--fg-disabled:#5b5b5b;--border-base:#ffffff0a;--border-strong:#ffffff14;--border-contrast:#ffffff1f;--border-focus:#fff6}@media(max-width:768px){:root{--spacing-96:64px;--spacing-128:64px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}
quanxue/assets/quanxue-sLzXMlPk.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Br42UDbl.js","./index-BlGQAcOD.js","./client-BlQxAbrl.js","./index-tKuM8enU.js","./App-BVPCfY98.js","./jsx-dev-runtime-Czb3f8pQ.js","./App-AJceFVqW.css","./ErrorBoundary-DwultlP_.js"])))=>i.map(i=>d[i]);
2
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))d(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const a of t.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&d(a)}).observe(document,{childList:!0,subtree:!0});function s(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function d(e){if(e.ep)return;e.ep=!0;const t=s(e);fetch(e.href,t)}})();const E="modulepreload",v=function(o,n){return new URL(o,n).href},w={},y=function(n,s,d){let e=Promise.resolve();if(s&&s.length>0){let a=function(i){return Promise.all(i.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const l=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));e=a(s.map(i=>{if(i=v(i,d),i in w)return;w[i]=!0;const u=i.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(!!d)for(let m=l.length-1;m>=0;m--){const g=l[m];if(g.href===i&&(!u||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${p}`))return;const r=document.createElement("link");if(r.rel=u?"stylesheet":E,u||(r.as="script"),r.crossOrigin="",r.href=i,h&&r.setAttribute("nonce",h),document.head.appendChild(r),u)return new Promise((m,g)=>{r.addEventListener("load",m),r.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${i}`)))})}))}function t(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return e.then(a=>{for(const l of a||[])l.status==="rejected"&&t(l.reason);return n().catch(t)})},_="__dep_reload",L=6,O=6e4;function P(){try{return JSON.parse(sessionStorage.getItem(_)||"{}")}catch{return{c:0,t:0}}}async function R(){const o=document.getElementById("root");try{let n=function(){if(!document.querySelector("[data-surf-placeholder]"))try{window.parent.postMessage({type:"surf-app-ready"},"*")}catch{}};const s=await y(()=>import("./index-Br42UDbl.js").then(c=>c.i),__vite__mapDeps([0,1]),import.meta.url);if(typeof s.useState!="function")throw new Error("dep-stub");const{createElement:d}=s,{createRoot:e,hydrateRoot:t}=await y(async()=>{const{createRoot:c,hydrateRoot:r}=await import("./client-BlQxAbrl.js").then(m=>m.c);return{createRoot:c,hydrateRoot:r}},__vite__mapDeps([2,1]),import.meta.url),{QueryClient:a,QueryClientProvider:l}=await y(async()=>{const{QueryClient:c,QueryClientProvider:r}=await import("./index-tKuM8enU.js");return{QueryClient:c,QueryClientProvider:r}},__vite__mapDeps([3,0,1]),import.meta.url),{default:f}=await y(async()=>{const{default:c}=await import("./App-BVPCfY98.js").then(r=>r.A);return{default:c}},__vite__mapDeps([4,5,1,0,6]),import.meta.url),{default:h}=await y(async()=>{const{default:c}=await import("./ErrorBoundary-DwultlP_.js");return{default:c}},__vite__mapDeps([7,5,1,0]),import.meta.url),i=new a({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,retryDelay:c=>Math.min(1e3*2**c,1e4),staleTime:3e4}}}),u=d(h,null,d(l,{client:i},d(f))),p=!!o.querySelector("[data-surf-placeholder]");o.childNodes.length>0&&o.innerHTML!=="<!--ssr-outlet-->"&&!p?t(o,u):(o.innerHTML="",e(o).render(u)),window.__reactOk=!0,sessionStorage.removeItem(_),n(),new MutationObserver(n).observe(o,{childList:!0,subtree:!0})}catch{const n=P(),s=Date.now()-n.t>O?0:n.c;s<L?(o.innerHTML=['<div style="padding:24px;text-align:center;font-family:system-ui,sans-serif">','<p style="color:#3b82f6;font-weight:600;margin:0 0 4px">Loading dependencies...</p>','<p style="color:#3b82f6;opacity:0.7;font-size:12px;margin:0">Reloading automatically</p>',"</div>"].join(""),sessionStorage.setItem(_,JSON.stringify({c:s+1,t:Date.now()})),setTimeout(()=>location.reload(),3e3+s*1e3)):o.innerHTML=['<div style="padding:24px;text-align:center;font-family:system-ui,sans-serif">','<p style="color:#c0392b;font-weight:600;margin:0 0 4px">Failed to load dependencies</p>','<p style="color:#c0392b;opacity:0.8;font-size:12px;margin:0">Please refresh the page</p>',"</div>"].join("")}}R();export{y as _};