karin-plugin-kkk 2.31.1 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM } from "./rolldown-runtime.js";
2
- import { $ as SiHonor, $n as require_protobufjs, $t as Moon, A as RiGroupLine, An as CircleEllipsis, At as Square, B as RiStarLine, Bn as Bookmark, Bt as ScanLine, C as BiImage, Cn as CornerDownLeft, Ct as UserPlus, D as AiOutlineVideoCamera, Dn as Clapperboard, Dt as Terminal, E as AiFillStar, En as Clock, Et as Trash2, F as RiLiveLine, Fn as ChartColumn, Ft as Shield, G as RiVerifiedBadgeFill, Gn as clsx, Gt as Quote, H as RiTiktokFill, Hn as ArrowDownToLine, Ht as RotateCcw, I as RiMessage3Fill, In as Camera, It as ShieldCheck, J as SiVivo, Jn as require_react, Jt as Plus, K as RiVideoLine, Kn as require_jsx_runtime, Kt as QrCode, L as RiPieChart2Fill, Ln as Calendar, Lt as Share2, M as RiHeart3Fill, Mn as CircleCheckBig, Mt as Sparkles, N as RiHeart3Line, Nn as CircleAlert, Nt as Smartphone, O as Markdown, On as CircleQuestionMark, Ot as Sun, P as RiHeartLine, Pn as Check, Pt as ShoppingBag, Q as SiHuawei, Qn as require_heic_decode, Qt as Music, R as RiShareForwardFill, Rn as Box, Rt as Settings2, S as FaUserGroup, Sn as Cpu, St as User, T as AiFillPushpin, Tn as Code, Tt as TriangleAlert, U as RiTrophyFill, Un as Chip, Ut as RefreshCw, V as RiThumbUpFill, Vn as BellRing, Vt as Save, W as RiUserFollowLine, Wn as Button, Wt as Radio, X as SiOppo, Xn as require_jsQR, Xt as Pencil, Y as SiSamsung, Yn as require_png, Yt as Play, Z as SiOneplus, Zn as require_jpeg_js, Zt as Palette, _ as MdLocationOn, _n as Eye, _t as X, a as purify, an as LoaderCircle, at as o, b as FaMusic, bn as Download, bt as Users, c as VictoryLine, cn as Info, ct as n, d as VictoryLabel, dn as Hash, dt as parse, en as Monitor, er as Chalk, et as SiGooglephotos, f as VictoryTheme, fn as GitBranch, ft as fromUnixTime, g as MdLightbulbOutline, gn as FilePlay, gt as Zap, h as MdInfoOutline, hn as FileText, ht as differenceInSeconds, i as Window, in as MapPin, it as SiAnthropic, j as RiHashtag, jn as CircleCheck, jt as SquarePen, k as RiArrowRightFill, kn as CircleFadingArrowUp, kt as Star, l as VictoryChart, ln as Image$1, lt as c, m as MdFitScreen, mn as Gamepad2, mt as format, n as require_lib, nn as Menu, nr as zod_default, nt as SiBilibili, o as VictoryScatter, on as Link, ot as m, p as rehypeHighlight, pn as Gift, pt as formatDistanceToNow, q as SiXiaomi, qn as require_server_node, qt as Puzzle, r as require_qr_code_styling, rn as Maximize, rt as SiApple, s as VictoryPie, sn as LayoutTemplate, st as a, t as createProxyMiddleware, tn as MessageCircle, tr as Xhshow, tt as SiGithub, u as VictoryAxis, un as Heart, ut as zhCN, v as MdSchedule, vn as EyeOff, vt as WandSparkles, w as AiFillHeart, wn as Copy, wt as Upload, x as FaTiktok, xn as Crown, xt as UsersRound, y as FaCommentDots, yn as ExternalLink, yt as Video, z as RiStarFill, zn as Bot, zt as Search } from "./vendor.js";
2
+ import { $ as SiGooglephotos, $t as Moon, A as RiHashtag, An as CircleEllipsis, At as Square, B as RiThumbUpFill, Bn as Bookmark, Bt as ScanLine, C as AiFillHeart, Cn as CornerDownLeft, Ct as UserPlus, D as Markdown, Dn as Clapperboard, Dt as Terminal, E as AiOutlineVideoCamera, En as Clock, Et as Trash2, F as RiMessage3Fill, Fn as ChartColumn, Ft as Shield, G as RiVideoLine, Gn as clsx, Gt as Quote, H as RiTrophyFill, Hn as ArrowDownToLine, Ht as RotateCcw, I as RiPieChart2Fill, In as Camera, It as ShieldCheck, J as SiSamsung, Jn as require_react, Jt as Plus, K as SiXiaomi, Kn as require_jsx_runtime, Kt as QrCode, L as RiShareForwardFill, Ln as Calendar, Lt as Share2, M as RiHeart3Line, Mn as CircleCheckBig, Mt as Sparkles, N as RiHeartLine, Nn as CircleAlert, Nt as Smartphone, O as RiArrowRightFill, On as CircleQuestionMark, Ot as Sun, P as RiLiveLine, Pn as Check, Pt as ShoppingBag, Q as SiHonor, Qn as zod_default, Qt as Music, R as RiStarFill, Rn as Box, Rt as Settings2, S as BiImage, Sn as Cpu, St as User, T as AiFillStar, Tn as Code, Tt as TriangleAlert, U as RiUserFollowLine, Un as Chip, Ut as RefreshCw, V as RiTiktokFill, Vn as BellRing, Vt as Save, W as RiVerifiedBadgeFill, Wn as Button, Wt as Radio, X as SiOneplus, Xn as Chalk, Xt as Pencil, Y as SiOppo, Yn as require_protobufjs, Yt as Play, Z as SiHuawei, Zn as Xhshow, Zt as Palette, _ as MdSchedule, _n as Eye, _t as X, a as VictoryScatter, an as LoaderCircle, at as m, b as FaTiktok, bn as Download, bt as Users, c as VictoryChart, cn as Info, ct as c, d as VictoryTheme, dn as Hash, dt as fromUnixTime, en as Monitor, et as SiGithub, f as rehypeHighlight, fn as GitBranch, ft as formatDistanceToNow, g as MdLocationOn, gn as FilePlay, gt as Zap, h as MdLightbulbOutline, hn as FileText, ht as twMerge, i as require_heic_decode, in as MapPin, it as o, j as RiHeart3Fill, jn as CircleCheck, jt as SquarePen, k as RiGroupLine, kn as CircleFadingArrowUp, kt as Star, l as VictoryAxis, ln as Image$1, lt as zhCN, m as MdInfoOutline, mn as Gamepad2, mt as differenceInSeconds, n as require_lib, nn as Menu, nt as SiApple, o as VictoryPie, on as Link, ot as a, p as MdFitScreen, pn as Gift, pt as format, q as SiVivo, qn as require_server_node, qt as Puzzle, r as require_jpeg_js, rn as Maximize, rt as SiAnthropic, s as VictoryLine, sn as LayoutTemplate, st as n, t as createProxyMiddleware, tn as MessageCircle, tt as SiBilibili, u as VictoryLabel, un as Heart, ut as parse, v as FaCommentDots, vn as EyeOff, vt as WandSparkles, w as AiFillPushpin, wn as Copy, wt as Upload, x as FaUserGroup, xn as Crown, xt as UsersRound, y as FaMusic, yn as ExternalLink, yt as Video, z as RiStarLine, zn as Bot, zt as Search } from "./vendor.js";
3
3
  import "node:module";
4
4
  import fs from "node:fs";
5
5
  import path, { resolve } from "node:path";
@@ -15,8 +15,10 @@ import { karinPathBase, karinPathTemp as karinPathTemp$1 } from "node-karin/root
15
15
  import sqlite3 from "node-karin/sqlite3";
16
16
  import YAML from "node-karin/yaml";
17
17
  import util from "node:util";
18
+ import { generate, scan } from "@ikenxuan/qrcode";
18
19
  import { Transform } from "node:stream";
19
20
  import { pipeline } from "node:stream/promises";
21
+ import { inflateSync } from "node:zlib";
20
22
  import { embedWatermarkToPngBytes } from "@ikenxuan/watermark";
21
23
  import { snapka } from "@karinjs/plugin-puppeteer";
22
24
  import { newInjectedPage } from "fingerprint-injector";
@@ -3280,7 +3282,6 @@ var XBogus = class {
3280
3282
  const array2 = this.md5StrToArray(this.md5(this.md5StrToArray("d41d8cd98f00b204e9800998ecf8427e")));
3281
3283
  const urlEncryptedArray = this.md5Encrypt(urlPath);
3282
3284
  const timestamp = Math.floor(Date.now() / 1e3);
3283
- const ct = 536919696;
3284
3285
  const newArray = [
3285
3286
  64,
3286
3287
  1,
@@ -3296,10 +3297,10 @@ var XBogus = class {
3296
3297
  timestamp >> 16 & 255,
3297
3298
  timestamp >> 8 & 255,
3298
3299
  timestamp & 255,
3299
- ct >> 24 & 255,
3300
- ct >> 16 & 255,
3301
- ct >> 8 & 255,
3302
- ct & 255
3300
+ 32,
3301
+ 0,
3302
+ 190,
3303
+ 144
3303
3304
  ];
3304
3305
  let xorResult = newArray[0];
3305
3306
  for (let i = 1; i < newArray.length; i++) xorResult ^= newArray[i];
@@ -6296,7 +6297,7 @@ var captureKuaishouEncodeStack = () => {
6296
6297
  * @returns 用于 `SECS.s` 的栈尾字符串
6297
6298
  */
6298
6299
  var deriveKuaishouSecsStackTail = (stack = captureKuaishouEncodeStack()) => {
6299
- return stack.length > KUAISHOU_SECS_STACK_LIMIT ? stack.slice(-KUAISHOU_SECS_STACK_LIMIT) : stack;
6300
+ return stack.length > KUAISHOU_SECS_STACK_LIMIT ? stack.slice(-100) : stack;
6300
6301
  };
6301
6302
  /**
6302
6303
  * 构造快手 `window.SECS` 的纯算法等价状态。
@@ -10906,585 +10907,6 @@ var formatBuildTime = (isoString) => {
10906
10907
  const date = new Date(isoString);
10907
10908
  return `${date.getFullYear()}年${String(date.getMonth() + 1).padStart(2, "0")}月${String(date.getDate()).padStart(2, "0")}日 ${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
10908
10909
  };
10909
- //#endregion
10910
- //#region src/module/utils/QRCodeScanner.ts
10911
- var import_heic_decode = /* @__PURE__ */ __toESM(require_heic_decode(), 1);
10912
- var import_jpeg_js = /* @__PURE__ */ __toESM(require_jpeg_js(), 1);
10913
- var import_jsQR = /* @__PURE__ */ __toESM(require_jsQR(), 1);
10914
- var import_png = require_png();
10915
- /**
10916
- * 二维码扫描工具类
10917
- *
10918
- * 使用纯 JavaScript 实现,无需任何 native 模块依赖
10919
- *
10920
- * 支持的图片格式:
10921
- * - PNG (使用 pngjs)
10922
- * - JPEG/JPG (使用 jpeg-js)
10923
- * - HEIC/HEIF (使用 heic-decode,基于 WASM)
10924
- *
10925
- * 注意:所有图片解码库均为纯 JavaScript/WASM 实现,
10926
- * 不依赖任何 native 模块,可在任何平台上运行
10927
- */
10928
- var QRCodeScanner = class {
10929
- /**
10930
- * 从图片 URL 识别二维码
10931
- * @param imageUrl 图片 URL
10932
- * @returns 二维码内容,如果没有识别到则返回 null
10933
- */
10934
- static async scanFromUrl(imageUrl) {
10935
- try {
10936
- const response = await axios.get(imageUrl, { responseType: "arraybuffer" });
10937
- const buffer = Buffer.from(response.data);
10938
- if (!this.detectImageFormat(buffer)) {
10939
- logger.debug("URL 内容不是支持的图片格式,跳过二维码扫描");
10940
- return null;
10941
- }
10942
- return this.scanFromBuffer(buffer);
10943
- } catch (error) {
10944
- logger.error("识别二维码时发生错误:", error);
10945
- return null;
10946
- }
10947
- }
10948
- /**
10949
- * 提取图片的一个区域
10950
- * @param imageData 原始图片数据
10951
- * @param x 起始 x 坐标
10952
- * @param y 起始 y 坐标
10953
- * @param width 区域宽度
10954
- * @param height 区域高度
10955
- * @returns 区域图片数据
10956
- */
10957
- static extractRegion(imageData, x, y, width, height) {
10958
- const newData = new Uint8ClampedArray(width * height * 4);
10959
- for (let dy = 0; dy < height; dy++) for (let dx = 0; dx < width; dx++) {
10960
- const srcX = x + dx;
10961
- const srcY = y + dy;
10962
- if (srcX >= imageData.width || srcY >= imageData.height) continue;
10963
- const srcIndex = (srcY * imageData.width + srcX) * 4;
10964
- const dstIndex = (dy * width + dx) * 4;
10965
- newData[dstIndex] = imageData.data[srcIndex];
10966
- newData[dstIndex + 1] = imageData.data[srcIndex + 1];
10967
- newData[dstIndex + 2] = imageData.data[srcIndex + 2];
10968
- newData[dstIndex + 3] = imageData.data[srcIndex + 3];
10969
- }
10970
- return {
10971
- width,
10972
- height,
10973
- data: newData
10974
- };
10975
- }
10976
- /**
10977
- * 增强图片对比度(用于提高二维码识别率)
10978
- * @param imageData 图片数据
10979
- * @returns 增强后的图片数据
10980
- */
10981
- static enhanceContrast(imageData) {
10982
- const { width, height, data } = imageData;
10983
- const newData = new Uint8ClampedArray(data.length);
10984
- const histogram = new Array(256).fill(0);
10985
- for (let i = 0; i < data.length; i += 4) {
10986
- const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
10987
- histogram[gray]++;
10988
- }
10989
- const cdf = new Array(256).fill(0);
10990
- cdf[0] = histogram[0];
10991
- for (let i = 1; i < 256; i++) cdf[i] = cdf[i - 1] + histogram[i];
10992
- const totalPixels = width * height;
10993
- const cdfMin = cdf.find((v) => v > 0) || 0;
10994
- for (let i = 0; i < data.length; i += 4) {
10995
- const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
10996
- const newGray = Math.floor((cdf[gray] - cdfMin) / (totalPixels - cdfMin) * 255);
10997
- newData[i] = newGray;
10998
- newData[i + 1] = newGray;
10999
- newData[i + 2] = newGray;
11000
- newData[i + 3] = data[i + 3];
11001
- }
11002
- return {
11003
- width,
11004
- height,
11005
- data: newData
11006
- };
11007
- }
11008
- /**
11009
- * 二值化处理(用于提高小二维码识别率)
11010
- * @param imageData 图片数据
11011
- * @param threshold 阈值(0-255),默认自动计算
11012
- * @returns 二值化后的图片数据
11013
- */
11014
- static binarize(imageData, threshold) {
11015
- const { width, height, data } = imageData;
11016
- const newData = new Uint8ClampedArray(data.length);
11017
- if (threshold === void 0) {
11018
- const histogram = new Array(256).fill(0);
11019
- for (let i = 0; i < data.length; i += 4) {
11020
- const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
11021
- histogram[gray]++;
11022
- }
11023
- const total = width * height;
11024
- let sum = 0;
11025
- for (let i = 0; i < 256; i++) sum += i * histogram[i];
11026
- let sumB = 0;
11027
- let wB = 0;
11028
- let wF = 0;
11029
- let maxVariance = 0;
11030
- threshold = 0;
11031
- for (let t = 0; t < 256; t++) {
11032
- wB += histogram[t];
11033
- if (wB === 0) continue;
11034
- wF = total - wB;
11035
- if (wF === 0) break;
11036
- sumB += t * histogram[t];
11037
- const mB = sumB / wB;
11038
- const mF = (sum - sumB) / wF;
11039
- const variance = wB * wF * (mB - mF) * (mB - mF);
11040
- if (variance > maxVariance) {
11041
- maxVariance = variance;
11042
- threshold = t;
11043
- }
11044
- }
11045
- }
11046
- for (let i = 0; i < data.length; i += 4) {
11047
- const binary = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]) > threshold ? 255 : 0;
11048
- newData[i] = binary;
11049
- newData[i + 1] = binary;
11050
- newData[i + 2] = binary;
11051
- newData[i + 3] = data[i + 3];
11052
- }
11053
- return {
11054
- width,
11055
- height,
11056
- data: newData
11057
- };
11058
- }
11059
- /**
11060
- * 锐化处理(增强边缘)
11061
- * @param imageData 图片数据
11062
- * @returns 锐化后的图片数据
11063
- */
11064
- static sharpen(imageData) {
11065
- const { width, height, data } = imageData;
11066
- const newData = new Uint8ClampedArray(data.length);
11067
- const kernel = [
11068
- 0,
11069
- -1,
11070
- 0,
11071
- -1,
11072
- 5,
11073
- -1,
11074
- 0,
11075
- -1,
11076
- 0
11077
- ];
11078
- for (let y = 1; y < height - 1; y++) for (let x = 1; x < width - 1; x++) {
11079
- let r = 0, g = 0, b = 0;
11080
- for (let ky = -1; ky <= 1; ky++) for (let kx = -1; kx <= 1; kx++) {
11081
- const idx = ((y + ky) * width + (x + kx)) * 4;
11082
- const k = kernel[(ky + 1) * 3 + (kx + 1)];
11083
- r += data[idx] * k;
11084
- g += data[idx + 1] * k;
11085
- b += data[idx + 2] * k;
11086
- }
11087
- const idx = (y * width + x) * 4;
11088
- newData[idx] = Math.max(0, Math.min(255, r));
11089
- newData[idx + 1] = Math.max(0, Math.min(255, g));
11090
- newData[idx + 2] = Math.max(0, Math.min(255, b));
11091
- newData[idx + 3] = data[idx + 3];
11092
- }
11093
- for (let x = 0; x < width; x++) {
11094
- const topIdx = x * 4;
11095
- const bottomIdx = ((height - 1) * width + x) * 4;
11096
- for (let c = 0; c < 4; c++) {
11097
- newData[topIdx + c] = data[topIdx + c];
11098
- newData[bottomIdx + c] = data[bottomIdx + c];
11099
- }
11100
- }
11101
- for (let y = 0; y < height; y++) {
11102
- const leftIdx = y * width * 4;
11103
- const rightIdx = (y * width + width - 1) * 4;
11104
- for (let c = 0; c < 4; c++) {
11105
- newData[leftIdx + c] = data[leftIdx + c];
11106
- newData[rightIdx + c] = data[rightIdx + c];
11107
- }
11108
- }
11109
- return {
11110
- width,
11111
- height,
11112
- data: newData
11113
- };
11114
- }
11115
- /**
11116
- * 在图片区域中尝试识别二维码
11117
- * @param imageData 图片数据
11118
- * @param regionName 区域名称(用于日志)
11119
- * @returns 二维码内容或 null
11120
- */
11121
- static tryRecognizeInRegion(imageData, regionName) {
11122
- for (const strategy of [
11123
- {
11124
- name: "默认",
11125
- enhance: false,
11126
- binarize: false,
11127
- sharpen: false,
11128
- options: void 0
11129
- },
11130
- {
11131
- name: "二值化",
11132
- enhance: false,
11133
- binarize: true,
11134
- sharpen: false,
11135
- options: void 0
11136
- },
11137
- {
11138
- name: "锐化",
11139
- enhance: false,
11140
- binarize: false,
11141
- sharpen: true,
11142
- options: void 0
11143
- },
11144
- {
11145
- name: "增强对比度",
11146
- enhance: true,
11147
- binarize: false,
11148
- sharpen: false,
11149
- options: void 0
11150
- },
11151
- {
11152
- name: "增强+二值化",
11153
- enhance: true,
11154
- binarize: true,
11155
- sharpen: false,
11156
- options: void 0
11157
- },
11158
- {
11159
- name: "锐化+二值化",
11160
- enhance: false,
11161
- binarize: true,
11162
- sharpen: true,
11163
- options: void 0
11164
- },
11165
- {
11166
- name: "attemptBoth",
11167
- enhance: false,
11168
- binarize: false,
11169
- sharpen: false,
11170
- options: { inversionAttempts: "attemptBoth" }
11171
- },
11172
- {
11173
- name: "二值化+attemptBoth",
11174
- enhance: false,
11175
- binarize: true,
11176
- sharpen: false,
11177
- options: { inversionAttempts: "attemptBoth" }
11178
- }
11179
- ]) try {
11180
- logger.debug(` 尝试策略: ${strategy.name}`);
11181
- let processedData = imageData;
11182
- if (strategy.sharpen) processedData = this.sharpen(processedData);
11183
- if (strategy.enhance) processedData = this.enhanceContrast(processedData);
11184
- if (strategy.binarize) processedData = this.binarize(processedData);
11185
- const code = (0, import_jsQR.default)(processedData.data, processedData.width, processedData.height, strategy.options);
11186
- if (code && code.data) {
11187
- logger.debug(`✓ 成功识别二维码 [区域: ${regionName}] [策略: ${strategy.name}]`);
11188
- logger.debug(` 二维码内容: ${code.data}`);
11189
- return code.data;
11190
- } else logger.debug(` 策略 ${strategy.name} 未识别到二维码`);
11191
- } catch (err) {
11192
- logger.debug(` 策略 ${strategy.name} 执行失败: ${err}`);
11193
- }
11194
- logger.debug(` 区域 ${regionName} 识别失败,尝试下一个区域`);
11195
- return null;
11196
- }
11197
- /**
11198
- * 检测图片格式
11199
- * @param buffer 图片 Buffer
11200
- * @returns 图片格式或 null
11201
- */
11202
- static detectImageFormat(buffer) {
11203
- if (buffer.length >= 8 && buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71) return "png";
11204
- if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) return "jpeg";
11205
- if (buffer.length >= 12) {
11206
- if (buffer.toString("ascii", 4, 8) === "ftyp") {
11207
- const brand = buffer.toString("ascii", 8, 12);
11208
- if (brand === "heic" || brand === "heix" || brand === "hevc" || brand === "hevx" || brand === "mif1" || brand === "msf1") return "heic";
11209
- }
11210
- }
11211
- if (buffer.length >= 6 && buffer[0] === 71 && buffer[1] === 73 && buffer[2] === 70 && buffer[3] === 56) return "gif";
11212
- if (buffer.length >= 2 && buffer[0] === 66 && buffer[1] === 77) return "bmp";
11213
- if (buffer.length >= 12 && buffer[0] === 82 && buffer[1] === 73 && buffer[2] === 70 && buffer[3] === 70 && buffer[8] === 87 && buffer[9] === 69 && buffer[10] === 66 && buffer[11] === 80) return "webp";
11214
- return null;
11215
- }
11216
- /**
11217
- * 解析 PNG 图片
11218
- * @param buffer 图片 Buffer
11219
- * @returns 图片数据或 null
11220
- */
11221
- static parsePNG(buffer) {
11222
- try {
11223
- const png = import_png.PNG.sync.read(buffer);
11224
- logger.debug(`PNG 解析成功: ${png.width}x${png.height}`);
11225
- return {
11226
- width: png.width,
11227
- height: png.height,
11228
- data: Uint8ClampedArray.from(png.data)
11229
- };
11230
- } catch (err) {
11231
- logger.warn("PNG 解析失败:", err);
11232
- return null;
11233
- }
11234
- }
11235
- /**
11236
- * 解析 JPEG 图片
11237
- * @param buffer 图片 Buffer
11238
- * @returns 图片数据或 null
11239
- */
11240
- static parseJPEG(buffer) {
11241
- try {
11242
- const decoded = import_jpeg_js.default.decode(buffer, { useTArray: true });
11243
- logger.debug(`JPEG 解析成功: ${decoded.width}x${decoded.height}`);
11244
- return {
11245
- width: decoded.width,
11246
- height: decoded.height,
11247
- data: Uint8ClampedArray.from(decoded.data)
11248
- };
11249
- } catch (err) {
11250
- logger.warn("JPEG 解析失败:", err);
11251
- return null;
11252
- }
11253
- }
11254
- /**
11255
- * 解析 HEIC/HEIF 图片
11256
- * @param buffer 图片 Buffer
11257
- * @returns 图片数据或 null
11258
- */
11259
- static async parseHEIC(buffer) {
11260
- try {
11261
- const decoded = await (0, import_heic_decode.default)({ buffer });
11262
- logger.debug(`HEIC 解析成功: ${decoded.width}x${decoded.height}`);
11263
- return {
11264
- width: decoded.width,
11265
- height: decoded.height,
11266
- data: Uint8ClampedArray.from(decoded.data)
11267
- };
11268
- } catch (err) {
11269
- logger.warn("HEIC 解析失败:", err);
11270
- return null;
11271
- }
11272
- }
11273
- /**
11274
- * 解析图片 Buffer 为像素数据
11275
- * @param buffer 图片 Buffer
11276
- * @returns 图片数据或 null
11277
- */
11278
- static async parseImageBuffer(buffer) {
11279
- try {
11280
- const format = this.detectImageFormat(buffer);
11281
- logger.debug(`检测到图片格式: ${format || "未知"}`);
11282
- if (!format) {
11283
- logger.warn("无法识别图片格式");
11284
- return null;
11285
- }
11286
- switch (format) {
11287
- case "png": return this.parsePNG(buffer);
11288
- case "jpeg": return this.parseJPEG(buffer);
11289
- case "heic": return await this.parseHEIC(buffer);
11290
- default:
11291
- logger.warn(`不支持的图片格式: ${format}`);
11292
- return null;
11293
- }
11294
- } catch (err) {
11295
- logger.warn("图片解析失败:", err);
11296
- return null;
11297
- }
11298
- }
11299
- /**
11300
- * 从图片 Buffer 识别二维码
11301
- * @param buffer 图片 Buffer
11302
- * @returns 二维码内容,如果没有识别到则返回 null
11303
- */
11304
- static async scanFromBuffer(buffer) {
11305
- try {
11306
- const imageData = await this.parseImageBuffer(buffer);
11307
- if (!imageData) return null;
11308
- const { width, height } = imageData;
11309
- const dataSizeMB = (width * height * 4 / 1024 / 1024).toFixed(2);
11310
- logger.debug(`图片数据: ${width}x${height}, 内存占用: ${dataSizeMB}MB`);
11311
- if (width <= 1024 && height <= 1024) {
11312
- logger.debug("图片尺寸较小,使用全图识别策略");
11313
- const result = this.tryRecognizeInRegion(imageData, "全图");
11314
- if (result) return result;
11315
- }
11316
- logger.debug(`使用分块扫描策略 (${width}x${height})`);
11317
- const scanRegions = [];
11318
- const smallBlock = Math.min(400, Math.floor(Math.min(width, height) * .3));
11319
- const mediumBlock = Math.min(600, Math.floor(Math.min(width, height) * .5));
11320
- const largeBlock = Math.min(800, Math.floor(Math.max(width, height) * .6));
11321
- logger.debug("添加四角小块扫描区域(优先)");
11322
- scanRegions.push({
11323
- name: "左上角-小",
11324
- x: 0,
11325
- y: 0,
11326
- w: Math.min(smallBlock, width),
11327
- h: Math.min(smallBlock, height)
11328
- });
11329
- scanRegions.push({
11330
- name: "右上角-小",
11331
- x: Math.max(0, width - smallBlock),
11332
- y: 0,
11333
- w: Math.min(smallBlock, width),
11334
- h: Math.min(smallBlock, height)
11335
- });
11336
- scanRegions.push({
11337
- name: "左下角-小",
11338
- x: 0,
11339
- y: Math.max(0, height - smallBlock),
11340
- w: Math.min(smallBlock, width),
11341
- h: Math.min(smallBlock, height)
11342
- });
11343
- scanRegions.push({
11344
- name: "右下角-小",
11345
- x: Math.max(0, width - smallBlock),
11346
- y: Math.max(0, height - smallBlock),
11347
- w: Math.min(smallBlock, width),
11348
- h: Math.min(smallBlock, height)
11349
- });
11350
- logger.debug("添加四角中块扫描区域");
11351
- scanRegions.push({
11352
- name: "左上角-中",
11353
- x: 0,
11354
- y: 0,
11355
- w: Math.min(mediumBlock, width),
11356
- h: Math.min(mediumBlock, height)
11357
- });
11358
- scanRegions.push({
11359
- name: "右上角-中",
11360
- x: Math.max(0, width - mediumBlock),
11361
- y: 0,
11362
- w: Math.min(mediumBlock, width),
11363
- h: Math.min(mediumBlock, height)
11364
- });
11365
- scanRegions.push({
11366
- name: "左下角-中",
11367
- x: 0,
11368
- y: Math.max(0, height - mediumBlock),
11369
- w: Math.min(mediumBlock, width),
11370
- h: Math.min(mediumBlock, height)
11371
- });
11372
- scanRegions.push({
11373
- name: "右下角-中",
11374
- x: Math.max(0, width - mediumBlock),
11375
- y: Math.max(0, height - mediumBlock),
11376
- w: Math.min(mediumBlock, width),
11377
- h: Math.min(mediumBlock, height)
11378
- });
11379
- logger.debug("添加四角大块扫描区域");
11380
- const blockW = Math.min(largeBlock, width);
11381
- const blockH = Math.min(largeBlock, height);
11382
- scanRegions.push({
11383
- name: "左上角-大",
11384
- x: 0,
11385
- y: 0,
11386
- w: blockW,
11387
- h: blockH
11388
- });
11389
- scanRegions.push({
11390
- name: "右上角-大",
11391
- x: Math.max(0, width - blockW),
11392
- y: 0,
11393
- w: blockW,
11394
- h: blockH
11395
- });
11396
- scanRegions.push({
11397
- name: "左下角-大",
11398
- x: 0,
11399
- y: Math.max(0, height - blockH),
11400
- w: blockW,
11401
- h: blockH
11402
- });
11403
- scanRegions.push({
11404
- name: "右下角-大",
11405
- x: Math.max(0, width - blockW),
11406
- y: Math.max(0, height - blockH),
11407
- w: blockW,
11408
- h: blockH
11409
- });
11410
- if (width > mediumBlock * 1.5) {
11411
- logger.debug("添加顶部/底部中间扫描区域");
11412
- scanRegions.push({
11413
- name: "顶部中-小",
11414
- x: Math.floor((width - smallBlock) / 2),
11415
- y: 0,
11416
- w: Math.min(smallBlock, width),
11417
- h: Math.min(smallBlock, height)
11418
- });
11419
- if (height > mediumBlock * 1.5) scanRegions.push({
11420
- name: "底部中-小",
11421
- x: Math.floor((width - smallBlock) / 2),
11422
- y: Math.max(0, height - smallBlock),
11423
- w: Math.min(smallBlock, width),
11424
- h: Math.min(smallBlock, height)
11425
- });
11426
- }
11427
- if (height > mediumBlock * 1.5) {
11428
- logger.debug("添加左右中间扫描区域");
11429
- const middleY = Math.floor((height - smallBlock) / 2);
11430
- scanRegions.push({
11431
- name: "左中-小",
11432
- x: 0,
11433
- y: middleY,
11434
- w: Math.min(smallBlock, width),
11435
- h: Math.min(smallBlock, height)
11436
- });
11437
- if (width > mediumBlock * 1.5) scanRegions.push({
11438
- name: "右中-小",
11439
- x: Math.max(0, width - smallBlock),
11440
- y: middleY,
11441
- w: Math.min(smallBlock, width),
11442
- h: Math.min(smallBlock, height)
11443
- });
11444
- }
11445
- if (width > mediumBlock && height > mediumBlock) {
11446
- logger.debug("添加中心区域");
11447
- scanRegions.push({
11448
- name: "中心-小",
11449
- x: Math.floor((width - smallBlock) / 2),
11450
- y: Math.floor((height - smallBlock) / 2),
11451
- w: Math.min(smallBlock, width),
11452
- h: Math.min(smallBlock, height)
11453
- });
11454
- }
11455
- logger.debug(`共生成 ${scanRegions.length} 个扫描区域,开始逐个扫描`);
11456
- for (let i = 0; i < scanRegions.length; i++) {
11457
- const region = scanRegions[i];
11458
- logger.debug(`[${i + 1}/${scanRegions.length}] 扫描区域: ${region.name} (位置: ${region.x},${region.y}, 尺寸: ${region.w}x${region.h})`);
11459
- const regionData = this.extractRegion(imageData, region.x, region.y, region.w, region.h);
11460
- const result = this.tryRecognizeInRegion(regionData, region.name);
11461
- if (result) {
11462
- logger.debug(`二维码识别完成,共扫描了 ${i + 1}/${scanRegions.length} 个区域`);
11463
- return result;
11464
- }
11465
- }
11466
- logger.warn(`图片中未识别到二维码,已扫描所有 ${scanRegions.length} 个区域`);
11467
- return null;
11468
- } catch (error) {
11469
- logger.error("解析图片时发生错误:", error);
11470
- return null;
11471
- }
11472
- }
11473
- /**
11474
- * 检查二维码内容是否包含支持的平台链接
11475
- * @param qrContent 二维码内容
11476
- * @returns 是否包含支持的平台链接
11477
- */
11478
- static isSupportedPlatform(qrContent) {
11479
- return [
11480
- /(https?:\/\/)?(www|v|jx|m|jingxuan)\.(douyin|iesdouyin)\.com/i,
11481
- /https:\/\/aweme\.snssdk\.com\/aweme\/v1\/play/i,
11482
- /(bilibili\.com|b23\.tv|t\.bilibili\.com|bili2233\.cn|\bBV[1-9a-zA-Z]{10}\b|\bav\d+\b)/i,
11483
- /(快手.*快手|v\.kuaishou\.com|kuaishou\.com)/,
11484
- /(xiaohongshu\.com|xhslink\.com)/
11485
- ].some((pattern) => pattern.test(qrContent));
11486
- }
11487
- };
11488
10910
  /** 常用工具合集 */
11489
10911
  var Common = new class Tools {
11490
10912
  static VIDEO_PREVIEW_REMOVED_RETENTION_MS = 300 * 1e3;
@@ -11525,8 +10947,15 @@ var Common = new class Tools {
11525
10947
  async tryScanImageQrCode(imageUrl, source) {
11526
10948
  try {
11527
10949
  logger.debug(`检测到${source}为图片,尝试识别二维码...`);
11528
- const qrContent = await QRCodeScanner.scanFromUrl(imageUrl);
11529
- if (qrContent && QRCodeScanner.isSupportedPlatform(qrContent)) {
10950
+ const response = await axios.get(imageUrl, { responseType: "arraybuffer" });
10951
+ const qrContent = scan(Buffer.from(response.data));
10952
+ if (qrContent && [
10953
+ /(https?:\/\/)?(www|v|jx|m|jingxuan)\.(douyin|iesdouyin)\.com/i,
10954
+ /https:\/\/aweme\.snssdk\.com\/aweme\/v1\/play/i,
10955
+ /(bilibili\.com|b23\.tv|t\.bilibili\.com|bili2233\.cn|\bBV[1-9a-zA-Z]{10}\b|\bav\d+\b)/i,
10956
+ /(快手.*快手|v\.kuaishou\.com|kuaishou\.com)/,
10957
+ /(xiaohongshu\.com|xhslink\.com)/
10958
+ ].some((pattern) => pattern.test(qrContent))) {
11530
10959
  logger.debug(`从${source}二维码中识别到支持的平台链接: ${qrContent}`);
11531
10960
  return qrContent;
11532
10961
  } else if (qrContent) logger.debug(`识别到二维码内容但不是支持的平台: ${qrContent}`);
@@ -13565,6 +12994,11 @@ var PreviewLayout = ({ state }) => {
13565
12994
  });
13566
12995
  };
13567
12996
  //#endregion
12997
+ //#region ../template/src/utils/cn.ts
12998
+ function cn(...inputs) {
12999
+ return twMerge(clsx(inputs));
13000
+ }
13001
+ //#endregion
13568
13002
  //#region ../template/src/components/common/GlowImage.tsx
13569
13003
  var GlowImage = ({ src, children, alt, className, imgClassName, mode = "blur-layer", blurRadius = 18, glowStrength = .6, scale = 1.06, shadowRadius = 28, crossOrigin }) => {
13570
13004
  const [shadowColor, setShadowColor] = import_react.useState("rgba(255,255,255,0.5)");
@@ -14592,7 +14026,7 @@ var ViteLogo = ({ className = "w-auto h-12" }) => /* @__PURE__ */ (0, import_jsx
14592
14026
  var DefaultLayout = ({ children, version, data, scale = 3, className = "", style = {}, watermarkTextBitSize }) => {
14593
14027
  const { useDarkTheme } = data;
14594
14028
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
14595
- className: clsx("w-360 shrink-0 bg-background text-foreground font-[HarmonyOSHans-Regular]", useDarkTheme ? "dark" : "light", className),
14029
+ className: cn("w-360 shrink-0 bg-background text-foreground font-[HarmonyOSHans-Regular]", useDarkTheme ? "dark" : "light", className),
14596
14030
  "data-theme": useDarkTheme ? "dark" : "light",
14597
14031
  id: "container",
14598
14032
  style: {
@@ -14668,12 +14102,12 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
14668
14102
  className: "w-4 h-4"
14669
14103
  }),
14670
14104
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
14671
- className: clsx(version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
14105
+ className: cn(version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
14672
14106
  children: version.hasUpdate ? "有可用更新" : version.releaseType
14673
14107
  })
14674
14108
  ]
14675
14109
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
14676
- className: clsx("text-5xl font-bold tracking-wide", version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
14110
+ className: cn("text-5xl font-bold tracking-wide", version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
14677
14111
  children: ["v", version.pluginVersion]
14678
14112
  })]
14679
14113
  }),
@@ -14750,7 +14184,7 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
14750
14184
  var UsernameDisplay = ({ metadata, className, style }) => {
14751
14185
  const vipColor = metadata.vipStatus === 1 ? metadata.nicknameColor ?? "#FB7299" : null;
14752
14186
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
14753
- className: clsx(!vipColor && "text-foreground", "font-bold", className),
14187
+ className: cn(!vipColor && "text-foreground", "font-bold", className),
14754
14188
  style: {
14755
14189
  ...style,
14756
14190
  ...vipColor ? { color: vipColor } : {}
@@ -15182,14 +14616,14 @@ var BangumiBilibiliEpisodes = (props) => {
15182
14616
  className: "flex justify-center items-center text-7xl font-bold select-text text-foreground",
15183
14617
  children: day
15184
14618
  }),
15185
- !isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: clsx("mt-8 w-1 bg-divider", episodesInSameDate > 1 ? "h-110" : "h-95") })
14619
+ !isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("mt-8 w-1 bg-divider", episodesInSameDate > 1 ? "h-110" : "h-95") })
15186
14620
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
15187
14621
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-1 h-10 bg-divider" }),
15188
14622
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-2 w-4 h-4 rounded-full bg-divider" }),
15189
- (!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: clsx("w-1 bg-divider", isLastOfDate ? "h-110" : "h-130") })
14623
+ (!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("w-1 bg-divider", isLastOfDate ? "h-110" : "h-130") })
15190
14624
  ] })
15191
14625
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
15192
- className: clsx("flex-1 min-w-0", !isLastOfAll && isLastOfDate && "mb-20"),
14626
+ className: cn("flex-1 min-w-0", !isLastOfAll && isLastOfDate && "mb-20"),
15193
14627
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
15194
14628
  className: "flex justify-between items-center mb-10",
15195
14629
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -15893,6 +15327,34 @@ var renderRichTextToReact = (document, options = {}) => {
15893
15327
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: document.nodes.map((node, index) => renderNodeToReact(node, index, options)) });
15894
15328
  };
15895
15329
  //#endregion
15330
+ //#region ../template/src/utils/QRcode.ts
15331
+ /**
15332
+ * Generates a QR code image in base64 format for the given text.
15333
+ *
15334
+ * @param {string} text - The text to encode in the QR code.
15335
+ * @param {boolean} [useDarkTheme=false] - Whether to use a dark theme for the QR code.
15336
+ * @return {string} The base64-encoded QR code image.
15337
+ */
15338
+ var generateQRCode = (text, useDarkTheme = false) => {
15339
+ return `data:image/webp;base64,${generate({
15340
+ data: text,
15341
+ size: 1e3,
15342
+ dotsOptions: {
15343
+ dotType: "rounded",
15344
+ color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
15345
+ },
15346
+ cornersSquareOptions: {
15347
+ cornerType: "extra-rounded",
15348
+ color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
15349
+ },
15350
+ cornersDotOptions: {
15351
+ cornerType: "dot",
15352
+ color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
15353
+ },
15354
+ backgroundOptions: { transparent: true }
15355
+ }, "webp", "base64")}`;
15356
+ };
15357
+ //#endregion
15896
15358
  //#region ../template/src/components/platforms/bilibili/Icons.tsx
15897
15359
  /** B站官方点赞图标 */
15898
15360
  var ThumbUpIcon = ({ className, size, variant = "solid" }) => {
@@ -16109,7 +15571,7 @@ var FansMedal = ({ detail }) => {
16109
15571
  const nameColor = intToRgba(detail.medal_color_name);
16110
15572
  const levelColor = intToRgba(detail.medal_color_level);
16111
15573
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
16112
- className: clsx("inline-flex items-center shrink-0", "h-14 rounded-full border"),
15574
+ className: cn("inline-flex items-center shrink-0", "h-14 rounded-full border"),
16113
15575
  style: {
16114
15576
  borderColor,
16115
15577
  backgroundImage: `linear-gradient(90deg, ${bgStart}, ${bgEnd})`
@@ -16121,7 +15583,7 @@ var FansMedal = ({ detail }) => {
16121
15583
  referrerPolicy: "no-referrer",
16122
15584
  crossOrigin: "anonymous"
16123
15585
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
16124
- className: clsx("flex items-center", detail.first_icon ? "pr-4" : "px-4"),
15586
+ className: cn("flex items-center", detail.first_icon ? "pr-4" : "px-4"),
16125
15587
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
16126
15588
  className: "font-medium whitespace-nowrap text-3xl",
16127
15589
  style: { color: nameColor },
@@ -16139,7 +15601,7 @@ var FansMedal = ({ detail }) => {
16139
15601
  */
16140
15602
  var TopBadge = () => {
16141
15603
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
16142
- className: clsx("inline-flex justify-center items-center", "px-4 py-2 mr-4 mb-1 rounded-xl", "text-[45px] font-light leading-none", "align-baseline", "bg-[#ffedf5] text-[#ff799e]", "dark:bg-[#321b26] dark:text-[#cb5775]"),
15604
+ className: cn("inline-flex justify-center items-center", "px-4 py-2 mr-4 mb-1 rounded-xl", "text-[45px] font-light leading-none", "align-baseline", "bg-[#ffedf5] text-[#ff799e]", "dark:bg-[#321b26] dark:text-[#cb5775]"),
16143
15605
  children: "置顶"
16144
15606
  });
16145
15607
  };
@@ -16213,21 +15675,15 @@ var BilibiliLogo = () => {
16213
15675
  * @param props 组件属性
16214
15676
  * @returns JSX元素
16215
15677
  */
16216
- var QRCodeSection$2 = ({ qrCodeDataUrl }) => {
15678
+ var QRCodeSection$1 = ({ share_url, useDarkTheme }) => {
16217
15679
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16218
15680
  className: "flex flex-col items-center",
16219
15681
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16220
15682
  className: "flex justify-center items-center w-100 h-100 p-4",
16221
- children: qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
16222
- src: qrCodeDataUrl,
15683
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
15684
+ src: generateQRCode(share_url, useDarkTheme),
16223
15685
  alt: "二维码",
16224
15686
  className: "object-contain w-full h-full rounded-lg"
16225
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16226
- className: "flex flex-col justify-center items-center text-muted",
16227
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
16228
- className: "text-lg",
16229
- children: "二维码生成失败"
16230
- })
16231
15687
  })
16232
15688
  })
16233
15689
  });
@@ -16314,7 +15770,10 @@ var VideoInfoHeader$1 = (props) => {
16314
15770
  })]
16315
15771
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16316
15772
  className: "shrink-0",
16317
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection$2, { qrCodeDataUrl: props.qrCodeDataUrl })
15773
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection$1, {
15774
+ share_url: props.share_url,
15775
+ useDarkTheme: props.useDarkTheme
15776
+ })
16318
15777
  })]
16319
15778
  })
16320
15779
  });
@@ -16326,7 +15785,7 @@ var VideoInfoHeader$1 = (props) => {
16326
15785
  */
16327
15786
  var CommentItemComponent$2 = ({ isLast = false, ...props }) => {
16328
15787
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
16329
- className: clsx("flex relative px-10 py-10 max-w-full", { "pb-0": isLast }),
15788
+ className: cn("flex relative px-10 py-10 max-w-full", { "pb-0": isLast }),
16330
15789
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
16331
15790
  className: "relative mr-[33.75px] shrink-0 w-50 h-50 flex items-center justify-center",
16332
15791
  children: [
@@ -16675,10 +16134,7 @@ var BilibiliComment = import_react.memo((props) => {
16675
16134
  className: "p-5",
16676
16135
  children: [
16677
16136
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
16678
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader$1, {
16679
- ...processedData,
16680
- qrCodeDataUrl: props.qrCodeDataUrl
16681
- }),
16137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader$1, { ...processedData }),
16682
16138
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16683
16139
  className: "overflow-hidden mt-8",
16684
16140
  children: processedData.CommentsData.length > 0 ? processedData.CommentsData.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentItemComponent$2, {
@@ -16981,16 +16437,10 @@ var BilibiliArticleFooter = import_react.memo((props) => {
16981
16437
  })]
16982
16438
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16983
16439
  className: "flex flex-col items-center gap-4",
16984
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
16985
- src: props.qrCodeDataUrl,
16440
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
16441
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
16986
16442
  alt: "二维码",
16987
16443
  className: "h-auto w-75 rounded-2xl"
16988
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
16989
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
16990
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
16991
- className: "text-muted",
16992
- children: "二维码"
16993
- })
16994
16444
  })
16995
16445
  })]
16996
16446
  });
@@ -17145,15 +16595,12 @@ var BilibiliDynamicFooter = (props) => {
17145
16595
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17146
16596
  className: "text-7xl font-bold select-text",
17147
16597
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsernameDisplay, { metadata: props.usernameMeta })
17148
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
16598
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17149
16599
  className: "flex gap-2 items-center text-4xl text-muted",
17150
- children: [props.showUidHash && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
17151
- className: "text-muted",
17152
- children: "#"
17153
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
16600
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
17154
16601
  className: "text-muted select-text",
17155
16602
  children: ["UID: ", props.user_shortid]
17156
- })]
16603
+ })
17157
16604
  })]
17158
16605
  })]
17159
16606
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -17217,16 +16664,10 @@ var BilibiliDynamicFooter = (props) => {
17217
16664
  })]
17218
16665
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17219
16666
  className: "flex flex-col items-center gap-4",
17220
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
17221
- src: props.qrCodeDataUrl,
16667
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
16668
+ src: generateQRCode(props.share_url, props.useDarkTheme),
17222
16669
  alt: "二维码",
17223
16670
  className: "h-auto w-75 rounded-2xl"
17224
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17225
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
17226
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
17227
- className: "text-muted",
17228
- children: "二维码"
17229
- })
17230
16671
  })
17231
16672
  })]
17232
16673
  });
@@ -17443,20 +16884,9 @@ var BilibiliVideoDynamic = import_react.memo((props) => {
17443
16884
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoContent, { ...props }),
17444
16885
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
17445
16886
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
17446
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: clsx(props.data.staff && props.data.staff.length > 0 && "h-23", !props.data.staff && "h-40") }),
16887
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn(props.data.staff && props.data.staff.length > 0 && "h-23", !props.data.staff && "h-40") }),
17447
16888
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoStaff, { ...props }),
17448
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
17449
- avatar_url: props.data.avatar_url,
17450
- frame: props.data.frame,
17451
- usernameMeta: props.data.usernameMeta,
17452
- user_shortid: props.data.user_shortid,
17453
- total_favorited: props.data.total_favorited,
17454
- following_count: props.data.following_count,
17455
- fans: props.data.fans,
17456
- dynamicTYPE: props.data.dynamicTYPE,
17457
- share_url: props.data.share_url,
17458
- qrCodeDataUrl: props.qrCodeDataUrl
17459
- })
16889
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
17460
16890
  ]
17461
16891
  })
17462
16892
  });
@@ -17647,7 +17077,7 @@ var BilibiliUgcCard = ({ ugc }) => {
17647
17077
  var BilibiliAdditionalCard = ({ additional, gap = true, className }) => {
17648
17078
  if (!additional) return null;
17649
17079
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17650
- className: clsx(gap && "px-20 pb-20", className),
17080
+ className: cn(gap && "px-20 pb-20", className),
17651
17081
  children: [
17652
17082
  additional.type === "ADDITIONAL_TYPE_RESERVE" && additional.reserve && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliReserveCard, { reserve: additional.reserve }),
17653
17083
  additional.type === "ADDITIONAL_TYPE_VOTE" && additional.vote && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVoteCard, { vote: additional.vote }),
@@ -17770,16 +17200,16 @@ var BilibiliDynamicContent = (props) => {
17770
17200
  })]
17771
17201
  }),
17772
17202
  layoutType === "vertical" && props.image_url.map((img, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17773
- className: "flex flex-col items-center",
17203
+ className: "flex items-center",
17774
17204
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17775
17205
  className: "flex overflow-hidden flex-col flex-1 items-center rounded-4xl shadow-large",
17776
17206
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
17777
17207
  src: img.image_src,
17778
17208
  alt: "封面",
17779
- className: "object-contain w-full h-full rounded-3xl"
17209
+ className: "object-contain w-full h-full rounded-5xl"
17780
17210
  })
17781
17211
  })
17782
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-18" })] }, index)),
17212
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" })] }, index)),
17783
17213
  (layoutType === "waterfall" || layoutType === "grid") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-18" })
17784
17214
  ]
17785
17215
  }),
@@ -17806,19 +17236,8 @@ var BilibiliDrawDynamic = import_react.memo((props) => {
17806
17236
  additional: props.data.additional
17807
17237
  }),
17808
17238
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
17809
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-23" }),
17810
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
17811
- avatar_url: props.data.avatar_url,
17812
- frame: props.data.frame,
17813
- usernameMeta: props.data.usernameMeta,
17814
- user_shortid: props.data.user_shortid,
17815
- total_favorited: props.data.total_favorited,
17816
- following_count: props.data.following_count,
17817
- fans: props.data.fans,
17818
- dynamicTYPE: props.data.dynamicTYPE,
17819
- share_url: props.data.share_url,
17820
- qrCodeDataUrl: props.qrCodeDataUrl
17821
- })
17239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40" }),
17240
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
17822
17241
  ]
17823
17242
  })
17824
17243
  });
@@ -17831,7 +17250,7 @@ BilibiliDrawDynamic.displayName = "BilibiliDrawDynamic";
17831
17250
  */
17832
17251
  var OriginalUserInfo = (props) => {
17833
17252
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17834
- className: "flex justify-between items-center pt-6 pb-10 pl-6 pr-0",
17253
+ className: "flex justify-between items-center pl-8 pr-0",
17835
17254
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17836
17255
  className: "flex gap-10 items-center min-w-0",
17837
17256
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -17868,6 +17287,7 @@ var OriginalAVContent = ({ content }) => {
17868
17287
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17869
17288
  className: "px-12 py-8 mt-4 w-full rounded-8xl bg-surface-secondary",
17870
17289
  children: [
17290
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" }),
17871
17291
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OriginalUserInfo, {
17872
17292
  avatar_url: content.avatar_url,
17873
17293
  frame: content.frame,
@@ -17875,35 +17295,46 @@ var OriginalAVContent = ({ content }) => {
17875
17295
  create_time: content.create_time,
17876
17296
  decoration_card: content.decoration_card
17877
17297
  }),
17298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
17878
17299
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17879
- className: "flex flex-col items-center py-11",
17880
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17881
- className: "flex overflow-hidden relative flex-col items-center w-11/12 rounded-4xl rounded-10 aspect-video shadow-large",
17882
- children: [
17883
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
17884
- src: content.cover,
17885
- alt: "视频封面",
17886
- className: "object-cover object-center absolute"
17887
- }),
17888
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute right-0 bottom-0 left-0 h-1/2 bg-linear-to-t to-transparent pointer-events-none from-black/75" }),
17889
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17890
- className: "absolute right-5 left-12 bottom-14 z-10 text-4xl font-light text-white select-text",
17891
- children: [
17892
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
17893
- className: "px-4 py-2 mr-3 text-4xl text-white rounded-2xl bg-black/50",
17894
- children: content.duration_text
17895
- }),
17896
- content.play,
17897
- "观看 ",
17898
- content.danmaku,
17899
- "弹幕"
17900
- ]
17901
- })
17902
- ]
17300
+ className: "relative items-center text-5xl tracking-wider wrap-break-word text-muted leading-relaxed",
17301
+ children: content.text.nodes.length > 0 && renderRichTextToReact(content.text, {
17302
+ at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17303
+ topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17304
+ lottery: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17305
+ webLink: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17306
+ vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17307
+ viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" }
17903
17308
  })
17904
17309
  }),
17310
+ content.text.nodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-5" }),
17311
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17312
+ className: "flex overflow-hidden relative flex-col items-center w-full rounded-5xl aspect-video",
17313
+ children: [
17314
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
17315
+ src: content.cover,
17316
+ alt: "视频封面",
17317
+ className: "w-full h-full"
17318
+ }),
17319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute right-0 bottom-0 left-0 h-1/2 bg-linear-to-t to-transparent pointer-events-none from-black/75" }),
17320
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17321
+ className: "absolute right-5 left-12 bottom-14 z-10 text-4xl font-light text-white select-text",
17322
+ children: [
17323
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
17324
+ className: "px-4 py-2 mr-3 text-4xl text-white rounded-2xl bg-black/50",
17325
+ children: content.duration_text
17326
+ }),
17327
+ content.play,
17328
+ "观看 ",
17329
+ content.danmaku,
17330
+ "弹幕"
17331
+ ]
17332
+ })
17333
+ ]
17334
+ }),
17335
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" }),
17905
17336
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17906
- className: "pb-10 pl-8 text-6xl font-bold select-text leading-20 text-foreground",
17337
+ className: "pl-2 text-6xl font-bold select-text leading-20 text-foreground",
17907
17338
  children: content.title && renderRichTextToReact(content.title, {
17908
17339
  at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17909
17340
  topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
@@ -17912,7 +17343,8 @@ var OriginalAVContent = ({ content }) => {
17912
17343
  vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17913
17344
  viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" }
17914
17345
  })
17915
- })
17346
+ }),
17347
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4" })
17916
17348
  ]
17917
17349
  });
17918
17350
  };
@@ -17930,27 +17362,25 @@ var OriginalDrawContent = ({ content }) => {
17930
17362
  create_time: content.create_time,
17931
17363
  decoration_card: content.decoration_card
17932
17364
  }),
17933
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17934
- className: "py-4",
17935
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17936
- className: "text-5xl leading-relaxed text-foreground wrap-break-word",
17937
- children: [content.title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
17938
- className: "text-6xl font-bold",
17939
- children: [
17940
- content.title,
17941
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
17942
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})
17943
- ]
17944
- }), content.text && renderRichTextToReact(content.text, {
17945
- at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17946
- topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17947
- lottery: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17948
- webLink: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17949
- vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17950
- viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17951
- iconScale: .8
17952
- })]
17953
- })
17365
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
17366
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
17367
+ className: "text-5xl leading-relaxed text-foreground wrap-break-word",
17368
+ children: [content.title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
17369
+ className: "text-6xl font-bold",
17370
+ children: [
17371
+ content.title,
17372
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
17373
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})
17374
+ ]
17375
+ }), content.text && renderRichTextToReact(content.text, {
17376
+ at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17377
+ topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17378
+ lottery: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17379
+ webLink: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17380
+ vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17381
+ viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
17382
+ iconScale: .8
17383
+ })]
17954
17384
  }),
17955
17385
  content.image_url && content.image_url.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
17956
17386
  className: "flex justify-center py-11 pb-0",
@@ -18143,20 +17573,8 @@ var BilibiliForwardDynamic = import_react.memo((props) => {
18143
17573
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliForwardContent, { ...props.data }),
18144
17574
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
18145
17575
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
18146
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-23" }),
18147
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
18148
- avatar_url: props.data.avatar_url,
18149
- frame: props.data.frame,
18150
- usernameMeta: props.data.usernameMeta,
18151
- user_shortid: props.data.user_shortid,
18152
- total_favorited: props.data.total_favorited,
18153
- following_count: props.data.following_count,
18154
- fans: props.data.fans,
18155
- dynamicTYPE: props.data.dynamicTYPE,
18156
- share_url: props.data.share_url,
18157
- qrCodeDataUrl: props.qrCodeDataUrl,
18158
- showUidHash: true
18159
- })
17576
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40" }),
17577
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
18160
17578
  ]
18161
17579
  })
18162
17580
  });
@@ -18211,7 +17629,7 @@ var getSingleLineFontSize = (content, base, min) => {
18211
17629
  return min;
18212
17630
  };
18213
17631
  var BilibiliLiveDynamic = import_react.memo((props) => {
18214
- const { data, qrCodeDataUrl } = props;
17632
+ const { data } = props;
18215
17633
  const isDark = data.useDarkTheme === true;
18216
17634
  const { bgColor, primaryColor, secondaryColor, mutedColor, accentColor, deepColor, coverShade } = props.posterPalettes ? isDark ? props.posterPalettes.dark : props.posterPalettes.light : props.posterPalette ?? (isDark ? DARK_FALLBACK : LIGHT_FALLBACK);
18217
17635
  const logo = isDark ? "/image/bilibili/bilibili-light.png" : "/image/bilibili/bilibili.png";
@@ -18671,8 +18089,8 @@ var BilibiliLiveDynamic = import_react.memo((props) => {
18671
18089
  className: "absolute right-22 top-1/2 h-52 w-52 -translate-y-1/2 rounded-full blur-[48px]",
18672
18090
  style: { backgroundColor: withAlphaFromCss(accentColor, isDark ? .16 : .1) }
18673
18091
  }),
18674
- qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
18675
- src: qrCodeDataUrl,
18092
+ data.share_url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
18093
+ src: generateQRCode(data.share_url, isDark),
18676
18094
  alt: "二维码",
18677
18095
  className: "relative h-100 w-100 object-contain drop-shadow-[0_20px_38px_rgba(0,0,0,0.18)]"
18678
18096
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -18737,18 +18155,7 @@ var BilibiliWordDynamic = import_react.memo((props) => {
18737
18155
  }),
18738
18156
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
18739
18157
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-23" }),
18740
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
18741
- avatar_url: props.data.avatar_url,
18742
- frame: props.data.frame,
18743
- usernameMeta: props.data.usernameMeta,
18744
- user_shortid: props.data.user_shortid,
18745
- total_favorited: props.data.total_favorited,
18746
- following_count: props.data.following_count,
18747
- fans: props.data.fans,
18748
- dynamicTYPE: props.data.dynamicTYPE,
18749
- share_url: props.data.share_url,
18750
- qrCodeDataUrl: props.qrCodeDataUrl
18751
- })
18158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
18752
18159
  ]
18753
18160
  })
18754
18161
  });
@@ -18763,7 +18170,7 @@ BilibiliWordDynamic.displayName = "BilibiliWordDynamic";
18763
18170
  */
18764
18171
  var BilibiliQrcodeImg = import_react.memo((props) => {
18765
18172
  const isDark = props.data?.useDarkTheme ?? false;
18766
- const { qrCodeDataUrl } = props;
18173
+ const qrCodeDataUrl = generateQRCode(props.data.share_url, isDark);
18767
18174
  const theme = {
18768
18175
  bg: isDark ? "#000000" : "#FFFFFF",
18769
18176
  text: isDark ? "#FFFFFF" : "#000000",
@@ -19869,16 +19276,10 @@ var DouyinArticleWork = (props) => {
19869
19276
  className: "flex justify-between items-start px-20 pb-20",
19870
19277
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$3, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
19871
19278
  className: "flex flex-col items-center gap-4",
19872
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
19873
- src: props.qrCodeDataUrl,
19279
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
19280
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
19874
19281
  alt: "二维码",
19875
19282
  className: "h-auto w-75 rounded-xl"
19876
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
19877
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
19878
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
19879
- className: "text-muted",
19880
- children: "二维码"
19881
- })
19882
19283
  })
19883
19284
  })]
19884
19285
  })
@@ -19925,24 +19326,15 @@ var formatPublishTime = (timestamp) => {
19925
19326
  * @param props 组件属性
19926
19327
  * @returns JSX元素
19927
19328
  */
19928
- var QRCodeSection$1 = ({ qrCodeDataUrl }) => {
19329
+ var QRCodeSection = (props) => {
19929
19330
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
19930
19331
  className: "flex flex-col items-center",
19931
19332
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
19932
19333
  className: "flex justify-center items-center w-100 h-100 p-4",
19933
- children: qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
19934
- src: qrCodeDataUrl,
19334
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
19335
+ src: generateQRCode(props.share_url, props.useDarkTheme),
19935
19336
  alt: "二维码",
19936
19337
  className: "object-contain w-full h-full rounded-lg"
19937
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
19938
- className: "flex flex-col justify-center items-center text-muted",
19939
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
19940
- width: 80,
19941
- className: "mb-4"
19942
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
19943
- className: "text-lg",
19944
- children: "二维码生成失败"
19945
- })]
19946
19338
  })
19947
19339
  })
19948
19340
  });
@@ -20073,7 +19465,7 @@ var VideoInfoHeader = (props) => {
20073
19465
  ]
20074
19466
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20075
19467
  className: "shrink-0",
20076
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection$1, { qrCodeDataUrl: props.qrCodeDataUrl })
19468
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection, { ...props })
20077
19469
  })]
20078
19470
  })
20079
19471
  });
@@ -20203,26 +19595,26 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
20203
19595
  })
20204
19596
  }), reply.children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-0.5 bg-border-secondary h-full grow mt-3 rounded-t-full" })]
20205
19597
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
20206
- className: clsx("flex flex-col pl-6 min-w-0 gap-2", isLast && reply.children.length === 0 ? "pb-16" : "pb-6"),
19598
+ className: cn("flex flex-col pl-6 min-w-0 gap-2", isLast && reply.children.length === 0 ? "pb-16" : "pb-6"),
20207
19599
  children: [
20208
19600
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
20209
19601
  className: "flex flex-nowrap items-center content-center w-full overflow-hidden",
20210
19602
  children: [
20211
19603
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
20212
- className: clsx("mr-2 text-4xl font-normal text-muted", isNicknameLonger ? "min-w-0 truncate shrink" : "shrink-0"),
19604
+ className: cn("mr-2 text-4xl font-normal text-muted", isNicknameLonger ? "min-w-0 truncate shrink" : "shrink-0"),
20213
19605
  children: reply.nickname
20214
19606
  }),
20215
19607
  reply.label_text !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20216
- className: clsx("inline-flex shrink-0 items-center px-3 py-1 text-3xl rounded-lg mr-2", reply.label_text === "作者" ? "bg-[#fe2c55] text-white" : "bg-surface text-muted"),
19608
+ className: cn("px-4 py-1 text-3xl rounded-xl mr-2", reply.label_text === "作者" ? "bg-[#fe2c55] text-white" : "bg-surface text-muted"),
20217
19609
  children: reply.label_text
20218
19610
  }),
20219
19611
  reply.reply_to_username && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
20220
- className: clsx("flex items-center", !isNicknameLonger ? "overflow-hidden min-w-0 shrink" : "shrink-0"),
19612
+ className: cn("flex items-center", !isNicknameLonger ? "overflow-hidden min-w-0 shrink" : "shrink-0"),
20221
19613
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(a, {
20222
19614
  weight: "fill",
20223
19615
  className: "w-7 h-auto mr-3.5 mx-1 text-muted shrink-0"
20224
19616
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
20225
- className: clsx("text-4xl font-normal text-muted", !isNicknameLonger && "truncate"),
19617
+ className: cn("text-4xl font-normal text-muted", !isNicknameLonger && "truncate"),
20226
19618
  children: reply.reply_to_username
20227
19619
  })]
20228
19620
  })
@@ -20292,7 +19684,7 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
20292
19684
  */
20293
19685
  var CommentItemComponent$1 = (props) => {
20294
19686
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20295
- className: clsx("flex flex-col px-6 pt-8", {
19687
+ className: cn("flex flex-col px-6 pt-8", {
20296
19688
  "pb-0": props.isLast,
20297
19689
  "pb-10": !props.isLast
20298
19690
  }),
@@ -20409,10 +19801,7 @@ var DouyinComment = import_react.memo((props) => {
20409
19801
  className: "p-5 px-15",
20410
19802
  children: [
20411
19803
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
20412
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader, {
20413
- ...props.data,
20414
- qrCodeDataUrl: props.qrCodeDataUrl
20415
- }),
19804
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader, { ...props.data }),
20416
19805
  randomSuggestWord && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20417
19806
  className: "mx-auto my-20 mb-5 ml-10",
20418
19807
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -20756,16 +20145,10 @@ var DouyinDynamic = (props) => {
20756
20145
  className: "flex justify-between items-start px-20 pb-20",
20757
20146
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$2, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20758
20147
  className: "flex flex-col items-center gap-4",
20759
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
20760
- src: props.qrCodeDataUrl,
20148
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
20149
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
20761
20150
  alt: "二维码",
20762
20151
  className: "h-auto w-75 rounded-xl"
20763
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
20764
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
20765
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
20766
- className: "text-muted",
20767
- children: "二维码"
20768
- })
20769
20152
  })
20770
20153
  })]
20771
20154
  })]
@@ -20924,8 +20307,8 @@ var DouyinFavoriteList = (props) => {
20924
20307
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px w-full bg-linear-to-r from-surface-secondary via-border to-transparent" }),
20925
20308
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
20926
20309
  className: "flex items-end gap-6",
20927
- children: [props.qrCodeDataUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
20928
- src: props.qrCodeDataUrl,
20310
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
20311
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
20929
20312
  className: "w-65 h-auto rounded-2xl mix-blend-multiply",
20930
20313
  alt: "QR"
20931
20314
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -21340,16 +20723,10 @@ var DouyinImageWork = (props) => {
21340
20723
  className: "flex justify-between items-start px-20 pb-20",
21341
20724
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$1, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
21342
20725
  className: "flex flex-col items-center gap-4",
21343
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
21344
- src: props.qrCodeDataUrl,
20726
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
20727
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
21345
20728
  alt: "二维码",
21346
20729
  className: "h-auto w-75 rounded-xl"
21347
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
21348
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
21349
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
21350
- className: "text-muted",
21351
- children: "二维码"
21352
- })
21353
20730
  })
21354
20731
  })]
21355
20732
  })]
@@ -21582,7 +20959,7 @@ var InfoSection$1 = ({ data }) => {
21582
20959
  /**
21583
20960
  * 底部区域 - 主播信息 + 二维码 + 抖音Logo
21584
20961
  */
21585
- var BottomSection = ({ data, qrCodeDataUrl }) => {
20962
+ var BottomSection = ({ data }) => {
21586
20963
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
21587
20964
  className: "flex justify-between items-end px-16 pt-24 pb-16",
21588
20965
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -21675,8 +21052,8 @@ var BottomSection = ({ data, qrCodeDataUrl }) => {
21675
21052
  alt: "抖音",
21676
21053
  className: "w-60 h-auto opacity-80 dark:opacity-70"
21677
21054
  }),
21678
- qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
21679
- src: qrCodeDataUrl,
21055
+ generateQRCode(data.share_url, data.useDarkTheme) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
21056
+ src: generateQRCode(data.share_url, data.useDarkTheme),
21680
21057
  alt: "二维码",
21681
21058
  className: "h-auto w-75"
21682
21059
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -21698,7 +21075,6 @@ var BottomSection = ({ data, qrCodeDataUrl }) => {
21698
21075
  * 抖音直播组件
21699
21076
  */
21700
21077
  var DouyinLive = (props) => {
21701
- const { qrCodeDataUrl } = props;
21702
21078
  const d = props.data;
21703
21079
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DefaultLayout, {
21704
21080
  ...props,
@@ -21708,10 +21084,7 @@ var DouyinLive = (props) => {
21708
21084
  children: [
21709
21085
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection$1, { imageUrl: d.image_url }),
21710
21086
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$1, { data: d }),
21711
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BottomSection, {
21712
- data: d,
21713
- qrCodeDataUrl
21714
- })
21087
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BottomSection, { data: d })
21715
21088
  ]
21716
21089
  })]
21717
21090
  });
@@ -21841,7 +21214,7 @@ var MusicAuthorInfoSection = ({ avatarUrl, username, userShortId, totalFavorited
21841
21214
  * @param props 组件属性
21842
21215
  * @returns JSX元素
21843
21216
  */
21844
- var MusicQRCodeSection = ({ qrCodeDataUrl }) => {
21217
+ var MusicQRCodeSection = ({ share_url, useDarkTheme }) => {
21845
21218
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
21846
21219
  className: "flex flex-col-reverse items-center -mb-12 mr-18",
21847
21220
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -21850,7 +21223,7 @@ var MusicQRCodeSection = ({ qrCodeDataUrl }) => {
21850
21223
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
21851
21224
  className: "p-2.5 rounded-sm border-[7px] border-dashed border-border",
21852
21225
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
21853
- src: qrCodeDataUrl,
21226
+ src: generateQRCode(share_url, useDarkTheme),
21854
21227
  alt: "二维码",
21855
21228
  className: "w-87.5 h-87.5 select-text"
21856
21229
  })
@@ -21863,7 +21236,7 @@ var MusicQRCodeSection = ({ qrCodeDataUrl }) => {
21863
21236
  * @returns JSX元素
21864
21237
  */
21865
21238
  var DouyinMusicInfo = (props) => {
21866
- const { data, qrCodeDataUrl } = props;
21239
+ const { data } = props;
21867
21240
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultLayout, {
21868
21241
  ...props,
21869
21242
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
@@ -21897,7 +21270,7 @@ var DouyinMusicInfo = (props) => {
21897
21270
  fans: data.fans,
21898
21271
  useDarkTheme: data.useDarkTheme
21899
21272
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MusicQRCodeSection, {
21900
- qrCodeDataUrl,
21273
+ share_url: data.share_url,
21901
21274
  useDarkTheme: data.useDarkTheme
21902
21275
  })]
21903
21276
  })
@@ -21913,7 +21286,7 @@ var DouyinMusicInfo = (props) => {
21913
21286
  */
21914
21287
  var DouyinQrcodeImg = import_react.memo((props) => {
21915
21288
  const isDark = props.data?.useDarkTheme ?? false;
21916
- const qrCodeImage = props.data.qrCodeDataUrl || props.qrCodeDataUrl;
21289
+ const qrCodeImage = generateQRCode(props.data.share_url || "", isDark);
21917
21290
  const theme = {
21918
21291
  bg: isDark ? "#000000" : "#FFFFFF",
21919
21292
  text: isDark ? "#FFFFFF" : "#000000",
@@ -22273,8 +21646,8 @@ var DouyinRecommendList = (props) => {
22273
21646
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px w-full bg-linear-to-r from-surface-secondary via-border to-transparent" }),
22274
21647
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
22275
21648
  className: "flex items-end gap-6",
22276
- children: [props.qrCodeDataUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
22277
- src: props.qrCodeDataUrl,
21649
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
21650
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
22278
21651
  className: "w-65 h-auto rounded-2xl mix-blend-multiply",
22279
21652
  alt: "QR"
22280
21653
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -23534,16 +22907,10 @@ var DouyinVideoWork = (props) => {
23534
22907
  className: "flex justify-between items-start px-20 pb-20",
23535
22908
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23536
22909
  className: "flex flex-col items-center gap-4",
23537
- children: props.qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
23538
- src: props.qrCodeDataUrl,
22910
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
22911
+ src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
23539
22912
  alt: "二维码",
23540
22913
  className: "h-auto w-75 rounded-xl"
23541
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23542
- className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
23543
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23544
- className: "text-muted",
23545
- children: "二维码"
23546
- })
23547
22914
  })
23548
22915
  })]
23549
22916
  })]
@@ -23577,28 +22944,19 @@ var formatKuaishouLikeCount = (count) => {
23577
22944
  * @param props 组件属性
23578
22945
  * @returns JSX元素
23579
22946
  */
23580
- var KuaishouQRCodeSection = ({ qrCodeDataUrl, type, imageLength }) => {
22947
+ var KuaishouQRCodeSection = (props) => {
23581
22948
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23582
22949
  className: "flex flex-col items-center -mr-10",
23583
22950
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23584
22951
  className: "mt-20 flex items-center justify-center w-150 h-150 bg-surface rounded-lg shadow-medium",
23585
- children: qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
23586
- src: qrCodeDataUrl,
22952
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
22953
+ src: generateQRCode(props.share_url, props.useDarkTheme),
23587
22954
  alt: "二维码",
23588
22955
  className: "object-contain w-full h-full"
23589
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23590
- className: "flex flex-col justify-center items-center text-muted",
23591
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
23592
- width: 80,
23593
- className: "mb-4"
23594
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23595
- className: "text-lg",
23596
- children: "二维码生成失败"
23597
- })]
23598
22956
  })
23599
22957
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23600
22958
  className: "mt-5 text-[45px] text-center text-foreground",
23601
- children: type === "视频" ? "视频直链(永久)" : type === "图集" ? `图集分享链接 共${imageLength}张` : "分享链接"
22959
+ children: props.Type === "视频" ? "视频直链(永久)" : props.Type === "图集" ? `图集分享链接 共${props.ImageLength}张` : "分享链接"
23602
22960
  })]
23603
22961
  });
23604
22962
  };
@@ -23607,7 +22965,7 @@ var KuaishouQRCodeSection = ({ qrCodeDataUrl, type, imageLength }) => {
23607
22965
  * @param props 组件属性
23608
22966
  * @returns JSX元素
23609
22967
  */
23610
- var KuaishouVideoInfoHeader = ({ type, commentLength, videoSize, likeCount, viewCount, imageLength }) => {
22968
+ var KuaishouVideoInfoHeader = (props) => {
23611
22969
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23612
22970
  className: "flex justify-between items-center max-w-300 mx-auto p-5",
23613
22971
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -23632,33 +22990,33 @@ var KuaishouVideoInfoHeader = ({ type, commentLength, videoSize, likeCount, view
23632
22990
  className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
23633
22991
  children: [
23634
22992
  "评论数量:",
23635
- commentLength,
22993
+ props.CommentLength,
23636
22994
  "条"
23637
22995
  ]
23638
22996
  }),
23639
- type === "视频" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
22997
+ props.Type === "视频" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
23640
22998
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23641
22999
  className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
23642
23000
  children: [
23643
23001
  "视频大小:",
23644
- videoSize,
23002
+ props.VideoSize,
23645
23003
  "MB"
23646
23004
  ]
23647
23005
  }),
23648
23006
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23649
23007
  className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
23650
- children: ["点赞数量:", likeCount]
23008
+ children: ["点赞数量:", props.likeCount]
23651
23009
  }),
23652
23010
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23653
23011
  className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
23654
- children: ["观看次数:", viewCount]
23012
+ children: ["观看次数:", props.viewCount]
23655
23013
  })
23656
23014
  ] }),
23657
- type === "图集" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23015
+ props.Type === "图集" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23658
23016
  className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
23659
23017
  children: [
23660
23018
  "图片数量:",
23661
- imageLength,
23019
+ props.ImageLength,
23662
23020
  "张"
23663
23021
  ]
23664
23022
  })
@@ -23672,11 +23030,11 @@ var KuaishouVideoInfoHeader = ({ type, commentLength, videoSize, likeCount, view
23672
23030
  * @param props 组件属性
23673
23031
  * @returns JSX元素
23674
23032
  */
23675
- var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
23033
+ var KuaishouCommentItemComponent = ({ ...props }, isLast = false) => {
23676
23034
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23677
23035
  className: `flex px-10 pt-10 ${isLast ? "pb-0" : "pb-10"}`,
23678
23036
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
23679
- src: comment.userimageurl,
23037
+ src: props.userimageurl,
23680
23038
  className: "mb-12.5 w-[187.5px] h-[187.5px] rounded-full mr-8 object-cover shadow-lg",
23681
23039
  alt: "用户头像"
23682
23040
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -23686,7 +23044,7 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
23686
23044
  className: "mb-12.5 text-[50px] text-foreground/70 relative flex items-center",
23687
23045
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23688
23046
  className: "font-medium",
23689
- children: comment.nickname
23047
+ children: props.nickname
23690
23048
  })
23691
23049
  }),
23692
23050
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -23695,13 +23053,13 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
23695
23053
  wordBreak: "break-word",
23696
23054
  overflowWrap: "break-word"
23697
23055
  },
23698
- children: renderKuaishouCommentRichText(comment.text)
23056
+ children: renderKuaishouCommentRichText(props.text)
23699
23057
  }),
23700
- (comment.commentimage || comment.sticker) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23058
+ (props.commentimage || props.sticker) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23701
23059
  className: "flex my-5 overflow-hidden shadow-md rounded-2xl w-[95%] flex-1",
23702
23060
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
23703
23061
  className: "object-contain w-full h-full rounded-2xl",
23704
- src: comment.commentimage || comment.sticker,
23062
+ src: props.commentimage || props.sticker,
23705
23063
  alt: "评论图片"
23706
23064
  })
23707
23065
  }),
@@ -23712,17 +23070,17 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
23712
23070
  children: [
23713
23071
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23714
23072
  className: "text-[45px] select-text",
23715
- children: formatKuaishouCommentTime(comment.create_time)
23073
+ children: formatKuaishouCommentTime(props.create_time)
23716
23074
  }),
23717
- comment.ip_label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23075
+ props.ip_label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23718
23076
  className: "text-[45px] select-text",
23719
- children: comment.ip_label
23077
+ children: props.ip_label
23720
23078
  }),
23721
- comment.reply_comment_total && comment.reply_comment_total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
23079
+ props.reply_comment_total && props.reply_comment_total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
23722
23080
  className: "text-[40px] text-foreground/70",
23723
23081
  children: [
23724
23082
  "共",
23725
- comment.reply_comment_total,
23083
+ props.reply_comment_total,
23726
23084
  "条回复"
23727
23085
  ]
23728
23086
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
@@ -23739,7 +23097,7 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
23739
23097
  className: "stroke-current"
23740
23098
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23741
23099
  className: "text-[50px] select-text",
23742
- children: formatKuaishouLikeCount(comment.digg_count)
23100
+ children: formatKuaishouLikeCount(props.digg_count)
23743
23101
  })]
23744
23102
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23745
23103
  className: "flex items-center transition-colors cursor-pointer hover:text-accent",
@@ -23767,24 +23125,11 @@ var KuaishouComment = import_react.memo((props) => {
23767
23125
  className: "p-5",
23768
23126
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23769
23127
  className: "flex justify-between items-center max-w-300 mx-auto p-5",
23770
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouVideoInfoHeader, {
23771
- type: props.data?.Type || "视频",
23772
- commentLength: props.data?.CommentLength || 0,
23773
- videoSize: props.data?.VideoSize,
23774
- likeCount: props.data?.likeCount,
23775
- viewCount: props.data?.viewCount,
23776
- imageLength: props.data?.ImageLength,
23777
- useDarkTheme: props.data?.useDarkTheme
23778
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouQRCodeSection, {
23779
- qrCodeDataUrl: props.qrCodeDataUrl || "",
23780
- type: props.data?.Type || "视频",
23781
- imageLength: props.data?.ImageLength,
23782
- useDarkTheme: props.data?.useDarkTheme
23783
- })]
23128
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouVideoInfoHeader, { ...props.data }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouQRCodeSection, { ...props.data })]
23784
23129
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23785
23130
  className: "overflow-auto mx-auto max-w-full",
23786
23131
  children: commentsArray.length > 0 ? commentsArray.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouCommentItemComponent, {
23787
- comment,
23132
+ ...comment,
23788
23133
  isLast: index === commentsArray.length - 1
23789
23134
  }, comment.cid || index)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23790
23135
  className: "flex justify-center items-center py-20 text-muted",
@@ -23820,7 +23165,7 @@ var InlineCalloutCode = ({ children, className }) => /* @__PURE__ */ (0, import_
23820
23165
  */
23821
23166
  var Changelog = import_react.memo((props) => {
23822
23167
  const isDark = props.data.useDarkTheme ?? false;
23823
- const { qrCodeDataUrl } = props;
23168
+ const share_url = props.data?.share_url || "";
23824
23169
  const backgroundColors = isDark ? {
23825
23170
  base: "#0a0a0a",
23826
23171
  primary: "rgba(212, 175, 55, 0.28)",
@@ -24132,12 +23477,12 @@ var Changelog = import_react.memo((props) => {
24132
23477
  children: props.data?.markdown ?? ""
24133
23478
  })
24134
23479
  }),
24135
- qrCodeDataUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23480
+ share_url && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
24136
23481
  className: "flex flex-col items-center gap-12 py-8",
24137
23482
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
24138
23483
  className: "w-120 h-auto",
24139
23484
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
24140
- src: qrCodeDataUrl,
23485
+ src: generateQRCode(share_url, isDark),
24141
23486
  alt: "二维码",
24142
23487
  className: "w-full h-full object-contain"
24143
23488
  })
@@ -25644,7 +24989,7 @@ var SectionTitle = ({ icon, en, zh, color }) => /* @__PURE__ */ (0, import_jsx_r
25644
24989
  * API错误显示组件 - 手机端 Apple 风格
25645
24990
  */
25646
24991
  var handlerError = (props) => {
25647
- const { data, qrCodeDataUrl } = props;
24992
+ const { data } = props;
25648
24993
  const isDark = data.useDarkTheme === true;
25649
24994
  const businessError = data.type === "business_error" ? data.error : null;
25650
24995
  const displayMethod = businessError?.businessName || data.method;
@@ -25919,7 +25264,7 @@ var handlerError = (props) => {
25919
25264
  children: displayMethod
25920
25265
  })]
25921
25266
  }),
25922
- data.isVerification && qrCodeDataUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25267
+ data.isVerification && data.verificationUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25923
25268
  className: "mb-16 p-12 rounded-[40px]",
25924
25269
  style: { backgroundColor: isDark ? "rgba(0,0,0,0.25)" : "rgba(255,255,255,0.6)" },
25925
25270
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -25935,7 +25280,7 @@ var handlerError = (props) => {
25935
25280
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25936
25281
  className: "flex gap-16 items-center",
25937
25282
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
25938
- src: qrCodeDataUrl,
25283
+ src: generateQRCode(data.verificationUrl, isDark),
25939
25284
  alt: "验证二维码",
25940
25285
  className: "w-64 h-64 rounded-3xl"
25941
25286
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -27086,7 +26431,7 @@ var LivePhotoTip = import_react.memo((props) => {
27086
26431
  ]
27087
26432
  }),
27088
26433
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
27089
- className: "relative z-10 flex flex-col min-h-360 px-20 py-16",
26434
+ className: "relative z-10 flex flex-col min-h-360 px-16 py-16",
27090
26435
  children: [
27091
26436
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
27092
26437
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -27095,7 +26440,7 @@ var LivePhotoTip = import_react.memo((props) => {
27095
26440
  className: "rounded-full p-5 shrink-0",
27096
26441
  style: { background: "radial-gradient(circle, " + (isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.06)") + " 0%, transparent 70%)" },
27097
26442
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowDownToLine, {
27098
- className: "w-20 h-auto",
26443
+ className: "w-30 h-auto",
27099
26444
  style: { color: primaryColor }
27100
26445
  })
27101
26446
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
@@ -27103,9 +26448,9 @@ var LivePhotoTip = import_react.memo((props) => {
27103
26448
  style: { color: accentColor },
27104
26449
  children: "保存原图"
27105
26450
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
27106
- className: "text-2xl mt-1",
26451
+ className: "text-5xl mt-1",
27107
26452
  style: { color: mutedColor },
27108
- children: "长按选择「保存原图」即可识别为实况照片"
26453
+ children: "点击「查看原图」后保存到相册即可识别为实况照片"
27109
26454
  })] })]
27110
26455
  }),
27111
26456
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -27191,7 +26536,7 @@ LivePhotoTip.displayName = "LivePhotoTip";
27191
26536
  * @returns JSX元素
27192
26537
  */
27193
26538
  var QrLogin = import_react.memo((props) => {
27194
- const qrCodeDataUrl = props.qrCodeDataUrl;
26539
+ const qrCodeDataUrl = props.data.qr_url ? generateQRCode(props.data.qr_url, props.data.useDarkTheme ?? false) : "";
27195
26540
  const isDark = props.data.useDarkTheme ?? false;
27196
26541
  const bgColor = isDark ? "#0f0f1a" : "#f8f6ff";
27197
26542
  const secondaryColor = isDark ? "#a78bfa" : "#8b5cf6";
@@ -27978,7 +27323,7 @@ var VersionWarning = (props) => {
27978
27323
  })
27979
27324
  }),
27980
27325
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Puzzle, {
27981
- className: clsx("w-10 h-auto"),
27326
+ className: cn("w-10 h-auto"),
27982
27327
  style: { color: mutedColor }
27983
27328
  }),
27984
27329
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
@@ -28248,35 +27593,11 @@ var formatXiaohongshuLikeCount = (count) => {
28248
27593
  return count || "0";
28249
27594
  };
28250
27595
  /**
28251
- * 二维码区域组件
28252
- * @param props 组件属性
28253
- * @returns JSX元素
28254
- */
28255
- var QRCodeSection = ({ qrCodeDataUrl }) => {
28256
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28257
- className: "flex flex-col justify-center items-center p-5",
28258
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28259
- className: "flex overflow-hidden justify-center items-center bg-white w-110 h-110",
28260
- children: qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
28261
- src: qrCodeDataUrl,
28262
- alt: "二维码",
28263
- className: "object-contain"
28264
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
28265
- width: 200,
28266
- className: "text-muted"
28267
- })
28268
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
28269
- className: "mt-5 text-[40px] text-muted text-center",
28270
- children: "扫码查看原笔记"
28271
- })]
28272
- });
28273
- };
28274
- /**
28275
27596
  * 笔记信息头部组件
28276
27597
  * @param props 组件属性
28277
27598
  * @returns JSX元素
28278
27599
  */
28279
- var NoteInfoHeader = ({ type, commentLength, imageLength, qrCodeDataUrl }) => {
27600
+ var NoteInfoHeader = (props) => {
28280
27601
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28281
27602
  className: "flex justify-between items-center max-w-300 mx-auto p-5",
28282
27603
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -28299,27 +27620,40 @@ var NoteInfoHeader = ({ type, commentLength, imageLength, qrCodeDataUrl }) => {
28299
27620
  children: [
28300
27621
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28301
27622
  className: "tracking-[6px] text-[45px] select-text",
28302
- children: ["笔记类型:", type]
27623
+ children: ["笔记类型:", props.Type]
28303
27624
  }),
28304
27625
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28305
27626
  className: "tracking-[6px] text-[45px] select-text",
28306
27627
  children: [
28307
27628
  "评论数量:",
28308
- commentLength,
27629
+ props.CommentLength,
28309
27630
  "条"
28310
27631
  ]
28311
27632
  }),
28312
- type === "图文" && imageLength && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
27633
+ props.Type === "图文" && props.ImageLength && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28313
27634
  className: "tracking-[6px] text-[45px] select-text",
28314
27635
  children: [
28315
27636
  "图片数量:",
28316
- imageLength,
27637
+ props.ImageLength,
28317
27638
  "张"
28318
27639
  ]
28319
27640
  })
28320
27641
  ]
28321
27642
  })]
28322
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection, { qrCodeDataUrl })]
27643
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
27644
+ className: "flex flex-col justify-center items-center p-5",
27645
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
27646
+ className: "flex overflow-hidden justify-center items-center bg-white w-110 h-110",
27647
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
27648
+ src: generateQRCode(props.share_url, props.useDarkTheme),
27649
+ alt: "二维码",
27650
+ className: "object-contain"
27651
+ })
27652
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
27653
+ className: "mt-5 text-[40px] text-muted text-center",
27654
+ children: "扫码查看原笔记"
27655
+ })]
27656
+ })]
28323
27657
  });
28324
27658
  };
28325
27659
  /**
@@ -28327,11 +27661,11 @@ var NoteInfoHeader = ({ type, commentLength, imageLength, qrCodeDataUrl }) => {
28327
27661
  * @param props 组件属性
28328
27662
  * @returns JSX元素
28329
27663
  */
28330
- var CommentItemComponent = ({ comment, isLast = false }) => {
27664
+ var CommentItemComponent = ({ ...props }, isLast = false) => {
28331
27665
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28332
27666
  className: `flex px-10 pt-15 ${isLast ? "pb-0" : "pb-15"}`,
28333
27667
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
28334
- src: comment.user_info.image,
27668
+ src: props.user_info.image,
28335
27669
  className: "mb-12.5 w-[187.5px] h-[187.5px] rounded-full mr-8 object-cover shadow-lg",
28336
27670
  alt: "用户头像"
28337
27671
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -28341,8 +27675,8 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
28341
27675
  className: "mb-12.5 text-[50px] text-foreground/70 relative flex items-center select-text",
28342
27676
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
28343
27677
  className: "text-5xl",
28344
- children: comment.user_info.nickname
28345
- }), comment.show_tags && comment.show_tags.length > 0 && comment.show_tags.map((tag, index) => {
27678
+ children: props.user_info.nickname
27679
+ }), props.show_tags && props.show_tags.length > 0 && props.show_tags.map((tag, index) => {
28346
27680
  if (tag === "is_author") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28347
27681
  className: "inline-block px-6 py-3 ml-3 text-4xl rounded-full bg-surface text-muted",
28348
27682
  children: "作者"
@@ -28360,13 +27694,13 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
28360
27694
  wordBreak: "break-word",
28361
27695
  overflowWrap: "break-word"
28362
27696
  },
28363
- children: renderXiaohongshuCommentRichText(comment.content)
27697
+ children: renderXiaohongshuCommentRichText(props.content)
28364
27698
  }),
28365
- comment.pictures && comment.pictures.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
27699
+ props.pictures && props.pictures.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28366
27700
  className: "flex my-5 overflow-hidden shadow-md rounded-2xl w-[95%] flex-1",
28367
27701
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
28368
27702
  className: "object-contain w-full h-full rounded-2xl",
28369
- src: comment.pictures[0].url_default,
27703
+ src: props.pictures[0].url_default,
28370
27704
  alt: "评论图片"
28371
27705
  })
28372
27706
  }),
@@ -28377,17 +27711,17 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
28377
27711
  children: [
28378
27712
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
28379
27713
  className: "text-[45px]",
28380
- children: formatXiaohongshuCommentTime(comment.create_time)
27714
+ children: formatXiaohongshuCommentTime(props.create_time)
28381
27715
  }),
28382
27716
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
28383
27717
  className: "text-[45px]",
28384
- children: comment.ip_location
27718
+ children: props.ip_location
28385
27719
  }),
28386
- parseInt(comment.sub_comment_count) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
27720
+ parseInt(props.sub_comment_count) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
28387
27721
  className: "text-[40px] text-foreground/70",
28388
27722
  children: [
28389
27723
  "共",
28390
- comment.sub_comment_count,
27724
+ props.sub_comment_count,
28391
27725
  "条回复"
28392
27726
  ]
28393
27727
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
@@ -28401,10 +27735,10 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
28401
27735
  className: "flex items-center space-x-2 transition-colors cursor-pointer",
28402
27736
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Heart, {
28403
27737
  size: 60,
28404
- className: comment.liked ? "text-red-500 fill-current" : "text-muted"
27738
+ className: props.liked ? "text-red-500 fill-current" : "text-muted"
28405
27739
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
28406
27740
  className: "text-[50px] select-text",
28407
- children: formatXiaohongshuLikeCount(comment.like_count)
27741
+ children: formatXiaohongshuLikeCount(props.like_count)
28408
27742
  })]
28409
27743
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28410
27744
  className: "flex items-center transition-colors cursor-pointer",
@@ -28415,10 +27749,10 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
28415
27749
  })]
28416
27750
  })]
28417
27751
  }),
28418
- comment.sub_comments && comment.sub_comments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
27752
+ props.sub_comments && props.sub_comments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28419
27753
  className: "pl-6 mt-6",
28420
- children: comment.sub_comments.map((subComment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28421
- className: `py-4 ${index !== comment.sub_comments.length - 1 ? "border-b border-divider" : ""}`,
27754
+ children: props.sub_comments.map((subComment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
27755
+ className: `py-4 ${index !== props.sub_comments.length - 1 ? "border-b border-divider" : ""}`,
28422
27756
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
28423
27757
  className: "flex items-start space-x-4",
28424
27758
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
@@ -28487,18 +27821,13 @@ var XiaohongshuComment = import_react.memo((props) => {
28487
27821
  ...props,
28488
27822
  children: [
28489
27823
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-30" }),
28490
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoteInfoHeader, {
28491
- type: props.data.Type,
28492
- commentLength: props.data.CommentLength,
28493
- imageLength: props.data.ImageLength,
28494
- qrCodeDataUrl: props.qrCodeDataUrl
28495
- }),
27824
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoteInfoHeader, { ...props.data }),
28496
27825
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28497
27826
  className: "overflow-auto mx-20 max-w-full",
28498
27827
  children: props.data.CommentsData.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
28499
27828
  className: "divide-y divide-divider",
28500
27829
  children: props.data.CommentsData.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentItemComponent, {
28501
- comment,
27830
+ ...comment,
28502
27831
  isLast: index === props.data.CommentsData.length - 1
28503
27832
  }, comment.id))
28504
27833
  }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -30031,6 +29360,7 @@ var SSRRender = class {
30031
29360
  async render(request) {
30032
29361
  try {
30033
29362
  logger$1.debug("[SSR] 开始渲染组件,预设模板:", `${logger$1.yellow(`${request.templateType}/`)}${request.templateName}`);
29363
+ const startTime = Date.now();
30034
29364
  const ctx = {
30035
29365
  request,
30036
29366
  outputDir: this.outputDir,
@@ -30053,6 +29383,8 @@ var SSRRender = class {
30053
29383
  const fullHtml = this.htmlWrapper.wrapContent(ctx.state.html ?? htmlContent, filePath, request.data.useDarkTheme ?? false);
30054
29384
  fs.writeFileSync(filePath, fullHtml, "utf-8");
30055
29385
  if (process.env.NODE_ENV === "development") DevDataManager.saveRenderData(request.templateType, request.templateName, buildDevPreviewPayload(request.data, ctx.state.props));
29386
+ const endTime = Date.now();
29387
+ logger$1.debug(`[SSR] ${logger$1.yellow(`${request.templateType}/`)}${request.templateName} Done! ${endTime - startTime >= 1e3 ? logger$1.green(`${((endTime - startTime) / 1e3).toFixed(2)} s`) : logger$1.green(`${endTime - startTime} ms`)}`);
30056
29388
  return {
30057
29389
  success: true,
30058
29390
  htmlPath: filePath
@@ -30247,114 +29579,12 @@ var isSemverGreater = (remote, local) => {
30247
29579
  };
30248
29580
  //#endregion
30249
29581
  //#region src/module/utils/Render/plugins.ts
30250
- var import_qr_code_styling = /* @__PURE__ */ __toESM(require_qr_code_styling(), 1);
30251
- /**
30252
- * 创建 DOMPurify 实例
30253
- * 使用 happy-dom 的 Window 来创建隔离的 DOM 环境
30254
- */
30255
- var createDomPurify = () => {
30256
- return purify(new Window());
30257
- };
30258
- /**
30259
- * 对值进行消毒处理
30260
- * 如果是字符串则进行 HTML 消毒
30261
- * 如果是数组则递归处理每个元素
30262
- * 如果是对象则递归处理每个属性值
30263
- * 其他类型直接返回原值
30264
- * @param value 需要消毒的值
30265
- * @returns 消毒后的值
30266
- */
30267
- var sanitizeValue = (value) => {
30268
- const domPurify = createDomPurify();
30269
- if (typeof value === "string") return domPurify.sanitize(value);
30270
- if (Array.isArray(value)) return value.map((item) => sanitizeValue(item));
30271
- if (value && typeof value === "object") {
30272
- const output = {};
30273
- for (const [key, item] of Object.entries(value)) output[key] = sanitizeValue(item);
30274
- return output;
30275
- }
30276
- return value;
30277
- };
30278
- /**
30279
- * 对渲染数据进行消毒处理,防止 XSS 攻击。
30280
- * 在渲染前调用,确保数据安全。
30281
- */
30282
- var createSanitizeContentPlugin = () => {
30283
- return {
30284
- name: "数据消毒",
30285
- enforce: "pre",
30286
- beforeRender(ctx) {
30287
- ctx.request.data = sanitizeValue(ctx.request.data);
30288
- ctx.state.props = sanitizeValue(ctx.state.props);
30289
- }
30290
- };
30291
- };
30292
- /**
30293
- * 二维码插件工厂
30294
- * 为指定字段生成二维码数据 URL
30295
- * @param options 插件配置选项
30296
- * @returns 二维码插件实例
30297
- */
30298
- var createQrCodePlugin = () => {
30299
- return {
30300
- name: "生成二维码",
30301
- enforce: "pre",
30302
- async beforeRender(ctx) {
30303
- const data = ctx.request.data || {};
30304
- const useDarkTheme = Boolean(data.useDarkTheme);
30305
- const toDataUrl = async (url) => {
30306
- const buffer = await new import_qr_code_styling.default({
30307
- jsdom: Window,
30308
- type: "svg",
30309
- shape: "square",
30310
- width: 2e3,
30311
- height: 2e3,
30312
- data: url,
30313
- margin: 0,
30314
- qrOptions: {
30315
- typeNumber: 0,
30316
- mode: "Byte",
30317
- errorCorrectionLevel: "L"
30318
- },
30319
- imageOptions: {
30320
- hideBackgroundDots: false,
30321
- imageSize: .4,
30322
- margin: 0
30323
- },
30324
- dotsOptions: {
30325
- type: "rounded",
30326
- color: useDarkTheme ? "#C3C3C3" : "#3A3A3A",
30327
- roundSize: false
30328
- },
30329
- backgroundOptions: { color: "transparent" },
30330
- cornersSquareOptions: {
30331
- type: "extra-rounded",
30332
- color: useDarkTheme ? "#C3C3C3" : "#3A3A3A"
30333
- },
30334
- cornersDotOptions: { color: useDarkTheme ? "#C3C3C3" : "#3A3A3A" }
30335
- }).getRawData("svg");
30336
- if (!buffer) throw new Error("Failed to generate QR code");
30337
- return `data:image/svg+xml;base64,${buffer.toString("base64")}`;
30338
- };
30339
- const props = ctx.state.props || {};
30340
- if (!props.qrCodes) props.qrCodes = {};
30341
- if (!props.qrCodeDataUrl) props.qrCodeDataUrl = void 0;
30342
- if (typeof data.share_url === "string" && data.share_url.length > 0) {
30343
- const dataUrl = await toDataUrl(data.share_url);
30344
- const qrCodes = props.qrCodes;
30345
- qrCodes.share_url = dataUrl;
30346
- if (!props.qrCodeDataUrl) props.qrCodeDataUrl = dataUrl;
30347
- }
30348
- ctx.state.props = props;
30349
- }
30350
- };
30351
- };
30352
29582
  var clamp = (value, min, max) => {
30353
29583
  return Math.min(max, Math.max(min, value));
30354
29584
  };
30355
29585
  var buildProxyImageUrl = (url) => {
30356
29586
  if (!url || !url.startsWith("http")) return url;
30357
- return `https://images.weserv.nl/?url=${encodeURIComponent(url)}&w=96&h=96&fit=cover&output=jpg`;
29587
+ return `https://images.weserv.nl/?url=${encodeURIComponent(url)}&w=96&h=96&fit=cover&output=png`;
30358
29588
  };
30359
29589
  var mixRgb = (a, b, weight) => {
30360
29590
  const w = clamp(weight, 0, 1);
@@ -30432,20 +29662,80 @@ var tuneRgb = (rgb, saturationMin, lightnessTarget) => {
30432
29662
  const { h, s } = rgbToHsl(rgb);
30433
29663
  return hslToRgb(h, Math.max(s, saturationMin), clamp(lightnessTarget, 0, 1));
30434
29664
  };
30435
- var decodeImageToPixels = (buffer, contentType) => {
30436
- if (contentType.includes("png")) {
30437
- const decoded = import_png.PNG.sync.read(buffer);
30438
- return {
30439
- data: decoded.data,
30440
- width: decoded.width,
30441
- height: decoded.height
30442
- };
29665
+ var decodePngToPixels = (buffer) => {
29666
+ if (buffer[0] !== 137 || buffer[1] !== 80) return null;
29667
+ let offset = 8;
29668
+ let width = 0;
29669
+ let height = 0;
29670
+ let bitDepth = 0;
29671
+ let colorType = 0;
29672
+ const idatChunks = [];
29673
+ while (offset < buffer.length) {
29674
+ const length = buffer.readUInt32BE(offset);
29675
+ const type = buffer.toString("ascii", offset + 4, offset + 8);
29676
+ const chunkData = buffer.subarray(offset + 8, offset + 8 + length);
29677
+ if (type === "IHDR") {
29678
+ width = chunkData.readUInt32BE(0);
29679
+ height = chunkData.readUInt32BE(4);
29680
+ bitDepth = chunkData[8];
29681
+ colorType = chunkData[9];
29682
+ } else if (type === "IDAT") idatChunks.push(chunkData);
29683
+ else if (type === "IEND") break;
29684
+ offset += 12 + length;
29685
+ }
29686
+ if (!width || !height || bitDepth !== 8) return null;
29687
+ const channels = colorType === 6 ? 4 : colorType === 2 ? 3 : 0;
29688
+ if (!channels) return null;
29689
+ const raw = inflateSync(Buffer.concat(idatChunks));
29690
+ const stride = width * channels;
29691
+ const pixels = Buffer.alloc(width * height * 4);
29692
+ const prevRow = Buffer.alloc(stride);
29693
+ let rawOffset = 0;
29694
+ for (let y = 0; y < height; y++) {
29695
+ const filter = raw[rawOffset++];
29696
+ const curRow = Buffer.alloc(stride);
29697
+ for (let x = 0; x < stride; x++) {
29698
+ const val = raw[rawOffset++];
29699
+ const a = x >= channels ? curRow[x - channels] : 0;
29700
+ const b = prevRow[x];
29701
+ const c = x >= channels ? prevRow[x - channels] : 0;
29702
+ switch (filter) {
29703
+ case 0:
29704
+ curRow[x] = val;
29705
+ break;
29706
+ case 1:
29707
+ curRow[x] = val + a & 255;
29708
+ break;
29709
+ case 2:
29710
+ curRow[x] = val + b & 255;
29711
+ break;
29712
+ case 3:
29713
+ curRow[x] = val + (a + b >> 1) & 255;
29714
+ break;
29715
+ case 4: {
29716
+ const p = a + b - c;
29717
+ const pa = Math.abs(p - a);
29718
+ const pb = Math.abs(p - b);
29719
+ const pc = Math.abs(p - c);
29720
+ curRow[x] = val + (pa <= pb && pa <= pc ? a : pb <= pc ? b : c) & 255;
29721
+ break;
29722
+ }
29723
+ }
29724
+ }
29725
+ for (let x = 0; x < width; x++) {
29726
+ const pi = (y * width + x) * 4;
29727
+ const ci = x * channels;
29728
+ pixels[pi] = curRow[ci];
29729
+ pixels[pi + 1] = curRow[ci + 1];
29730
+ pixels[pi + 2] = curRow[ci + 2];
29731
+ pixels[pi + 3] = channels === 4 ? curRow[ci + 3] : 255;
29732
+ }
29733
+ curRow.copy(prevRow);
30443
29734
  }
30444
- const decoded = import_jpeg_js.default.decode(buffer, { useTArray: true });
30445
29735
  return {
30446
- data: decoded.data,
30447
- width: decoded.width,
30448
- height: decoded.height
29736
+ data: pixels,
29737
+ width,
29738
+ height
30449
29739
  };
30450
29740
  };
30451
29741
  var createPosterPalette = (seed, isDark) => {
@@ -30480,8 +29770,10 @@ var createPosterPalette = (seed, isDark) => {
30480
29770
  coverShade: isDark ? "rgba(0, 0, 0, 0.42)" : "rgba(10, 24, 32, 0.34)"
30481
29771
  };
30482
29772
  };
30483
- var extractPosterPaletteSeedFromBuffer = (buffer, contentType) => {
30484
- const { data } = decodeImageToPixels(buffer, contentType);
29773
+ var extractPosterPaletteSeedFromBuffer = (buffer) => {
29774
+ const decoded = decodePngToPixels(buffer);
29775
+ if (!decoded) return null;
29776
+ const { data } = decoded;
30485
29777
  let weightedR = 0;
30486
29778
  let weightedG = 0;
30487
29779
  let weightedB = 0;
@@ -30536,9 +29828,11 @@ var createPosterPalettePlugin = () => {
30536
29828
  const useDarkTheme = Boolean(ctx.request.useDarkTheme ?? data.useDarkTheme);
30537
29829
  const candidates = [buildProxyImageUrl(imageUrl), imageUrl];
30538
29830
  for (const candidate of candidates) try {
30539
- const response = await fetch(candidate, { headers: { accept: "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8" } });
30540
- if (!response.ok) continue;
30541
- const paletteSeed = extractPosterPaletteSeedFromBuffer(Buffer.from(await response.arrayBuffer()), response.headers.get("content-type") || "image/jpeg");
29831
+ const response = await axios.get(candidate, {
29832
+ responseType: "arraybuffer",
29833
+ headers: { accept: "image/png,image/apng,image/*,*/*;q=0.8" }
29834
+ });
29835
+ const paletteSeed = extractPosterPaletteSeedFromBuffer(Buffer.from(response.data));
30542
29836
  if (paletteSeed) {
30543
29837
  const lightPalette = createPosterPalette(paletteSeed, false);
30544
29838
  const darkPalette = createPosterPalette(paletteSeed, true);
@@ -30596,9 +29890,10 @@ var embedWatermark = (pngBytes, watermarkText) => {
30596
29890
  * @template P 渲染路径,必须是有效的动态路径
30597
29891
  * @param path 渲染路径,格式为 "平台/组件ID" 或 "平台/分类/组件ID"
30598
29892
  * @param data 渲染数据,类型根据路径自动推断
29893
+ * @options 渲染选项
30599
29894
  * @returns 渲染结果图片元素数组的 Promise
30600
29895
  */
30601
- var Render = async (event, path$1, data) => {
29896
+ var Render = async (event, path$1, data, options) => {
30602
29897
  const pathParts = path$1.split("/");
30603
29898
  let templateType;
30604
29899
  let templateName;
@@ -30641,11 +29936,7 @@ var Render = async (event, path$1, data) => {
30641
29936
  }
30642
29937
  },
30643
29938
  outputDir,
30644
- plugins: [
30645
- createQrCodePlugin(),
30646
- createPosterPalettePlugin(),
30647
- createSanitizeContentPlugin()
30648
- ]
29939
+ plugins: [createPosterPalettePlugin()]
30649
29940
  }).then((res) => {
30650
29941
  if (!res.success || !res.htmlPath) throw new Error(res.error);
30651
29942
  return res;
@@ -30656,7 +29947,7 @@ var Render = async (event, path$1, data) => {
30656
29947
  const renderResult = await render.render({
30657
29948
  name: `${Root.pluginName}/${templateType}`,
30658
29949
  file: result.htmlPath,
30659
- multiPage: Config.app.multiPageRender && event.bot.adapter.name !== "QQ Official Bot" ? Config.app.multiPageHeight : false,
29950
+ multiPage: Config.app.multiPageRender && event.bot.adapter.protocol !== "qqbot" ? Config.app.multiPageHeight : false,
30660
29951
  selector: "#container",
30661
29952
  fullPage: false,
30662
29953
  type: "png",
@@ -30671,7 +29962,9 @@ var Render = async (event, path$1, data) => {
30671
29962
  const imageStats = [];
30672
29963
  for (const image of images) {
30673
29964
  const imageBuffer = Buffer.from(image, "base64");
30674
- const finalImageBuffer = embedWatermark(imageBuffer, watermarkText) ?? imageBuffer;
29965
+ let finalImageBuffer;
29966
+ if (options?.skipWatermark) finalImageBuffer = imageBuffer;
29967
+ else finalImageBuffer = embedWatermark(imageBuffer, watermarkText) ?? imageBuffer;
30675
29968
  const metadata = getImageMetadata(finalImageBuffer);
30676
29969
  const dimensions = metadata.width && metadata.height ? `${metadata.width}x${metadata.height}` : "unknown";
30677
29970
  imageStats.push({
@@ -30707,6 +30000,24 @@ var getImageMetadata = (buffer) => {
30707
30000
  };
30708
30001
  return {};
30709
30002
  };
30003
+ /**
30004
+ * 对已渲染的图片元素数组应用水印
30005
+ * 用于推送场景:渲染一次,按目标群逐个嵌入不同 bot 的水印
30006
+ */
30007
+ var applyWatermarkToImages = (images, event) => {
30008
+ if (Config.app.RemoveWatermark) return images;
30009
+ const watermarkText = JSON.stringify({
30010
+ a: Date.now(),
30011
+ b: `Generated by karin-plugin-kkk v${Root.pluginVersion}, with source code open-sourced under the GPL-3.0 license`,
30012
+ c: `Sent by ${event?.bot?.account.selfId ?? "unknown"}|${event?.bot?.account.name ?? "unknown"}`
30013
+ });
30014
+ return images.map((img) => {
30015
+ const base64Data = img.file.replace(/^base64:\/\//, "");
30016
+ const buffer = Buffer.from(base64Data, "base64");
30017
+ const watermarked = embedWatermark(buffer, watermarkText) ?? buffer;
30018
+ return segment.image("base64://" + watermarked.toString("base64"));
30019
+ });
30020
+ };
30710
30021
  //#endregion
30711
30022
  //#region src/module/db/bilibili.ts
30712
30023
  /** 数据库操作类 */
@@ -36591,7 +35902,7 @@ var Bilibili = class extends Base {
36591
35902
  outputPath,
36592
35903
  loopCount,
36593
35904
  staticImagePath: staticImg.filepath,
36594
- transitionEnabled: loopCount > 1
35905
+ transitionEnabled: true
36595
35906
  })).success) {
36596
35907
  const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
36597
35908
  fs.renameSync(outputPath, filePath);
@@ -36749,24 +36060,28 @@ var Bilibili = class extends Base {
36749
36060
  const text = buildBilibiliDynamicRichText(dynamicInfo.data.data.item.modules.module_dynamic.desc.text, dynamicInfo.data.data.item.modules.module_dynamic.desc.rich_text_nodes);
36750
36061
  const imgList = [];
36751
36062
  for (const richTxtItem of dynamicInfo.data.data.item.modules.module_dynamic.desc.rich_text_nodes) if (richTxtItem.type === "RICH_TEXT_NODE_TYPE_VIEW_PICTURE") for (const pic of richTxtItem.pics) imgList.push(pic.src);
36752
- let data = {};
36063
+ let original_content = {};
36753
36064
  switch (dynamicInfo.data.data.item.orig.type) {
36754
- case DynamicType.AV:
36755
- data = {
36065
+ case DynamicType.AV: {
36066
+ const desc = dynamicInfo.data.data.item.orig.modules.module_dynamic?.desc || {
36067
+ text: "",
36068
+ rich_text_nodes: []
36069
+ };
36070
+ original_content = { DYNAMIC_TYPE_AV: {
36756
36071
  usernameMeta: getUsernameMetadata(dynamicInfo.data.data.item.orig.modules.module_author),
36757
- pub_action: dynamicInfo.data.data.item.orig.modules.module_author.pub_action,
36758
36072
  avatar_url: dynamicInfo.data.data.item.orig.modules.module_author.face,
36759
36073
  duration_text: dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.duration_text,
36074
+ text: buildBilibiliDynamicRichText(desc.text, desc.rich_text_nodes),
36760
36075
  title: buildBilibiliDynamicRichText(dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.title, []),
36761
36076
  danmaku: dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.stat.danmaku,
36762
- view: dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.stat.view,
36763
36077
  play: dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.stat.play,
36764
36078
  cover: dynamicInfo.data.data.item.orig.modules.module_dynamic.major.archive.cover,
36765
36079
  create_time: TimeFormatter.toDateTime(dynamicInfo.data.data.item.orig.modules.module_author.pub_ts),
36766
36080
  decoration_card: generateDecorationCard(dynamicInfo.data.data.item.orig.modules.module_author.decoration_card),
36767
36081
  frame: dynamicInfo.data.data.item.orig.modules.module_author.pendant.image
36768
- };
36082
+ } };
36769
36083
  break;
36084
+ }
36770
36085
  case DynamicType.DRAW: {
36771
36086
  const origMd = dynamicInfo.data.data.item.orig.modules.module_dynamic;
36772
36087
  if (origMd.topic) {
@@ -36785,8 +36100,8 @@ var Bilibili = class extends Base {
36785
36100
  summary.text = summary.text ? `${name}\n${summary.text}` : name;
36786
36101
  }
36787
36102
  }
36788
- data = {
36789
- title: dynamicInfo.data.data.item.orig.modules.module_dynamic.major?.opus?.title ?? null,
36103
+ original_content = { DYNAMIC_TYPE_DRAW: {
36104
+ title: dynamicInfo.data.data.item.orig.modules.module_dynamic.major?.opus?.title ?? void 0,
36790
36105
  usernameMeta: getUsernameMetadata(dynamicInfo.data.data.item.orig.modules.module_author),
36791
36106
  create_time: TimeFormatter.toDateTime(dynamicInfo.data.data.item.orig.modules.module_author.pub_ts),
36792
36107
  avatar_url: dynamicInfo.data.data.item.orig.modules.module_author.face,
@@ -36794,7 +36109,7 @@ var Bilibili = class extends Base {
36794
36109
  image_url: Object.values(dynamicInfo.data.data.item.orig.modules.module_dynamic.major.opus.pics).filter((item) => typeof item?.url === "string").map((item) => ({ image_src: item.url })),
36795
36110
  decoration_card: generateDecorationCard(dynamicInfo.data.data.item.orig.modules.module_author.decoration_card),
36796
36111
  frame: dynamicInfo.data.data.item.orig.modules.module_author.pendant.image
36797
- };
36112
+ } };
36798
36113
  break;
36799
36114
  }
36800
36115
  case DynamicType.WORD: {
@@ -36813,7 +36128,7 @@ var Bilibili = class extends Base {
36813
36128
  summary.text = summary.text ? `${name}\n${summary.text}` : name;
36814
36129
  }
36815
36130
  }
36816
- data = {
36131
+ original_content = { DYNAMIC_TYPE_WORD: {
36817
36132
  usernameMeta: getUsernameMetadata(dynamicInfo.data.data.item.orig.modules.module_author),
36818
36133
  create_time: TimeFormatter.toDateTime(dynamicInfo.data.data.item.orig.modules.module_author.pub_ts),
36819
36134
  avatar_url: dynamicInfo.data.data.item.orig.modules.module_author.face,
@@ -36821,12 +36136,12 @@ var Bilibili = class extends Base {
36821
36136
  decoration_card: generateDecorationCard(dynamicInfo.data.data.item.orig.modules.module_author.decoration_card),
36822
36137
  frame: dynamicInfo.data.data.item.orig.modules.module_author.pendant.image,
36823
36138
  additional: parseAdditionalCard(dynamicInfo.data.data.item.orig.modules.module_dynamic.additional)
36824
- };
36139
+ } };
36825
36140
  break;
36826
36141
  }
36827
36142
  case DynamicType.LIVE_RCMD: {
36828
36143
  const liveData = JSON.parse(dynamicInfo.data.data.item.orig.modules.module_dynamic.major.live_rcmd.content);
36829
- data = {
36144
+ original_content = { DYNAMIC_TYPE_LIVE_RCMD: {
36830
36145
  usernameMeta: getUsernameMetadata(dynamicInfo.data.data.item.orig.modules.module_author),
36831
36146
  create_time: TimeFormatter.toDateTime(dynamicInfo.data.data.item.orig.modules.module_author.pub_ts),
36832
36147
  avatar_url: dynamicInfo.data.data.item.orig.modules.module_author.face,
@@ -36837,7 +36152,7 @@ var Bilibili = class extends Base {
36837
36152
  area_name: liveData.live_play_info.area_name,
36838
36153
  title: buildBilibiliDynamicRichText(liveData.live_play_info.title, []),
36839
36154
  online: liveData.live_play_info.online
36840
- };
36155
+ } };
36841
36156
  break;
36842
36157
  }
36843
36158
  default:
@@ -36862,7 +36177,7 @@ var Bilibili = class extends Base {
36862
36177
  dynamicTYPE: "转发动态解析",
36863
36178
  decoration_card: generateDecorationCard(dynamicInfo.data.data.item.modules.module_author.decoration_card),
36864
36179
  render_time: TimeFormatter.now(),
36865
- original_content: { [dynamicInfo.data.data.item.orig.type]: data },
36180
+ original_content,
36866
36181
  dynamic_id: dynamicInfo.data.data.item.id_str
36867
36182
  }));
36868
36183
  break;
@@ -38247,7 +37562,7 @@ var Bilibilipush = class extends Base {
38247
37562
  additional: parseAdditionalCard(data[dynamicId].Dynamic_Data.modules.module_dynamic.additional),
38248
37563
  dynamicTYPE: "图文动态推送",
38249
37564
  dynamic_id: dynamicId
38250
- });
37565
+ }, { skipWatermark: true });
38251
37566
  break;
38252
37567
  /** 处理纯文动态 */
38253
37568
  case DynamicType.WORD: {
@@ -38284,7 +37599,7 @@ var Bilibilipush = class extends Base {
38284
37599
  additional: parseAdditionalCard(data[dynamicId].Dynamic_Data.modules.module_dynamic.additional),
38285
37600
  dynamicTYPE: "纯文动态推送",
38286
37601
  dynamic_id: dynamicId
38287
- });
37602
+ }, { skipWatermark: true });
38288
37603
  break;
38289
37604
  }
38290
37605
  /** 处理视频动态 */
@@ -38357,7 +37672,7 @@ var Bilibilipush = class extends Base {
38357
37672
  dynamicTYPE: "视频动态推送",
38358
37673
  dynamic_id: dynamicId,
38359
37674
  staff
38360
- });
37675
+ }, { skipWatermark: true });
38361
37676
  }
38362
37677
  break;
38363
37678
  /** 处理直播动态 */
@@ -38375,7 +37690,7 @@ var Bilibilipush = class extends Base {
38375
37690
  now_time: TimeFormatter.now(),
38376
37691
  share_url: "https://live.bilibili.com/" + liveInfo.live_play_info.room_id,
38377
37692
  dynamicTYPE: "直播动态推送"
38378
- });
37693
+ }, { skipWatermark: true });
38379
37694
  break;
38380
37695
  }
38381
37696
  /** 处理转发动态 */
@@ -38515,7 +37830,7 @@ var Bilibilipush = class extends Base {
38515
37830
  original_content: { [data[dynamicId].Dynamic_Data.orig.type]: param },
38516
37831
  imgList: imgList.length > 0 ? imgList : null,
38517
37832
  dynamic_id: dynamicId
38518
- });
37833
+ }, { skipWatermark: true });
38519
37834
  break;
38520
37835
  }
38521
37836
  /** 文章/专栏动态 */
@@ -38549,7 +37864,7 @@ var Bilibilipush = class extends Base {
38549
37864
  render_time: TimeFormatter.now(),
38550
37865
  share_url: articleContent.dyn_id_str ? `https://www.bilibili.com/opus/${articleContent.dyn_id_str}` : `https://www.bilibili.com/read/cv${articleContent.id}`,
38551
37866
  dynamicTYPE: "专栏动态推送"
38552
- });
37867
+ }, { skipWatermark: true });
38553
37868
  break;
38554
37869
  }
38555
37870
  /** 未处理的动态类型 */
@@ -38567,7 +37882,11 @@ var Bilibilipush = class extends Base {
38567
37882
  const { groupId, botId } = target;
38568
37883
  const bot = karin$1.getBot(botId);
38569
37884
  const Contact = karin$1.contactGroup(groupId);
38570
- status = await karin$1.sendMsg(botId, Contact, img ? [...img] : []);
37885
+ const eventWithBot = this.e;
37886
+ eventWithBot.bot = bot;
37887
+ eventWithBot.selfId = botId;
37888
+ const watermarkedImg = img ? applyWatermarkToImages(img, this.e) : [];
37889
+ status = await karin$1.sendMsg(botId, Contact, [...watermarkedImg]);
38571
37890
  if (Config.bilibili.push.parsedynamic && status.messageId) switch (data[dynamicId].dynamic_type) {
38572
37891
  case "DYNAMIC_TYPE_AV":
38573
37892
  if (send_video) {
@@ -38699,7 +38018,7 @@ var Bilibilipush = class extends Base {
38699
38018
  outputPath,
38700
38019
  loopCount,
38701
38020
  staticImagePath: staticImg.filepath,
38702
- transitionEnabled: loopCount > 1
38021
+ transitionEnabled: true
38703
38022
  })).success) {
38704
38023
  const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
38705
38024
  fs.renameSync(outputPath, filePath);
@@ -39128,6 +38447,8 @@ registerErrorStrategy({
39128
38447
  });
39129
38448
  //#endregion
39130
38449
  //#region src/platform/douyin/comments.ts
38450
+ var import_heic_decode = /* @__PURE__ */ __toESM(require_heic_decode(), 1);
38451
+ var import_jpeg_js = /* @__PURE__ */ __toESM(require_jpeg_js(), 1);
39131
38452
  /**
39132
38453
  * @description 提取评论里的 @ 用户 sec_uid 列表
39133
38454
  */
@@ -41197,7 +40518,7 @@ var DouYinpush = class extends Base {
41197
40518
  following_count: this.count(Detail_Data.user_info.data.user.following_count),
41198
40519
  total_favorited: this.count(Detail_Data.user_info.data.user.total_favorited),
41199
40520
  has_commerce_goods: liveItem.has_commerce_goods
41200
- });
40521
+ }, { skipWatermark: true });
41201
40522
  } else {
41202
40523
  const realUrl = Config.douyin.push.shareType === "web" && await new Network({
41203
40524
  url: Detail_Data.share_url,
@@ -41227,7 +40548,7 @@ var DouYinpush = class extends Base {
41227
40548
  author_avatar: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + authorUserInfo.data.user.avatar_larger.uri,
41228
40549
  author_douyin_id: authorUserInfo.data.user.unique_id === "" ? authorUserInfo.data.user.short_id : authorUserInfo.data.user.unique_id,
41229
40550
  share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`
41230
- });
40551
+ }, { skipWatermark: true });
41231
40552
  } else if (pushItem.pushType === "recommend") {
41232
40553
  const authorUserInfo = "author_user_info" in Detail_Data ? Detail_Data.author_user_info : void 0;
41233
40554
  const coverUrl = getWorkCoverUrl(getWorkTypeInfo(Detail_Data), Detail_Data);
@@ -41247,7 +40568,7 @@ var DouYinpush = class extends Base {
41247
40568
  author_avatar: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + authorUserInfo.data.user.avatar_larger.uri,
41248
40569
  author_douyin_id: authorUserInfo.data.user.unique_id === "" ? authorUserInfo.data.user.short_id : authorUserInfo.data.user.unique_id,
41249
40570
  share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`
41250
- });
40571
+ }, { skipWatermark: true });
41251
40572
  } else {
41252
40573
  const dynamicTypeLabel = "作品动态推送";
41253
40574
  const workTypeInfo = getWorkTypeInfo(Detail_Data);
@@ -41273,7 +40594,7 @@ var DouYinpush = class extends Base {
41273
40594
  粉丝: this.count(Detail_Data.user_info.data.user.follower_count),
41274
40595
  share_url: Detail_Data.share_url,
41275
40596
  useDarkTheme: false
41276
- });
40597
+ }, { skipWatermark: true });
41277
40598
  } else img = await Render(this.e, workTypeInfo.templatePath, {
41278
40599
  image_url: coverUrl,
41279
40600
  desc: this.desc(Detail_Data, Detail_Data.desc),
@@ -41315,7 +40636,7 @@ var DouYinpush = class extends Base {
41315
40636
  subscriber_role: subscriberInCreators?.role_title ?? (subscriberUid && Detail_Data.author?.uid && subscriberUid === Detail_Data.author.uid || subscriberSecUid && Detail_Data.author?.sec_uid && subscriberSecUid === Detail_Data.author.sec_uid || Detail_Data.user_info.data.user.nickname && Detail_Data.author?.nickname && Detail_Data.user_info.data.user.nickname === Detail_Data.author.nickname ? "作者" : void 0)
41316
40637
  };
41317
40638
  })()
41318
- });
40639
+ }, { skipWatermark: true });
41319
40640
  }
41320
40641
  }
41321
40642
  for (const target of pushItem.targets) {
@@ -41323,7 +40644,12 @@ var DouYinpush = class extends Base {
41323
40644
  const { groupId, botId } = target;
41324
40645
  if (!skip) {
41325
40646
  const Contact = karin$1.contactGroup(groupId);
41326
- status = await karin$1.sendMsg(botId, Contact, img ? [...img] : []);
40647
+ const bot = karin$1.getBot(botId);
40648
+ const eventWithBot = this.e;
40649
+ eventWithBot.bot = bot;
40650
+ eventWithBot.selfId = botId;
40651
+ const watermarkedImg = img ? applyWatermarkToImages(img, this.e) : [];
40652
+ status = await karin$1.sendMsg(botId, Contact, [...watermarkedImg]);
41327
40653
  if (pushItem.pushType === "live" && "room_data" in pushItem.Detail_Data && status.message_id) await douyinDBInstance.updateLiveStatus(pushItem.sec_uid, true);
41328
40654
  if (Config.douyin.push.parsedynamic && status.message_id) {
41329
40655
  const workTypeInfo = getWorkTypeInfo(Detail_Data);
@@ -42429,7 +41755,7 @@ var Xiaohongshu = class extends Base {
42429
41755
  if (livePhoto.filepath) {
42430
41756
  if (shouldGenerateVideo) {
42431
41757
  const outputPath = Common.tempDri.video + `xhs_live_${Date.now()}_${index}.mp4`;
42432
- const transitionEnabled = loopCount > 1 && Boolean(staticImgPath);
41758
+ const transitionEnabled = Boolean(staticImgPath);
42433
41759
  const safeStaticPath = staticImgPath || livePhoto.filepath;
42434
41760
  const result = await loopVideoWithTransition({
42435
41761
  inputPath: livePhoto.filepath,
@@ -42441,7 +41767,7 @@ var Xiaohongshu = class extends Base {
42441
41767
  context: bgmContext ?? void 0
42442
41768
  });
42443
41769
  const success = result.success;
42444
- if (mergeMode === "continuous" && result.context) bgmContext = result.context;
41770
+ if (result.context) bgmContext = result.context;
42445
41771
  if (success) {
42446
41772
  const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
42447
41773
  fs.renameSync(outputPath, filePath);
@@ -42785,7 +42111,7 @@ var douyinLogin = async (e) => {
42785
42111
  }
42786
42112
  let gcInterval;
42787
42113
  try {
42788
- const loginQRcode = await Render(e, "douyin/qrcodeImg", qrCodeData.url ? { share_url: qrCodeData.url } : { qrCodeDataUrl: qrCodeData.originalImage });
42114
+ const loginQRcode = await Render(e, "douyin/qrcodeImg", qrCodeData.url ? { share_url: qrCodeData.url } : { share_url: qrCodeData.originalImage });
42789
42115
  const base64Data = loginQRcode[0]?.file;
42790
42116
  if (!base64Data) throw new Error("生成二维码图片失败");
42791
42117
  const cleanBase64 = base64Data.replace(/^base64:\/\//, "");
@@ -43027,7 +42353,7 @@ var waitQrcode = async (page) => {
43027
42353
  const response = await fetch(originalImage);
43028
42354
  imageBuffer = Buffer.from(await response.arrayBuffer());
43029
42355
  }
43030
- const qrContent = await QRCodeScanner.scanFromBuffer(imageBuffer);
42356
+ const qrContent = scan(imageBuffer);
43031
42357
  if (qrContent) {
43032
42358
  logger.mark("二维码解码成功:", qrContent);
43033
42359
  return {
@@ -47721,9 +47047,13 @@ app$1.use(express.urlencoded({ extended: true }));
47721
47047
  if (Config.app.APIServer && Config.app.APIServerMount) {
47722
47048
  app$1.use("/amagi/api/bilibili", createBilibiliRoutes(Config.cookies.bilibili));
47723
47049
  app$1.use("/amagi/api/douyin", createDouyinRoutes(Config.cookies.douyin));
47050
+ app$1.use("/amagi/api/kuaishou", createKuaishouRoutes(Config.cookies.kuaishou));
47051
+ app$1.use("/amagi/api/xiaohongshu", createXiaohongshuRoutes(Config.cookies.xiaohongshu));
47724
47052
  } else if (Config.app.APIServer) new Client({ cookies: {
47725
47053
  bilibili: Config.cookies.bilibili,
47726
- douyin: Config.cookies.douyin
47054
+ douyin: Config.cookies.douyin,
47055
+ kuaishou: Config.cookies.kuaishou,
47056
+ xiaohongshu: Config.cookies.xiaohongshu
47727
47057
  } }).startServer(Config.app.APIServerPort);
47728
47058
  app$1.get("/stream/:filename", videoStreamRouter);
47729
47059
  app$1.get("/video/:filename", getVideoRouter);