@pomelolabs/leads 0.0.0-stage → 0.1.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.
- package/README.md +50 -2
- package/client/bundle.js +2236 -0
- package/cordis.patch.yml +3 -0
- package/docs/preview-dark.png +0 -0
- package/docs/preview-light.png +0 -0
- package/host/browser.js +662 -0
- package/host/index.js +1361 -0
- package/icon.svg +14 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +61 -4
package/client/bundle.js
ADDED
|
@@ -0,0 +1,2236 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
// node_modules/@phosphor-icons/core/assets/regular/squares-four.svg
|
|
3
|
+
var squares_four_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>';
|
|
4
|
+
|
|
5
|
+
// node_modules/@phosphor-icons/core/assets/regular/clock-counter-clockwise.svg
|
|
6
|
+
var clock_counter_clockwise_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"/></svg>';
|
|
7
|
+
|
|
8
|
+
// node_modules/@phosphor-icons/core/assets/regular/chart-line-up.svg
|
|
9
|
+
var chart_line_up_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V48a8,8,0,0,1,16,0V156.69l50.34-50.35a8,8,0,0,1,11.32,0L128,132.69,180.69,80H160a8,8,0,0,1,0-16h40a8,8,0,0,1,8,8v40a8,8,0,0,1-16,0V91.31l-58.34,58.35a8,8,0,0,1-11.32,0L96,123.31l-56,56V200H224A8,8,0,0,1,232,208Z"/></svg>';
|
|
10
|
+
|
|
11
|
+
// node_modules/@phosphor-icons/core/assets/regular/gear-six.svg
|
|
12
|
+
var gear_six_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"/></svg>';
|
|
13
|
+
|
|
14
|
+
// node_modules/@phosphor-icons/core/assets/regular/plus.svg
|
|
15
|
+
var plus_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>';
|
|
16
|
+
|
|
17
|
+
// node_modules/@phosphor-icons/core/assets/regular/arrows-clockwise.svg
|
|
18
|
+
var arrows_clockwise_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"/></svg>';
|
|
19
|
+
|
|
20
|
+
// node_modules/@phosphor-icons/core/assets/regular/magnifying-glass.svg
|
|
21
|
+
var magnifying_glass_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>';
|
|
22
|
+
|
|
23
|
+
// node_modules/@phosphor-icons/core/assets/regular/copy.svg
|
|
24
|
+
var copy_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>';
|
|
25
|
+
|
|
26
|
+
// node_modules/@phosphor-icons/core/assets/regular/trash.svg
|
|
27
|
+
var trash_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>';
|
|
28
|
+
|
|
29
|
+
// node_modules/@phosphor-icons/core/assets/regular/check.svg
|
|
30
|
+
var check_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>';
|
|
31
|
+
|
|
32
|
+
// node_modules/@phosphor-icons/core/assets/regular/x.svg
|
|
33
|
+
var x_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>';
|
|
34
|
+
|
|
35
|
+
// node_modules/@phosphor-icons/core/assets/regular/image.svg
|
|
36
|
+
var image_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>';
|
|
37
|
+
|
|
38
|
+
// node_modules/@phosphor-icons/core/assets/regular/video-camera.svg
|
|
39
|
+
var video_camera_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>';
|
|
40
|
+
|
|
41
|
+
// node_modules/@phosphor-icons/core/assets/regular/lock.svg
|
|
42
|
+
var lock_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z"/></svg>';
|
|
43
|
+
|
|
44
|
+
// node_modules/@phosphor-icons/core/assets/regular/user.svg
|
|
45
|
+
var user_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>';
|
|
46
|
+
|
|
47
|
+
// node_modules/@phosphor-icons/core/assets/regular/desktop.svg
|
|
48
|
+
var desktop_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40ZM48,56H208a8,8,0,0,1,8,8v80H40V64A8,8,0,0,1,48,56ZM208,184H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z"/></svg>';
|
|
49
|
+
|
|
50
|
+
// node_modules/@phosphor-icons/core/assets/regular/folder.svg
|
|
51
|
+
var folder_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>';
|
|
52
|
+
|
|
53
|
+
// node_modules/@phosphor-icons/core/assets/regular/download-simple.svg
|
|
54
|
+
var download_simple_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>';
|
|
55
|
+
|
|
56
|
+
// node_modules/@phosphor-icons/core/assets/regular/caret-right.svg
|
|
57
|
+
var caret_right_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>';
|
|
58
|
+
|
|
59
|
+
// node_modules/@phosphor-icons/core/assets/regular/arrow-right.svg
|
|
60
|
+
var arrow_right_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>';
|
|
61
|
+
|
|
62
|
+
// node_modules/@phosphor-icons/core/assets/regular/arrow-left.svg
|
|
63
|
+
var arrow_left_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>';
|
|
64
|
+
|
|
65
|
+
// node_modules/@phosphor-icons/core/assets/regular/corners-out.svg
|
|
66
|
+
var corners_out_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z"/></svg>';
|
|
67
|
+
|
|
68
|
+
// node_modules/@phosphor-icons/core/assets/regular/corners-in.svg
|
|
69
|
+
var corners_in_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z"/></svg>';
|
|
70
|
+
|
|
71
|
+
// node_modules/@phosphor-icons/core/assets/regular/paper-plane-tilt.svg
|
|
72
|
+
var paper_plane_tilt_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>';
|
|
73
|
+
|
|
74
|
+
// node_modules/@phosphor-icons/core/assets/regular/warning.svg
|
|
75
|
+
var warning_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>';
|
|
76
|
+
|
|
77
|
+
// node_modules/@phosphor-icons/core/assets/regular/clock.svg
|
|
78
|
+
var clock_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>';
|
|
79
|
+
|
|
80
|
+
// node_modules/@phosphor-icons/core/assets/regular/book-open.svg
|
|
81
|
+
var book_open_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"/></svg>';
|
|
82
|
+
|
|
83
|
+
// node_modules/@phosphor-icons/core/assets/regular/robot.svg
|
|
84
|
+
var robot_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,48H136V16a8,8,0,0,0-16,0V48H56A32,32,0,0,0,24,80V192a32,32,0,0,0,32,32H200a32,32,0,0,0,32-32V80A32,32,0,0,0,200,48Zm16,144a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V80A16,16,0,0,1,56,64H200a16,16,0,0,1,16,16Zm-52-56H92a28,28,0,0,0,0,56h72a28,28,0,0,0,0-56Zm-24,16v24H116V152ZM80,164a12,12,0,0,1,12-12h8v24H92A12,12,0,0,1,80,164Zm84,12h-8V152h8a12,12,0,0,1,0,24ZM72,108a12,12,0,1,1,12,12A12,12,0,0,1,72,108Zm88,0a12,12,0,1,1,12,12A12,12,0,0,1,160,108Z"/></svg>';
|
|
85
|
+
|
|
86
|
+
// node_modules/@phosphor-icons/core/assets/regular/database.svg
|
|
87
|
+
var database_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>';
|
|
88
|
+
|
|
89
|
+
// node_modules/@phosphor-icons/core/assets/regular/hard-drive.svg
|
|
90
|
+
var hard_drive_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,64H32A16,16,0,0,0,16,80v96a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V80A16,16,0,0,0,224,64Zm0,112H32V80H224v96Zm-24-48a12,12,0,1,1-12-12A12,12,0,0,1,200,128Z"/></svg>';
|
|
91
|
+
|
|
92
|
+
// node_modules/@phosphor-icons/core/assets/regular/arrow-square-out.svg
|
|
93
|
+
var arrow_square_out_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>';
|
|
94
|
+
|
|
95
|
+
// node_modules/@phosphor-icons/core/assets/regular/play.svg
|
|
96
|
+
var play_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>';
|
|
97
|
+
|
|
98
|
+
// node_modules/@phosphor-icons/core/assets/regular/file-text.svg
|
|
99
|
+
var file_text_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z"/></svg>';
|
|
100
|
+
|
|
101
|
+
// node_modules/@phosphor-icons/core/assets/regular/list-checks.svg
|
|
102
|
+
var list_checks_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"/></svg>';
|
|
103
|
+
|
|
104
|
+
// node_modules/@phosphor-icons/core/assets/regular/circle.svg
|
|
105
|
+
var circle_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"/></svg>';
|
|
106
|
+
|
|
107
|
+
// node_modules/@phosphor-icons/core/assets/regular/dots-three.svg
|
|
108
|
+
var dots_three_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>';
|
|
109
|
+
|
|
110
|
+
// client/src/assets/chrome.svg
|
|
111
|
+
var chrome_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 276 276"><linearGradient id="a" x1="145" x2="34" y1="253" y2="61" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1e8e3e"/><stop offset="1" stop-color="#34a853"/></linearGradient><linearGradient id="b" x1="111" x2="222" y1="254" y2="62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fcc934"/><stop offset="1" stop-color="#fbbc04"/></linearGradient><linearGradient id="c" x1="17" x2="239" y1="80" y2="80" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d93025"/><stop offset="1" stop-color="#ea4335"/></linearGradient><circle cx="128" cy="128" r="64" fill="#fff"/><path fill="url(#a)" d="M96 183.4A63.7 63.7 0 0 1 72.6 160L17.2 64A128 128 0 0 0 128 256l55.4-96A64 64 0 0 1 96 183.4Z"/><path fill="url(#b)" d="M192 128a63.7 63.7 0 0 1-8.6 32L128 256A128 128 0 0 0 238.9 64h-111a64 64 0 0 1 64 64Z"/><circle cx="128" cy="128" r="52" fill="#1a73e8"/><path fill="url(#c)" d="M96 72.6a63.7 63.7 0 0 1 32-8.6h110.8a128 128 0 0 0-221.7 0l55.5 96A64 64 0 0 1 96 72.6Z"/></svg>';
|
|
112
|
+
|
|
113
|
+
// client/src/assets/douyin.svg
|
|
114
|
+
var douyin_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <rect x="4" y="4" width="56" height="56" rx="15" fill="#111111"/>\n <g transform="translate(16 10) scale(1.45)">\n <g transform="translate(-0.55 0.35)" fill="#25F4EE"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></g>\n <g transform="translate(0.55 -0.35)" fill="#FE2C55"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></g>\n <path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" fill="#ffffff"/>\n </g>\n</svg>\n';
|
|
115
|
+
|
|
116
|
+
// client/src/assets/xhs.svg
|
|
117
|
+
var xhs_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <rect x="4" y="4" width="56" height="56" rx="15" fill="#FF2442"/>\n <g transform="translate(8 8) scale(2)" fill="#ffffff">\n <path d="M22.405 9.879c.002.016.01.02.07.019h.725a.797.797 0 0 0 .78-.972.794.794 0 0 0-.884-.618.795.795 0 0 0-.692.794c0 .101-.002.666.001.777zm-11.509 4.808c-.203.001-1.353.004-1.685.003a2.528 2.528 0 0 1-.766-.126.025.025 0 0 0-.03.014L7.7 16.127a.025.025 0 0 0 .01.032c.111.06.336.124.495.124.66.01 1.32.002 1.981 0 .01 0 .02-.006.023-.015l.712-1.545a.025.025 0 0 0-.024-.036zM.477 9.91c-.071 0-.076.002-.076.01a.834.834 0 0 0-.01.08c-.027.397-.038.495-.234 3.06-.012.24-.034.389-.135.607-.026.057-.033.042.003.112.046.092.681 1.523.787 1.74.008.015.011.02.017.02.008 0 .033-.026.047-.044.147-.187.268-.391.371-.606.306-.635.44-1.325.486-1.706.014-.11.021-.22.03-.33l.204-2.616.022-.293c.003-.029 0-.033-.03-.034zm7.203 3.757a1.427 1.427 0 0 1-.135-.607c-.004-.084-.031-.39-.235-3.06a.443.443 0 0 0-.01-.082c-.004-.011-.052-.008-.076-.008h-1.48c-.03.001-.034.005-.03.034l.021.293c.076.982.153 1.964.233 2.946.05.4.186 1.085.487 1.706.103.215.223.419.37.606.015.018.037.051.048.049.02-.003.742-1.642.804-1.765.036-.07.03-.055.003-.112zm3.861-.913h-.872a.126.126 0 0 1-.116-.178l1.178-2.625a.025.025 0 0 0-.023-.035l-1.318-.003a.148.148 0 0 1-.135-.21l.876-1.954a.025.025 0 0 0-.023-.035h-1.56c-.01 0-.02.006-.024.015l-.926 2.068c-.085.169-.314.634-.399.938a.534.534 0 0 0-.02.191.46.46 0 0 0 .23.378.981.981 0 0 0 .46.119h.59c.041 0-.688 1.482-.834 1.972a.53.53 0 0 0-.023.172.465.465 0 0 0 .23.398c.15.092.342.12.475.12l1.66-.001c.01 0 .02-.006.023-.015l.575-1.28a.025.025 0 0 0-.024-.035zm-6.93-4.937H3.1a.032.032 0 0 0-.034.033c0 1.048-.01 2.795-.01 6.829 0 .288-.269.262-.28.262h-.74c-.04.001-.044.004-.04.047.001.037.465 1.064.555 1.263.01.02.03.033.051.033.157.003.767.009.938-.014.153-.02.3-.06.438-.132.3-.156.49-.419.595-.765.052-.172.075-.353.075-.533.002-2.33 0-4.66-.007-6.991a.032.032 0 0 0-.032-.032zm11.784 6.896c0-.014-.01-.021-.024-.022h-1.465c-.048-.001-.049-.002-.05-.049v-4.66c0-.072-.005-.07.07-.07h.863c.08 0 .075.004.075-.074V8.393c0-.082.006-.076-.08-.076h-3.5c-.064 0-.075-.006-.075.073v1.445c0 .083-.006.077.08.077h.854c.075 0 .07-.004.07.07v4.624c0 .095.008.084-.085.084-.37 0-1.11-.002-1.304 0-.048.001-.06.03-.06.03l-.697 1.519s-.014.025-.008.036c.006.01.013.008.058.008 1.748.003 3.495.002 5.243.002.03-.001.034-.006.035-.033v-1.539zm4.177-3.43c0 .013-.007.023-.02.024-.346.006-.692.004-1.037.004-.014-.002-.022-.01-.022-.024-.005-.434-.007-.869-.01-1.303 0-.072-.006-.071.07-.07l.733-.003c.041 0 .081.002.12.015.093.025.16.107.165.204.006.431.002 1.153.001 1.153zm2.67.244a1.953 1.953 0 0 0-.883-.222h-.18c-.04-.001-.04-.003-.042-.04V10.21c0-.132-.007-.263-.025-.394a1.823 1.823 0 0 0-.153-.53 1.533 1.533 0 0 0-.677-.71 2.167 2.167 0 0 0-1-.258c-.153-.003-.567 0-.72 0-.07 0-.068.004-.068-.065V7.76c0-.031-.01-.041-.046-.039H17.93s-.016 0-.023.007c-.006.006-.008.012-.008.023v.546c-.008.036-.057.015-.082.022h-.95c-.022.002-.028.008-.03.032v1.481c0 .09-.004.082.082.082h.913c.082 0 .072.128.072.128V11.19s.003.117-.06.117h-1.482c-.068 0-.06.082-.06.082v1.445s-.01.068.064.068h1.457c.082 0 .076-.006.076.079v3.225c0 .088-.007.081.082.081h1.43c.09 0 .082.007.082-.08v-3.27c0-.029.006-.035.033-.035l2.323-.003c.098 0 .191.02.28.061a.46.46 0 0 1 .274.407c.008.395.003.79.003 1.185 0 .259-.107.367-.33.367h-1.218c-.023.002-.029.008-.028.033.184.437.374.871.57 1.303a.045.045 0 0 0 .04.026c.17.005.34.002.51.003.15-.002.517.004.666-.01a2.03 2.03 0 0 0 .408-.075c.59-.18.975-.698.976-1.313v-1.981c0-.128-.01-.254-.034-.38 0 .078-.029-.641-.724-.998z"/>\n </g>\n</svg>\n';
|
|
118
|
+
|
|
119
|
+
// client/src/app.jsx
|
|
120
|
+
var WEEKDAYS = ["\u5468\u65E5", "\u5468\u4E00", "\u5468\u4E8C", "\u5468\u4E09", "\u5468\u56DB", "\u5468\u4E94", "\u5468\u516D"];
|
|
121
|
+
var PROFILE_QUESTIONS = [
|
|
122
|
+
{
|
|
123
|
+
key: "q1",
|
|
124
|
+
no: "1",
|
|
125
|
+
title: "\u4F60\u662F\u8C01\uFF1F\u76EE\u524D\u5728\u505A\u4EC0\u4E48\u751F\u610F\uFF1F",
|
|
126
|
+
hint: "\u4ECB\u7ECD\u4F60\u7684\u79F0\u547C\u3001\u6240\u5728\u57CE\u5E02\uFF0C\u4EE5\u53CA\u4E3B\u8981\u5356\u4EC0\u4E48\u4EA7\u54C1\u6216\u670D\u52A1\u3002",
|
|
127
|
+
placeholder: "\u4F8B\u5982\uFF1A\u6211\u53EB\u963F\u67DA\uFF0C\u5728\u676D\u5DDE\u505A\u672C\u5730\u5BB6\u653F\u548C\u6574\u7406\u6536\u7EB3\uFF0C\u4E3B\u8981\u670D\u52A1\u5E74\u8F7B\u4E0A\u73ED\u65CF\u548C\u5B9D\u5988\u3002"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: "q2",
|
|
131
|
+
no: "2",
|
|
132
|
+
title: "\u4F60\u6709\u54EA\u4E9B\u503C\u5F97\u5206\u4EAB\u7684\u4E2A\u4EBA\u7ECF\u5386\uFF1F",
|
|
133
|
+
hint: "\u6BD4\u5982\u8FC7\u53BB\u505A\u8FC7\u4EC0\u4E48\u5DE5\u4F5C\u3001\u4E3A\u4EC0\u4E48\u521B\u4E1A\uFF0C\u6709\u4EC0\u4E48\u96BE\u5FD8\u7684\u7ECF\u5386\u3002",
|
|
134
|
+
placeholder: "\u4F8B\u5982\uFF1A\u4E4B\u524D\u5728\u4E92\u8054\u7F51\u516C\u53F8\u505A\u8FD0\u8425\uFF0C\u540E\u6765\u81EA\u5DF1\u521B\u4E1A\u505A\u5BB6\u653F\u2026\u2026"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: "q3",
|
|
138
|
+
no: "3",
|
|
139
|
+
title: "\u4F60\u7684\u5BA2\u6237\u4E3B\u8981\u662F\u54EA\u4E9B\u4EBA\uFF1F\u4ED6\u4EEC\u6709\u4EC0\u4E48\u9700\u6C42\uFF1F",
|
|
140
|
+
hint: "\u4ECB\u7ECD\u4F60\u7684\u4E3B\u8981\u5BA2\u6237\uFF0C\u4EE5\u53CA\u4ED6\u4EEC\u901A\u5E38\u9047\u5230\u4EC0\u4E48\u95EE\u9898\u3001\u5E0C\u671B\u89E3\u51B3\u4EC0\u4E48\u3002",
|
|
141
|
+
placeholder: "\u4F8B\u5982\uFF1A\u4E3B\u8981\u5BA2\u6237\u662F 25-40 \u5C81\u7684\u4E0A\u73ED\u65CF\u548C\u5B9D\u5988\uFF0C\u6CA1\u65F6\u95F4\u6253\u626B\uFF0C\u53C8\u6015\u9047\u5230\u4E0D\u9760\u8C31\u7684\u963F\u59E8\u2026\u2026"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: "q4",
|
|
145
|
+
no: "4",
|
|
146
|
+
title: "\u4F60\u6709\u54EA\u4E9B\u4E13\u4E1A\u7ECF\u9A8C\u6216\u884C\u4E1A\u89C2\u70B9\uFF1F",
|
|
147
|
+
hint: "\u6BD4\u5982\u5BA2\u6237\u7ECF\u5E38\u95EE\u4EC0\u4E48\u3001\u884C\u4E1A\u6709\u54EA\u4E9B\u8BEF\u533A\uFF0C\u6216\u8005\u4F60\u7684\u72EC\u7279\u89C1\u89E3\u3002",
|
|
148
|
+
placeholder: "\u4F8B\u5982\uFF1A\u5BA2\u6237\u6700\u5E38\u95EE\u201C\u591A\u5C11\u94B1\u201D\u201C\u4F1A\u4E0D\u4F1A\u4E71\u6536\u8D39\u201D\uFF0C\u884C\u4E1A\u6700\u5927\u7684\u8BEF\u533A\u662F\u53EA\u62FC\u4F4E\u4EF7\u2026\u2026"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
key: "q5",
|
|
152
|
+
no: "5",
|
|
153
|
+
title: "\u4F60\u7684\u4EA7\u54C1\u6216\u670D\u52A1\u6709\u54EA\u4E9B\u7279\u70B9\uFF1F",
|
|
154
|
+
hint: "\u4ECB\u7ECD\u4E3B\u8981\u4EA7\u54C1\u3001\u4EF7\u683C\u533A\u95F4\u3001\u670D\u52A1\u6D41\u7A0B\uFF0C\u4EE5\u53CA\u6700\u503C\u5F97\u63A8\u8350\u7684\u5730\u65B9\u3002",
|
|
155
|
+
placeholder: "\u4F8B\u5982\uFF1A\u505A\u6DF1\u5EA6\u4FDD\u6D01\u3001\u65E5\u5E38\u4FDD\u6D01\u548C\u642C\u5BB6\u524D\u540E\u6E05\u6D01\uFF0C\u6309\u9762\u79EF\u548C\u9879\u76EE\u62A5\u4EF7\u2026\u2026"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "q6",
|
|
159
|
+
no: "6",
|
|
160
|
+
title: "\u4F60\u5E0C\u671B\u5BA2\u6237\u5982\u4F55\u8BA4\u8BC6\u548C\u8BC4\u4EF7\u4F60\uFF1F",
|
|
161
|
+
hint: "\u6BD4\u5982\u4E13\u4E1A\u9760\u8C31\u3001\u771F\u8BDA\u4EB2\u5207\u3001\u5E7D\u9ED8\u6709\u8DA3\uFF0C\u6216\u8005\u6709\u81EA\u5DF1\u7684\u4E2A\u6027\u548C\u89C2\u70B9\u3002",
|
|
162
|
+
placeholder: "\u4F8B\u5982\uFF1A\u5E0C\u671B\u5BA2\u6237\u89C9\u5F97\u6211\u4EEC\u4E13\u4E1A\u3001\u771F\u8BDA\u3001\u6709\u8FB9\u754C\u611F\uFF0C\u4E0D\u662F\u4E00\u6B21\u6027\u7684\u4F4E\u4EF7\u4FDD\u6D01\u2026\u2026"
|
|
163
|
+
}
|
|
164
|
+
];
|
|
165
|
+
EMPTY_PROFILE = {
|
|
166
|
+
q1: "",
|
|
167
|
+
q2: "",
|
|
168
|
+
q3: "",
|
|
169
|
+
q4: "",
|
|
170
|
+
q5: "",
|
|
171
|
+
q6: ""
|
|
172
|
+
};
|
|
173
|
+
var ICON_MAP = {
|
|
174
|
+
workbench: squares_four_default,
|
|
175
|
+
review: clock_counter_clockwise_default,
|
|
176
|
+
plan: chart_line_up_default,
|
|
177
|
+
settings: gear_six_default,
|
|
178
|
+
plus: plus_default,
|
|
179
|
+
refresh: arrows_clockwise_default,
|
|
180
|
+
search: magnifying_glass_default,
|
|
181
|
+
copy: copy_default,
|
|
182
|
+
trash: trash_default,
|
|
183
|
+
check: check_default,
|
|
184
|
+
close: x_default,
|
|
185
|
+
image: image_default,
|
|
186
|
+
video: video_camera_default,
|
|
187
|
+
lock: lock_default,
|
|
188
|
+
user: user_default,
|
|
189
|
+
monitor: desktop_default,
|
|
190
|
+
folder: folder_default,
|
|
191
|
+
download: download_simple_default,
|
|
192
|
+
chevron: caret_right_default,
|
|
193
|
+
arrow: arrow_right_default,
|
|
194
|
+
back: arrow_left_default,
|
|
195
|
+
expand: corners_out_default,
|
|
196
|
+
collapse: corners_in_default,
|
|
197
|
+
send: paper_plane_tilt_default,
|
|
198
|
+
alert: warning_default,
|
|
199
|
+
clock: clock_default,
|
|
200
|
+
book: book_open_default,
|
|
201
|
+
bot: robot_default,
|
|
202
|
+
database: database_default,
|
|
203
|
+
drive: hard_drive_default,
|
|
204
|
+
external: arrow_square_out_default,
|
|
205
|
+
play: play_default,
|
|
206
|
+
file: file_text_default,
|
|
207
|
+
checks: list_checks_default,
|
|
208
|
+
dot: circle_default,
|
|
209
|
+
dots: dots_three_default
|
|
210
|
+
};
|
|
211
|
+
function createApp(React, css) {
|
|
212
|
+
const { useState, useEffect, useMemo, useRef } = React;
|
|
213
|
+
const HOST_MODE = typeof window !== "undefined" && Boolean(window.__POMELO_TOKEN__);
|
|
214
|
+
function rpcEndpoint() {
|
|
215
|
+
if (window.location.protocol === "dsh-app:") {
|
|
216
|
+
return new URL("/pomelo-rpc", window.location.origin).toString();
|
|
217
|
+
}
|
|
218
|
+
const injected = window.__POMELO_RPC__;
|
|
219
|
+
if (injected && !String(injected).startsWith("dsh-app:")) return injected;
|
|
220
|
+
const streamBase = window.__DSH_TRANSPORT__?.streamBaseUrl;
|
|
221
|
+
if (streamBase) return new URL("/pomelo-rpc", streamBase).toString();
|
|
222
|
+
return new URL("/pomelo-rpc", window.location.origin).toString();
|
|
223
|
+
}
|
|
224
|
+
async function rpc(action, payload = {}) {
|
|
225
|
+
if (!HOST_MODE) throw new Error("\u672C\u5730 Host \u672A\u8FDE\u63A5");
|
|
226
|
+
const endpoint = rpcEndpoint();
|
|
227
|
+
let response;
|
|
228
|
+
try {
|
|
229
|
+
response = await fetch(endpoint, {
|
|
230
|
+
method: "POST",
|
|
231
|
+
credentials: "omit",
|
|
232
|
+
headers: {
|
|
233
|
+
"content-type": "application/json",
|
|
234
|
+
"x-pomelo-token": window.__POMELO_TOKEN__
|
|
235
|
+
},
|
|
236
|
+
body: JSON.stringify({ action, payload })
|
|
237
|
+
});
|
|
238
|
+
if (response.status === 405) {
|
|
239
|
+
const url = new URL(endpoint);
|
|
240
|
+
url.searchParams.set("action", action);
|
|
241
|
+
url.searchParams.set("payload", JSON.stringify(payload));
|
|
242
|
+
url.searchParams.set("t", window.__POMELO_TOKEN__ || "");
|
|
243
|
+
response = await fetch(url.toString(), {
|
|
244
|
+
method: "GET",
|
|
245
|
+
credentials: "omit",
|
|
246
|
+
headers: { "x-pomelo-token": window.__POMELO_TOKEN__ }
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
} catch (error) {
|
|
250
|
+
throw new Error(`${error?.message || "Failed to fetch"} \xB7 ${endpoint}`);
|
|
251
|
+
}
|
|
252
|
+
const body = await response.json().catch(() => ({}));
|
|
253
|
+
if (!response.ok || !body.ok) {
|
|
254
|
+
const detail = body?.error?.message ? `\uFF1A${body.error.message}` : "";
|
|
255
|
+
throw new Error(`\u672C\u5730\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08${response.status}\uFF09${detail} \xB7 ${endpoint}`);
|
|
256
|
+
}
|
|
257
|
+
return body.data;
|
|
258
|
+
}
|
|
259
|
+
function cx(...parts) {
|
|
260
|
+
return parts.filter(Boolean).join(" ");
|
|
261
|
+
}
|
|
262
|
+
function todayLabel() {
|
|
263
|
+
const d = /* @__PURE__ */ new Date();
|
|
264
|
+
return `${d.getMonth() + 1} \u6708 ${d.getDate()} \u65E5 \xB7 ${WEEKDAYS[d.getDay()]}`;
|
|
265
|
+
}
|
|
266
|
+
async function copyText(text) {
|
|
267
|
+
try {
|
|
268
|
+
await navigator.clipboard.writeText(text);
|
|
269
|
+
return true;
|
|
270
|
+
} catch {
|
|
271
|
+
try {
|
|
272
|
+
const ta = document.createElement("textarea");
|
|
273
|
+
ta.value = text;
|
|
274
|
+
ta.style.position = "fixed";
|
|
275
|
+
ta.style.opacity = "0";
|
|
276
|
+
document.body.appendChild(ta);
|
|
277
|
+
ta.select();
|
|
278
|
+
document.execCommand("copy");
|
|
279
|
+
ta.remove();
|
|
280
|
+
return true;
|
|
281
|
+
} catch {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function Icon({ name, size = 18 }) {
|
|
287
|
+
const svg = ICON_MAP[name] || plus_default;
|
|
288
|
+
return /* @__PURE__ */ React.createElement(
|
|
289
|
+
"span",
|
|
290
|
+
{
|
|
291
|
+
className: "pm-icon",
|
|
292
|
+
style: { width: size, height: size },
|
|
293
|
+
"aria-hidden": "true",
|
|
294
|
+
dangerouslySetInnerHTML: { __html: svg }
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
function BrandLogo({ name, size = 20 }) {
|
|
299
|
+
const svg = name === "chrome" || name === "chromium" ? chrome_default : name === "douyin" ? douyin_default : xhs_default;
|
|
300
|
+
return /* @__PURE__ */ React.createElement(
|
|
301
|
+
"span",
|
|
302
|
+
{
|
|
303
|
+
className: "pm-platform-brand",
|
|
304
|
+
style: { width: size, height: size },
|
|
305
|
+
"aria-hidden": "true",
|
|
306
|
+
dangerouslySetInnerHTML: { __html: svg }
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
function PlatformBadge({ platform, size = 14, plain = false }) {
|
|
311
|
+
const items = platform === "\u5C0F\u7EA2\u4E66 / \u6296\u97F3" ? ["\u5C0F\u7EA2\u4E66", "\u6296\u97F3"] : [platform];
|
|
312
|
+
return /* @__PURE__ */ React.createElement("span", { className: cx("pm-platform-badge", plain && "is-plain") }, items.map((item) => /* @__PURE__ */ React.createElement("span", { key: item, className: "pm-platform-badge-item" }, /* @__PURE__ */ React.createElement(BrandLogo, { name: item === "\u6296\u97F3" ? "douyin" : "xhs", size }), /* @__PURE__ */ React.createElement("span", null, item))));
|
|
313
|
+
}
|
|
314
|
+
function SidebarToggleIcon({ size = 17 }) {
|
|
315
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", focusable: "false" }, /* @__PURE__ */ React.createElement("rect", { x: "2.5", y: "3.5", width: "15", height: "13", rx: "3.2", stroke: "currentColor", strokeWidth: "1.35" }), /* @__PURE__ */ React.createElement("path", { d: "M8 4v12", stroke: "currentColor", strokeWidth: "1.35" }), /* @__PURE__ */ React.createElement("path", { d: "M5.7 4.2h1.7v11.6H5.7A1.9 1.9 0 0 1 3.8 13.9V6.1a1.9 1.9 0 0 1 1.9-1.9Z", fill: "currentColor", opacity: "0.28" }));
|
|
316
|
+
}
|
|
317
|
+
function PomeloMark({ size = 40 }) {
|
|
318
|
+
return /* @__PURE__ */ React.createElement(
|
|
319
|
+
"svg",
|
|
320
|
+
{
|
|
321
|
+
className: "pm-logo",
|
|
322
|
+
width: size,
|
|
323
|
+
height: size,
|
|
324
|
+
viewBox: "0 0 64 64",
|
|
325
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
326
|
+
"aria-hidden": "true",
|
|
327
|
+
focusable: "false"
|
|
328
|
+
},
|
|
329
|
+
/* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", { id: "pm-logo-body", x1: "32", y1: "16", x2: "32", y2: "62", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ React.createElement("stop", { stopColor: "#FFC24D" }), /* @__PURE__ */ React.createElement("stop", { offset: "0.5", stopColor: "#F37021" }), /* @__PURE__ */ React.createElement("stop", { offset: "1", stopColor: "#D9540C" })), /* @__PURE__ */ React.createElement("linearGradient", { id: "pm-logo-leaf", x1: "28", y1: "1", x2: "46", y2: "14", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ React.createElement("stop", { stopColor: "#FFD36A" }), /* @__PURE__ */ React.createElement("stop", { offset: "1", stopColor: "#E86A00" }))),
|
|
330
|
+
/* @__PURE__ */ React.createElement("g", { className: "pm-logo-fruit" }, /* @__PURE__ */ React.createElement("path", { d: "M 30.45 16.23 L 26.95 16.85 L 25.30 17.46 L 23.86 18.08 L 22.62 18.70 L 21.79 19.32 L 20.76 19.94 L 19.94 20.56 L 19.11 21.18 L 18.29 21.79 L 17.26 22.41 L 16.64 23.03 L 15.81 23.65 L 14.99 24.27 L 14.37 24.89 L 13.55 25.51 L 12.93 26.12 L 12.31 26.74 L 11.69 27.36 L 11.28 27.98 L 10.66 28.60 L 10.25 29.22 L 9.63 29.84 L 9.22 30.45 L 8.80 31.07 L 8.60 31.69 L 8.19 32.31 L 7.77 32.93 L 7.57 33.55 L 7.15 34.16 L 6.95 34.78 L 6.74 35.40 L 6.33 36.02 L 6.12 36.64 L 5.92 37.26 L 5.92 37.88 L 5.71 38.49 L 5.51 39.11 L 5.51 39.73 L 5.30 40.35 L 5.30 40.97 L 5.09 41.59 L 5.09 42.21 L 5.09 42.82 L 5.09 43.44 L 5.09 44.06 L 5.09 44.68 L 5.09 45.30 L 5.09 45.92 L 5.30 46.54 L 5.30 47.15 L 5.51 47.77 L 5.71 48.39 L 5.92 49.01 L 5.92 49.63 L 6.12 50.25 L 6.54 50.87 L 6.74 51.48 L 6.95 52.10 L 7.36 52.72 L 7.77 53.34 L 7.98 53.96 L 8.60 54.58 L 9.01 55.20 L 9.42 55.81 L 10.04 56.43 L 10.66 57.05 L 11.48 57.67 L 12.10 58.29 L 13.13 58.91 L 14.16 59.53 L 15.40 60.14 L 16.85 60.76 L 18.91 61.38 L 22.82 62.00 L 41.38 62.00 L 45.30 61.38 L 47.36 60.76 L 49.01 60.14 L 50.25 59.53 L 51.28 58.91 L 52.10 58.29 L 52.93 57.67 L 53.55 57.05 L 54.16 56.43 L 54.78 55.81 L 55.20 55.20 L 55.61 54.58 L 56.02 53.96 L 56.43 53.34 L 56.85 52.72 L 57.05 52.10 L 57.46 51.48 L 57.67 50.87 L 57.88 50.25 L 58.08 49.63 L 58.29 49.01 L 58.49 48.39 L 58.49 47.77 L 58.70 47.15 L 58.70 46.54 L 58.91 45.92 L 58.91 45.30 L 58.91 44.68 L 58.91 44.06 L 58.91 43.44 L 58.91 42.82 L 58.91 42.21 L 58.91 41.59 L 58.91 40.97 L 58.70 40.35 L 58.70 39.73 L 58.49 39.11 L 58.29 38.49 L 58.29 37.88 L 58.08 37.26 L 57.88 36.64 L 57.67 36.02 L 57.46 35.40 L 57.05 34.78 L 56.85 34.16 L 56.64 33.55 L 56.23 32.93 L 55.81 32.31 L 55.61 31.69 L 55.20 31.07 L 54.78 30.45 L 54.37 29.84 L 53.75 29.22 L 53.34 28.60 L 52.72 27.98 L 52.31 27.36 L 51.69 26.74 L 51.07 26.12 L 50.45 25.51 L 49.63 24.89 L 49.01 24.27 L 48.19 23.65 L 47.36 23.03 L 46.74 22.41 L 45.92 21.79 L 45.09 21.18 L 44.06 20.56 L 43.24 19.94 L 42.41 19.32 L 41.38 18.70 L 40.14 18.08 L 38.70 17.46 L 37.05 16.85 L 33.55 16.23 Z", fill: "url(#pm-logo-body)" }), /* @__PURE__ */ React.createElement("path", { d: "M 42.82 1.00 L 38.29 1.62 L 36.43 2.24 L 35.20 2.86 L 34.16 3.47 L 33.34 4.09 L 32.52 4.71 L 31.90 5.33 L 31.28 5.95 L 30.87 6.57 L 30.25 7.19 L 29.84 7.80 L 29.63 8.42 L 29.22 9.04 L 29.01 9.66 L 28.80 10.28 L 28.60 10.90 L 28.39 11.52 L 28.19 12.13 L 28.19 12.75 L 27.98 13.37 L 28.19 13.58 L 28.39 13.58 L 30.04 13.37 L 34.99 12.75 L 37.26 12.13 L 38.91 11.52 L 40.14 10.90 L 41.18 10.28 L 42.00 9.66 L 42.62 9.04 L 43.03 8.42 L 43.65 7.80 L 43.86 7.19 L 44.27 6.57 L 44.47 5.95 L 44.89 5.33 L 45.09 4.71 L 45.30 4.09 L 45.30 3.47 L 45.51 2.86 L 45.51 2.24 L 45.71 1.62 L 42.82 1.00 Z", fill: "url(#pm-logo-leaf)" }))
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
function Button({ children, variant = "secondary", size = "md", icon, className, ...rest }) {
|
|
334
|
+
return /* @__PURE__ */ React.createElement(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
type: "button",
|
|
338
|
+
className: cx("pm-btn", `pm-btn--${variant}`, size !== "md" && `pm-btn--${size}`, className),
|
|
339
|
+
...rest
|
|
340
|
+
},
|
|
341
|
+
icon,
|
|
342
|
+
children
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
function IconButton({ label, children, danger, className, ...rest }) {
|
|
346
|
+
return /* @__PURE__ */ React.createElement(
|
|
347
|
+
"button",
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
className: cx("pm-iconbtn", danger && "pm-iconbtn--danger", className),
|
|
351
|
+
"aria-label": label,
|
|
352
|
+
title: label,
|
|
353
|
+
...rest
|
|
354
|
+
},
|
|
355
|
+
children
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function Badge({ tone: tone2 = "neutral", dot, children }) {
|
|
359
|
+
return /* @__PURE__ */ React.createElement("span", { className: cx("pm-badge", `pm-badge--${tone2}`) }, dot && /* @__PURE__ */ React.createElement("span", { className: "pm-badge-dot" }), children);
|
|
360
|
+
}
|
|
361
|
+
function Card({ className, children, ...rest }) {
|
|
362
|
+
return /* @__PURE__ */ React.createElement("div", { className: cx("pm-card", className), ...rest }, children);
|
|
363
|
+
}
|
|
364
|
+
function Field({ label, hint, children }) {
|
|
365
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-form-col" }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, label, hint && /* @__PURE__ */ React.createElement("span", null, hint)), children);
|
|
366
|
+
}
|
|
367
|
+
function TextInput(props) {
|
|
368
|
+
return /* @__PURE__ */ React.createElement("input", { className: "pm-input", ...props });
|
|
369
|
+
}
|
|
370
|
+
function Textarea(props) {
|
|
371
|
+
return /* @__PURE__ */ React.createElement("textarea", { className: "pm-textarea", ...props });
|
|
372
|
+
}
|
|
373
|
+
function Select({ options, ...props }) {
|
|
374
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-select-wrap" }, /* @__PURE__ */ React.createElement("select", { className: "pm-select", ...props }, options.map((o) => /* @__PURE__ */ React.createElement("option", { key: o.value, value: o.value }, o.label))));
|
|
375
|
+
}
|
|
376
|
+
function Segmented({ value, options, onChange, className }) {
|
|
377
|
+
return /* @__PURE__ */ React.createElement("div", { className: cx("pm-seg", className), role: "tablist" }, options.map((o) => /* @__PURE__ */ React.createElement(
|
|
378
|
+
"button",
|
|
379
|
+
{
|
|
380
|
+
key: o.value,
|
|
381
|
+
type: "button",
|
|
382
|
+
role: "tab",
|
|
383
|
+
"aria-selected": value === o.value,
|
|
384
|
+
className: cx("pm-seg-btn", value === o.value && "is-on"),
|
|
385
|
+
onClick: () => onChange(o.value)
|
|
386
|
+
},
|
|
387
|
+
o.label
|
|
388
|
+
)));
|
|
389
|
+
}
|
|
390
|
+
function Sparkline({ points, color = "var(--pm-accent)" }) {
|
|
391
|
+
const max = Math.max(...points);
|
|
392
|
+
const min = Math.min(...points);
|
|
393
|
+
const range = max - min || 1;
|
|
394
|
+
const coords = points.map((p, i) => [
|
|
395
|
+
i / (points.length - 1 || 1) * 92 + 2,
|
|
396
|
+
31 - (p - min) / range * 24
|
|
397
|
+
]);
|
|
398
|
+
const line = coords.map(([x, y], i) => `${i === 0 ? "M" : "L"}${x.toFixed(1)},${y.toFixed(1)}`).join(" ");
|
|
399
|
+
const area = `${line} L94,33 L2,33 Z`;
|
|
400
|
+
return /* @__PURE__ */ React.createElement("svg", { className: "pm-spark", width: "94", height: "35", viewBox: "0 0 96 35", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { className: "pm-spark-area", d: area, fill: color, opacity: "0.08" }), /* @__PURE__ */ React.createElement("path", { className: "pm-spark-line", d: line, pathLength: 1, fill: "none", stroke: color, strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("circle", { className: "pm-spark-dot", cx: coords[coords.length - 1][0], cy: coords[coords.length - 1][1], r: "2.2", fill: color }));
|
|
401
|
+
}
|
|
402
|
+
function MiniBars({ values, color = "var(--pm-violet)" }) {
|
|
403
|
+
const max = Math.max(...values);
|
|
404
|
+
return /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "flex-end", gap: 3, height: 35 } }, values.map((v, i) => /* @__PURE__ */ React.createElement(
|
|
405
|
+
"i",
|
|
406
|
+
{
|
|
407
|
+
key: i,
|
|
408
|
+
className: "pm-mini-bar",
|
|
409
|
+
style: {
|
|
410
|
+
display: "block",
|
|
411
|
+
width: 5,
|
|
412
|
+
height: `${Math.max(18, v / max * 100)}%`,
|
|
413
|
+
borderRadius: 2,
|
|
414
|
+
background: color,
|
|
415
|
+
opacity: 0.35 + v / max * 0.6,
|
|
416
|
+
animationDelay: `${0.12 + i * 0.065}s`
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
)));
|
|
420
|
+
}
|
|
421
|
+
function Ring({ value, color = "var(--pm-accent)", size = 38 }) {
|
|
422
|
+
const r = 15;
|
|
423
|
+
const c = 2 * Math.PI * r;
|
|
424
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 38 38", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("circle", { cx: "19", cy: "19", r, fill: "none", stroke: "var(--pm-surface-2)", strokeWidth: "3.5" }), /* @__PURE__ */ React.createElement(
|
|
425
|
+
"circle",
|
|
426
|
+
{
|
|
427
|
+
className: "pm-ring-progress",
|
|
428
|
+
cx: "19",
|
|
429
|
+
cy: "19",
|
|
430
|
+
r,
|
|
431
|
+
fill: "none",
|
|
432
|
+
stroke: color,
|
|
433
|
+
strokeWidth: "3.5",
|
|
434
|
+
strokeLinecap: "round",
|
|
435
|
+
strokeDasharray: c,
|
|
436
|
+
strokeDashoffset: c * (1 - Math.min(1, Math.max(0, value))),
|
|
437
|
+
transform: "rotate(-90 19 19)",
|
|
438
|
+
style: { "--pm-ring-full": c, "--pm-ring-offset": c * (1 - Math.min(1, Math.max(0, value))) }
|
|
439
|
+
}
|
|
440
|
+
), /* @__PURE__ */ React.createElement("circle", { className: "pm-ring-dot", cx: "19", cy: "19", r: "3.5", fill: color, opacity: "0.18" }));
|
|
441
|
+
}
|
|
442
|
+
function KpiCard({ label, value, unit, sub, chart }) {
|
|
443
|
+
return /* @__PURE__ */ React.createElement(Card, { className: "pm-kpi" }, /* @__PURE__ */ React.createElement("div", { className: "pm-kpi-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-kpi-label" }, label), /* @__PURE__ */ React.createElement("div", { className: "pm-kpi-value" }, value, /* @__PURE__ */ React.createElement("small", null, unit)), /* @__PURE__ */ React.createElement("div", { className: "pm-kpi-sub" }, sub)), /* @__PURE__ */ React.createElement("div", { className: "pm-kpi-chart" }, chart));
|
|
444
|
+
}
|
|
445
|
+
function EmptyState({ icon = "plus", tone: tone2 = "gold", title, desc, action }) {
|
|
446
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-empty" }, /* @__PURE__ */ React.createElement("div", { className: cx("pm-empty-ic", tone2 && `pm-empty-ic--${tone2}`) }, /* @__PURE__ */ React.createElement(Icon, { name: icon, size: 21 })), /* @__PURE__ */ React.createElement("h3", null, title), desc && /* @__PURE__ */ React.createElement("p", null, desc), action);
|
|
447
|
+
}
|
|
448
|
+
function PageHero({ eyebrow, title, subtitle, children }) {
|
|
449
|
+
return /* @__PURE__ */ React.createElement("section", { className: "pm-hero pm-hero--page" }, /* @__PURE__ */ React.createElement("div", { className: "pm-hero-inner" }, /* @__PURE__ */ React.createElement("div", null, eyebrow && /* @__PURE__ */ React.createElement("div", { className: "pm-eyebrow" }, eyebrow), /* @__PURE__ */ React.createElement("h1", null, title), subtitle && /* @__PURE__ */ React.createElement("p", null, subtitle)), children && /* @__PURE__ */ React.createElement("div", { className: "pm-hero-actions" }, children)));
|
|
450
|
+
}
|
|
451
|
+
function formatTime(value) {
|
|
452
|
+
if (!value) return "\u2014";
|
|
453
|
+
const date = new Date(value);
|
|
454
|
+
if (Number.isNaN(date.getTime())) return "\u2014";
|
|
455
|
+
const pad = (number) => String(number).padStart(2, "0");
|
|
456
|
+
return `${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
457
|
+
}
|
|
458
|
+
function platformTone(platform) {
|
|
459
|
+
return "neutral";
|
|
460
|
+
return "neutral";
|
|
461
|
+
}
|
|
462
|
+
function formatTone(format) {
|
|
463
|
+
return format === "\u89C6\u9891" ? "blue" : "violet";
|
|
464
|
+
}
|
|
465
|
+
const TYPE_META = {
|
|
466
|
+
peer: { label: "\u540C\u884C\u5206\u6790", tone: "orange", icon: "search" },
|
|
467
|
+
search: { label: "\u5185\u5BB9\u5206\u6790", tone: "blue", icon: "search" },
|
|
468
|
+
topics: { label: "\u4ECA\u65E5\u9009\u9898", tone: "neutral", icon: "checks" },
|
|
469
|
+
script: { label: "\u811A\u672C", tone: "violet", icon: "book" },
|
|
470
|
+
plan: { label: "\u83B7\u5BA2\u65B9\u6848", tone: "green", icon: "plan" },
|
|
471
|
+
account: { label: "\u8D26\u53F7\u5206\u6790", tone: "red", icon: "user" }
|
|
472
|
+
};
|
|
473
|
+
function typeMeta(type) {
|
|
474
|
+
return TYPE_META[type] || TYPE_META.script;
|
|
475
|
+
}
|
|
476
|
+
function scriptFormatOf(archive) {
|
|
477
|
+
if (archive?.scriptFormat === "video" || archive?.format === "video") return "video";
|
|
478
|
+
if (archive?.scriptFormat === "image" || archive?.format === "image") return "image";
|
|
479
|
+
return String(archive?.title || "").startsWith("\u89C6\u9891\u811A\u672C") ? "video" : "image";
|
|
480
|
+
}
|
|
481
|
+
function archiveTypeMeta(archive) {
|
|
482
|
+
const meta = typeMeta(archive?.type);
|
|
483
|
+
if (archive?.type !== "script") return meta;
|
|
484
|
+
return scriptFormatOf(archive) === "video" ? { ...meta, label: "\u89C6\u9891\u811A\u672C" } : { ...meta, label: "\u56FE\u6587\u811A\u672C" };
|
|
485
|
+
}
|
|
486
|
+
function tagTone(tag) {
|
|
487
|
+
if (!tag) return "neutral";
|
|
488
|
+
if (tag.includes("\u9A6C\u4E0A\u62CD")) return "red";
|
|
489
|
+
if (tag.includes("\u6536\u85CF")) return "blue";
|
|
490
|
+
if (tag.includes("\u6DA8\u7C89")) return "violet";
|
|
491
|
+
if (tag.includes("\u8F6C\u5316")) return "green";
|
|
492
|
+
if (tag.includes("\u4FE1\u4EFB") || tag.includes("\u7F6E\u9876")) return "gold";
|
|
493
|
+
return "neutral";
|
|
494
|
+
}
|
|
495
|
+
function makePeerArchive(account, data) {
|
|
496
|
+
const posts = data?.posts || [];
|
|
497
|
+
return {
|
|
498
|
+
id: `peer-${Date.now()}`,
|
|
499
|
+
type: "peer",
|
|
500
|
+
title: `\u62C6\u89E3\u300C${account.replace(/^@/, "")}\u300D\uFF1A${posts.length} \u6761\u771F\u5B9E\u516C\u5F00\u7ED3\u679C`,
|
|
501
|
+
platform: data?.platform || "\u5C0F\u7EA2\u4E66",
|
|
502
|
+
summary: `\u4ECE\u672C\u5730 Chromium \u516C\u5F00\u9875\u9762\u91C7\u96C6 ${posts.length} \u6761\u7ED3\u679C\uFF1B${data?.summary?.length ? "\u5DF2\u751F\u6210\u540C\u884C\u5185\u5BB9\u62C6\u89E3\u3002" : "AI \u62C6\u89E3\u672A\u5B8C\u6210\uFF0C\u4FDD\u7559\u539F\u59CB\u7ED3\u679C\u3002"}`,
|
|
503
|
+
time: (/* @__PURE__ */ new Date()).toISOString(),
|
|
504
|
+
profileVersion: 1,
|
|
505
|
+
sections: [
|
|
506
|
+
{ h: "\u771F\u5B9E\u7ED3\u679C", list: posts.slice(0, 12).map((post) => `\u300C${post.title}\u300D${post.likes ? ` \xB7 ${post.likes} \u8D5E` : ""}`) },
|
|
507
|
+
...data?.summary?.length ? [{ h: "AI \u62C6\u89E3", list: data.summary }] : [],
|
|
508
|
+
...data?.tags?.length ? [{ h: "\u53EF\u590D\u7528\u6807\u7B7E", list: data.tags }] : []
|
|
509
|
+
]
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
function makeSearchArchive(keyword, data) {
|
|
513
|
+
const posts = data?.posts || [];
|
|
514
|
+
const report = data?.report || {};
|
|
515
|
+
return {
|
|
516
|
+
id: `search-${Date.now()}`,
|
|
517
|
+
type: "search",
|
|
518
|
+
title: `\u641C\u5185\u5BB9\u300C${keyword}\u300D\uFF1A${posts.length} \u6761\u771F\u5B9E\u516C\u5F00\u7ED3\u679C`,
|
|
519
|
+
platform: data?.platform || "\u5C0F\u7EA2\u4E66 / \u6296\u97F3",
|
|
520
|
+
summary: `\u4ECE\u672C\u5730 Chromium \u516C\u5F00\u9875\u9762\u91C7\u96C6 ${posts.length} \u6761\u7ED3\u679C\uFF1B${report.themes?.length ? "\u5DF2\u751F\u6210\u9700\u6C42\u3001\u7A7A\u4F4D\u548C\u53EF\u62CD\u89D2\u5EA6\u3002" : "AI \u5206\u6790\u672A\u5B8C\u6210\uFF0C\u4FDD\u7559\u539F\u59CB\u7ED3\u679C\u3002"}`,
|
|
521
|
+
time: (/* @__PURE__ */ new Date()).toISOString(),
|
|
522
|
+
profileVersion: 1,
|
|
523
|
+
sections: [
|
|
524
|
+
{ h: "\u771F\u5B9E\u7ED3\u679C", list: posts.slice(0, 12).map((post) => `\u300C${post.title}\u300D${post.author ? ` \xB7 ${post.author}` : ""}${post.likes ? ` \xB7 ${post.likes} \u8D5E` : ""}`) },
|
|
525
|
+
...report.themes?.length ? [{ h: "\u9AD8\u9891\u9700\u6C42", list: report.themes }] : [],
|
|
526
|
+
...report.gaps?.length ? [{ h: "\u4F60\u53EF\u4EE5\u5207\u7684\u7A7A\u4F4D", list: report.gaps }] : [],
|
|
527
|
+
...report.angles?.length ? [{ h: "\u53EF\u62CD\u89D2\u5EA6", list: report.angles }] : []
|
|
528
|
+
]
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function scriptToText(topic, format, script) {
|
|
532
|
+
if (format === "image") {
|
|
533
|
+
return [
|
|
534
|
+
`# ${script.title}`,
|
|
535
|
+
"",
|
|
536
|
+
script.body,
|
|
537
|
+
"",
|
|
538
|
+
"## \u56FE\u7247\u5EFA\u8BAE",
|
|
539
|
+
...script.images.map((i) => `${i.no}. ${i.text}`),
|
|
540
|
+
"",
|
|
541
|
+
`\u6807\u7B7E\uFF1A${script.tags.join(" ")}`
|
|
542
|
+
].join("\n");
|
|
543
|
+
}
|
|
544
|
+
return [
|
|
545
|
+
`# ${script.title}`,
|
|
546
|
+
"",
|
|
547
|
+
script.body,
|
|
548
|
+
"",
|
|
549
|
+
"## \u62CD\u6444\u811A\u672C",
|
|
550
|
+
...script.shots.map((s) => `${s.no}. [${s.dur}] ${s.scene}\uFF5C${s.line}`),
|
|
551
|
+
"",
|
|
552
|
+
`\u6807\u7B7E\uFF1A${script.tags.join(" ")}`
|
|
553
|
+
].join("\n");
|
|
554
|
+
}
|
|
555
|
+
function aiFamily(model) {
|
|
556
|
+
const key = `${model?.provider || ""} ${model?.model || ""}`.toLowerCase();
|
|
557
|
+
if (key.includes("claude") || key.includes("anthropic")) return { id: "claude", name: "Claude" };
|
|
558
|
+
if (key.includes("openai") || key.includes("gpt") || key.includes("o1") || key.includes("o3")) return { id: "openai", name: "OpenAI" };
|
|
559
|
+
if (key.includes("gemini") || key.includes("google")) return { id: "gemini", name: "Gemini" };
|
|
560
|
+
if (key.includes("qwen") || key.includes("\u901A\u4E49")) return { id: "qwen", name: "Qwen" };
|
|
561
|
+
if (key.includes("deepseek")) return { id: "deepseek", name: "DeepSeek" };
|
|
562
|
+
return { id: "default", name: "AI" };
|
|
563
|
+
}
|
|
564
|
+
function activityKind(aiActivity) {
|
|
565
|
+
if (!aiActivity) return "idle";
|
|
566
|
+
if (aiActivity.includes("\u9009\u9898")) return "topics";
|
|
567
|
+
if (aiActivity.includes("\u65B9\u6848")) return "plan";
|
|
568
|
+
if (aiActivity.includes("\u811A\u672C")) return "script";
|
|
569
|
+
if (aiActivity.includes("\u590D\u76D8")) return "review";
|
|
570
|
+
return "work";
|
|
571
|
+
}
|
|
572
|
+
function Sidebar({ page, onNavigate, archiveCount, topicCount, model, aiActivity, planStale }) {
|
|
573
|
+
const [collapsed, setCollapsed] = useState(() => {
|
|
574
|
+
try {
|
|
575
|
+
return window.localStorage.getItem("pomelo.sidebar.collapsed") === "1";
|
|
576
|
+
} catch {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
const nav = [
|
|
581
|
+
{ id: "workbench", label: "\u5DE5\u4F5C\u53F0", icon: "workbench", count: topicCount, countTone: "red" },
|
|
582
|
+
{ id: "review", label: "\u590D\u76D8", icon: "review", count: archiveCount, countTone: "violet" },
|
|
583
|
+
{ id: "plan", label: "\u83B7\u5BA2\u65B9\u6848", icon: "plan", alert: planStale },
|
|
584
|
+
{ id: "settings", label: "\u8BBE\u7F6E", icon: "settings" }
|
|
585
|
+
];
|
|
586
|
+
const family = aiFamily(model);
|
|
587
|
+
const task = activityKind(aiActivity);
|
|
588
|
+
function toggle() {
|
|
589
|
+
setCollapsed((value) => {
|
|
590
|
+
const next = !value;
|
|
591
|
+
try {
|
|
592
|
+
window.localStorage.setItem("pomelo.sidebar.collapsed", next ? "1" : "0");
|
|
593
|
+
} catch {
|
|
594
|
+
}
|
|
595
|
+
return next;
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
return /* @__PURE__ */ React.createElement("aside", { className: cx("pm-sidebar", collapsed && "is-collapsed") }, /* @__PURE__ */ React.createElement("div", { className: "pm-brand" }, /* @__PURE__ */ React.createElement("span", { className: "pm-brand-mark" }, /* @__PURE__ */ React.createElement(PomeloMark, { size: collapsed ? 28 : 32 })), /* @__PURE__ */ React.createElement("span", { className: "pm-brand-text" }, /* @__PURE__ */ React.createElement("span", { className: "pm-brand-name" }, "\u67DA\u5BA2"), /* @__PURE__ */ React.createElement("span", { className: "pm-brand-sub" }, "Pomelo")), /* @__PURE__ */ React.createElement(
|
|
599
|
+
"button",
|
|
600
|
+
{
|
|
601
|
+
type: "button",
|
|
602
|
+
className: "pm-sidebar-toggle",
|
|
603
|
+
onClick: toggle,
|
|
604
|
+
"aria-label": collapsed ? "\u5C55\u5F00\u4FA7\u8FB9\u680F" : "\u6536\u8D77\u4FA7\u8FB9\u680F",
|
|
605
|
+
title: collapsed ? "\u5C55\u5F00\u4FA7\u8FB9\u680F" : "\u6536\u8D77\u4FA7\u8FB9\u680F"
|
|
606
|
+
},
|
|
607
|
+
/* @__PURE__ */ React.createElement(SidebarToggleIcon, { size: 17 })
|
|
608
|
+
)), /* @__PURE__ */ React.createElement("nav", { className: "pm-nav" }, nav.map((item) => /* @__PURE__ */ React.createElement(
|
|
609
|
+
"button",
|
|
610
|
+
{
|
|
611
|
+
key: item.id,
|
|
612
|
+
type: "button",
|
|
613
|
+
title: collapsed ? item.label : item.alert ? "\u83B7\u5BA2\u65B9\u6848 \xB7 \u8D44\u6599\u6709\u66F4\u65B0" : void 0,
|
|
614
|
+
"aria-label": item.label,
|
|
615
|
+
className: cx("pm-nav-btn", page === item.id && "is-on"),
|
|
616
|
+
onClick: () => onNavigate(item.id)
|
|
617
|
+
},
|
|
618
|
+
/* @__PURE__ */ React.createElement("span", { className: "pm-nav-icon" }, /* @__PURE__ */ React.createElement(Icon, { name: item.icon, size: 22 })),
|
|
619
|
+
/* @__PURE__ */ React.createElement("span", { className: "pm-nav-label" }, item.label),
|
|
620
|
+
/* @__PURE__ */ React.createElement("span", { className: "pm-nav-tail" }, item.count > 0 && /* @__PURE__ */ React.createElement("span", { className: cx("pm-nav-count", item.countTone && `pm-nav-count--${item.countTone}`) }, item.count), item.alert && /* @__PURE__ */ React.createElement("span", { className: "pm-nav-flag" }, "\u5F85\u66F4\u65B0"))
|
|
621
|
+
))), /* @__PURE__ */ React.createElement("div", { className: "pm-sidebar-spacer" }), !collapsed && /* @__PURE__ */ React.createElement("div", { className: "pm-ai-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-ai-head" }, /* @__PURE__ */ React.createElement("span", { className: cx("pm-ai-orb", aiActivity && "is-live") }), /* @__PURE__ */ React.createElement("span", null, model?.model ? "\u5728\u7EBF" : "\u79BB\u7EBF")), /* @__PURE__ */ React.createElement("div", { className: "pm-ai-modelline" }, model?.model || "\u672A\u9009\u62E9\u6A21\u578B"), /* @__PURE__ */ React.createElement("div", { className: "pm-pet-row" }, /* @__PURE__ */ React.createElement("div", { className: cx("pm-pet", `is-${family.id}`, `is-task-${task}`, aiActivity && "is-working"), "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("span", { className: "pm-pet-orbit" }, /* @__PURE__ */ React.createElement("i", null), /* @__PURE__ */ React.createElement("i", null), /* @__PURE__ */ React.createElement("i", null)), /* @__PURE__ */ React.createElement("span", { className: "pm-pet-antenna" }), /* @__PURE__ */ React.createElement("span", { className: "pm-pet-head" }, /* @__PURE__ */ React.createElement("i", { className: "pm-pet-eye" }), /* @__PURE__ */ React.createElement("i", { className: "pm-pet-eye" })), /* @__PURE__ */ React.createElement("span", { className: "pm-pet-base" })), /* @__PURE__ */ React.createElement("div", { className: "pm-pet-info" }, /* @__PURE__ */ React.createElement("div", { className: "pm-ai-activity" }, aiActivity || (model?.model ? "\u5F85\u673A\u4E2D" : "\u7B49\u5F85\u6A21\u578B")), /* @__PURE__ */ React.createElement("div", { className: "pm-pet-hint" }, aiActivity ? "\u5904\u7406\u4E2D \xB7 \u8BF7\u7A0D\u5019" : model?.model ? "\u5C31\u7EEA \xB7 \u7B49\u5F85\u6307\u4EE4" : "\u5230\u8BBE\u7F6E\u91CC\u9009\u62E9\u6A21\u578B"))), /* @__PURE__ */ React.createElement("div", { className: cx("pm-ecg", `is-${family.id}`, `is-task-${task}`, aiActivity && "is-working"), "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 220 40", preserveAspectRatio: "none" }, /* @__PURE__ */ React.createElement("path", { className: "pm-ecg-base", d: "M0 23 H18 L23 23 L27 12 L31 33 L35 18 L40 23 H64 L69 23 L73 8 L78 37 L83 16 L88 23 H116 L121 23 L125 15 L129 30 L133 21 L138 23 H166 L171 23 L175 10 L180 35 L185 18 L190 23 H220" }), /* @__PURE__ */ React.createElement("path", { className: "pm-ecg-pulse", d: "M0 23 H18 L23 23 L27 12 L31 33 L35 18 L40 23 H64 L69 23 L73 8 L78 37 L83 16 L88 23 H116 L121 23 L125 15 L129 30 L133 21 L138 23 H166 L171 23 L175 10 L180 35 L185 18 L190 23 H220" }), /* @__PURE__ */ React.createElement("g", { className: "pm-ecg-arcs" }, /* @__PURE__ */ React.createElement("path", { className: "pm-ecg-arc is-a", d: "M73 32 L81 21 L76 22 L89 3" }), /* @__PURE__ */ React.createElement("path", { className: "pm-ecg-arc is-b", d: "M177 33 L168 24 L173 22 L161 7" }), /* @__PURE__ */ React.createElement("path", { className: "pm-ecg-arc is-c", d: "M120 29 L127 19 L122 20 L134 5" }), /* @__PURE__ */ React.createElement("circle", { className: "pm-ecg-spark is-a", cx: "81", cy: "21", r: "1.7" }), /* @__PURE__ */ React.createElement("circle", { className: "pm-ecg-spark is-b", cx: "168", cy: "24", r: "1.5" })))), /* @__PURE__ */ React.createElement("div", { className: "pm-side-note" }, "DSH \u5DF2\u8FDE\u63A5 \xB7 \u672C\u5730\u6A21\u578B")), collapsed && /* @__PURE__ */ React.createElement("div", { className: "pm-side-compact", title: "DSH \u5DF2\u8FDE\u63A5" }, /* @__PURE__ */ React.createElement("span", { className: "pm-ai-orb" })), !collapsed && /* @__PURE__ */ React.createElement("div", { className: "pm-version" }, "\u67DA\u5BA2 v0.1.0 \xB7 \u672C\u5730\u7248"));
|
|
622
|
+
}
|
|
623
|
+
function ToastStack({ toasts, onClose }) {
|
|
624
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-toast-wrap", "aria-live": "polite", "aria-atomic": "false" }, toasts.map((t) => /* @__PURE__ */ React.createElement("div", { key: t.id, className: cx("pm-toast", `pm-toast--${t.kind || "success"}`, t.leaving && "is-leaving") }, /* @__PURE__ */ React.createElement("span", { className: "pm-toast-ic" }, /* @__PURE__ */ React.createElement(
|
|
625
|
+
Icon,
|
|
626
|
+
{
|
|
627
|
+
name: t.kind === "error" ? "alert" : t.kind === "info" ? "plus" : t.kind === "loading" ? "refresh" : "check",
|
|
628
|
+
size: 16
|
|
629
|
+
}
|
|
630
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-toast-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-toast-title" }, t.title), t.desc && /* @__PURE__ */ React.createElement("div", { className: "pm-toast-desc" }, t.desc)), /* @__PURE__ */ React.createElement(IconButton, { label: "\u5173\u95ED", onClick: () => onClose(t.id) }, /* @__PURE__ */ React.createElement(Icon, { name: "close", size: 13 })))));
|
|
631
|
+
}
|
|
632
|
+
function ConfirmDialog({ data, onClose }) {
|
|
633
|
+
if (!data) return null;
|
|
634
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-modal-overlay", role: "presentation", onMouseDown: onClose }, /* @__PURE__ */ React.createElement(
|
|
635
|
+
"div",
|
|
636
|
+
{
|
|
637
|
+
className: "pm-modal",
|
|
638
|
+
role: "dialog",
|
|
639
|
+
"aria-modal": "true",
|
|
640
|
+
"aria-labelledby": "pm-confirm-title",
|
|
641
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
642
|
+
},
|
|
643
|
+
/* @__PURE__ */ React.createElement("h3", { id: "pm-confirm-title" }, data.title),
|
|
644
|
+
/* @__PURE__ */ React.createElement("p", null, data.body),
|
|
645
|
+
/* @__PURE__ */ React.createElement("div", { className: "pm-modal-foot" }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", onClick: onClose }, "\u53D6\u6D88"), /* @__PURE__ */ React.createElement(
|
|
646
|
+
Button,
|
|
647
|
+
{
|
|
648
|
+
variant: data.danger ? "danger" : "primary",
|
|
649
|
+
onClick: () => {
|
|
650
|
+
data.onOk?.();
|
|
651
|
+
onClose();
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
data.ok || "\u786E\u5B9A"
|
|
655
|
+
))
|
|
656
|
+
));
|
|
657
|
+
}
|
|
658
|
+
function scriptArchivePayload(topic, format, script, profileVersion = 1) {
|
|
659
|
+
return {
|
|
660
|
+
type: "script",
|
|
661
|
+
scriptFormat: format === "video" ? "video" : "image",
|
|
662
|
+
title: `${format === "image" ? "\u56FE\u6587" : "\u89C6\u9891"}\u811A\u672C \xB7 ${topic.title}`,
|
|
663
|
+
platform: topic.platform,
|
|
664
|
+
summary: format === "image" ? "\u6807\u9898 + \u6B63\u6587 + \u56FE\u7247\u5EFA\u8BAE + \u6807\u7B7E" : "\u6807\u9898 + \u6B63\u6587 + \u62CD\u6444\u811A\u672C + \u6807\u7B7E",
|
|
665
|
+
profileVersion,
|
|
666
|
+
sections: format === "image" ? [
|
|
667
|
+
{ h: "\u6807\u9898", p: script.title },
|
|
668
|
+
{ h: "\u6B63\u6587", p: script.body },
|
|
669
|
+
{ h: "\u56FE\u7247\u5EFA\u8BAE", list: (script.images || []).map((i) => `${i.no}. ${i.text}`) },
|
|
670
|
+
{ h: "\u6807\u7B7E", p: (script.tags || []).join(" ") }
|
|
671
|
+
] : [
|
|
672
|
+
{ h: "\u6807\u9898", p: script.title },
|
|
673
|
+
{ h: "\u6B63\u6587", p: script.body },
|
|
674
|
+
{ h: "\u62CD\u6444\u811A\u672C", list: (script.shots || []).map((s) => `${s.no}. [${s.dur}] ${s.scene}\uFF5C${s.line}`) },
|
|
675
|
+
{ h: "\u6807\u7B7E", p: (script.tags || []).join(" ") }
|
|
676
|
+
]
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function hasSavedScript(archives, topic, format, script) {
|
|
680
|
+
if (!script || !Array.isArray(archives)) return false;
|
|
681
|
+
const payload = scriptArchivePayload(topic, format, script);
|
|
682
|
+
return archives.some((item) => item.type === "script" && item.title === payload.title && item.platform === payload.platform && JSON.stringify(item.sections) === JSON.stringify(payload.sections));
|
|
683
|
+
}
|
|
684
|
+
function ScriptSheet({ data, onClose, onSave, notify, onGenerate, archives }) {
|
|
685
|
+
const { topic, format } = data;
|
|
686
|
+
const [loading, setLoading] = useState(true);
|
|
687
|
+
const [saving, setSaving] = useState(false);
|
|
688
|
+
const [script, setScript] = useState(null);
|
|
689
|
+
const [error, setError] = useState("");
|
|
690
|
+
const [saved, setSaved] = useState(false);
|
|
691
|
+
const generateRef = useRef(onGenerate);
|
|
692
|
+
useEffect(() => {
|
|
693
|
+
generateRef.current = onGenerate;
|
|
694
|
+
}, [onGenerate]);
|
|
695
|
+
async function load(force = false) {
|
|
696
|
+
setLoading(true);
|
|
697
|
+
setError("");
|
|
698
|
+
setScript(null);
|
|
699
|
+
try {
|
|
700
|
+
if (!generateRef.current) throw new Error("\u672C\u5730 Host \u672A\u8FDE\u63A5");
|
|
701
|
+
const result = await generateRef.current(topic, format, { force });
|
|
702
|
+
setScript(result);
|
|
703
|
+
} catch (err) {
|
|
704
|
+
setError(err?.message || "\u751F\u6210\u5931\u8D25");
|
|
705
|
+
} finally {
|
|
706
|
+
setLoading(false);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
useEffect(() => {
|
|
710
|
+
load(false);
|
|
711
|
+
}, [topic, format]);
|
|
712
|
+
async function copyAll() {
|
|
713
|
+
if (!script) return;
|
|
714
|
+
const ok = await copyText(scriptToText(topic, format, script));
|
|
715
|
+
notify({
|
|
716
|
+
kind: ok ? "success" : "error",
|
|
717
|
+
title: ok ? "\u5DF2\u590D\u5236\u5168\u6587" : "\u590D\u5236\u5931\u8D25",
|
|
718
|
+
desc: ok ? "\u53EF\u4EE5\u76F4\u63A5\u7C98\u8D34\u5230\u5E73\u53F0\u7F16\u8F91\u5668\u3002" : "\u8BF7\u624B\u52A8\u9009\u4E2D\u6587\u672C\u590D\u5236\u3002"
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
async function save() {
|
|
722
|
+
if (saved) {
|
|
723
|
+
notify({ kind: "info", title: "\u5DF2\u7ECF\u4FDD\u5B58\u8FC7", desc: "\u8FD9\u4EFD\u811A\u672C\u5728\u590D\u76D8\u91CC\u5DF2\u6709\u5F52\u6863\uFF0C\u91CD\u65B0\u751F\u6210\u6216\u4FEE\u6539\u540E\u518D\u4FDD\u5B58\u3002" });
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (!script || saving) return;
|
|
727
|
+
setSaving(true);
|
|
728
|
+
try {
|
|
729
|
+
await onSave({ topic, format, script });
|
|
730
|
+
setSaved(true);
|
|
731
|
+
} catch (err) {
|
|
732
|
+
notify({ kind: "error", title: "\u4FDD\u5B58\u5931\u8D25", desc: err?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
733
|
+
} finally {
|
|
734
|
+
setSaving(false);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-sheet-overlay", role: "presentation", onMouseDown: onClose }, /* @__PURE__ */ React.createElement(
|
|
738
|
+
"aside",
|
|
739
|
+
{
|
|
740
|
+
className: "pm-sheet",
|
|
741
|
+
role: "dialog",
|
|
742
|
+
"aria-modal": "true",
|
|
743
|
+
"aria-label": format === "image" ? "\u56FE\u6587\u811A\u672C" : "\u89C6\u9891\u811A\u672C",
|
|
744
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
745
|
+
},
|
|
746
|
+
/* @__PURE__ */ React.createElement("div", { className: "pm-sheet-head" }, /* @__PURE__ */ React.createElement("div", { className: "pm-sheet-head-main" }, /* @__PURE__ */ React.createElement(Badge, { tone: format === "image" ? "violet" : "blue" }, format === "image" ? "\u56FE\u6587\u811A\u672C" : "\u89C6\u9891\u811A\u672C"), /* @__PURE__ */ React.createElement("h2", null, topic.title), script?.cached && /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, "\u5DF2\u7F13\u5B58")), /* @__PURE__ */ React.createElement(IconButton, { label: "\u5173\u95ED", onClick: onClose }, /* @__PURE__ */ React.createElement(Icon, { name: "close", size: 18 }))),
|
|
747
|
+
/* @__PURE__ */ React.createElement("div", { className: "pm-sheet-body" }, loading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "72%", height: 22 } }), /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "100%", height: 13, marginTop: 18 } }), /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "94%", height: 13 } }), /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "88%", height: 13 } }), /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "46%", height: 13, marginTop: 22 } }), /* @__PURE__ */ React.createElement("div", { className: "pm-skeleton", style: { width: "100%", height: 72, marginTop: 10 } }), /* @__PURE__ */ React.createElement("p", { style: { marginTop: 14, color: "var(--pm-ink-3)", fontSize: 11.5 } }, "AI \u6B63\u5728\u5199\u811A\u672C\u2026\u901A\u5E38\u9700\u8981 20\u201360 \u79D2")), !loading && error && /* @__PURE__ */ React.createElement("div", { className: "pm-empty", style: { minHeight: 220 } }, /* @__PURE__ */ React.createElement("div", { className: cx("pm-empty-ic", tone && `pm-empty-ic--${tone}`) }, /* @__PURE__ */ React.createElement(Icon, { name: "alert", size: 20 })), /* @__PURE__ */ React.createElement("h3", null, "\u8FD9\u6B21\u6CA1\u751F\u6210\u51FA\u6765"), /* @__PURE__ */ React.createElement("p", null, error), /* @__PURE__ */ React.createElement(Button, { variant: "primary", size: "sm", onClick: () => load(true) }, "\u91CD\u8BD5")), !loading && !error && script && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "pm-script-section" }, /* @__PURE__ */ React.createElement("div", { className: "pm-script-label" }, "\u6807\u9898"), /* @__PURE__ */ React.createElement("div", { className: "pm-script-title" }, script.title)), /* @__PURE__ */ React.createElement("div", { className: "pm-script-section" }, /* @__PURE__ */ React.createElement("div", { className: "pm-script-label" }, "\u6B63\u6587"), /* @__PURE__ */ React.createElement("div", { className: "pm-script-text" }, script.body)), format === "image" ? /* @__PURE__ */ React.createElement("div", { className: "pm-script-section" }, /* @__PURE__ */ React.createElement("div", { className: "pm-script-label" }, "\u56FE\u7247\u5EFA\u8BAE"), /* @__PURE__ */ React.createElement("div", { className: "pm-image-list" }, (script.images || []).map((image) => /* @__PURE__ */ React.createElement("div", { key: image.no, className: "pm-image-item" }, /* @__PURE__ */ React.createElement("span", { className: "pm-image-no" }, image.no), /* @__PURE__ */ React.createElement("span", null, image.text))))) : /* @__PURE__ */ React.createElement("div", { className: "pm-script-section" }, /* @__PURE__ */ React.createElement("div", { className: "pm-script-label" }, "\u62CD\u6444\u811A\u672C"), /* @__PURE__ */ React.createElement("table", { className: "pm-shot-table" }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", { style: { width: 34 } }, "\u955C\u53F7"), /* @__PURE__ */ React.createElement("th", null, "\u753B\u9762"), /* @__PURE__ */ React.createElement("th", null, "\u53F0\u8BCD / \u5B57\u5E55"), /* @__PURE__ */ React.createElement("th", { style: { width: 54 } }, "\u65F6\u957F"))), /* @__PURE__ */ React.createElement("tbody", null, (script.shots || []).map((shot) => /* @__PURE__ */ React.createElement("tr", { key: shot.no }, /* @__PURE__ */ React.createElement("td", null, shot.no), /* @__PURE__ */ React.createElement("td", null, shot.scene), /* @__PURE__ */ React.createElement("td", null, shot.line), /* @__PURE__ */ React.createElement("td", null, shot.dur)))))), /* @__PURE__ */ React.createElement("div", { className: "pm-script-section" }, /* @__PURE__ */ React.createElement("div", { className: "pm-script-label" }, "\u6807\u7B7E"), /* @__PURE__ */ React.createElement("div", { className: "pm-tags" }, (script.tags || []).map((tag) => /* @__PURE__ */ React.createElement("span", { key: tag, className: "pm-tag" }, tag)))))),
|
|
748
|
+
/* @__PURE__ */ React.createElement("div", { className: "pm-sheet-foot" }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "copy", size: 14 }), onClick: copyAll, disabled: loading || Boolean(error) }, "\u590D\u5236\u5168\u6587"), /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 14 }), onClick: () => load(true), disabled: loading }, "\u91CD\u65B0\u751F\u6210"), /* @__PURE__ */ React.createElement(
|
|
749
|
+
Button,
|
|
750
|
+
{
|
|
751
|
+
variant: saved ? "secondary" : "primary",
|
|
752
|
+
size: "sm",
|
|
753
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: "check", size: 14 }),
|
|
754
|
+
onClick: save,
|
|
755
|
+
disabled: loading || Boolean(error) || saving,
|
|
756
|
+
"aria-disabled": saved,
|
|
757
|
+
className: saved ? "pm-save-done" : void 0
|
|
758
|
+
},
|
|
759
|
+
saving ? "\u4FDD\u5B58\u4E2D\u2026" : saved ? "\u5DF2\u4FDD\u5B58" : "\u4FDD\u5B58\u5230\u590D\u76D8"
|
|
760
|
+
))
|
|
761
|
+
));
|
|
762
|
+
}
|
|
763
|
+
function TaskProgress({ title, desc, progress = 0, onCancel, indeterminate = false }) {
|
|
764
|
+
return /* @__PURE__ */ React.createElement(Card, { className: "pm-progress-card" }, /* @__PURE__ */ React.createElement("span", { className: "pm-toast-ic", style: { background: "var(--pm-accent-soft)", color: "var(--pm-accent-text)" } }, /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 16 })), /* @__PURE__ */ React.createElement("div", { className: "pm-progress-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-progress-title" }, title), /* @__PURE__ */ React.createElement("div", { className: "pm-progress-desc" }, desc), /* @__PURE__ */ React.createElement("div", { className: cx("pm-progress-track", indeterminate && "is-indeterminate") }, /* @__PURE__ */ React.createElement("div", { className: "pm-progress-fill", style: indeterminate ? void 0 : { width: `${progress}%` } }))), onCancel && /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", onClick: onCancel }, "\u53D6\u6D88"));
|
|
765
|
+
}
|
|
766
|
+
function PipelineEmpty({ onRefresh, generating }) {
|
|
767
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline" }, /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h3", null, "\u9009\u9898\u6D41\u6C34\u7EBF"), /* @__PURE__ */ React.createElement("p", null, "\u8D44\u6599 \u2192 \u7406\u89E3\u4E1A\u52A1 \u2192 \u751F\u6210\u9009\u9898 \u2192 \u5199\u811A\u672C")), /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-legend" }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", { className: "is-idle" }), "\u5F85\u751F\u6210"), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", { className: "is-run" }), "\u751F\u6210\u4E2D"), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", { className: "is-done" }), "\u5DF2\u5F52\u6863"))), /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-body" }, /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-bot" }, /* @__PURE__ */ React.createElement(Icon, { name: "bot", size: 42 })), /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-copy" }, /* @__PURE__ */ React.createElement("h4", null, "\u4ECA\u5929\u8FD8\u6CA1\u6709\u9009\u9898"), /* @__PURE__ */ React.createElement("p", null, "\u5148\u586B\u597D\u53F3\u4E0A\u89D2\u7684\u8D44\u6599\uFF0C\u518D\u8BA9\u67DA\u5BA2\u6309\u4F60\u7684\u57CE\u5E02\u3001\u5BA2\u6237\u548C\u4EA7\u54C1\uFF0C\u751F\u6210 10 \u4E2A\u4ECA\u5929\u80FD\u62CD\u7684\u9009\u9898\u3002"), /* @__PURE__ */ React.createElement(Button, { variant: "gold", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "plus", size: 14 }), onClick: onRefresh, disabled: generating }, generating ? "\u6B63\u5728\u751F\u6210\u2026" : "\u751F\u6210\u4ECA\u65E5\u9009\u9898")), /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-jar" }, /* @__PURE__ */ React.createElement("b", null, "0"), /* @__PURE__ */ React.createElement("span", null, "\u5F85\u751F\u6210"))), /* @__PURE__ */ React.createElement("div", { className: "pm-pipeline-track", "aria-hidden": "true" }, Array.from({ length: 48 }).map((_, i) => /* @__PURE__ */ React.createElement("i", { key: i }))));
|
|
768
|
+
}
|
|
769
|
+
function TopicPipelineRunning() {
|
|
770
|
+
const stages = [
|
|
771
|
+
{ title: "\u8BFB\u53D6\u8D44\u6599", desc: "\u8BFB\u53D6 6 \u4E2A\u95EE\u9898\u548C\u8D26\u53F7\u4FE1\u606F" },
|
|
772
|
+
{ title: "\u7406\u89E3\u4E1A\u52A1", desc: "\u63D0\u70BC\u5BA2\u6237\u3001\u5356\u70B9\u548C\u5185\u5BB9\u7A7A\u4F4D" },
|
|
773
|
+
{ title: "\u751F\u6210\u9009\u9898", desc: "\u6309\u4F18\u5148\u7EA7\u751F\u6210\u4ECA\u5929\u80FD\u62CD\u7684\u9898" },
|
|
774
|
+
{ title: "\u6574\u7406\u7ED3\u679C", desc: "\u53BB\u91CD\u3001\u8865\u7406\u7531\u3001\u4FDD\u5B58\u5230\u672C\u673A" }
|
|
775
|
+
];
|
|
776
|
+
const [stage, setStage] = useState(0);
|
|
777
|
+
useEffect(() => {
|
|
778
|
+
const started = Date.now();
|
|
779
|
+
const timer = window.setInterval(() => {
|
|
780
|
+
setStage(Math.min(3, Math.floor((Date.now() - started) / 2800)));
|
|
781
|
+
}, 240);
|
|
782
|
+
return () => window.clearInterval(timer);
|
|
783
|
+
}, []);
|
|
784
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-run-pipeline" }, /* @__PURE__ */ React.createElement("div", { className: "pm-run-head" }, /* @__PURE__ */ React.createElement("div", { className: "pm-run-title" }, /* @__PURE__ */ React.createElement("div", { className: "pm-run-robot" }, /* @__PURE__ */ React.createElement("span", { className: "pm-run-halo" }), /* @__PURE__ */ React.createElement("span", { className: "pm-run-antenna" }), /* @__PURE__ */ React.createElement("span", { className: "pm-run-ear is-left" }), /* @__PURE__ */ React.createElement("span", { className: "pm-run-ear is-right" }), /* @__PURE__ */ React.createElement("span", { className: "pm-run-head-face" }, /* @__PURE__ */ React.createElement("i", null), /* @__PURE__ */ React.createElement("i", null)), /* @__PURE__ */ React.createElement("span", { className: "pm-run-body" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h3", null, "\u6B63\u5728\u751F\u6210\u4ECA\u5929\u80FD\u62CD\u7684\u9009\u9898"), /* @__PURE__ */ React.createElement("p", null, stages[stage].title, " \xB7 ", stages[stage].desc))), /* @__PURE__ */ React.createElement("span", { className: "pm-run-live" }, /* @__PURE__ */ React.createElement("i", null), "\u751F\u6210\u4E2D")), /* @__PURE__ */ React.createElement("div", { className: "pm-run-steps" }, stages.map((item, index) => /* @__PURE__ */ React.createElement("div", { key: item.title, className: cx("pm-run-step", index === stage && "is-active", index < stage && "is-done") }, /* @__PURE__ */ React.createElement("div", { className: "pm-run-step-line" }, /* @__PURE__ */ React.createElement("span", { className: "pm-run-step-dot" }, index < stage ? /* @__PURE__ */ React.createElement(Icon, { name: "check", size: 9 }) : String(index + 1).padStart(2, "0"))), /* @__PURE__ */ React.createElement("b", null, item.title), /* @__PURE__ */ React.createElement("small", null, item.desc)))), /* @__PURE__ */ React.createElement("div", { className: "pm-run-track", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("span", { style: { width: `${[24, 48, 72, 92][stage]}%` } })));
|
|
785
|
+
}
|
|
786
|
+
function TopicsTab({ topics, onOpenScript, onRefresh, onReplace, replacing, generating, notify }) {
|
|
787
|
+
if (generating) return /* @__PURE__ */ React.createElement(TopicPipelineRunning, null);
|
|
788
|
+
if (!topics.length) {
|
|
789
|
+
return /* @__PURE__ */ React.createElement(PipelineEmpty, { onRefresh, generating });
|
|
790
|
+
}
|
|
791
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u4ECA\u5929 \xB7 ", topics.length, " \u4E2A\u9009\u9898"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, "\u6309\u4F18\u5148\u7EA7\u6392\u597D\uFF0C\u5148\u62CD\u5E26\u300C\u9002\u5408\u9A6C\u4E0A\u62CD\u300D\u7684\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-section-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 14 }), onClick: onRefresh, disabled: generating }, generating ? "\u751F\u6210\u4E2D\u2026" : "\u6362\u4E00\u6279"))), /* @__PURE__ */ React.createElement("div", { className: "pm-topic-grid" }, topics.map((topic, index) => /* @__PURE__ */ React.createElement("article", { key: topic.id, className: "pm-topic" }, /* @__PURE__ */ React.createElement("div", { className: "pm-topic-top" }, /* @__PURE__ */ React.createElement("span", { className: "pm-topic-index" }, String(index + 1).padStart(2, "0")), /* @__PURE__ */ React.createElement(PlatformBadge, { platform: topic.platform }), /* @__PURE__ */ React.createElement(Badge, { tone: formatTone(topic.format) }, topic.format), topic.tag && /* @__PURE__ */ React.createElement(Badge, { tone: tagTone(topic.tag) }, topic.tag), /* @__PURE__ */ React.createElement(
|
|
792
|
+
IconButton,
|
|
793
|
+
{
|
|
794
|
+
label: "\u6362\u4E00\u4E2A",
|
|
795
|
+
onClick: () => onReplace?.(topic),
|
|
796
|
+
disabled: replacing
|
|
797
|
+
},
|
|
798
|
+
/* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 14 })
|
|
799
|
+
)), /* @__PURE__ */ React.createElement("h3", null, topic.title), /* @__PURE__ */ React.createElement("p", { className: "pm-topic-reason" }, topic.reason), /* @__PURE__ */ React.createElement("div", { className: "pm-topic-source" }, /* @__PURE__ */ React.createElement(Icon, { name: "dot", size: 12 }), topic.source), /* @__PURE__ */ React.createElement("div", { className: "pm-topic-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "soft", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "image", size: 14 }), onClick: () => onOpenScript(topic, "image") }, "\u56FE\u6587\u811A\u672C"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "video", size: 14 }), onClick: () => onOpenScript(topic, "video") }, "\u89C6\u9891\u811A\u672C"))))));
|
|
800
|
+
}
|
|
801
|
+
function PeerReport({ data, onUpdate, updating }) {
|
|
802
|
+
const platform = data.platform || "\u5C0F\u7EA2\u4E66";
|
|
803
|
+
const posts = (data.posts || []).map((post) => ({ ...post, avatar: data.avatar || "", platform: post.platform || platform }));
|
|
804
|
+
const summary = data.summary || [];
|
|
805
|
+
const tags = data.tags || [];
|
|
806
|
+
async function openProfile() {
|
|
807
|
+
if (!data.profileUrl) return;
|
|
808
|
+
try {
|
|
809
|
+
await rpc("browser.open", { url: data.profileUrl });
|
|
810
|
+
} catch {
|
|
811
|
+
window.open(data.profileUrl, "_blank", "noopener,noreferrer");
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Card, { className: "pm-peer-profile" }, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-profile-head" }, data.avatar ? /* @__PURE__ */ React.createElement("img", { className: "pm-peer-avatar", src: data.avatar, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }) : /* @__PURE__ */ React.createElement("span", { className: "pm-peer-avatar pm-peer-avatar--fallback" }, String(data.name || "?").slice(0, 1)), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-profile-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-profile-name" }, data.name, /* @__PURE__ */ React.createElement("span", { className: "pm-platform-chip" }, /* @__PURE__ */ React.createElement(BrandLogo, { name: platform === "\u6296\u97F3" ? "douyin" : "xhs", size: 15 }), platform)), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-profile-meta" }, data.followers && data.followers !== "\u2014" ? `${data.followers} \u7C89\u4E1D \xB7 ` : "", data.postCount, " \u6761\u516C\u5F00\u7ED3\u679C")), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-profile-actions" }, /* @__PURE__ */ React.createElement(Badge, { tone: "green" }, "\u5DF2\u5F52\u6863"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: openProfile }, "\u6253\u5F00\u4E3B\u9875")))), data.comparison && /* @__PURE__ */ React.createElement(Card, { className: "pm-peer-compare" }, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-compare-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u5BF9\u6BD4\u4E0A\u6B21"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, "\u4E0A\u6B21\u91C7\u96C6\u4E8E ", formatTime(data.comparison.previousAt))), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 13 }), onClick: onUpdate, disabled: updating }, "\u66F4\u65B0\u770B\u65B0\u589E")), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-compare-stats" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("b", null, "+", data.comparison.newCount), /* @__PURE__ */ React.createElement("span", null, "\u65B0\u589E\u4F5C\u54C1")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("b", null, data.comparison.followerDelta === null ? "\u2014" : `${data.comparison.followerDelta > 0 ? "+" : ""}${data.comparison.followerDelta}`), /* @__PURE__ */ React.createElement("span", null, "\u7C89\u4E1D\u53D8\u5316")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("b", null, data.postCount), /* @__PURE__ */ React.createElement("span", null, "\u672C\u6B21\u516C\u5F00"))), data.comparison.newPosts?.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "pm-peer-new-list" }, data.comparison.newPosts.slice(0, 4).map((post) => /* @__PURE__ */ React.createElement("div", { key: post.url || post.title, className: "pm-peer-new-item" }, /* @__PURE__ */ React.createElement("span", { className: "pm-peer-new-dot" }), /* @__PURE__ */ React.createElement("span", null, post.title))))), /* @__PURE__ */ React.createElement("div", { className: "pm-section-head", style: { marginTop: 18 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u8BFB\u5230\u7684\u516C\u5F00\u4F5C\u54C1"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, "\u70B9\u51FB\u6807\u9898\u4F1A\u5728\u672C\u673A Chromium \u91CC\u6253\u5F00\u539F\u5E16"))), /* @__PURE__ */ React.createElement("div", { className: "pm-post-grid" }, posts.map((post) => /* @__PURE__ */ React.createElement(PostCard, { key: post.url || post.title, post }))), /* @__PURE__ */ React.createElement(Card, { className: "pm-peer-insight" }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-head", style: { marginBottom: 10 } }, /* @__PURE__ */ React.createElement("h3", null, "AI \u62C6\u89E3"), /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, "\u57FA\u4E8E\u516C\u5F00\u7ED3\u679C")), summary.length ? /* @__PURE__ */ React.createElement("ul", { className: "pm-peer-summary" }, summary.map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item))) : /* @__PURE__ */ React.createElement("p", { style: { margin: 0, color: "var(--pm-ink-3)", fontSize: 12 } }, "\u6A21\u578B\u62C6\u89E3\u672A\u8FD4\u56DE\uFF0C\u5148\u770B\u4E0A\u9762\u7684\u771F\u5B9E\u4F5C\u54C1\u3002"), tags.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "pm-peer-tags" }, tags.map((tag) => /* @__PURE__ */ React.createElement(Badge, { key: tag, tone: "gold" }, tag)))));
|
|
815
|
+
}
|
|
816
|
+
function PeerTab({ notify, addArchive }) {
|
|
817
|
+
const [platform, setPlatform] = useState("\u5C0F\u7EA2\u4E66");
|
|
818
|
+
const [account, setAccount] = useState("");
|
|
819
|
+
const [status, setStatus] = useState("idle");
|
|
820
|
+
const [data, setData] = useState(null);
|
|
821
|
+
const [error, setError] = useState("");
|
|
822
|
+
const [history, setHistory] = useState([]);
|
|
823
|
+
async function refreshHistory() {
|
|
824
|
+
try {
|
|
825
|
+
const items = await rpc("peer.history");
|
|
826
|
+
setHistory(Array.isArray(items) ? items : []);
|
|
827
|
+
} catch {
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
useEffect(() => {
|
|
831
|
+
refreshHistory();
|
|
832
|
+
}, []);
|
|
833
|
+
async function run(nextPlatform = platform, nextAccount = account) {
|
|
834
|
+
const target = String(nextAccount || "").trim();
|
|
835
|
+
if (!target) {
|
|
836
|
+
notify({ kind: "error", title: "\u5148\u7C98\u8D34\u540C\u884C\u8D26\u53F7\u6216 ID", desc: "\u4F8B\u5982\uFF1A@\u676D\u5DDE\u4FDD\u6D01\u963F\u6770\uFF0C\u6216\u4E3B\u9875\u94FE\u63A5\u3002" });
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
setStatus("loading");
|
|
840
|
+
setError("");
|
|
841
|
+
setData(null);
|
|
842
|
+
setAccount(target);
|
|
843
|
+
setPlatform(nextPlatform);
|
|
844
|
+
try {
|
|
845
|
+
const result = await rpc("peer.run", { platform: nextPlatform, account: target });
|
|
846
|
+
setData(result);
|
|
847
|
+
setStatus("done");
|
|
848
|
+
await addArchive(makePeerArchive(target, result));
|
|
849
|
+
await refreshHistory();
|
|
850
|
+
const compared = result.comparison ? `\uFF0C\u6BD4\u4E0A\u6B21\u65B0\u589E ${result.comparison.newCount} \u6761` : "";
|
|
851
|
+
notify({ kind: "success", title: "\u540C\u884C\u5206\u6790\u5B8C\u6210", desc: `\u5DF2\u8BFB\u53D6 ${result.posts?.length || 0} \u6761\u771F\u5B9E\u516C\u5F00\u7ED3\u679C${compared}\uFF0C\u5E76\u4FDD\u5B58\u5230\u590D\u76D8\u3002` });
|
|
852
|
+
} catch (err) {
|
|
853
|
+
setError(err?.message || "\u672C\u5730\u6D4F\u89C8\u5668\u91C7\u96C6\u5931\u8D25");
|
|
854
|
+
setStatus("error");
|
|
855
|
+
notify({ kind: "error", title: "\u540C\u884C\u5206\u6790\u5931\u8D25", desc: err?.message || "\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u3002" });
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
function openHistory(item) {
|
|
859
|
+
setPlatform(item.platform || "\u5C0F\u7EA2\u4E66");
|
|
860
|
+
setAccount(item.account || item.name || "");
|
|
861
|
+
setData(item);
|
|
862
|
+
setError("");
|
|
863
|
+
setStatus("done");
|
|
864
|
+
}
|
|
865
|
+
function updateHistory(item) {
|
|
866
|
+
run(item.platform || "\u5C0F\u7EA2\u4E66", item.profileUrl || item.account || item.name);
|
|
867
|
+
}
|
|
868
|
+
async function openLoginWindow() {
|
|
869
|
+
try {
|
|
870
|
+
await rpc("browser.login", { platform });
|
|
871
|
+
notify({ kind: "info", title: "\u767B\u5F55\u7A97\u53E3\u5DF2\u6253\u5F00", desc: `\u8BF7\u5728 Chromium \u91CC\u767B\u5F55${platform}\uFF0C\u767B\u5F55\u540E\u56DE\u6765\u91CD\u8BD5\u3002` });
|
|
872
|
+
} catch (err) {
|
|
873
|
+
notify({ kind: "error", title: "\u767B\u5F55\u7A97\u53E3\u6253\u5F00\u5931\u8D25", desc: err?.message || "\u8BF7\u68C0\u67E5 Chromium \u5B89\u88C5\u3002" });
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Card, { className: "pm-form-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-form-head" }, /* @__PURE__ */ React.createElement("h2", null, "\u641C\u540C\u884C"), /* @__PURE__ */ React.createElement("p", null, "\u6253\u5F00\u672C\u673A Chromium\uFF0C\u5148\u8FDB\u5165\u535A\u4E3B\u4E3B\u9875\uFF0C\u518D\u8BFB\u53D6\u771F\u5B9E\u516C\u5F00\u4F5C\u54C1\uFF1B\u4E0D\u662F\u63A5\u53E3\uFF0C\u4E5F\u4E0D\u662F\u793A\u4F8B\u6570\u636E\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-form-row" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u5E73\u53F0"), /* @__PURE__ */ React.createElement(
|
|
877
|
+
Segmented,
|
|
878
|
+
{
|
|
879
|
+
value: platform,
|
|
880
|
+
options: [{ value: "\u5C0F\u7EA2\u4E66", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u5C0F\u7EA2\u4E66", plain: true }) }, { value: "\u6296\u97F3", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u6296\u97F3", plain: true }) }],
|
|
881
|
+
onChange: setPlatform
|
|
882
|
+
}
|
|
883
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-form-col", style: { flex: "2 1 260px" } }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u540C\u884C\u8D26\u53F7 ", /* @__PURE__ */ React.createElement("span", null, "\u8D26\u53F7\u540D / ID / \u4E3B\u9875\u94FE\u63A5")), /* @__PURE__ */ React.createElement(
|
|
884
|
+
TextInput,
|
|
885
|
+
{
|
|
886
|
+
value: account,
|
|
887
|
+
onChange: (e) => setAccount(e.target.value),
|
|
888
|
+
onKeyDown: (e) => e.key === "Enter" && run(),
|
|
889
|
+
placeholder: "\u4F8B\u5982\uFF1A@\u676D\u5DDE\u4FDD\u6D01\u963F\u6770\uFF0C\u6216\u7C98\u8D34\u4E3B\u9875\u94FE\u63A5"
|
|
890
|
+
}
|
|
891
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-form-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "primary", icon: /* @__PURE__ */ React.createElement(Icon, { name: "search", size: 15 }), onClick: () => run(), disabled: status === "loading" }, "\u8BFB\u53D6\u771F\u5B9E\u4E3B\u9875"))), /* @__PURE__ */ React.createElement("div", { className: "pm-form-row", style: { marginTop: 11 } }, /* @__PURE__ */ React.createElement("span", { style: { color: "var(--pm-ink-3)", fontSize: 10.5 } }, "\u8BD5\u8BD5"), /* @__PURE__ */ React.createElement("div", { className: "pm-chips" }, ["@\u676D\u5DDE\u4FDD\u6D01\u963F\u6770", "@\u6574\u7406\u5E08\u5C0F\u9E7F", "@\u738B\u963F\u59E8\u5BB6\u653F"].map((item) => /* @__PURE__ */ React.createElement("button", { key: item, className: "pm-chip", type: "button", onClick: () => setAccount(item) }, item))), /* @__PURE__ */ React.createElement("span", { style: { marginLeft: "auto", color: "var(--pm-ink-3)", fontSize: 10.5 } }, "\u53EA\u8BFB\u516C\u5F00\u9875\u9762 \xB7 \u7B2C\u4E00\u6B21\u9700\u767B\u5F55"))), history.length > 0 && /* @__PURE__ */ React.createElement(Card, { className: "pm-peer-history" }, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-history-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u641C\u7D22\u5386\u53F2"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, "\u70B9\u4E00\u6761\u67E5\u770B\u5F53\u6B21\u7ED3\u679C\uFF0C\u6216\u76F4\u63A5\u66F4\u65B0\u770B\u8FD9\u6B21\u65B0\u589E\u4E86\u4EC0\u4E48")), /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, history.length, " \u6B21")), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-history-list" }, history.slice(0, 8).map((item) => /* @__PURE__ */ React.createElement("div", { key: item.id, className: "pm-peer-history-row", onClick: () => openHistory(item), role: "button", tabIndex: 0 }, item.avatar ? /* @__PURE__ */ React.createElement("img", { className: "pm-peer-history-avatar", src: item.avatar, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }) : /* @__PURE__ */ React.createElement("span", { className: "pm-peer-history-avatar pm-peer-history-avatar--fallback" }, String(item.name || "?").slice(0, 1)), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-history-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-history-name" }, item.name, /* @__PURE__ */ React.createElement(PlatformBadge, { platform: item.platform }), item.comparison?.newCount > 0 && /* @__PURE__ */ React.createElement(Badge, { tone: "green" }, "+", item.comparison.newCount, " \u65B0")), /* @__PURE__ */ React.createElement("div", { className: "pm-peer-history-meta" }, formatTime(item.collectedAt), " \xB7 ", item.followers || "\u2014", " \u7C89\u4E1D \xB7 ", item.posts?.length || 0, " \u6761")), /* @__PURE__ */ React.createElement(
|
|
892
|
+
"button",
|
|
893
|
+
{
|
|
894
|
+
type: "button",
|
|
895
|
+
className: "pm-peer-history-update",
|
|
896
|
+
onClick: (event) => {
|
|
897
|
+
event.stopPropagation();
|
|
898
|
+
updateHistory(item);
|
|
899
|
+
},
|
|
900
|
+
disabled: status === "loading"
|
|
901
|
+
},
|
|
902
|
+
/* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 12 }),
|
|
903
|
+
" \u66F4\u65B0"
|
|
904
|
+
))))), /* @__PURE__ */ React.createElement("div", { style: { marginTop: 12 } }, status === "loading" && /* @__PURE__ */ React.createElement(
|
|
905
|
+
TaskProgress,
|
|
906
|
+
{
|
|
907
|
+
indeterminate: true,
|
|
908
|
+
title: `\u6B63\u5728\u6253\u5F00\u6D4F\u89C8\u5668\u8BFB\u53D6 ${account.replace(/^@/, "")}`,
|
|
909
|
+
desc: "\u4F1A\u5728\u672C\u673A Chromium \u91CC\u8FDB\u5165\u535A\u4E3B\u4E3B\u9875\uFF0C\u6309\u771F\u4EBA\u8282\u594F\u6EDA\u52A8\u5E76\u8BFB\u53D6\u516C\u5F00\u4F5C\u54C1\u3002"
|
|
910
|
+
}
|
|
911
|
+
), status === "done" && data && /* @__PURE__ */ React.createElement(PeerReport, { data, onUpdate: () => updateHistory(data), updating: status === "loading" }), status === "error" && /* @__PURE__ */ React.createElement(Card, { className: "pm-report", style: { padding: 22 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-head", style: { marginBottom: 8 } }, /* @__PURE__ */ React.createElement("h3", null, "\u6CA1\u6709\u8BFB\u5230\u771F\u5B9E\u4E3B\u9875"), /* @__PURE__ */ React.createElement(Badge, { tone: "red" }, "\u91C7\u96C6\u5931\u8D25")), /* @__PURE__ */ React.createElement("p", { style: { margin: 0, color: "var(--pm-ink-2)", fontSize: 13, lineHeight: 1.7 } }, error), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 8, marginTop: 14 } }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: openLoginWindow }, "\u6253\u5F00", platform, "\u767B\u5F55\u7A97\u53E3"), /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", onClick: () => run() }, "\u91CD\u8BD5"))), status === "idle" && /* @__PURE__ */ React.createElement(
|
|
912
|
+
EmptyState,
|
|
913
|
+
{
|
|
914
|
+
icon: "search",
|
|
915
|
+
title: "\u8FD8\u6CA1\u6709\u641C\u8FC7\u540C\u884C",
|
|
916
|
+
desc: "\u8F93\u5165\u8D26\u53F7\u540E\uFF0C\u67DA\u5BA2\u4F1A\u6253\u5F00\u672C\u673A Chromium\uFF0C\u8BFB\u53D6\u516C\u5F00\u4E3B\u9875\uFF0C\u5E76\u57FA\u4E8E\u771F\u5B9E\u5185\u5BB9\u62C6\u89E3\u3002"
|
|
917
|
+
}
|
|
918
|
+
)));
|
|
919
|
+
}
|
|
920
|
+
function PostCard({ post }) {
|
|
921
|
+
async function openPost(event) {
|
|
922
|
+
event.preventDefault();
|
|
923
|
+
if (!post.url) return;
|
|
924
|
+
try {
|
|
925
|
+
await rpc("browser.open", { url: post.url });
|
|
926
|
+
} catch {
|
|
927
|
+
window.open(post.url, "_blank", "noopener,noreferrer");
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
return /* @__PURE__ */ React.createElement("article", { className: "pm-post" }, /* @__PURE__ */ React.createElement("span", { className: cx("pm-post-cover", `is-${post.tone || "sand"}`) }, post.cover ? /* @__PURE__ */ React.createElement("img", { src: post.cover, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }) : null), /* @__PURE__ */ React.createElement("div", { className: "pm-post-body" }, /* @__PURE__ */ React.createElement("a", { className: "pm-post-title", href: post.url || "#", onClick: openPost }, post.title), /* @__PURE__ */ React.createElement("div", { className: "pm-post-meta" }, post.avatar ? /* @__PURE__ */ React.createElement("img", { className: "pm-post-avatar", src: post.avatar, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }) : null, /* @__PURE__ */ React.createElement("span", null, post.author || "\u516C\u5F00\u7ED3\u679C")), /* @__PURE__ */ React.createElement("div", { className: "pm-post-stats" }, post.likes && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("b", null, post.likes), " \u8D5E"), post.saves && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("b", null, post.saves), " \u85CF"), post.comments && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("b", null, post.comments), " \u8BC4"))));
|
|
931
|
+
}
|
|
932
|
+
function SearchReport({ report }) {
|
|
933
|
+
const hasReport = report && (report.themes?.length || report.gaps?.length || report.angles?.length);
|
|
934
|
+
if (!hasReport) {
|
|
935
|
+
return /* @__PURE__ */ React.createElement(Card, { className: "pm-report", style: { padding: 18 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-head", style: { marginBottom: 8 } }, /* @__PURE__ */ React.createElement("h3", null, "\u771F\u5B9E\u7ED3\u679C\u5DF2\u62FF\u5230"), /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, "\u5F85\u5206\u6790")), /* @__PURE__ */ React.createElement("p", { style: { margin: 0, color: "var(--pm-ink-3)", fontSize: 12.5, lineHeight: 1.65 } }, "\u516C\u5F00\u7ED3\u679C\u5DF2\u7ECF\u91C7\u96C6\u5B8C\u6210\uFF0C\u4F46\u8FD9\u6B21\u6A21\u578B\u5206\u6790\u6CA1\u6709\u8FD4\u56DE\u53EF\u7528 JSON\u3002\u53EF\u4EE5\u7A0D\u540E\u91CD\u8BD5\uFF0C\u6216\u76F4\u63A5\u770B\u5DE6\u4FA7\u539F\u5E16\u3002"));
|
|
936
|
+
}
|
|
937
|
+
return /* @__PURE__ */ React.createElement(Card, { className: "pm-report", style: { padding: 18 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-head", style: { marginBottom: 12 } }, /* @__PURE__ */ React.createElement("h3", null, "\u8FD9\u6279\u5185\u5BB9\u5728\u8BF4\u4EC0\u4E48"), /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, "\u5206\u6790\u7ED3\u679C")), /* @__PURE__ */ React.createElement("div", { className: "pm-report-block", style: { marginBottom: 9 } }, /* @__PURE__ */ React.createElement("h4", null, "\u9AD8\u9891\u9700\u6C42"), /* @__PURE__ */ React.createElement("ul", null, report.themes.map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item)))), /* @__PURE__ */ React.createElement("div", { className: "pm-report-block", style: { marginBottom: 9 } }, /* @__PURE__ */ React.createElement("h4", null, "\u4F60\u53EF\u4EE5\u5207\u7684\u7A7A\u4F4D"), /* @__PURE__ */ React.createElement("ul", null, report.gaps.map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item)))), /* @__PURE__ */ React.createElement("div", { className: "pm-report-block" }, /* @__PURE__ */ React.createElement("h4", null, "\u53EF\u62CD\u89D2\u5EA6"), /* @__PURE__ */ React.createElement("ul", null, report.angles.map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item)))), /* @__PURE__ */ React.createElement("div", { style: { marginTop: 10, color: "var(--pm-ink-3)", fontSize: 10.5 } }, "\u57FA\u4E8E\u672C\u6B21\u771F\u5B9E\u516C\u5F00\u7ED3\u679C\u751F\u6210\uFF0C\u5DF2\u81EA\u52A8\u5F52\u6863\u5230\u590D\u76D8"));
|
|
938
|
+
}
|
|
939
|
+
function SearchTab({ notify, addArchive }) {
|
|
940
|
+
const [platform, setPlatform] = useState("\u5C0F\u7EA2\u4E66");
|
|
941
|
+
const [keyword, setKeyword] = useState("");
|
|
942
|
+
const [sort, setSort] = useState("\u7EFC\u5408");
|
|
943
|
+
const [range, setRange] = useState("30 \u5929");
|
|
944
|
+
const [type, setType] = useState("\u4E0D\u9650");
|
|
945
|
+
const [status, setStatus] = useState("idle");
|
|
946
|
+
const [results, setResults] = useState([]);
|
|
947
|
+
const [report, setReport] = useState(null);
|
|
948
|
+
const [error, setError] = useState("");
|
|
949
|
+
async function run() {
|
|
950
|
+
if (!keyword.trim()) {
|
|
951
|
+
notify({ kind: "error", title: "\u5148\u8F93\u5165\u5173\u952E\u8BCD", desc: "\u4F8B\u5982\uFF1A\u4FDD\u6D01\u3001\u6574\u7406\u6536\u7EB3\u3001\u5BB6\u653F\u521B\u4E1A\u3002" });
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
setStatus("loading");
|
|
955
|
+
setError("");
|
|
956
|
+
setResults([]);
|
|
957
|
+
setReport(null);
|
|
958
|
+
try {
|
|
959
|
+
const data = await rpc("search.run", { platform, keyword: keyword.trim(), sort, range, type });
|
|
960
|
+
if (!data.posts?.length) throw new Error("\u6D4F\u89C8\u5668\u6CA1\u6709\u8BFB\u5230\u516C\u5F00\u7ED3\u679C\u3002\u8BF7\u5148\u767B\u5F55\uFF0C\u5E76\u68C0\u67E5\u662F\u5426\u51FA\u73B0\u9A8C\u8BC1\u7801\u6216\u9875\u9762\u7ED3\u6784\u53D8\u5316\u3002");
|
|
961
|
+
setResults(data.posts || []);
|
|
962
|
+
setReport(data.report || null);
|
|
963
|
+
setStatus("done");
|
|
964
|
+
await addArchive(makeSearchArchive(keyword.trim(), data));
|
|
965
|
+
notify({
|
|
966
|
+
kind: "success",
|
|
967
|
+
title: `\u91C7\u96C6\u5230 ${data.posts?.length || 0} \u6761\u771F\u5B9E\u7ED3\u679C`,
|
|
968
|
+
desc: "\u5DF2\u4ECE\u672C\u5730 Chromium \u7684\u516C\u5F00\u9875\u9762\u8BFB\u53D6\uFF0C\u5E76\u4FDD\u5B58\u5230\u590D\u76D8\u3002"
|
|
969
|
+
});
|
|
970
|
+
} catch (err) {
|
|
971
|
+
setError(err?.message || "\u672C\u5730\u6D4F\u89C8\u5668\u91C7\u96C6\u5931\u8D25");
|
|
972
|
+
setStatus("error");
|
|
973
|
+
notify({ kind: "error", title: "\u6CA1\u6709\u62FF\u5230\u771F\u5B9E\u7ED3\u679C", desc: err?.message || "\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u3002" });
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
async function openLoginWindow() {
|
|
977
|
+
try {
|
|
978
|
+
await rpc("browser.login", { platform });
|
|
979
|
+
notify({ kind: "info", title: "\u767B\u5F55\u7A97\u53E3\u5DF2\u6253\u5F00", desc: `\u8BF7\u5728 Chromium \u91CC\u767B\u5F55${platform}\uFF0C\u767B\u5F55\u540E\u56DE\u5230\u8FD9\u91CC\u91CD\u8BD5\u3002` });
|
|
980
|
+
} catch (err) {
|
|
981
|
+
notify({ kind: "error", title: "\u767B\u5F55\u7A97\u53E3\u6253\u5F00\u5931\u8D25", desc: err?.message || "\u8BF7\u68C0\u67E5 Chromium \u5B89\u88C5\u3002" });
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Card, { className: "pm-form-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-form-head" }, /* @__PURE__ */ React.createElement("h2", null, "\u641C\u5185\u5BB9"), /* @__PURE__ */ React.createElement("p", null, "\u6253\u5F00\u672C\u673A Chromium\uFF0C\u50CF\u771F\u4EBA\u4E00\u6837\u5728\u5E73\u53F0\u91CC\u641C\u7D22\u3001\u6EDA\u52A8\u3001\u8BFB\u53D6\u516C\u5F00\u7ED3\u679C\uFF1B\u4E0D\u662F\u63A5\u53E3\uFF0C\u4E5F\u4E0D\u662F\u793A\u4F8B\u6570\u636E\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-form-row" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u5E73\u53F0"), /* @__PURE__ */ React.createElement(
|
|
985
|
+
Segmented,
|
|
986
|
+
{
|
|
987
|
+
value: platform,
|
|
988
|
+
options: [
|
|
989
|
+
{ value: "\u5C0F\u7EA2\u4E66", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u5C0F\u7EA2\u4E66", plain: true }) },
|
|
990
|
+
{ value: "\u6296\u97F3", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u6296\u97F3", plain: true }) }
|
|
991
|
+
],
|
|
992
|
+
onChange: setPlatform
|
|
993
|
+
}
|
|
994
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-form-col", style: { flex: "2 1 240px" } }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u5173\u952E\u8BCD ", /* @__PURE__ */ React.createElement("span", null, "\u8D8A\u5177\u4F53\u8D8A\u597D")), /* @__PURE__ */ React.createElement(
|
|
995
|
+
TextInput,
|
|
996
|
+
{
|
|
997
|
+
value: keyword,
|
|
998
|
+
onChange: (e) => setKeyword(e.target.value),
|
|
999
|
+
onKeyDown: (e) => e.key === "Enter" && run(),
|
|
1000
|
+
placeholder: "\u4F8B\u5982\uFF1A\u676D\u5DDE\u4FDD\u6D01\u3001\u6574\u7406\u6536\u7EB3\u3001\u5BB6\u653F\u521B\u4E1A"
|
|
1001
|
+
}
|
|
1002
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-form-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "primary", icon: /* @__PURE__ */ React.createElement(Icon, { name: "search", size: 15 }), onClick: run, disabled: status === "loading" }, "\u641C\u7D22\u771F\u5B9E\u5185\u5BB9"))), /* @__PURE__ */ React.createElement("div", { className: "pm-form-row", style: { marginTop: 10 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-filters" }, /* @__PURE__ */ React.createElement(Select, { value: sort, onChange: (e) => setSort(e.target.value), options: [{ value: "\u7EFC\u5408", label: "\u7EFC\u5408\u6392\u5E8F" }, { value: "\u6700\u65B0", label: "\u6700\u65B0" }, { value: "\u6700\u70ED", label: "\u6700\u70ED" }] }), /* @__PURE__ */ React.createElement(Select, { value: range, onChange: (e) => setRange(e.target.value), options: [{ value: "\u4E0D\u9650", label: "\u65F6\u95F4\u4E0D\u9650" }, { value: "7 \u5929", label: "\u6700\u8FD1 7 \u5929" }, { value: "30 \u5929", label: "\u6700\u8FD1 30 \u5929" }, { value: "90 \u5929", label: "\u6700\u8FD1 90 \u5929" }] }), /* @__PURE__ */ React.createElement(Select, { value: type, onChange: (e) => setType(e.target.value), options: [{ value: "\u4E0D\u9650", label: "\u7C7B\u578B\u4E0D\u9650" }, { value: "\u56FE\u6587", label: "\u56FE\u6587" }, { value: "\u89C6\u9891", label: "\u89C6\u9891" }] })), /* @__PURE__ */ React.createElement("div", { className: "pm-chips", style: { marginLeft: "auto" } }, ["\u4FDD\u6D01", "\u9A8C\u6536\u6E05\u5355", "\u5BB6\u653F\u521B\u4E1A"].map((item) => /* @__PURE__ */ React.createElement("button", { key: item, className: "pm-chip", type: "button", onClick: () => setKeyword(item) }, item))))), /* @__PURE__ */ React.createElement("div", { style: { marginTop: 12 } }, status === "loading" && /* @__PURE__ */ React.createElement(
|
|
1003
|
+
TaskProgress,
|
|
1004
|
+
{
|
|
1005
|
+
indeterminate: true,
|
|
1006
|
+
title: `\u6B63\u5728\u6253\u5F00\u6D4F\u89C8\u5668\u641C\u7D22\u300C${keyword.trim()}\u300D`,
|
|
1007
|
+
desc: "\u4F1A\u5148\u6253\u5F00\u672C\u673A Chromium \u7684\u516C\u5F00\u641C\u7D22\u9875\uFF0C\u6309\u771F\u4EBA\u8282\u594F\u6EDA\u52A8\u9605\u8BFB\uFF1B\u5982\u679C\u672A\u767B\u5F55\u4F1A\u63D0\u793A\u4F60\u767B\u5F55\u3002"
|
|
1008
|
+
}
|
|
1009
|
+
), status === "done" && /* @__PURE__ */ React.createElement("div", { className: "pm-search-layout" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-head", style: { marginTop: 0 } }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u627E\u5230 ", results.length, " \u6761\u771F\u5B9E\u7ED3\u679C"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, "\u6765\u81EA\u672C\u5730 Chromium \u7684\u516C\u5F00\u9875\u9762 \xB7 \u70B9\u51FB\u6807\u9898\u770B\u539F\u5E16")), /* @__PURE__ */ React.createElement(Badge, { tone: "green", dot: true }, "\u5DF2\u8BFB\u9875\u9762")), results.length ? /* @__PURE__ */ React.createElement("div", { className: "pm-post-grid" }, results.map((post) => /* @__PURE__ */ React.createElement(PostCard, { key: post.url || post.title, post }))) : /* @__PURE__ */ React.createElement(EmptyState, { icon: "search", title: "\u9875\u9762\u6CA1\u6709\u8FD4\u56DE\u516C\u5F00\u7ED3\u679C", desc: "\u53EF\u80FD\u662F\u767B\u5F55\u5931\u6548\u3001\u9A8C\u8BC1\u7801\u6216\u5E73\u53F0\u9875\u9762\u7ED3\u6784\u53D8\u5316\u3002\u6253\u5F00\u767B\u5F55\u7A97\u53E3\u68C0\u67E5\u540E\u91CD\u8BD5\u3002" })), /* @__PURE__ */ React.createElement(SearchReport, { report })), status === "error" && /* @__PURE__ */ React.createElement(Card, { className: "pm-report", style: { padding: 22 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-head", style: { marginBottom: 8 } }, /* @__PURE__ */ React.createElement("h3", null, "\u6CA1\u6709\u62FF\u5230\u771F\u5B9E\u7ED3\u679C"), /* @__PURE__ */ React.createElement(Badge, { tone: "red" }, "\u91C7\u96C6\u5931\u8D25")), /* @__PURE__ */ React.createElement("p", { style: { margin: 0, color: "var(--pm-ink-2)", fontSize: 13, lineHeight: 1.7 } }, error), /* @__PURE__ */ React.createElement("p", { style: { margin: "8px 0 0", color: "var(--pm-ink-3)", fontSize: 11.5, lineHeight: 1.6 } }, "\u771F\u5B9E\u6D4F\u89C8\u5668\u91C7\u96C6\u4E0D\u4F1A\u4F7F\u7528\u5E73\u53F0\u63A5\u53E3\uFF1B\u5E73\u53F0\u9A8C\u8BC1\u3001\u767B\u5F55\u5931\u6548\u6216 DOM \u6539\u7248\u90FD\u4F1A\u5BFC\u81F4\u5931\u8D25\u3002\u5148\u70B9\u4E0B\u9762\u7684\u6309\u94AE\u6253\u5F00\u767B\u5F55\u7A97\u53E3\uFF0C\u767B\u5F55\u540E\u518D\u8BD5\u3002"), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 8, marginTop: 14 } }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: openLoginWindow }, "\u6253\u5F00", platform, "\u767B\u5F55\u7A97\u53E3"), /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", onClick: run }, "\u91CD\u8BD5"))), status === "idle" && /* @__PURE__ */ React.createElement(
|
|
1010
|
+
EmptyState,
|
|
1011
|
+
{
|
|
1012
|
+
icon: "search",
|
|
1013
|
+
title: "\u8F93\u5165\u4E00\u4E2A\u5173\u952E\u8BCD\uFF0C\u8BFB\u771F\u5B9E\u516C\u5F00\u5185\u5BB9",
|
|
1014
|
+
desc: "\u67DA\u5BA2\u4F1A\u6253\u5F00\u672C\u673A Chromium\uFF0C\u5728\u5E73\u53F0\u91CC\u6A21\u62DF\u771F\u4EBA\u641C\u7D22\u548C\u6EDA\u52A8\uFF0C\u8BFB\u53D6\u5F53\u524D\u53EF\u89C1\u7684\u516C\u5F00\u7ED3\u679C\u3002"
|
|
1015
|
+
}
|
|
1016
|
+
)));
|
|
1017
|
+
}
|
|
1018
|
+
function Workbench({ archives, topics, generatingTopics, topicsStale, notify, onOpenScript, addArchive, goSettings, onGenerateTopics, onReplaceTopic, replacingTopic, onReloadTopics, model, license }) {
|
|
1019
|
+
const [tab, setTab] = useState("topics");
|
|
1020
|
+
const scriptCount = archives.filter((a) => a.type === "script").length;
|
|
1021
|
+
const hasTopics = topics.length > 0;
|
|
1022
|
+
useEffect(() => {
|
|
1023
|
+
if (!hasTopics && !generatingTopics) onReloadTopics?.();
|
|
1024
|
+
}, []);
|
|
1025
|
+
function refreshTopics() {
|
|
1026
|
+
if (generatingTopics) return;
|
|
1027
|
+
onGenerateTopics();
|
|
1028
|
+
}
|
|
1029
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("section", { className: "pm-hero" }, /* @__PURE__ */ React.createElement("div", { className: "pm-hero-inner" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-eyebrow" }, todayLabel()), /* @__PURE__ */ React.createElement("h1", null, hasTopics ? /* @__PURE__ */ React.createElement(React.Fragment, null, "\u4ECA\u5929\u6709 ", /* @__PURE__ */ React.createElement("em", null, topics.length), " \u4E2A\u9009\u9898\u503C\u5F97\u62CD") : /* @__PURE__ */ React.createElement(React.Fragment, null, "\u4ECA\u5929\u8FD8\u6CA1\u6709\u9009\u9898")), /* @__PURE__ */ React.createElement("p", null, hasTopics ? "\u57FA\u4E8E\u4F60\u7684\u8D44\u6599\u751F\u6210\uFF0C\u5DF2\u7ECF\u6392\u597D\u4F18\u5148\u7EA7\u3002\u5148\u62CD\u300C\u9002\u5408\u9A6C\u4E0A\u62CD\u300D\u7684\u90A3\u51E0\u6761\u3002" : "\u586B\u5B8C 6 \u4E2A\u95EE\u9898\uFF0C\u70B9\u4E00\u4E0B\u751F\u6210\uFF0C\u67DA\u5BA2\u4F1A\u6309\u4F60\u7684\u4E1A\u52A1\u7ED9\u51FA 10 \u4E2A\u4ECA\u5929\u80FD\u62CD\u7684\u9009\u9898\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-hero-actions" }, /* @__PURE__ */ React.createElement("span", { className: "pm-ai-pill" }, /* @__PURE__ */ React.createElement("span", { className: "pm-status-dot" }), model?.model ? `DSH \xB7 ${model.model}` : "DSH \u6A21\u578B\u5F85\u8FDE\u63A5")))), /* @__PURE__ */ React.createElement("div", { className: "pm-content" }, /* @__PURE__ */ React.createElement("div", { className: "pm-kpis" }, /* @__PURE__ */ React.createElement(
|
|
1030
|
+
KpiCard,
|
|
1031
|
+
{
|
|
1032
|
+
label: "\u4ECA\u65E5\u9009\u9898",
|
|
1033
|
+
value: String(topics.length),
|
|
1034
|
+
unit: "\u4E2A",
|
|
1035
|
+
sub: hasTopics ? "\u5DF2\u6309\u4F18\u5148\u7EA7\u6392\u5217" : "\u7B49\u5F85\u751F\u6210",
|
|
1036
|
+
chart: /* @__PURE__ */ React.createElement(Sparkline, { points: [2, 4, 3, 6, 5, 8, Math.max(1, topics.length)], color: "var(--pm-gold)" })
|
|
1037
|
+
}
|
|
1038
|
+
), /* @__PURE__ */ React.createElement(
|
|
1039
|
+
KpiCard,
|
|
1040
|
+
{
|
|
1041
|
+
label: "\u672C\u5468\u811A\u672C",
|
|
1042
|
+
value: String(scriptCount),
|
|
1043
|
+
unit: "\u7BC7",
|
|
1044
|
+
sub: "\u751F\u6210\u540E\u81EA\u52A8\u5F52\u6863",
|
|
1045
|
+
chart: /* @__PURE__ */ React.createElement(MiniBars, { values: [1, 2, 1, 3, 2, 4, 3] })
|
|
1046
|
+
}
|
|
1047
|
+
), /* @__PURE__ */ React.createElement(
|
|
1048
|
+
KpiCard,
|
|
1049
|
+
{
|
|
1050
|
+
label: "\u5DF2\u5F52\u6863",
|
|
1051
|
+
value: String(archives.length),
|
|
1052
|
+
unit: "\u6761",
|
|
1053
|
+
sub: "\u81EA\u52A8\u5F52\u6863",
|
|
1054
|
+
chart: /* @__PURE__ */ React.createElement(Ring, { value: Math.min(1, archives.length / 10) })
|
|
1055
|
+
}
|
|
1056
|
+
), /* @__PURE__ */ React.createElement(
|
|
1057
|
+
KpiCard,
|
|
1058
|
+
{
|
|
1059
|
+
label: "\u8FDE\u7EED\u521B\u4F5C",
|
|
1060
|
+
value: "1",
|
|
1061
|
+
unit: "\u5929",
|
|
1062
|
+
sub: "\u4FDD\u6301\u6BCF\u5929\u4E00\u6761",
|
|
1063
|
+
chart: /* @__PURE__ */ React.createElement(Ring, { value: 0.2, color: "var(--pm-ok)" })
|
|
1064
|
+
}
|
|
1065
|
+
)), /* @__PURE__ */ React.createElement("div", { className: cx("pm-notice", hasTopics && "is-ready") }, /* @__PURE__ */ React.createElement("span", { className: "pm-notice-ic", style: hasTopics ? void 0 : { background: "var(--pm-accent-soft)", color: "var(--pm-accent-text)" } }, /* @__PURE__ */ React.createElement(Icon, { name: hasTopics ? "check" : "plus", size: 17 })), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-notice-title" }, hasTopics ? topicsStale ? "\u8D44\u6599\u5DF2\u66F4\u65B0\uFF0C\u5EFA\u8BAE\u91CD\u65B0\u751F\u6210\u9009\u9898" : "\u4ECA\u65E5\u9009\u9898\u5DF2\u751F\u6210" : "\u4ECA\u65E5\u9009\u9898\u5F85\u751F\u6210", /* @__PURE__ */ React.createElement(Badge, { tone: topicsStale ? "orange" : "neutral" }, topicsStale ? "\u8D44\u6599\u6709\u66F4\u65B0" : model?.provider || "\u672C\u5730 AI")), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-desc" }, topicsStale ? "6 \u4E2A\u95EE\u9898\u5DF2\u4FEE\u6539\uFF0C\u5F53\u524D\u9009\u9898\u8FD8\u662F\u65E7\u8D44\u6599\uFF0C\u70B9\u53F3\u4FA7\u66F4\u65B0\u3002" : hasTopics ? "\u7ED3\u679C\u4FDD\u5B58\u5728\u672C\u673A \xB7 \u8D44\u6599\u4FEE\u6539\u540E\u53EF\u91CD\u65B0\u751F\u6210" : "\u4F7F\u7528 DSH \u5F53\u524D\u9ED8\u8BA4\u6A21\u578B\u751F\u6210\uFF0C\u9996\u6B21\u751F\u6210\u7EA6 30\u201360 \u79D2")), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-stats" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("b", null, topics.length), /* @__PURE__ */ React.createElement("span", null, "\u9009\u9898")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("b", null, scriptCount), /* @__PURE__ */ React.createElement("span", null, "\u811A\u672C"))), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", onClick: () => goSettings() }, "\u8D44\u6599\u8BBE\u7F6E"), /* @__PURE__ */ React.createElement(
|
|
1066
|
+
Button,
|
|
1067
|
+
{
|
|
1068
|
+
variant: "gold",
|
|
1069
|
+
size: "sm",
|
|
1070
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: hasTopics ? "refresh" : "plus", size: 14 }),
|
|
1071
|
+
onClick: refreshTopics,
|
|
1072
|
+
disabled: generatingTopics
|
|
1073
|
+
},
|
|
1074
|
+
generatingTopics ? "\u751F\u6210\u4E2D\u2026" : topicsStale ? "\u66F4\u65B0\u9009\u9898" : hasTopics ? "\u91CD\u65B0\u751F\u6210" : "\u751F\u6210\u4ECA\u65E5\u9009\u9898"
|
|
1075
|
+
)), hasTopics && /* @__PURE__ */ React.createElement("span", { className: "pm-notice-progress" })), license?.status === "active" && /* @__PURE__ */ React.createElement("div", { className: "pm-renew" }, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("b", null, license.tierLabel, "\u8FD8\u5269 ", license.daysLeft, " \u5929\u5230\u671F\u3002"), "\u73B0\u5728\u7EED\u8D39\uFF0C\u7C98\u8D34\u65B0\u7801\u540E\u5230\u671F\u81EA\u52A8\u63A5\u4E0A\uFF0C\u5929\u6570\u4E0D\u6D6A\u8D39\u3002"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: () => goSettings() }, "\u7EED\u8D39")), /* @__PURE__ */ React.createElement("div", { className: "pm-tabbar", role: "tablist" }, /* @__PURE__ */ React.createElement(
|
|
1076
|
+
"button",
|
|
1077
|
+
{
|
|
1078
|
+
type: "button",
|
|
1079
|
+
role: "tab",
|
|
1080
|
+
"aria-selected": tab === "topics",
|
|
1081
|
+
className: cx("pm-tab", tab === "topics" && "is-on"),
|
|
1082
|
+
onClick: () => setTab("topics")
|
|
1083
|
+
},
|
|
1084
|
+
"\u4ECA\u65E5\u9009\u9898 ",
|
|
1085
|
+
/* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, topics.length)
|
|
1086
|
+
), /* @__PURE__ */ React.createElement(
|
|
1087
|
+
"button",
|
|
1088
|
+
{
|
|
1089
|
+
type: "button",
|
|
1090
|
+
role: "tab",
|
|
1091
|
+
"aria-selected": tab === "peer",
|
|
1092
|
+
className: cx("pm-tab", tab === "peer" && "is-on"),
|
|
1093
|
+
onClick: () => setTab("peer")
|
|
1094
|
+
},
|
|
1095
|
+
"\u641C\u540C\u884C"
|
|
1096
|
+
), /* @__PURE__ */ React.createElement(
|
|
1097
|
+
"button",
|
|
1098
|
+
{
|
|
1099
|
+
type: "button",
|
|
1100
|
+
role: "tab",
|
|
1101
|
+
"aria-selected": tab === "search",
|
|
1102
|
+
className: cx("pm-tab", tab === "search" && "is-on"),
|
|
1103
|
+
onClick: () => setTab("search")
|
|
1104
|
+
},
|
|
1105
|
+
"\u641C\u5185\u5BB9"
|
|
1106
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-tabpanel", key: tab, style: { marginTop: 18 } }, tab === "topics" && /* @__PURE__ */ React.createElement(
|
|
1107
|
+
TopicsTab,
|
|
1108
|
+
{
|
|
1109
|
+
topics,
|
|
1110
|
+
onOpenScript,
|
|
1111
|
+
onRefresh: refreshTopics,
|
|
1112
|
+
onReplace: onReplaceTopic,
|
|
1113
|
+
replacing: replacingTopic,
|
|
1114
|
+
generating: generatingTopics,
|
|
1115
|
+
notify
|
|
1116
|
+
}
|
|
1117
|
+
), tab === "peer" && /* @__PURE__ */ React.createElement(PeerTab, { notify, addArchive }), tab === "search" && /* @__PURE__ */ React.createElement(SearchTab, { notify, addArchive }))));
|
|
1118
|
+
}
|
|
1119
|
+
function archiveText(archive) {
|
|
1120
|
+
if (archive.sections) {
|
|
1121
|
+
return [
|
|
1122
|
+
`# ${archive.title}`,
|
|
1123
|
+
"",
|
|
1124
|
+
...archive.sections.flatMap((section) => [
|
|
1125
|
+
`## ${section.h}`,
|
|
1126
|
+
section.p || "",
|
|
1127
|
+
...(section.list || []).map((item) => `- ${item}`),
|
|
1128
|
+
""
|
|
1129
|
+
])
|
|
1130
|
+
].join("\n");
|
|
1131
|
+
}
|
|
1132
|
+
return archive.title;
|
|
1133
|
+
}
|
|
1134
|
+
function ReviewChat({ archive, notify, onAsk, expanded, onToggleExpand }) {
|
|
1135
|
+
const welcome = {
|
|
1136
|
+
role: "ai",
|
|
1137
|
+
text: `\u6211\u5DF2\u7ECF\u8BFB\u5B8C\u8FD9\u6761\u300C${archiveTypeMeta(archive).label}\u300D\u3002\u4F60\u53EF\u4EE5\u95EE\u6211\uFF1A\u8FD9\u6761\u4E3A\u4EC0\u4E48\u53EF\u80FD\u6709\u6548\uFF1F\u54EA\u91CC\u8FD8\u53EF\u4EE5\u66F4\u597D\uFF1F\u600E\u4E48\u6539\u6210\u89C6\u9891\uFF1F`
|
|
1138
|
+
};
|
|
1139
|
+
const initialMessages = () => {
|
|
1140
|
+
const saved = Array.isArray(archive.chat) ? archive.chat : [];
|
|
1141
|
+
return [welcome, ...saved];
|
|
1142
|
+
};
|
|
1143
|
+
const [messages, setMessages] = useState(initialMessages);
|
|
1144
|
+
const [input, setInput] = useState("");
|
|
1145
|
+
const [thinking, setThinking] = useState(false);
|
|
1146
|
+
const timer = useRef(null);
|
|
1147
|
+
const bodyRef = useRef(null);
|
|
1148
|
+
useEffect(() => {
|
|
1149
|
+
setMessages(initialMessages());
|
|
1150
|
+
setInput("");
|
|
1151
|
+
setThinking(false);
|
|
1152
|
+
}, [archive.id]);
|
|
1153
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
1154
|
+
useEffect(() => {
|
|
1155
|
+
const body = bodyRef.current;
|
|
1156
|
+
if (!body) return;
|
|
1157
|
+
body.scrollTo({ top: body.scrollHeight, behavior: "smooth" });
|
|
1158
|
+
}, [messages, thinking, archive.id]);
|
|
1159
|
+
async function send(text) {
|
|
1160
|
+
const value = (text || input).trim();
|
|
1161
|
+
if (!value || thinking) return;
|
|
1162
|
+
const history = messages;
|
|
1163
|
+
setMessages((prev) => [...prev, { role: "user", text: value }]);
|
|
1164
|
+
setInput("");
|
|
1165
|
+
if (onAsk) {
|
|
1166
|
+
setThinking(true);
|
|
1167
|
+
try {
|
|
1168
|
+
const result = await onAsk(archive, value, history);
|
|
1169
|
+
setMessages((prev) => [...prev, { role: "ai", text: result.text || "\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u5185\u5BB9\u3002" }]);
|
|
1170
|
+
} catch (err) {
|
|
1171
|
+
notify({ kind: "error", title: "\u590D\u76D8\u5931\u8D25", desc: err?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1172
|
+
setMessages((prev) => [...prev, { role: "ai", text: `\u8FD9\u6B21\u8C03\u7528\u6CA1\u6709\u6210\u529F\uFF1A${err?.message || "\u672A\u77E5\u9519\u8BEF"}` }]);
|
|
1173
|
+
} finally {
|
|
1174
|
+
setThinking(false);
|
|
1175
|
+
}
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
clearTimeout(timer.current);
|
|
1179
|
+
timer.current = setTimeout(() => {
|
|
1180
|
+
setMessages((prev) => [
|
|
1181
|
+
...prev,
|
|
1182
|
+
{
|
|
1183
|
+
role: "ai",
|
|
1184
|
+
text: "\u672C\u5730 Host \u6CA1\u6709\u8FD4\u56DE\u590D\u76D8\u5185\u5BB9\uFF0C\u8BF7\u91CD\u8BD5\u3002"
|
|
1185
|
+
}
|
|
1186
|
+
]);
|
|
1187
|
+
}, 520);
|
|
1188
|
+
}
|
|
1189
|
+
return /* @__PURE__ */ React.createElement(Card, { className: "pm-chat" }, /* @__PURE__ */ React.createElement("div", { className: "pm-chat-head" }, /* @__PURE__ */ React.createElement("span", { className: "pm-status-dot" }), /* @__PURE__ */ React.createElement("span", { className: "pm-chat-head-title" }, "\u548C\u8FD9\u6761\u5F52\u6863\u590D\u76D8"), /* @__PURE__ */ React.createElement(Badge, { tone: onAsk ? "green" : "violet" }, onAsk ? "AI" : "\u6F14\u793A"), onToggleExpand && /* @__PURE__ */ React.createElement(IconButton, { label: expanded ? "\u6062\u590D\u5206\u5C4F" : "\u5168\u5C4F\u5BF9\u8BDD", onClick: onToggleExpand }, /* @__PURE__ */ React.createElement(Icon, { name: expanded ? "collapse" : "expand", size: 15 }))), /* @__PURE__ */ React.createElement("div", { className: "pm-chat-body", ref: bodyRef }, messages.map((message, i) => /* @__PURE__ */ React.createElement("div", { key: `${message.role}-${i}`, className: cx("pm-msg", message.role === "user" ? "is-user" : "is-ai") }, message.text, i === 0 && /* @__PURE__ */ React.createElement("div", { className: "pm-msg-suggestions" }, ["\u8FD9\u6761\u4E3A\u4EC0\u4E48\u53EF\u80FD\u6709\u6548\uFF1F", "\u54EA\u91CC\u8FD8\u53EF\u4EE5\u66F4\u597D\uFF1F", "\u600E\u4E48\u6539\u6210\u89C6\u9891\uFF1F"].map((q) => /* @__PURE__ */ React.createElement("button", { key: q, type: "button", className: "pm-suggestion", onClick: () => send(q) }, q))))), thinking && /* @__PURE__ */ React.createElement("div", { className: "pm-msg is-ai is-thinking" }, /* @__PURE__ */ React.createElement("span", { className: "pm-thinking-dots" }, /* @__PURE__ */ React.createElement("i", null), /* @__PURE__ */ React.createElement("i", null), /* @__PURE__ */ React.createElement("i", null)), /* @__PURE__ */ React.createElement("span", null, "\u6B63\u5728\u7ED3\u5408\u4F60\u7684\u8D44\u6599\u60F3\u2026"))), /* @__PURE__ */ React.createElement("div", { className: "pm-chat-input" }, /* @__PURE__ */ React.createElement(
|
|
1190
|
+
TextInput,
|
|
1191
|
+
{
|
|
1192
|
+
value: input,
|
|
1193
|
+
onChange: (e) => setInput(e.target.value),
|
|
1194
|
+
onKeyDown: (e) => e.key === "Enter" && send(),
|
|
1195
|
+
placeholder: "\u57FA\u4E8E\u8FD9\u6761\u5F52\u6863\u7EE7\u7EED\u95EE\u2026",
|
|
1196
|
+
disabled: thinking
|
|
1197
|
+
}
|
|
1198
|
+
), /* @__PURE__ */ React.createElement(Button, { variant: "primary", size: "sm", onClick: () => send(), "aria-label": "\u53D1\u9001", disabled: thinking }, /* @__PURE__ */ React.createElement(Icon, { name: "send", size: 15 }))));
|
|
1199
|
+
}
|
|
1200
|
+
function ReviewDetail({ archive, onBack, onDelete, notify, onAsk }) {
|
|
1201
|
+
const splitRef = useRef(null);
|
|
1202
|
+
const [split, setSplit] = useState(62);
|
|
1203
|
+
const [expanded, setExpanded] = useState(null);
|
|
1204
|
+
const [resizing, setResizing] = useState(false);
|
|
1205
|
+
function startResize(event) {
|
|
1206
|
+
event.preventDefault();
|
|
1207
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
1208
|
+
setResizing(true);
|
|
1209
|
+
}
|
|
1210
|
+
function moveResize(event) {
|
|
1211
|
+
if (!resizing || !splitRef.current) return;
|
|
1212
|
+
const rect = splitRef.current.getBoundingClientRect();
|
|
1213
|
+
const next = (event.clientX - rect.left) / rect.width * 100;
|
|
1214
|
+
setSplit(Math.min(76, Math.max(38, next)));
|
|
1215
|
+
}
|
|
1216
|
+
function endResize() {
|
|
1217
|
+
setResizing(false);
|
|
1218
|
+
}
|
|
1219
|
+
async function copyArchive() {
|
|
1220
|
+
const ok = await copyText(archiveText(archive));
|
|
1221
|
+
notify({
|
|
1222
|
+
kind: ok ? "success" : "error",
|
|
1223
|
+
title: ok ? "\u5DF2\u590D\u5236\u5F52\u6863" : "\u590D\u5236\u5931\u8D25",
|
|
1224
|
+
desc: ok ? "\u53EF\u4EE5\u7C98\u8D34\u5230\u6587\u6863\u6216\u590D\u76D8\u7B14\u8BB0\u91CC\u3002" : "\u8BF7\u624B\u52A8\u9009\u4E2D\u6587\u672C\u590D\u5236\u3002"
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1228
|
+
PageHero,
|
|
1229
|
+
{
|
|
1230
|
+
eyebrow: /* @__PURE__ */ React.createElement("button", { type: "button", className: "pm-back-link", onClick: onBack }, /* @__PURE__ */ React.createElement(Icon, { name: "back", size: 14 }), /* @__PURE__ */ React.createElement("span", null, "\u8FD4\u56DE\u590D\u76D8")),
|
|
1231
|
+
title: archive.title,
|
|
1232
|
+
subtitle: archive.summary
|
|
1233
|
+
},
|
|
1234
|
+
/* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "copy", size: 14 }), onClick: copyArchive }, "\u590D\u5236"),
|
|
1235
|
+
/* @__PURE__ */ React.createElement(
|
|
1236
|
+
Button,
|
|
1237
|
+
{
|
|
1238
|
+
variant: "danger",
|
|
1239
|
+
size: "sm",
|
|
1240
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: "trash", size: 14 }),
|
|
1241
|
+
onClick: () => onDelete(archive.id, archive.title)
|
|
1242
|
+
},
|
|
1243
|
+
"\u5220\u9664"
|
|
1244
|
+
)
|
|
1245
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-content" }, /* @__PURE__ */ React.createElement(
|
|
1246
|
+
"div",
|
|
1247
|
+
{
|
|
1248
|
+
ref: splitRef,
|
|
1249
|
+
className: cx("pm-review-layout", expanded === "detail" && "is-detail-full", expanded === "chat" && "is-chat-full", resizing && "is-resizing"),
|
|
1250
|
+
style: !expanded ? { gridTemplateColumns: `${split}% 8px minmax(0, 1fr)` } : void 0
|
|
1251
|
+
},
|
|
1252
|
+
expanded !== "chat" && /* @__PURE__ */ React.createElement(Card, { className: "pm-detail" }, /* @__PURE__ */ React.createElement("div", { className: "pm-detail-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" } }, /* @__PURE__ */ React.createElement(Badge, { tone: archiveTypeMeta(archive).tone }, archiveTypeMeta(archive).label), /* @__PURE__ */ React.createElement(PlatformBadge, { platform: archive.platform })), /* @__PURE__ */ React.createElement("div", { className: "pm-detail-meta", style: { marginTop: 8 } }, /* @__PURE__ */ React.createElement("span", null, displayTime(archive.time)), /* @__PURE__ */ React.createElement("span", null, "\xB7"), /* @__PURE__ */ React.createElement("span", null, "\u81EA\u52A8\u5F52\u6863"))), /* @__PURE__ */ React.createElement("div", { className: "pm-panel-actions" }, /* @__PURE__ */ React.createElement(IconButton, { label: expanded === "detail" ? "\u6062\u590D\u5206\u5C4F" : "\u5168\u5C4F\u5185\u5BB9", onClick: () => setExpanded(expanded === "detail" ? null : "detail") }, /* @__PURE__ */ React.createElement(Icon, { name: expanded === "detail" ? "collapse" : "expand", size: 15 })))), /* @__PURE__ */ React.createElement("div", { className: "pm-detail-body" }, (archive.sections || []).map((section) => /* @__PURE__ */ React.createElement("div", { key: section.h, className: "pm-detail-section" }, /* @__PURE__ */ React.createElement("h3", null, section.h), section.p && /* @__PURE__ */ React.createElement("p", null, section.p), section.list && /* @__PURE__ */ React.createElement("ul", null, section.list.map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item)))))), /* @__PURE__ */ React.createElement("div", { className: "pm-detail-foot" }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "copy", size: 14 }), onClick: copyArchive }, "\u590D\u5236\u5168\u6587"), /* @__PURE__ */ React.createElement(
|
|
1253
|
+
Button,
|
|
1254
|
+
{
|
|
1255
|
+
variant: "ghost",
|
|
1256
|
+
size: "sm",
|
|
1257
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: "trash", size: 14 }),
|
|
1258
|
+
onClick: () => onDelete(archive.id, archive.title)
|
|
1259
|
+
},
|
|
1260
|
+
"\u5220\u9664\u8FD9\u6761\u5F52\u6863"
|
|
1261
|
+
))),
|
|
1262
|
+
!expanded && /* @__PURE__ */ React.createElement(
|
|
1263
|
+
"div",
|
|
1264
|
+
{
|
|
1265
|
+
className: "pm-split-handle",
|
|
1266
|
+
role: "separator",
|
|
1267
|
+
"aria-orientation": "vertical",
|
|
1268
|
+
"aria-label": "\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6",
|
|
1269
|
+
onPointerDown: startResize,
|
|
1270
|
+
onPointerMove: moveResize,
|
|
1271
|
+
onPointerUp: endResize,
|
|
1272
|
+
onPointerCancel: endResize
|
|
1273
|
+
},
|
|
1274
|
+
/* @__PURE__ */ React.createElement("span", null)
|
|
1275
|
+
),
|
|
1276
|
+
expanded !== "detail" && /* @__PURE__ */ React.createElement(
|
|
1277
|
+
ReviewChat,
|
|
1278
|
+
{
|
|
1279
|
+
archive,
|
|
1280
|
+
notify,
|
|
1281
|
+
onAsk,
|
|
1282
|
+
expanded: expanded === "chat",
|
|
1283
|
+
onToggleExpand: () => setExpanded(expanded === "chat" ? null : "chat")
|
|
1284
|
+
}
|
|
1285
|
+
)
|
|
1286
|
+
)));
|
|
1287
|
+
}
|
|
1288
|
+
function ReviewPage({ archives, deleteArchive, notify, goWorkbench, onAsk }) {
|
|
1289
|
+
const [filter, setFilter] = useState("all");
|
|
1290
|
+
const [query, setQuery] = useState("");
|
|
1291
|
+
const [selectedId, setSelectedId] = useState(null);
|
|
1292
|
+
const selected = archives.find((a) => a.id === selectedId);
|
|
1293
|
+
const filtered = useMemo(() => {
|
|
1294
|
+
return archives.filter((a) => {
|
|
1295
|
+
if (filter === "script-image" && !(a.type === "script" && scriptFormatOf(a) === "image")) return false;
|
|
1296
|
+
if (filter === "script-video" && !(a.type === "script" && scriptFormatOf(a) === "video")) return false;
|
|
1297
|
+
if (!["all", "script-image", "script-video"].includes(filter) && a.type !== filter) return false;
|
|
1298
|
+
if (query.trim() && !`${a.title} ${a.summary}`.toLowerCase().includes(query.trim().toLowerCase())) return false;
|
|
1299
|
+
return true;
|
|
1300
|
+
});
|
|
1301
|
+
}, [archives, filter, query]);
|
|
1302
|
+
if (selected) {
|
|
1303
|
+
return /* @__PURE__ */ React.createElement(
|
|
1304
|
+
ReviewDetail,
|
|
1305
|
+
{
|
|
1306
|
+
archive: selected,
|
|
1307
|
+
onBack: () => setSelectedId(null),
|
|
1308
|
+
onDelete: (id, title) => deleteArchive(id, title, () => {
|
|
1309
|
+
setSelectedId(null);
|
|
1310
|
+
}),
|
|
1311
|
+
notify,
|
|
1312
|
+
onAsk
|
|
1313
|
+
}
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
const filters = [
|
|
1317
|
+
{ value: "all", label: `\u5168\u90E8 ${archives.length}` },
|
|
1318
|
+
{ value: "peer", label: "\u540C\u884C\u5206\u6790" },
|
|
1319
|
+
{ value: "search", label: "\u5185\u5BB9\u5206\u6790" },
|
|
1320
|
+
{ value: "script-image", label: "\u56FE\u6587\u811A\u672C" },
|
|
1321
|
+
{ value: "script-video", label: "\u89C6\u9891\u811A\u672C" },
|
|
1322
|
+
{ value: "plan", label: "\u83B7\u5BA2\u65B9\u6848" }
|
|
1323
|
+
];
|
|
1324
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1325
|
+
PageHero,
|
|
1326
|
+
{
|
|
1327
|
+
eyebrow: "\u590D\u76D8",
|
|
1328
|
+
title: "\u628A\u751F\u6210\u8FC7\u7684\u5185\u5BB9\uFF0C\u53D8\u6210\u4E0B\u4E00\u6B21\u7684\u5E95\u7A3F",
|
|
1329
|
+
subtitle: "\u5206\u6790\u3001\u9009\u9898\u3001\u811A\u672C\u3001\u65B9\u6848\u90FD\u81EA\u52A8\u5F52\u6863\u3002\u70B9\u5F00\u4EFB\u610F\u4E00\u6761\uFF0C\u53EF\u4EE5\u7EE7\u7EED\u8FFD\u95EE\u3001\u7EE7\u7EED\u4F18\u5316\u3002"
|
|
1330
|
+
},
|
|
1331
|
+
/* @__PURE__ */ React.createElement(Badge, { tone: "green", dot: true }, "\u672C\u5730\u4FDD\u5B58")
|
|
1332
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-content" }, /* @__PURE__ */ React.createElement(Card, { className: "pm-form-card", style: { padding: 14 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-filters", style: { justifyContent: "space-between" } }, /* @__PURE__ */ React.createElement("div", { className: "pm-chips" }, filters.map((item) => /* @__PURE__ */ React.createElement(
|
|
1333
|
+
"button",
|
|
1334
|
+
{
|
|
1335
|
+
key: item.value,
|
|
1336
|
+
type: "button",
|
|
1337
|
+
className: "pm-chip",
|
|
1338
|
+
onClick: () => setFilter(item.value),
|
|
1339
|
+
style: filter === item.value ? { background: "var(--pm-ink)", color: "var(--pm-surface)", borderColor: "var(--pm-ink)" } : void 0
|
|
1340
|
+
},
|
|
1341
|
+
item.label
|
|
1342
|
+
))), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", gap: 8, alignItems: "center", minWidth: 220 } }, /* @__PURE__ */ React.createElement(
|
|
1343
|
+
TextInput,
|
|
1344
|
+
{
|
|
1345
|
+
value: query,
|
|
1346
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1347
|
+
placeholder: "\u641C\u6807\u9898\u3001\u6458\u8981\u2026",
|
|
1348
|
+
style: { height: 34 }
|
|
1349
|
+
}
|
|
1350
|
+
)))), /* @__PURE__ */ React.createElement("div", { style: { marginTop: 14 } }, filtered.length === 0 ? /* @__PURE__ */ React.createElement(
|
|
1351
|
+
EmptyState,
|
|
1352
|
+
{
|
|
1353
|
+
icon: "book",
|
|
1354
|
+
title: archives.length === 0 ? "\u8FD8\u6CA1\u6709\u5F52\u6863" : "\u6CA1\u6709\u5339\u914D\u7684\u5F52\u6863",
|
|
1355
|
+
desc: archives.length === 0 ? "\u53BB\u5DE5\u4F5C\u53F0\u751F\u6210\u4E00\u6761\u811A\u672C\u6216\u5206\u6790\uFF0C\u5B83\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u6362\u4E2A\u7B5B\u9009\u6761\u4EF6\u6216\u5173\u952E\u8BCD\u8BD5\u8BD5\u3002",
|
|
1356
|
+
action: archives.length === 0 ? /* @__PURE__ */ React.createElement(Button, { variant: "soft", size: "sm", onClick: goWorkbench }, "\u53BB\u5DE5\u4F5C\u53F0") : null
|
|
1357
|
+
}
|
|
1358
|
+
) : /* @__PURE__ */ React.createElement(Card, { className: "pm-list" }, filtered.map((archive) => {
|
|
1359
|
+
const meta = archiveTypeMeta(archive);
|
|
1360
|
+
return /* @__PURE__ */ React.createElement(
|
|
1361
|
+
"div",
|
|
1362
|
+
{
|
|
1363
|
+
key: archive.id,
|
|
1364
|
+
className: "pm-row",
|
|
1365
|
+
role: "button",
|
|
1366
|
+
tabIndex: 0,
|
|
1367
|
+
onClick: () => setSelectedId(archive.id),
|
|
1368
|
+
onKeyDown: (e) => e.key === "Enter" && setSelectedId(archive.id)
|
|
1369
|
+
},
|
|
1370
|
+
/* @__PURE__ */ React.createElement("span", { className: "pm-row-icon" }, /* @__PURE__ */ React.createElement(Icon, { name: meta.icon, size: 17 })),
|
|
1371
|
+
/* @__PURE__ */ React.createElement("div", { className: "pm-row-main" }, /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 7, flexWrap: "wrap" } }, /* @__PURE__ */ React.createElement("span", { style: { fontSize: 13.5, fontWeight: 600 } }, archive.title), /* @__PURE__ */ React.createElement(Badge, { tone: meta.tone }, meta.label)), /* @__PURE__ */ React.createElement("div", { className: "pm-detail-meta", style: { marginTop: 4 } }, /* @__PURE__ */ React.createElement("span", null, archive.summary))),
|
|
1372
|
+
/* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React.createElement("span", { style: { color: "var(--pm-ink-3)", fontSize: 10.5 } }, displayTime(archive.time)), /* @__PURE__ */ React.createElement(
|
|
1373
|
+
IconButton,
|
|
1374
|
+
{
|
|
1375
|
+
label: "\u5220\u9664",
|
|
1376
|
+
danger: true,
|
|
1377
|
+
onClick: (e) => {
|
|
1378
|
+
e.stopPropagation();
|
|
1379
|
+
deleteArchive(archive.id, archive.title);
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
/* @__PURE__ */ React.createElement(Icon, { name: "trash", size: 15 })
|
|
1383
|
+
))
|
|
1384
|
+
);
|
|
1385
|
+
})))));
|
|
1386
|
+
}
|
|
1387
|
+
function PlanPage({ notify, goSettings, profile, plan, stale, generating, onGenerate, linkedAccount, analyzingAccount, onAnalyzeAccount }) {
|
|
1388
|
+
const [platform, setPlatform] = useState(linkedAccount?.platform || "\u5C0F\u7EA2\u4E66");
|
|
1389
|
+
const [account, setAccount] = useState("");
|
|
1390
|
+
const ready = Boolean(profile.q1 && profile.q3 && profile.q5);
|
|
1391
|
+
const modules = [
|
|
1392
|
+
{ no: "01", title: "\u8D26\u53F7\u5B9A\u4F4D\u4E0E\u4EBA\u8BBE\u6253\u9020", empty: "\u751F\u6210\u540E\u5199\u6E05\u695A\u4F60\u662F\u8C01\u3001\u670D\u52A1\u8C01\u3001\u5BA2\u6237\u7B2C\u4E00\u773C\u4E3A\u4EC0\u4E48\u8BB0\u4F4F\u4F60\u3002" },
|
|
1393
|
+
{ no: "02", title: "\u5185\u5BB9\u65B9\u5411\u4E0E\u9009\u9898\u89C4\u5212", empty: "\u751F\u6210\u540E\u5199\u6E05\u695A\u6BCF\u5468\u53D1\u4EC0\u4E48\u3001\u5404\u7C7B\u5185\u5BB9\u5360\u591A\u5C11\u3001\u5148\u62CD\u54EA\u51E0\u6761\u3002" },
|
|
1394
|
+
{ no: "03", title: "\u62CD\u6444\u4E0E\u8868\u8FBE\u5EFA\u8BAE", empty: "\u751F\u6210\u540E\u5199\u6E05\u695A\u51FA\u955C\u3001\u573A\u666F\u3001\u5F00\u5934\u4E09\u79D2\u548C\u53E3\u64AD\u65B9\u5F0F\u3002" },
|
|
1395
|
+
{ no: "04", title: "\u83B7\u5BA2\u8DEF\u5F84\u4E0E\u8F6C\u5316\u7B56\u7565", empty: "\u751F\u6210\u540E\u5199\u6E05\u695A\u5BA2\u6237\u4ECE\u54EA\u91CC\u6765\u3001\u79C1\u4FE1\u600E\u4E48\u63A5\u3001\u600E\u4E48\u7EA6\u5230\u73B0\u573A\u3002" }
|
|
1396
|
+
];
|
|
1397
|
+
const planByNo = new Map(plan.map((section, index) => [section.no || String(index + 1).padStart(2, "0"), section]));
|
|
1398
|
+
async function bind() {
|
|
1399
|
+
if (!account.trim()) {
|
|
1400
|
+
notify({ kind: "error", title: "\u5148\u7C98\u8D34\u4F60\u7684\u4E3B\u9875\u94FE\u63A5\u6216 ID", desc: "\u7ED1\u5B9A\u540E\u4F1A\u6253\u5F00 Chromium \u8BFB\u53D6\u516C\u5F00\u4F5C\u54C1\uFF0C\u7ED9\u51FA\u771F\u5B9E\u8D26\u53F7\u8BCA\u65AD\u3002" });
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
await onAnalyzeAccount?.(platform, account.trim());
|
|
1404
|
+
}
|
|
1405
|
+
function copyPlan() {
|
|
1406
|
+
if (!plan.length) {
|
|
1407
|
+
notify({ kind: "info", title: "\u8FD8\u6CA1\u6709\u65B9\u6848", desc: "\u5148\u70B9\u300C\u751F\u6210\u65B9\u6848\u300D\u3002" });
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
const text = plan.map((section) => `## ${section.title}
|
|
1411
|
+
${section.bullets.map((b) => `- ${b}`).join("\n")}`).join("\n\n");
|
|
1412
|
+
copyText(text).then(
|
|
1413
|
+
(ok) => notify({
|
|
1414
|
+
kind: ok ? "success" : "error",
|
|
1415
|
+
title: ok ? "\u65B9\u6848\u5DF2\u590D\u5236" : "\u590D\u5236\u5931\u8D25",
|
|
1416
|
+
desc: ok ? "\u53EF\u4EE5\u7C98\u8D34\u5230\u6587\u6863\u91CC\u7EE7\u7EED\u6539\u3002" : "\u8BF7\u624B\u52A8\u9009\u4E2D\u6587\u672C\u590D\u5236\u3002"
|
|
1417
|
+
})
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1421
|
+
PageHero,
|
|
1422
|
+
{
|
|
1423
|
+
eyebrow: "\u83B7\u5BA2\u65B9\u6848",
|
|
1424
|
+
title: "\u4F60\u7684\u5185\u5BB9\u83B7\u5BA2\u65B9\u6848",
|
|
1425
|
+
subtitle: "\u7531 6 \u4E2A\u95EE\u9898\u548C\u8D26\u53F7\u5206\u6790\u751F\u6210\u3002\u8D44\u6599\u4E00\u53D8\uFF0C\u8FD9\u91CC\u548C\u4ECA\u65E5\u9009\u9898\u90FD\u4F1A\u8DDF\u7740\u66F4\u65B0\u3002"
|
|
1426
|
+
},
|
|
1427
|
+
/* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "settings", size: 14 }), onClick: goSettings }, "\u7F16\u8F91\u8D44\u6599"),
|
|
1428
|
+
/* @__PURE__ */ React.createElement(
|
|
1429
|
+
Button,
|
|
1430
|
+
{
|
|
1431
|
+
variant: "gold",
|
|
1432
|
+
size: "sm",
|
|
1433
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: plan.length ? "refresh" : "plus", size: 14 }),
|
|
1434
|
+
onClick: onGenerate,
|
|
1435
|
+
disabled: !ready || generating
|
|
1436
|
+
},
|
|
1437
|
+
generating ? "\u751F\u6210\u4E2D\u2026" : stale ? "\u66F4\u65B0\u65B9\u6848" : "\u91CD\u65B0\u751F\u6210"
|
|
1438
|
+
)
|
|
1439
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-content" }, stale && plan.length > 0 && /* @__PURE__ */ React.createElement(Card, { className: "pm-plan-stale" }, /* @__PURE__ */ React.createElement("span", { className: "pm-plan-stale-ic" }, /* @__PURE__ */ React.createElement(Icon, { name: "alert", size: 17 })), /* @__PURE__ */ React.createElement("div", { className: "pm-plan-stale-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-plan-stale-title" }, "6 \u4E2A\u95EE\u9898\u6709\u66F4\u65B0"), /* @__PURE__ */ React.createElement("div", { className: "pm-plan-stale-desc" }, "\u5F53\u524D\u65B9\u6848\u8FD8\u662F\u4E0A\u4E00\u7248\u8D44\u6599\u751F\u6210\u7684\u3002\u66F4\u65B0\u4F1A\u751F\u6210\u4E00\u4EFD\u65B0\u65B9\u6848\uFF0C\u65E7\u65B9\u6848\u548C\u5386\u53F2\u5F52\u6863\u4E0D\u4F1A\u88AB\u6539\u52A8\u3002")), /* @__PURE__ */ React.createElement(Button, { variant: "gold", size: "sm", onClick: onGenerate, disabled: generating }, generating ? "\u66F4\u65B0\u4E2D\u2026" : "\u624B\u52A8\u66F4\u65B0\u65B9\u6848")), !ready && /* @__PURE__ */ React.createElement(Card, { className: "pm-notice", style: { marginTop: 0 } }, /* @__PURE__ */ React.createElement("span", { className: "pm-notice-ic", style: { background: "var(--pm-accent-soft)", color: "var(--pm-accent-text)" } }, /* @__PURE__ */ React.createElement(Icon, { name: "alert", size: 17 })), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-notice-title" }, "\u8D44\u6599\u8FD8\u6CA1\u586B\u5B8C\u6574"), /* @__PURE__ */ React.createElement("div", { className: "pm-notice-desc" }, "\u5148\u56DE\u7B54 6 \u4E2A\u95EE\u9898\u91CC\u7684 1/3/5\uFF0C\u67DA\u5BA2\u624D\u80FD\u751F\u6210\u4E13\u5C5E\u65B9\u6848\u3002")), /* @__PURE__ */ React.createElement(Button, { variant: "soft", size: "sm", onClick: goSettings }, "\u53BB\u586B\u5199")), /* @__PURE__ */ React.createElement(Card, { className: cx("pm-account-card", !linkedAccount && "is-empty"), style: { marginTop: ready ? 0 : 12 } }, linkedAccount ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "pm-peer-account" }, linkedAccount.avatar ? /* @__PURE__ */ React.createElement("img", { className: "pm-avatar pm-avatar--img", src: linkedAccount.avatar, alt: "", referrerPolicy: "no-referrer" }) : /* @__PURE__ */ React.createElement("span", { className: "pm-avatar" }, String(linkedAccount.name || "?").slice(0, 1)), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-account-name" }, linkedAccount.name, " ", /* @__PURE__ */ React.createElement(PlatformBadge, { platform: linkedAccount.platform })), /* @__PURE__ */ React.createElement("div", { className: "pm-account-meta" }, linkedAccount.followers || "\u2014", " \u7C89\u4E1D \xB7 ", linkedAccount.postCount || 0, " \u6761\u4F5C\u54C1 \xB7 \u5206\u6790\u4E8E ", displayTime(linkedAccount.analyzedAt))), /* @__PURE__ */ React.createElement(
|
|
1440
|
+
Button,
|
|
1441
|
+
{
|
|
1442
|
+
variant: "secondary",
|
|
1443
|
+
size: "sm",
|
|
1444
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 14 }),
|
|
1445
|
+
disabled: analyzingAccount,
|
|
1446
|
+
onClick: () => onAnalyzeAccount?.(linkedAccount.platform, linkedAccount.profileUrl || linkedAccount.account)
|
|
1447
|
+
},
|
|
1448
|
+
analyzingAccount ? "\u5206\u6790\u4E2D\u2026" : "\u91CD\u65B0\u5206\u6790"
|
|
1449
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-report-grid", style: { marginTop: 14 } }, /* @__PURE__ */ React.createElement("div", { className: "pm-report-block" }, /* @__PURE__ */ React.createElement("h4", null, "\u8D26\u53F7\u5B9A\u4F4D"), /* @__PURE__ */ React.createElement("p", null, linkedAccount.positioning || "\u6A21\u578B\u8FD9\u6B21\u6CA1\u6709\u8FD4\u56DE\u5B9A\u4F4D\u5224\u65AD\u3002"), /* @__PURE__ */ React.createElement("ul", null, (linkedAccount.summary || []).map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item)))), /* @__PURE__ */ React.createElement("div", { className: "pm-report-block" }, /* @__PURE__ */ React.createElement("h4", null, "\u4E0E\u4F60\u76EE\u6807\u7684\u5339\u914D\u5EA6"), /* @__PURE__ */ React.createElement("ul", null, (linkedAccount.match || []).map((item) => /* @__PURE__ */ React.createElement("li", { key: item }, item))), !(linkedAccount.match || []).length && /* @__PURE__ */ React.createElement("p", null, "\u6A21\u578B\u8FD9\u6B21\u6CA1\u6709\u8FD4\u56DE\u5339\u914D\u5224\u65AD\uFF0C\u53EF\u4EE5\u91CD\u65B0\u5206\u6790\u3002")))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "pm-form-head", style: { marginBottom: 0 } }, /* @__PURE__ */ React.createElement("h2", null, "\u5148\u7ED1\u5B9A\u4F60\u7684\u8D26\u53F7"), /* @__PURE__ */ React.createElement("p", null, "\u7ED1\u5B9A\u540E\u4F1A\u6253\u5F00\u672C\u673A Chromium \u8BFB\u53D6\u4F60\u7684\u516C\u5F00\u4E3B\u9875\uFF0C\u7ED9\u51FA\u771F\u5B9E\u8D26\u53F7\u8BCA\u65AD\uFF0C\u5E76\u8BA9\u65B9\u6848\u66F4\u8D34\u5408\u4F60\u73B0\u5728\u7684\u72B6\u6001\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-account-form" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u5E73\u53F0"), /* @__PURE__ */ React.createElement(
|
|
1450
|
+
Segmented,
|
|
1451
|
+
{
|
|
1452
|
+
value: platform,
|
|
1453
|
+
options: [
|
|
1454
|
+
{ value: "\u5C0F\u7EA2\u4E66", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u5C0F\u7EA2\u4E66", plain: true }) },
|
|
1455
|
+
{ value: "\u6296\u97F3", label: /* @__PURE__ */ React.createElement(PlatformBadge, { platform: "\u6296\u97F3", plain: true }) }
|
|
1456
|
+
],
|
|
1457
|
+
onChange: setPlatform
|
|
1458
|
+
}
|
|
1459
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "pm-form-col" }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u4F60\u7684\u4E3B\u9875\u94FE\u63A5\u6216 ID"), /* @__PURE__ */ React.createElement(TextInput, { value: account, onChange: (e) => setAccount(e.target.value), placeholder: "\u4F8B\u5982\uFF1A@\u963F\u67DA\u6574\u7406" })), /* @__PURE__ */ React.createElement(Button, { variant: "primary", icon: /* @__PURE__ */ React.createElement(Icon, { name: "user", size: 15 }), onClick: bind, disabled: analyzingAccount }, analyzingAccount ? "\u5206\u6790\u4E2D\u2026" : "\u7ED1\u5B9A\u5E76\u5206\u6790")))), /* @__PURE__ */ React.createElement("div", { className: "pm-section-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-section-title" }, "\u65B9\u6848\u6B63\u6587"), /* @__PURE__ */ React.createElement("div", { className: "pm-section-sub" }, plan.length ? "\u57FA\u4E8E 6 \u4E2A\u95EE\u9898\u751F\u6210 \xB7 \u8D44\u6599\u4FEE\u6539\u540E\u624B\u52A8\u66F4\u65B0" : "\u56DB\u4E2A\u677F\u5757\u5148\u5C55\u793A\uFF0C\u751F\u6210\u540E\u81EA\u52A8\u586B\u5165\u5185\u5BB9")), /* @__PURE__ */ React.createElement("div", { className: "pm-section-actions" }, /* @__PURE__ */ React.createElement(Badge, { tone: stale ? "orange" : plan.length ? "green" : "neutral", dot: true }, stale ? "\u8D44\u6599\u6709\u66F4\u65B0" : plan.length ? "\u5DF2\u751F\u6210" : "\u5F85\u751F\u6210"), /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "copy", size: 14 }), onClick: copyPlan, disabled: !plan.length }, "\u590D\u5236\u65B9\u6848"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 14 }), onClick: onGenerate, disabled: !ready || generating }, generating ? "\u751F\u6210\u4E2D\u2026" : stale ? "\u66F4\u65B0\u65B9\u6848" : "\u91CD\u65B0\u751F\u6210"))), generating && !plan.length && /* @__PURE__ */ React.createElement("div", { className: "pm-plan-generating" }, /* @__PURE__ */ React.createElement("span", { className: "pm-plan-generating-dot" }), /* @__PURE__ */ React.createElement("span", null, "\u6B63\u5728\u751F\u6210\u65B9\u6848\uFF0C\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u586B\u5165\u4E0B\u9762\u56DB\u4E2A\u677F\u5757")), /* @__PURE__ */ React.createElement("div", { className: "pm-plan-grid" }, modules.map((module, index) => {
|
|
1460
|
+
const section = planByNo.get(module.no) || plan[index];
|
|
1461
|
+
return /* @__PURE__ */ React.createElement(Card, { key: module.no, className: cx("pm-plan-card", !section && "is-placeholder") }, /* @__PURE__ */ React.createElement("div", { className: "pm-plan-card-top" }, /* @__PURE__ */ React.createElement("span", { className: "pm-plan-no" }, module.no), /* @__PURE__ */ React.createElement("h3", null, section?.title || module.title)), section ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "pm-plan-lead" }, section.lead), /* @__PURE__ */ React.createElement("ul", null, (section.bullets || []).map((bullet) => /* @__PURE__ */ React.createElement("li", { key: bullet }, bullet)))) : /* @__PURE__ */ React.createElement("p", { className: "pm-plan-placeholder" }, module.empty));
|
|
1462
|
+
}))));
|
|
1463
|
+
}
|
|
1464
|
+
function SettingsPage({ profile, setProfile, profileSaveState, notify, askConfirm, goPlan, clearAll, model, onModelChange, license, onActivateLicense, onCreatePlan, creatingPlan, onProfileEdit }) {
|
|
1465
|
+
const [code, setCode] = useState("");
|
|
1466
|
+
const [browserInfo, setBrowserInfo] = useState(null);
|
|
1467
|
+
const [browserChecking, setBrowserChecking] = useState(false);
|
|
1468
|
+
const [installingBrowser, setInstallingBrowser] = useState(false);
|
|
1469
|
+
const loginPollRef = useRef(0);
|
|
1470
|
+
const [modelOptions, setModelOptions] = useState([]);
|
|
1471
|
+
const [modelValue, setModelValue] = useState(model ? `${model.provider}::${model.model}` : "");
|
|
1472
|
+
const [modelBusy, setModelBusy] = useState(false);
|
|
1473
|
+
const [modelError, setModelError] = useState("");
|
|
1474
|
+
const licenseActive = license?.status === "active";
|
|
1475
|
+
const licenseExpiry = license?.expiresAt ? new Date(license.expiresAt).toLocaleDateString("zh-CN") : "";
|
|
1476
|
+
function update(key, value) {
|
|
1477
|
+
setProfile({ ...profile, [key]: value });
|
|
1478
|
+
onProfileEdit?.();
|
|
1479
|
+
}
|
|
1480
|
+
useEffect(() => {
|
|
1481
|
+
if (!HOST_MODE) return void 0;
|
|
1482
|
+
let alive = true;
|
|
1483
|
+
rpc("model.list").then((data) => {
|
|
1484
|
+
if (!alive) return;
|
|
1485
|
+
setModelOptions(data.providers || []);
|
|
1486
|
+
if (data.selection?.provider && data.selection?.model) {
|
|
1487
|
+
setModelValue(`${data.selection.provider}::${data.selection.model}`);
|
|
1488
|
+
}
|
|
1489
|
+
}).catch((error) => {
|
|
1490
|
+
if (alive) setModelError(error?.message || "\u8BFB\u53D6 DSH \u6A21\u578B\u5931\u8D25");
|
|
1491
|
+
});
|
|
1492
|
+
return () => {
|
|
1493
|
+
alive = false;
|
|
1494
|
+
};
|
|
1495
|
+
}, []);
|
|
1496
|
+
useEffect(() => {
|
|
1497
|
+
if (model?.provider && model?.model) setModelValue(`${model.provider}::${model.model}`);
|
|
1498
|
+
}, [model]);
|
|
1499
|
+
async function changeModel(event) {
|
|
1500
|
+
const value = event.target.value;
|
|
1501
|
+
if (!value || value === modelValue) return;
|
|
1502
|
+
const [provider, modelId] = value.split("::");
|
|
1503
|
+
if (!provider || !modelId) return;
|
|
1504
|
+
setModelBusy(true);
|
|
1505
|
+
setModelError("");
|
|
1506
|
+
try {
|
|
1507
|
+
const data = await rpc("model.select", { provider, model: modelId });
|
|
1508
|
+
setModelValue(value);
|
|
1509
|
+
onModelChange?.(data.selection);
|
|
1510
|
+
notify({ kind: "success", title: "\u6A21\u578B\u5DF2\u5207\u6362", desc: `${provider} / ${modelId}\uFF0CDSH \u9ED8\u8BA4\u6A21\u578B\u4E5F\u5DF2\u540C\u6B65\u3002` });
|
|
1511
|
+
} catch (error) {
|
|
1512
|
+
setModelError(error?.message || "\u5207\u6362\u6A21\u578B\u5931\u8D25");
|
|
1513
|
+
notify({ kind: "error", title: "\u5207\u6362\u6A21\u578B\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5 DSH \u6A21\u578B\u914D\u7F6E\u3002" });
|
|
1514
|
+
} finally {
|
|
1515
|
+
setModelBusy(false);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
async function refreshBrowserStatus() {
|
|
1519
|
+
setBrowserChecking(true);
|
|
1520
|
+
try {
|
|
1521
|
+
const info = await rpc("browser.status");
|
|
1522
|
+
setBrowserInfo(info);
|
|
1523
|
+
return info;
|
|
1524
|
+
} catch {
|
|
1525
|
+
return null;
|
|
1526
|
+
} finally {
|
|
1527
|
+
setBrowserChecking(false);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
useEffect(() => {
|
|
1531
|
+
if (!HOST_MODE) return void 0;
|
|
1532
|
+
let alive = true;
|
|
1533
|
+
setBrowserChecking(true);
|
|
1534
|
+
rpc("browser.status").then((info) => {
|
|
1535
|
+
if (alive) setBrowserInfo(info);
|
|
1536
|
+
}).catch(() => {
|
|
1537
|
+
}).finally(() => {
|
|
1538
|
+
if (alive) setBrowserChecking(false);
|
|
1539
|
+
});
|
|
1540
|
+
return () => {
|
|
1541
|
+
alive = false;
|
|
1542
|
+
window.clearInterval(loginPollRef.current);
|
|
1543
|
+
};
|
|
1544
|
+
}, []);
|
|
1545
|
+
async function ensureBrowser() {
|
|
1546
|
+
if (browserInfo?.installed) return true;
|
|
1547
|
+
setInstallingBrowser(true);
|
|
1548
|
+
try {
|
|
1549
|
+
const info = await rpc("browser.install");
|
|
1550
|
+
setBrowserInfo(info);
|
|
1551
|
+
if (info?.installed) {
|
|
1552
|
+
notify({ kind: "success", title: "Chromium \u5DF2\u5B89\u88C5", desc: "\u73B0\u5728\u53EF\u4EE5\u6253\u5F00\u767B\u5F55\u7A97\u53E3\u4E86\u3002" });
|
|
1553
|
+
return true;
|
|
1554
|
+
}
|
|
1555
|
+
notify({ kind: "error", title: "Chromium \u5B89\u88C5\u672A\u5B8C\u6210", desc: "\u8BF7\u5728\u9879\u76EE\u76EE\u5F55\u8FD0\u884C npm run browser:install \u540E\u91CD\u8BD5\u3002" });
|
|
1556
|
+
return false;
|
|
1557
|
+
} catch (error) {
|
|
1558
|
+
notify({ kind: "error", title: "Chromium \u5B89\u88C5\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u7F51\u7EDC\u3002" });
|
|
1559
|
+
return false;
|
|
1560
|
+
} finally {
|
|
1561
|
+
setInstallingBrowser(false);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
async function activate() {
|
|
1565
|
+
if (!code.trim()) {
|
|
1566
|
+
notify({ kind: "error", title: "\u5148\u7C98\u8D34\u6388\u6743\u7801", desc: "\u6388\u6743\u7801\u5F62\u5982 PM-Y-XXXX-XXXX-XXXXXXXXXXXX\u3002" });
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
try {
|
|
1570
|
+
await onActivateLicense(code);
|
|
1571
|
+
setCode("");
|
|
1572
|
+
notify({ kind: "success", title: "\u6388\u6743\u6210\u529F", desc: "\u5168\u90E8\u529F\u80FD\u5DF2\u89E3\u9501\uFF0C\u5230\u671F\u65E5\u524D\u53EF\u7EE7\u7EED\u7EED\u8D39\u53E0\u52A0\u3002" });
|
|
1573
|
+
} catch (error) {
|
|
1574
|
+
notify({ kind: "error", title: "\u6388\u6743\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u6388\u6743\u7801\u3002" });
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
async function openBrowserLogin(platform) {
|
|
1578
|
+
if (!await ensureBrowser()) return;
|
|
1579
|
+
try {
|
|
1580
|
+
await rpc("browser.login", { platform });
|
|
1581
|
+
notify({ kind: "info", title: "\u767B\u5F55\u7A97\u53E3\u5DF2\u6253\u5F00", desc: `\u8BF7\u5728\u5F39\u51FA\u7684 Chromium \u7A97\u53E3\u767B\u5F55${platform}\uFF0C\u767B\u5F55\u540E\u4F1A\u81EA\u52A8\u66F4\u65B0\u72B6\u6001\u3002` });
|
|
1582
|
+
const key = platform === "\u6296\u97F3" ? "douyin" : "xhs";
|
|
1583
|
+
const started = Date.now();
|
|
1584
|
+
window.clearInterval(loginPollRef.current);
|
|
1585
|
+
loginPollRef.current = window.setInterval(async () => {
|
|
1586
|
+
try {
|
|
1587
|
+
const info = await rpc("browser.status");
|
|
1588
|
+
setBrowserInfo(info);
|
|
1589
|
+
if (info?.logins?.[key]?.loggedIn) {
|
|
1590
|
+
window.clearInterval(loginPollRef.current);
|
|
1591
|
+
notify({ kind: "success", title: `${platform}\u5DF2\u767B\u5F55`, desc: "\u72B6\u6001\u5DF2\u66F4\u65B0\uFF0C\u53EF\u4EE5\u76F4\u63A5\u641C\u5185\u5BB9\u3001\u641C\u540C\u884C\u3002" });
|
|
1592
|
+
} else if (Date.now() - started > 12e4) {
|
|
1593
|
+
window.clearInterval(loginPollRef.current);
|
|
1594
|
+
}
|
|
1595
|
+
} catch {
|
|
1596
|
+
}
|
|
1597
|
+
}, 2500);
|
|
1598
|
+
} catch (error) {
|
|
1599
|
+
notify({ kind: "error", title: "\u6253\u5F00\u767B\u5F55\u7A97\u53E3\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u672C\u5730 Chromium \u662F\u5426\u5B89\u88C5\u5B8C\u6210\u3002" });
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
async function openDataFolder() {
|
|
1603
|
+
try {
|
|
1604
|
+
const result = await rpc("data.openFolder");
|
|
1605
|
+
notify({ kind: "success", title: "\u5DF2\u6253\u5F00\u6570\u636E\u6587\u4EF6\u5939", desc: result?.path || "~/.dsh/pomelo/" });
|
|
1606
|
+
} catch (error) {
|
|
1607
|
+
notify({ kind: "error", title: "\u6253\u5F00\u6587\u4EF6\u5939\u5931\u8D25", desc: error?.message || "\u8BF7\u624B\u52A8\u6253\u5F00 ~/.dsh/pomelo/" });
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
async function exportData() {
|
|
1611
|
+
try {
|
|
1612
|
+
const result = await rpc("data.export");
|
|
1613
|
+
notify({ kind: "success", title: "\u5DF2\u5BFC\u51FA", desc: result?.path || "\u5DF2\u751F\u6210 Markdown \u6587\u4EF6\u3002" });
|
|
1614
|
+
} catch (error) {
|
|
1615
|
+
notify({ kind: "error", title: "\u5BFC\u51FA\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
async function testModel() {
|
|
1619
|
+
try {
|
|
1620
|
+
const result = await rpc("model.check");
|
|
1621
|
+
notify({
|
|
1622
|
+
kind: "success",
|
|
1623
|
+
title: "DSH \u6A21\u578B\u53EF\u7528",
|
|
1624
|
+
desc: `${result.model?.provider || ""} / ${result.model?.model || ""} \xB7 ${result.text}`
|
|
1625
|
+
});
|
|
1626
|
+
} catch (error) {
|
|
1627
|
+
notify({ kind: "error", title: "\u6A21\u578B\u4E0D\u53EF\u7528", desc: error?.message || "\u8BF7\u68C0\u67E5 DSH \u6A21\u578B\u8BBE\u7F6E\u3002" });
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1631
|
+
PageHero,
|
|
1632
|
+
{
|
|
1633
|
+
eyebrow: "\u8BBE\u7F6E",
|
|
1634
|
+
title: "\u8BBE\u7F6E\u4E00\u6B21\uFF0C\u4E4B\u540E\u67DA\u5BA2\u6BCF\u5929\u81EA\u5DF1\u8DD1",
|
|
1635
|
+
subtitle: "\u4F1A\u5458\u5361\u3001\u4F60\u7684\u8D44\u6599\u3001\u5E73\u53F0\u8D26\u53F7\u3001AI \u6A21\u578B\u548C\u6570\u636E\u4F4D\u7F6E\u90FD\u5728\u8FD9\u91CC\u3002"
|
|
1636
|
+
}
|
|
1637
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-content" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-wrap" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-stack" }, /* @__PURE__ */ React.createElement(Card, { className: "pm-settings-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "\u6388\u6743\u5361"), /* @__PURE__ */ React.createElement("p", null, "\u6388\u6743\u540E\u5168\u90E8\u529F\u80FD\u53EF\u7528\uFF1B\u7EED\u8D39\u4F1A\u4ECE\u5F53\u524D\u5230\u671F\u65E5\u81EA\u52A8\u53E0\u52A0\u3002")), /* @__PURE__ */ React.createElement(Badge, { tone: licenseActive ? "green" : "neutral", dot: licenseActive }, licenseActive ? "\u5DF2\u6FC0\u6D3B" : "\u672A\u6FC0\u6D3B")), /* @__PURE__ */ React.createElement("div", { className: "pm-member-row" }, /* @__PURE__ */ React.createElement("span", { className: "pm-member-expiry" }, "\u5F53\u524D\u72B6\u6001\uFF1A", /* @__PURE__ */ React.createElement("b", null, licenseActive ? `${license.tierLabel} \xB7 \u5230\u671F ${licenseExpiry}` : "\u672A\u6FC0\u6D3B \xB7 \u7C98\u8D34\u6388\u6743\u7801\u540E\u5F00\u59CB\u8BA1\u65F6"))), /* @__PURE__ */ React.createElement("div", { className: "pm-device-row" }, /* @__PURE__ */ React.createElement(Icon, { name: "monitor", size: 15 }), /* @__PURE__ */ React.createElement("span", null, "\u8FD9\u53F0 Mac\uFF08\u5F53\u524D\u8BBE\u5907\uFF09"), /* @__PURE__ */ React.createElement(Badge, { tone: "green", dot: true }, "\u5DF2\u8BC6\u522B")), /* @__PURE__ */ React.createElement("div", { className: "pm-code-box" }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, licenseActive ? "\u7EED\u8D39" : "\u6FC0\u6D3B", " ", /* @__PURE__ */ React.createElement("span", null, licenseActive ? "\u7C98\u8D34\u65B0\u7801\uFF0C\u5230\u671F\u65E5\u81EA\u52A8\u53E0\u52A0" : "\u7C98\u8D34\u6388\u6743\u7801\u540E\u89E3\u9501\u5168\u90E8\u529F\u80FD")), /* @__PURE__ */ React.createElement(
|
|
1638
|
+
Textarea,
|
|
1639
|
+
{
|
|
1640
|
+
value: code,
|
|
1641
|
+
onChange: (e) => setCode(e.target.value),
|
|
1642
|
+
placeholder: "\u7C98\u8D34\u6388\u6743\u7801\uFF0C\u4F8B\u5982 PM-XXXX-XXXX-XXXX-XXXX",
|
|
1643
|
+
style: { minHeight: 64 }
|
|
1644
|
+
}
|
|
1645
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-code-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "primary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "lock", size: 14 }), onClick: activate }, licenseActive ? "\u7EED\u8D39" : "\u6FC0\u6D3B")))), /* @__PURE__ */ React.createElement(Card, { className: "pm-settings-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "\u81EA\u6211\u4ECB\u7ECD / \u521B\u5EFA\u65B9\u6848"), /* @__PURE__ */ React.createElement("p", null, "\u8FD9 6 \u4E2A\u95EE\u9898\u662F\u6240\u6709 AI \u5206\u6790\u7684\u5E95\u7A3F\u3002\u6539\u5B8C\u4FDD\u5B58\uFF0C\u4ECA\u65E5\u9009\u9898\u548C\u83B7\u5BA2\u65B9\u6848\u4F1A\u6309\u65B0\u8D44\u6599\u66F4\u65B0\u3002")), /* @__PURE__ */ React.createElement(Badge, { tone: "green", dot: true }, "\u81EA\u52A8\u4FDD\u5B58")), /* @__PURE__ */ React.createElement("div", { className: "pm-qgrid" }, PROFILE_QUESTIONS.map((q) => /* @__PURE__ */ React.createElement("div", { key: q.key, className: "pm-qcard" }, /* @__PURE__ */ React.createElement("div", { className: "pm-qhead" }, /* @__PURE__ */ React.createElement("span", { className: "pm-qno" }, q.no), /* @__PURE__ */ React.createElement("span", { className: "pm-qtitle" }, q.title)), /* @__PURE__ */ React.createElement("div", { className: "pm-qhint" }, q.hint), /* @__PURE__ */ React.createElement(
|
|
1646
|
+
Textarea,
|
|
1647
|
+
{
|
|
1648
|
+
value: profile[q.key] || "",
|
|
1649
|
+
onChange: (e) => update(q.key, e.target.value),
|
|
1650
|
+
placeholder: q.placeholder
|
|
1651
|
+
}
|
|
1652
|
+
), /* @__PURE__ */ React.createElement("div", { className: "pm-qfoot" }, /* @__PURE__ */ React.createElement("span", null, (profile[q.key] || "").length, " \u5B57"), !(profile[q.key] || "").trim() ? /* @__PURE__ */ React.createElement("span", { className: "is-empty" }, "\u672A\u586B\u5199") : profileSaveState === "saving" ? /* @__PURE__ */ React.createElement("span", { className: "is-saving" }, "\u4FDD\u5B58\u4E2D\u2026") : profileSaveState === "error" ? /* @__PURE__ */ React.createElement("span", { className: "is-error" }, "\u4FDD\u5B58\u5931\u8D25") : profileSaveState === "saved" ? /* @__PURE__ */ React.createElement("span", { className: "is-saved" }, "\u5DF2\u4FDD\u5B58\u5230\u672C\u5730") : null)))), /* @__PURE__ */ React.createElement("div", { className: "pm-profile-actions" }, /* @__PURE__ */ React.createElement("span", { style: { color: "var(--pm-ink-3)", fontSize: 10.5 } }, "1\u30013\u30015 \u4E3A\u5FC5\u586B\uFF1B\u793A\u4F8B\u5185\u5BB9\u53EF\u76F4\u63A5\u4FEE\u6539\u3002"), /* @__PURE__ */ React.createElement(Button, { variant: "gold", icon: /* @__PURE__ */ React.createElement(Icon, { name: "plus", size: 15 }), onClick: onCreatePlan, disabled: creatingPlan }, creatingPlan ? "\u6B63\u5728\u751F\u6210\u2026" : "\u521B\u5EFA\u83B7\u5BA2\u65B9\u6848"))), /* @__PURE__ */ React.createElement(Card, { className: "pm-settings-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "\u5E73\u53F0\u8D26\u53F7"), /* @__PURE__ */ React.createElement("p", null, "\u767B\u5F55\u4E00\u6B21\uFF0C\u4E4B\u540E\u81EA\u52A8\u4FDD\u6301\u3002\u767B\u5F55\u6001\u53EA\u4FDD\u5B58\u5728\u672C\u5730 Chromium\uFF0C\u4E0D\u4E0A\u4F20\u3002")), /* @__PURE__ */ React.createElement(Button, { variant: "ghost", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "refresh", size: 13 }), onClick: refreshBrowserStatus, disabled: browserChecking }, browserChecking ? "\u68C0\u6D4B\u4E2D\u2026" : "\u5237\u65B0\u72B6\u6001")), /* @__PURE__ */ React.createElement("div", { className: "pm-platform-row" }, /* @__PURE__ */ React.createElement("span", { className: "pm-platform-ic" }, /* @__PURE__ */ React.createElement(BrandLogo, { name: "chrome", size: 28 })), /* @__PURE__ */ React.createElement("div", { className: "pm-platform-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-platform-name" }, "\u91C7\u96C6\u6D4F\u89C8\u5668"), /* @__PURE__ */ React.createElement("div", { className: "pm-platform-sub" }, "Chromium \xB7 \u7EA6 300\u2013400MB \xB7 \u9996\u6B21\u4F7F\u7528\u65F6\u4E0B\u8F7D")), /* @__PURE__ */ React.createElement(Badge, { tone: browserInfo?.installed ? "green" : "neutral", dot: Boolean(browserInfo?.installed) }, browserChecking ? "\u68C0\u6D4B\u4E2D" : browserInfo?.installed ? browserInfo.running ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u5B89\u88C5" : "\u672A\u5B89\u88C5"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "download", size: 14 }), onClick: () => browserInfo?.installed ? openBrowserLogin("\u5C0F\u7EA2\u4E66") : ensureBrowser(), disabled: installingBrowser }, installingBrowser ? "\u5B89\u88C5\u4E2D\u2026" : browserInfo?.installed ? "\u6253\u5F00" : "\u5B89\u88C5")), [
|
|
1653
|
+
{ name: "\u6296\u97F3", key: "douyin", sub: "\u767B\u5F55\u540E\u53EF\u641C\u5185\u5BB9\u3001\u641C\u540C\u884C\u3001\u5206\u6790\u8D26\u53F7", brand: "douyin" },
|
|
1654
|
+
{ name: "\u5C0F\u7EA2\u4E66", key: "xhs", sub: "\u767B\u5F55\u540E\u53EF\u641C\u5185\u5BB9\u3001\u641C\u540C\u884C\u3001\u5206\u6790\u8D26\u53F7", brand: "xhs" }
|
|
1655
|
+
].map((p) => {
|
|
1656
|
+
const login = browserInfo?.logins?.[p.key];
|
|
1657
|
+
const known = browserInfo?.logins?.known;
|
|
1658
|
+
return /* @__PURE__ */ React.createElement("div", { key: p.name, className: "pm-platform-row" }, /* @__PURE__ */ React.createElement("span", { className: "pm-platform-ic" }, /* @__PURE__ */ React.createElement(BrandLogo, { name: p.brand, size: 28 })), /* @__PURE__ */ React.createElement("div", { className: "pm-platform-main" }, /* @__PURE__ */ React.createElement("div", { className: "pm-platform-name" }, p.name), /* @__PURE__ */ React.createElement("div", { className: "pm-platform-sub" }, p.sub)), /* @__PURE__ */ React.createElement(Badge, { tone: login?.loggedIn ? "green" : "neutral", dot: Boolean(login?.loggedIn) }, browserChecking ? "\u68C0\u6D4B\u4E2D" : !known ? "\u5F85\u68C0\u6D4B" : login?.loggedIn ? "\u5DF2\u767B\u5F55" : "\u672A\u767B\u5F55"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: () => openBrowserLogin(p.name) }, login?.loggedIn ? "\u91CD\u65B0\u767B\u5F55" : "\u767B\u5F55"));
|
|
1659
|
+
})), /* @__PURE__ */ React.createElement(Card, { className: "pm-settings-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "AI \u6A21\u578B"), /* @__PURE__ */ React.createElement("p", null, "\u9ED8\u8BA4\u8DDF\u968F DSH\uFF0C\u4E5F\u53EF\u4EE5\u5728\u8FD9\u91CC\u624B\u52A8\u5207\u6362\u3002")), /* @__PURE__ */ React.createElement(Badge, { tone: "green", dot: true }, "\u53EF\u5207\u6362")), /* @__PURE__ */ React.createElement("div", { className: "pm-model-row" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-model-name" }, model ? `${model.provider} / ${model.model}` : "\u7B49\u5F85 DSH \u6A21\u578B"), /* @__PURE__ */ React.createElement("div", { className: "pm-model-sub" }, "\u5F53\u524D\u4F7F\u7528 DSH \u9ED8\u8BA4\u6A21\u578B\u3002\u5207\u6362\u540E\u4F1A\u540C\u6B65\u4FEE\u6539 DSH \u7684\u9ED8\u8BA4\u6A21\u578B\uFF0C\u65B0\u4F1A\u8BDD\u4E5F\u4F1A\u4F7F\u7528\u5B83\u3002")), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", onClick: testModel }, "\u68C0\u6D4B\u8FDE\u63A5")), /* @__PURE__ */ React.createElement("div", { className: "pm-model-picker" }, /* @__PURE__ */ React.createElement("div", { className: "pm-label" }, "\u5207\u6362\u6A21\u578B ", /* @__PURE__ */ React.createElement("span", null, "\u6765\u81EA DSH \u53EF\u9009\u5217\u8868")), /* @__PURE__ */ React.createElement("select", { className: "pm-select", value: modelValue, onChange: changeModel, disabled: !HOST_MODE || modelBusy || !modelOptions.length }, !modelOptions.length && /* @__PURE__ */ React.createElement("option", { value: modelValue || "" }, modelValue ? "\u5F53\u524D\u6A21\u578B" : "\u6B63\u5728\u8BFB\u53D6 DSH \u6A21\u578B\u2026"), modelOptions.map((provider) => /* @__PURE__ */ React.createElement("optgroup", { key: provider.id, label: provider.name }, provider.models.map((item) => /* @__PURE__ */ React.createElement("option", { key: `${provider.id}::${item.id}`, value: `${provider.id}::${item.id}` }, item.name))))), modelError ? /* @__PURE__ */ React.createElement("div", { className: "pm-model-error" }, modelError) : null), /* @__PURE__ */ React.createElement("div", { className: "pm-model-sub", style: { marginTop: 10 } }, "\u6A21\u578B\u8C03\u7528\u6D88\u8017\u4F60\u5F53\u524D\u7684 DSH \u6A21\u578B\u989D\u5EA6\uFF1B\u67DA\u5BA2\u4E0D\u5355\u72EC\u4FDD\u5B58 API Key\u3002")), /* @__PURE__ */ React.createElement(Card, { className: "pm-settings-card" }, /* @__PURE__ */ React.createElement("div", { className: "pm-settings-head" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "\u6570\u636E"), /* @__PURE__ */ React.createElement("p", null, "\u6240\u6709\u8D44\u6599\u3001\u9009\u9898\u3001\u811A\u672C\u3001\u5F52\u6863\u548C\u5BF9\u8BDD\u90FD\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u4E0D\u4E0A\u4E91\u3002")), /* @__PURE__ */ React.createElement(Badge, { tone: "neutral" }, "\u672C\u5730")), /* @__PURE__ */ React.createElement("div", { className: "pm-data-path" }, /* @__PURE__ */ React.createElement(Icon, { name: "folder", size: 15 }), "~/.dsh/pomelo/"), /* @__PURE__ */ React.createElement("div", { className: "pm-data-actions" }, /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "folder", size: 14 }), onClick: openDataFolder }, "\u6253\u5F00\u6587\u4EF6\u5939"), /* @__PURE__ */ React.createElement(Button, { variant: "secondary", size: "sm", icon: /* @__PURE__ */ React.createElement(Icon, { name: "download", size: 14 }), onClick: exportData }, "\u5BFC\u51FA"), /* @__PURE__ */ React.createElement(
|
|
1660
|
+
Button,
|
|
1661
|
+
{
|
|
1662
|
+
variant: "danger",
|
|
1663
|
+
size: "sm",
|
|
1664
|
+
icon: /* @__PURE__ */ React.createElement(Icon, { name: "trash", size: 14 }),
|
|
1665
|
+
onClick: () => askConfirm({
|
|
1666
|
+
title: "\u6E05\u7A7A\u5168\u90E8\u672C\u5730\u6570\u636E\uFF1F",
|
|
1667
|
+
body: "\u8D44\u6599\u3001\u5F52\u6863\u548C\u590D\u76D8\u5BF9\u8BDD\u90FD\u4F1A\u88AB\u5220\u9664\uFF0C\u4E14\u65E0\u6CD5\u6062\u590D\u3002",
|
|
1668
|
+
ok: "\u6E05\u7A7A",
|
|
1669
|
+
danger: true,
|
|
1670
|
+
onOk: clearAll
|
|
1671
|
+
})
|
|
1672
|
+
},
|
|
1673
|
+
"\u6E05\u7A7A\u6570\u636E"
|
|
1674
|
+
))), /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", color: "var(--pm-ink-3)", fontSize: 10.5, padding: "4px 0 8px" } }, "\u67DA\u5BA2 Pomelo v0.1.0 \xB7 \u672C\u5730\u7248 \xB7 \u91C7\u96C6 / \u6388\u6743\u670D\u52A1\u5C06\u5728\u540E\u7EED\u7248\u672C\u63A5\u5165")))));
|
|
1675
|
+
}
|
|
1676
|
+
function planFromArchive(archive) {
|
|
1677
|
+
return (archive?.sections || []).map((section, index) => ({
|
|
1678
|
+
no: String(index + 1).padStart(2, "0"),
|
|
1679
|
+
title: section.h,
|
|
1680
|
+
lead: section.p,
|
|
1681
|
+
bullets: section.list || []
|
|
1682
|
+
}));
|
|
1683
|
+
}
|
|
1684
|
+
function displayTime(value) {
|
|
1685
|
+
if (!value) return "";
|
|
1686
|
+
const date = new Date(value);
|
|
1687
|
+
if (Number.isNaN(date.getTime())) return String(value);
|
|
1688
|
+
return `${date.getMonth() + 1} \u6708 ${date.getDate()} \u65E5 ${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
|
|
1689
|
+
}
|
|
1690
|
+
function LicenseGate({ onActivate, notify }) {
|
|
1691
|
+
const [code, setCode] = useState("");
|
|
1692
|
+
const [busy, setBusy] = useState(false);
|
|
1693
|
+
const [error, setError] = useState("");
|
|
1694
|
+
async function submit(e) {
|
|
1695
|
+
e?.preventDefault?.();
|
|
1696
|
+
if (!code.trim() || busy) return;
|
|
1697
|
+
setBusy(true);
|
|
1698
|
+
setError("");
|
|
1699
|
+
try {
|
|
1700
|
+
await onActivate(code);
|
|
1701
|
+
notify({ kind: "success", title: "\u6388\u6743\u6210\u529F", desc: "\u5168\u90E8\u529F\u80FD\u5DF2\u89E3\u9501\u3002" });
|
|
1702
|
+
} catch (err) {
|
|
1703
|
+
setError(err?.message || "\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6388\u6743\u7801");
|
|
1704
|
+
} finally {
|
|
1705
|
+
setBusy(false);
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-root pm-shell pm-gate-root" }, /* @__PURE__ */ React.createElement("div", { className: "pm-gate" }, /* @__PURE__ */ React.createElement("div", { className: "pm-gate-brand" }, /* @__PURE__ */ React.createElement("span", { className: "pm-brand-mark" }, /* @__PURE__ */ React.createElement(PomeloMark, { size: 52 })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-gate-name" }, "\u67DA\u5BA2"), /* @__PURE__ */ React.createElement("div", { className: "pm-gate-sub" }, "POMELO"))), /* @__PURE__ */ React.createElement("h1", null, "\u6FC0\u6D3B\u67DA\u5BA2"), /* @__PURE__ */ React.createElement("p", { className: "pm-gate-desc" }, "\u7C98\u8D34\u6388\u6743\u7801\uFF0C\u89E3\u9501\u5B8C\u6574\u5DE5\u4F5C\u53F0\u3002\u6708\u5EA6\u3001\u5B63\u5EA6\u3001\u5E74\u5EA6\u6388\u6743\u5747\u5305\u542B\u5168\u90E8\u529F\u80FD\u3002"), /* @__PURE__ */ React.createElement("form", { className: "pm-gate-form", onSubmit: submit }, /* @__PURE__ */ React.createElement(
|
|
1709
|
+
"input",
|
|
1710
|
+
{
|
|
1711
|
+
className: "pm-input",
|
|
1712
|
+
value: code,
|
|
1713
|
+
onChange: (e) => setCode(e.target.value),
|
|
1714
|
+
placeholder: "PM-Y-XXXX-XXXX-XXXXXXXXXXXX",
|
|
1715
|
+
autoFocus: true,
|
|
1716
|
+
spellCheck: "false"
|
|
1717
|
+
}
|
|
1718
|
+
), /* @__PURE__ */ React.createElement(Button, { variant: "gold", type: "submit", disabled: busy || !code.trim() }, busy ? "\u6B63\u5728\u6FC0\u6D3B\u2026" : "\u6FC0\u6D3B")), error && /* @__PURE__ */ React.createElement("div", { className: "pm-gate-error" }, error), /* @__PURE__ */ React.createElement("p", { className: "pm-gate-foot" }, "\u8FD8\u6CA1\u6709\u6388\u6743\u7801\uFF1F\u6253\u5F00\u672C\u673A\u6388\u6743\u7BA1\u7406\u540E\u53F0\u751F\u6210\uFF1A", /* @__PURE__ */ React.createElement("a", { href: "http://127.0.0.1:5188", target: "_blank", rel: "noreferrer" }, "127.0.0.1:5188"))), /* @__PURE__ */ React.createElement("style", null, css));
|
|
1719
|
+
}
|
|
1720
|
+
function HostOffline() {
|
|
1721
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-root pm-shell pm-gate-root" }, /* @__PURE__ */ React.createElement("div", { className: "pm-gate" }, /* @__PURE__ */ React.createElement("div", { className: "pm-gate-brand" }, /* @__PURE__ */ React.createElement("span", { className: "pm-brand-mark" }, /* @__PURE__ */ React.createElement(PomeloMark, { size: 52 })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "pm-gate-name" }, "\u67DA\u5BA2"), /* @__PURE__ */ React.createElement("div", { className: "pm-gate-sub" }, "POMELO"))), /* @__PURE__ */ React.createElement("h1", null, "\u672C\u5730 Host \u672A\u8FDE\u63A5"), /* @__PURE__ */ React.createElement("p", { className: "pm-gate-desc" }, "\u63D2\u4EF6 Host \u6CA1\u6709\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 DSH \u6B63\u5728\u8FD0\u884C\uFF0C\u7136\u540E\u91CD\u65B0\u8FDE\u63A5\uFF1B\u4E0D\u4F1A\u518D\u8FDB\u5165\u6F14\u793A\u6570\u636E\u3002"), /* @__PURE__ */ React.createElement(Button, { variant: "gold", onClick: () => window.location.reload() }, "\u91CD\u65B0\u8FDE\u63A5")), /* @__PURE__ */ React.createElement("style", null, css));
|
|
1722
|
+
}
|
|
1723
|
+
function App() {
|
|
1724
|
+
const [page, setPage] = useState("workbench");
|
|
1725
|
+
const [profile, setProfile] = useState(EMPTY_PROFILE);
|
|
1726
|
+
const [archives, setArchives] = useState([]);
|
|
1727
|
+
const [topics, setTopics] = useState([]);
|
|
1728
|
+
const [plan, setPlan] = useState([]);
|
|
1729
|
+
const [planStale, setPlanStale] = useState(false);
|
|
1730
|
+
const [topicsStale, setTopicsStale] = useState(false);
|
|
1731
|
+
const [replacingTopic, setReplacingTopic] = useState(false);
|
|
1732
|
+
const [accountProfile, setAccountProfile] = useState(null);
|
|
1733
|
+
const [accountAnalyzing, setAccountAnalyzing] = useState(false);
|
|
1734
|
+
const [planVersion, setPlanVersion] = useState(0);
|
|
1735
|
+
const [model, setModel] = useState(null);
|
|
1736
|
+
const [ready, setReady] = useState(false);
|
|
1737
|
+
const [profileSaveState, setProfileSaveState] = useState("idle");
|
|
1738
|
+
const [license, setLicense] = useState(() => window.__POMELO_LICENSE__ || null);
|
|
1739
|
+
const [hostError, setHostError] = useState("");
|
|
1740
|
+
const [generatingTopics, setGeneratingTopics] = useState(false);
|
|
1741
|
+
const [generatingPlan, setGeneratingPlan] = useState(false);
|
|
1742
|
+
const [aiActivity, setAiActivity] = useState("");
|
|
1743
|
+
const [generatedAt, setGeneratedAt] = useState("");
|
|
1744
|
+
const [scriptSheet, setScriptSheet] = useState(null);
|
|
1745
|
+
const [confirm, setConfirm] = useState(null);
|
|
1746
|
+
const [toasts, setToasts] = useState([]);
|
|
1747
|
+
const toastSeq = useRef(0);
|
|
1748
|
+
const mainRef = useRef(null);
|
|
1749
|
+
const profileDirty = useRef(false);
|
|
1750
|
+
function dismissToast(id) {
|
|
1751
|
+
setToasts((prev) => prev.map((t) => t.id === id ? { ...t, leaving: true } : t));
|
|
1752
|
+
window.setTimeout(() => {
|
|
1753
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1754
|
+
}, 200);
|
|
1755
|
+
}
|
|
1756
|
+
function notify({ kind = "success", title, desc }) {
|
|
1757
|
+
const id = ++toastSeq.current;
|
|
1758
|
+
setToasts((prev) => [...prev, { id, kind, title, desc, leaving: false }]);
|
|
1759
|
+
window.setTimeout(() => dismissToast(id), kind === "error" ? 5800 : 4e3);
|
|
1760
|
+
}
|
|
1761
|
+
async function addArchive(archive) {
|
|
1762
|
+
if (HOST_MODE) {
|
|
1763
|
+
try {
|
|
1764
|
+
const saved = await rpc("archive.add", { archive });
|
|
1765
|
+
if (!saved?.duplicate) setArchives((prev) => [saved, ...prev]);
|
|
1766
|
+
return saved;
|
|
1767
|
+
} catch (error) {
|
|
1768
|
+
notify({ kind: "error", title: "\u5F52\u6863\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1769
|
+
throw error;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
const local = { ...archive, id: archive.id || `archive-${Date.now()}`, time: archive.time || (/* @__PURE__ */ new Date()).toISOString() };
|
|
1773
|
+
setArchives((prev) => [local, ...prev]);
|
|
1774
|
+
return local;
|
|
1775
|
+
}
|
|
1776
|
+
function deleteArchive(id, title, after) {
|
|
1777
|
+
setConfirm({
|
|
1778
|
+
title: "\u5220\u9664\u8FD9\u6761\u5F52\u6863\uFF1F",
|
|
1779
|
+
body: `\u300C${title}\u300D\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u5173\u8054\u7684\u590D\u76D8\u5BF9\u8BDD\u4E5F\u4F1A\u4E00\u5E76\u5220\u9664\u3002`,
|
|
1780
|
+
ok: "\u5220\u9664",
|
|
1781
|
+
danger: true,
|
|
1782
|
+
onOk: async () => {
|
|
1783
|
+
try {
|
|
1784
|
+
if (HOST_MODE) await rpc("archive.delete", { id });
|
|
1785
|
+
setArchives((prev) => prev.filter((a) => a.id !== id));
|
|
1786
|
+
notify({ kind: "success", title: "\u5DF2\u5220\u9664", desc: "\u8FD9\u6761\u5F52\u6863\u5DF2\u4ECE\u672C\u5730\u79FB\u9664\u3002" });
|
|
1787
|
+
after?.();
|
|
1788
|
+
} catch (error) {
|
|
1789
|
+
notify({ kind: "error", title: "\u5220\u9664\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
async function clearAll() {
|
|
1795
|
+
try {
|
|
1796
|
+
if (HOST_MODE) await rpc("state.clear");
|
|
1797
|
+
setProfile(EMPTY_PROFILE);
|
|
1798
|
+
setArchives([]);
|
|
1799
|
+
setTopics([]);
|
|
1800
|
+
setPlan([]);
|
|
1801
|
+
notify({ kind: "success", title: "\u5DF2\u6E05\u7A7A", desc: "\u8D44\u6599\u3001\u5F52\u6863\u548C\u590D\u76D8\u5BF9\u8BDD\u5DF2\u91CD\u7F6E\u3002" });
|
|
1802
|
+
} catch (error) {
|
|
1803
|
+
notify({ kind: "error", title: "\u6E05\u7A7A\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
function navigate(next) {
|
|
1807
|
+
setPage(next);
|
|
1808
|
+
requestAnimationFrame(() => {
|
|
1809
|
+
if (mainRef.current) mainRef.current.scrollTo({ top: 0, behavior: "smooth" });
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
function openScript(topic, format) {
|
|
1813
|
+
setScriptSheet({ topic, format });
|
|
1814
|
+
}
|
|
1815
|
+
async function generateScript(topic, format, options = {}) {
|
|
1816
|
+
setAiActivity("\u6B63\u5728\u5199\u811A\u672C");
|
|
1817
|
+
try {
|
|
1818
|
+
return await rpc("script.generate", { topic, format, force: Boolean(options.force) });
|
|
1819
|
+
} finally {
|
|
1820
|
+
setAiActivity("");
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
async function activateLicense(code) {
|
|
1824
|
+
const result = await rpc("license.activate", { code });
|
|
1825
|
+
setLicense(result);
|
|
1826
|
+
return result;
|
|
1827
|
+
}
|
|
1828
|
+
async function reloadTopics() {
|
|
1829
|
+
try {
|
|
1830
|
+
const state = await rpc("state");
|
|
1831
|
+
setTopics(Array.isArray(state.topics?.items) ? state.topics.items : []);
|
|
1832
|
+
setArchives(Array.isArray(state.archives) ? state.archives : []);
|
|
1833
|
+
setGeneratedAt(state.topics?.generatedAt || "");
|
|
1834
|
+
} catch {
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
async function generateTopics() {
|
|
1838
|
+
if (generatingTopics) return;
|
|
1839
|
+
setGeneratingTopics(true);
|
|
1840
|
+
setAiActivity("\u6B63\u5728\u751F\u6210\u4ECA\u65E5\u9009\u9898");
|
|
1841
|
+
try {
|
|
1842
|
+
const result = await rpc("topics.generate");
|
|
1843
|
+
setTopics(result.items || []);
|
|
1844
|
+
setTopicsStale(false);
|
|
1845
|
+
setGeneratedAt(result.generatedAt || (/* @__PURE__ */ new Date()).toISOString());
|
|
1846
|
+
notify({ kind: "success", title: "10 \u4E2A\u9009\u9898\u5DF2\u751F\u6210", desc: "\u5DF2\u4FDD\u5B58\u5230\u672C\u673A\uFF0C\u53BB\u5DE5\u4F5C\u53F0\u6311\u4E00\u4E2A\u5F00\u62CD\u3002" });
|
|
1847
|
+
} catch (error) {
|
|
1848
|
+
await reloadTopics();
|
|
1849
|
+
notify({ kind: "error", title: "\u9009\u9898\u751F\u6210\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u8D44\u6599\u548C DSH \u6A21\u578B\u8BBE\u7F6E\u3002" });
|
|
1850
|
+
} finally {
|
|
1851
|
+
setGeneratingTopics(false);
|
|
1852
|
+
setAiActivity("");
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
async function replaceTopic(topic) {
|
|
1856
|
+
if (replacingTopic || !topic) return;
|
|
1857
|
+
setReplacingTopic(true);
|
|
1858
|
+
setAiActivity("\u6B63\u5728\u6362\u4E00\u4E2A\u9009\u9898");
|
|
1859
|
+
try {
|
|
1860
|
+
const result = await rpc("topic.replace", { id: topic.id, title: topic.title });
|
|
1861
|
+
setTopics(result.items || []);
|
|
1862
|
+
notify({ kind: "success", title: "\u5DF2\u6362\u4E00\u4E2A\u9009\u9898", desc: "\u5176\u4F59\u9009\u9898\u4FDD\u6301\u4E0D\u53D8\u3002" });
|
|
1863
|
+
} catch (error) {
|
|
1864
|
+
notify({ kind: "error", title: "\u6362\u9009\u9898\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1865
|
+
} finally {
|
|
1866
|
+
setReplacingTopic(false);
|
|
1867
|
+
setAiActivity("");
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
async function analyzeAccount(platform, target) {
|
|
1871
|
+
if (accountAnalyzing) return;
|
|
1872
|
+
setAccountAnalyzing(true);
|
|
1873
|
+
setAiActivity("\u6B63\u5728\u5206\u6790\u8D26\u53F7");
|
|
1874
|
+
try {
|
|
1875
|
+
const result = await rpc("account.analyze", { platform, account: target });
|
|
1876
|
+
setAccountProfile(result);
|
|
1877
|
+
if (plan.length) setPlanStale(true);
|
|
1878
|
+
notify({ kind: "success", title: "\u8D26\u53F7\u5206\u6790\u5B8C\u6210", desc: `\u5DF2\u8BFB\u53D6 ${result.postCount || 0} \u6761\u516C\u5F00\u4F5C\u54C1\uFF0C\u5E76\u751F\u6210\u8BCA\u65AD\u3002` });
|
|
1879
|
+
return result;
|
|
1880
|
+
} catch (error) {
|
|
1881
|
+
notify({ kind: "error", title: "\u8D26\u53F7\u5206\u6790\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u767B\u5F55\u548C\u7F51\u7EDC\u3002" });
|
|
1882
|
+
} finally {
|
|
1883
|
+
setAccountAnalyzing(false);
|
|
1884
|
+
setAiActivity("");
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
async function generatePlan() {
|
|
1888
|
+
if (!profile.q1?.trim() || !profile.q3?.trim() || !profile.q5?.trim()) {
|
|
1889
|
+
notify({ kind: "error", title: "\u8FD8\u5DEE\u4E00\u70B9\u8D44\u6599", desc: "\u8BF7\u5148\u5B8C\u6210\u7B2C 1\u30013\u30015 \u4E2A\u95EE\u9898\u3002" });
|
|
1890
|
+
navigate("settings");
|
|
1891
|
+
return;
|
|
1892
|
+
}
|
|
1893
|
+
if (generatingPlan) return;
|
|
1894
|
+
setGeneratingPlan(true);
|
|
1895
|
+
setAiActivity("\u6B63\u5728\u751F\u6210\u83B7\u5BA2\u65B9\u6848");
|
|
1896
|
+
try {
|
|
1897
|
+
await rpc("profile.save", { profile });
|
|
1898
|
+
const result = await rpc("plan.generate");
|
|
1899
|
+
setPlan(result.sections || []);
|
|
1900
|
+
setPlanVersion(result.archive?.profileVersion || profile.version || 1);
|
|
1901
|
+
setPlanStale(false);
|
|
1902
|
+
if (result.archive) setArchives((prev) => [result.archive, ...prev]);
|
|
1903
|
+
navigate("plan");
|
|
1904
|
+
notify({ kind: "success", title: "\u83B7\u5BA2\u65B9\u6848\u5DF2\u751F\u6210", desc: "\u5DF2\u81EA\u52A8\u5F52\u6863\uFF0C\u53EF\u4EE5\u53BB\u590D\u76D8\u91CC\u7EE7\u7EED\u95EE\u3002" });
|
|
1905
|
+
} catch (error) {
|
|
1906
|
+
notify({ kind: "error", title: "\u65B9\u6848\u751F\u6210\u5931\u8D25", desc: error?.message || "\u8BF7\u68C0\u67E5\u8D44\u6599\u548C DSH \u6A21\u578B\u8BBE\u7F6E\u3002" });
|
|
1907
|
+
} finally {
|
|
1908
|
+
setGeneratingPlan(false);
|
|
1909
|
+
setAiActivity("");
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
async function askReview(archive, question, history) {
|
|
1913
|
+
setAiActivity("\u6B63\u5728\u590D\u76D8\u8FD9\u6761\u5F52\u6863");
|
|
1914
|
+
const result = await rpc("review.ask", { archive, question, history }).finally(() => setAiActivity(""));
|
|
1915
|
+
if (Array.isArray(result?.chat)) {
|
|
1916
|
+
setArchives((prev) => prev.map((item) => item.id === archive.id ? { ...item, chat: result.chat } : item));
|
|
1917
|
+
}
|
|
1918
|
+
return result;
|
|
1919
|
+
}
|
|
1920
|
+
async function saveScript({ topic, format, script }) {
|
|
1921
|
+
const title = `${format === "image" ? "\u56FE\u6587" : "\u89C6\u9891"}\u811A\u672C \xB7 ${topic.title}`;
|
|
1922
|
+
try {
|
|
1923
|
+
const saved = await addArchive(scriptArchivePayload(topic, format, script, profile.version || 1));
|
|
1924
|
+
setScriptSheet(null);
|
|
1925
|
+
if (saved?.duplicate) {
|
|
1926
|
+
notify({ kind: "info", title: "\u8FD9\u6761\u5DF2\u7ECF\u4FDD\u5B58\u8FC7", desc: "\u5185\u5BB9\u6CA1\u6709\u53D8\u5316\uFF0C\u6CA1\u6709\u91CD\u590D\u5F52\u6863\uFF1B\u91CD\u65B0\u751F\u6210\u540E\u518D\u4FDD\u5B58\u624D\u4F1A\u65B0\u589E\u3002" });
|
|
1927
|
+
} else {
|
|
1928
|
+
notify({ kind: "success", title: "\u5DF2\u4FDD\u5B58\u5230\u590D\u76D8", desc: "\u811A\u672C\u5DF2\u5F52\u6863\uFF0C\u53EF\u4EE5\u7EE7\u7EED\u53BB\u590D\u76D8\u91CC\u8FFD\u95EE\u3002" });
|
|
1929
|
+
}
|
|
1930
|
+
} catch {
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
useEffect(() => {
|
|
1934
|
+
if (!HOST_MODE) return void 0;
|
|
1935
|
+
let alive = true;
|
|
1936
|
+
(async () => {
|
|
1937
|
+
try {
|
|
1938
|
+
const state = await rpc("state");
|
|
1939
|
+
if (!alive) return;
|
|
1940
|
+
const answers = state.profile?.answers || {};
|
|
1941
|
+
const hasProfile = Object.values(answers).some((value) => String(value || "").trim());
|
|
1942
|
+
setProfile(hasProfile ? { ...EMPTY_PROFILE, ...answers } : EMPTY_PROFILE);
|
|
1943
|
+
setProfileSaveState(hasProfile ? "saved" : "idle");
|
|
1944
|
+
setArchives(Array.isArray(state.archives) ? state.archives : []);
|
|
1945
|
+
setTopics(Array.isArray(state.topics?.items) ? state.topics.items : []);
|
|
1946
|
+
setTopicsStale(Boolean(state.topics?.items?.length && state.topics.profileVersion && state.topics.profileVersion !== state.profile?.version));
|
|
1947
|
+
const latestPlan = (state.archives || []).find((item) => item.type === "plan");
|
|
1948
|
+
setPlan(latestPlan ? planFromArchive(latestPlan) : []);
|
|
1949
|
+
setPlanVersion(latestPlan?.profileVersion || 0);
|
|
1950
|
+
setPlanStale(Boolean(latestPlan && latestPlan.profileVersion !== state.profile?.version));
|
|
1951
|
+
setAccountProfile(state.account || null);
|
|
1952
|
+
setModel(state.model || null);
|
|
1953
|
+
setLicense(state.license || null);
|
|
1954
|
+
if (state.license?.status === "active" && state.license?.codeId) {
|
|
1955
|
+
rpc("license.validate").then((next) => {
|
|
1956
|
+
if (alive && next) setLicense(next);
|
|
1957
|
+
}).catch(() => {
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
setGeneratedAt(state.topics?.generatedAt || "");
|
|
1961
|
+
setReady(true);
|
|
1962
|
+
profileDirty.current = false;
|
|
1963
|
+
} catch (error) {
|
|
1964
|
+
if (!alive) return;
|
|
1965
|
+
setHostError(error?.message || "\u672C\u5730\u670D\u52A1\u8FDE\u63A5\u5931\u8D25");
|
|
1966
|
+
setReady(true);
|
|
1967
|
+
}
|
|
1968
|
+
})();
|
|
1969
|
+
return () => {
|
|
1970
|
+
alive = false;
|
|
1971
|
+
};
|
|
1972
|
+
}, []);
|
|
1973
|
+
useEffect(() => {
|
|
1974
|
+
if (!HOST_MODE || !ready) return void 0;
|
|
1975
|
+
if (!profileDirty.current) {
|
|
1976
|
+
profileDirty.current = true;
|
|
1977
|
+
return void 0;
|
|
1978
|
+
}
|
|
1979
|
+
setProfileSaveState("saving");
|
|
1980
|
+
const timer = window.setTimeout(async () => {
|
|
1981
|
+
try {
|
|
1982
|
+
const saved = await rpc("profile.save", { profile });
|
|
1983
|
+
if (saved?.version) {
|
|
1984
|
+
profileDirty.current = false;
|
|
1985
|
+
setProfile((prev) => ({ ...prev, version: saved.version }));
|
|
1986
|
+
}
|
|
1987
|
+
setProfileSaveState("saved");
|
|
1988
|
+
} catch (error) {
|
|
1989
|
+
setProfileSaveState("error");
|
|
1990
|
+
notify({ kind: "error", title: "\u8D44\u6599\u4FDD\u5B58\u5931\u8D25", desc: error?.message || "\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
1991
|
+
}
|
|
1992
|
+
}, 800);
|
|
1993
|
+
return () => window.clearTimeout(timer);
|
|
1994
|
+
}, [profile, ready]);
|
|
1995
|
+
useEffect(() => {
|
|
1996
|
+
function onKey(e) {
|
|
1997
|
+
if (e.key === "Escape") {
|
|
1998
|
+
setScriptSheet(null);
|
|
1999
|
+
setConfirm(null);
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
window.addEventListener("keydown", onKey);
|
|
2003
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
2004
|
+
}, []);
|
|
2005
|
+
if (!HOST_MODE) return /* @__PURE__ */ React.createElement(HostOffline, null);
|
|
2006
|
+
if (!ready) {
|
|
2007
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-root pm-shell" }, /* @__PURE__ */ React.createElement("div", { className: "pm-boot" }, /* @__PURE__ */ React.createElement("span", { className: "pm-brand-mark" }, /* @__PURE__ */ React.createElement(PomeloMark, { size: 44 })), /* @__PURE__ */ React.createElement("h2", null, "\u6B63\u5728\u8FDE\u63A5\u672C\u5730\u6570\u636E\u2026"), /* @__PURE__ */ React.createElement("p", null, "\u9996\u6B21\u542F\u52A8\u4F1A\u8BFB\u53D6 ~/.dsh/pomelo \u91CC\u7684\u8D44\u6599\u548C\u5F52\u6863\u3002")), /* @__PURE__ */ React.createElement("style", null, css));
|
|
2008
|
+
}
|
|
2009
|
+
if (HOST_MODE && license?.status !== "active") {
|
|
2010
|
+
return /* @__PURE__ */ React.createElement(LicenseGate, { onActivate: activateLicense, notify });
|
|
2011
|
+
}
|
|
2012
|
+
return /* @__PURE__ */ React.createElement("div", { className: "pm-root pm-shell" }, /* @__PURE__ */ React.createElement("div", { className: "pm-drag", "data-window-drag": "true", "aria-hidden": "true" }), /* @__PURE__ */ React.createElement("div", { className: "pm-app" }, /* @__PURE__ */ React.createElement(Sidebar, { page, onNavigate: navigate, archiveCount: archives.length, topicCount: topics.length, model, aiActivity, planStale }), /* @__PURE__ */ React.createElement("main", { className: "pm-main", ref: mainRef }, hostError && /* @__PURE__ */ React.createElement("div", { className: "pm-host-error" }, /* @__PURE__ */ React.createElement(Icon, { name: "alert", size: 15 }), /* @__PURE__ */ React.createElement("span", null, "\u672C\u5730\u670D\u52A1\u672A\u8FDE\u63A5\uFF1A", hostError, "\u3002\u8BF7\u91CD\u65B0\u8FDE\u63A5\u672C\u5730 Host\u3002")), /* @__PURE__ */ React.createElement("div", { className: "pm-page", key: page }, page === "workbench" && /* @__PURE__ */ React.createElement(
|
|
2013
|
+
Workbench,
|
|
2014
|
+
{
|
|
2015
|
+
archives,
|
|
2016
|
+
topics,
|
|
2017
|
+
generatingTopics,
|
|
2018
|
+
topicsStale,
|
|
2019
|
+
model,
|
|
2020
|
+
onModelChange: setModel,
|
|
2021
|
+
license,
|
|
2022
|
+
notify,
|
|
2023
|
+
onOpenScript: openScript,
|
|
2024
|
+
addArchive,
|
|
2025
|
+
goSettings: () => navigate("settings"),
|
|
2026
|
+
onGenerateTopics: generateTopics,
|
|
2027
|
+
onReplaceTopic: replaceTopic,
|
|
2028
|
+
replacingTopic,
|
|
2029
|
+
onReloadTopics: reloadTopics
|
|
2030
|
+
}
|
|
2031
|
+
), page === "review" && /* @__PURE__ */ React.createElement(
|
|
2032
|
+
ReviewPage,
|
|
2033
|
+
{
|
|
2034
|
+
archives,
|
|
2035
|
+
deleteArchive,
|
|
2036
|
+
notify,
|
|
2037
|
+
goWorkbench: () => navigate("workbench"),
|
|
2038
|
+
onAsk: askReview
|
|
2039
|
+
}
|
|
2040
|
+
), page === "plan" && /* @__PURE__ */ React.createElement(
|
|
2041
|
+
PlanPage,
|
|
2042
|
+
{
|
|
2043
|
+
notify,
|
|
2044
|
+
goSettings: () => navigate("settings"),
|
|
2045
|
+
profile,
|
|
2046
|
+
plan,
|
|
2047
|
+
stale: planStale,
|
|
2048
|
+
generating: generatingPlan,
|
|
2049
|
+
onGenerate: generatePlan,
|
|
2050
|
+
linkedAccount: accountProfile,
|
|
2051
|
+
analyzingAccount: accountAnalyzing,
|
|
2052
|
+
onAnalyzeAccount: analyzeAccount
|
|
2053
|
+
}
|
|
2054
|
+
), page === "settings" && /* @__PURE__ */ React.createElement(
|
|
2055
|
+
SettingsPage,
|
|
2056
|
+
{
|
|
2057
|
+
profile,
|
|
2058
|
+
setProfile,
|
|
2059
|
+
profileSaveState,
|
|
2060
|
+
notify,
|
|
2061
|
+
askConfirm: setConfirm,
|
|
2062
|
+
goPlan: () => navigate("plan"),
|
|
2063
|
+
clearAll,
|
|
2064
|
+
model,
|
|
2065
|
+
onModelChange: setModel,
|
|
2066
|
+
license,
|
|
2067
|
+
onActivateLicense: activateLicense,
|
|
2068
|
+
onCreatePlan: generatePlan,
|
|
2069
|
+
creatingPlan: generatingPlan,
|
|
2070
|
+
onProfileEdit: () => {
|
|
2071
|
+
if (plan.length) setPlanStale(true);
|
|
2072
|
+
if (topics.length) setTopicsStale(true);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
)))), scriptSheet && /* @__PURE__ */ React.createElement(
|
|
2076
|
+
ScriptSheet,
|
|
2077
|
+
{
|
|
2078
|
+
data: scriptSheet,
|
|
2079
|
+
onClose: () => setScriptSheet(null),
|
|
2080
|
+
onSave: saveScript,
|
|
2081
|
+
notify,
|
|
2082
|
+
onGenerate: generateScript,
|
|
2083
|
+
archives
|
|
2084
|
+
}
|
|
2085
|
+
), /* @__PURE__ */ React.createElement(ConfirmDialog, { data: confirm, onClose: () => setConfirm(null) }), /* @__PURE__ */ React.createElement(ToastStack, { toasts, onClose: dismissToast }), /* @__PURE__ */ React.createElement("style", null, css));
|
|
2086
|
+
}
|
|
2087
|
+
return App;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
// client/src/styles.css
|
|
2091
|
+
var styles_default = '/* \u67DA\u5BA2 Pomelo \u2014 scoped visual system. All selectors stay under .pm-root. */\n\n.pm-root {\n --pm-bg: #f5f5f7;\n --pm-surface: #ffffff;\n --pm-surface-2: #f2f2f7;\n --pm-surface-3: #e5e5ea;\n --pm-ink: #1d1d1f;\n --pm-ink-2: #6e6e73;\n --pm-ink-3: #86868b;\n --pm-line: rgba(0, 0, 0, 0.07);\n --pm-line-2: rgba(0, 0, 0, 0.13);\n --pm-accent: #f37021;\n --pm-accent-2: #ff8433;\n --pm-accent-text: #c4500a;\n --pm-accent-soft: rgba(243, 112, 33, 0.11);\n --pm-accent-ink: #1d1d1f;\n --pm-gold: #f37021;\n --pm-gold-soft: rgba(243, 112, 33, 0.11);\n --pm-gold-text: #c4500a;\n --pm-ok: #6e56cf;\n --pm-ok-soft: rgba(110, 86, 207, 0.12);\n --pm-danger: #d70015;\n --pm-danger-soft: rgba(255, 59, 48, 0.1);\n --pm-warn: #b45309;\n --pm-warn-soft: rgba(245, 158, 11, 0.14);\n --pm-violet: #c4500a;\n --pm-violet-soft: rgba(196, 80, 10, 0.12);\n --pm-blue: #f37021;\n --pm-blue-soft: rgba(243, 112, 33, 0.1);\n --pm-shadow-1: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04),\n 0 8px 24px -12px rgba(0, 0, 0, 0.08);\n --pm-shadow-2: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 12px 40px -12px rgba(0, 0, 0, 0.18);\n --pm-r-s: 8px;\n --pm-r-m: 12px;\n --pm-r-l: 20px;\n --pm-r-xl: 24px;\n --pm-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",\n "Helvetica Neue", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;\n --pm-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue",\n "Segoe UI", var(--pm-font);\n color-scheme: light;\n height: 100%;\n min-height: 0;\n background: var(--pm-bg);\n color: var(--pm-ink);\n font-family: var(--pm-font);\n font-size: 15px;\n line-height: 1.55;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n}\n\n:root[data-theme="dark"] .pm-root,\n.dark .pm-root,\n[data-theme="dark"] .pm-root {\n color-scheme: dark;\n --pm-bg: #000000;\n --pm-surface: #1c1c1e;\n --pm-surface-2: #2c2c2e;\n --pm-surface-3: #3a3a3c;\n --pm-ink: #f5f5f7;\n --pm-ink-2: #a1a1a6;\n --pm-ink-3: #8e8e93;\n --pm-line: rgba(255, 255, 255, 0.08);\n --pm-line-2: rgba(255, 255, 255, 0.15);\n --pm-accent: #ff8a3d;\n --pm-accent-2: #ff9f5a;\n --pm-accent-text: #ff9f5a;\n --pm-accent-soft: rgba(255, 138, 61, 0.16);\n --pm-accent-ink: #1a0e05;\n --pm-gold: #ff8a3d;\n --pm-gold-soft: rgba(255, 138, 61, 0.16);\n --pm-gold-text: #ff9f5a;\n --pm-ok: #b39bff;\n --pm-ok-soft: rgba(179, 155, 255, 0.16);\n --pm-danger: #ff6961;\n --pm-danger-soft: rgba(255, 105, 97, 0.16);\n --pm-warn: #ffb020;\n --pm-warn-soft: rgba(255, 176, 32, 0.16);\n --pm-violet: #ff9f5a;\n --pm-violet-soft: rgba(255, 159, 90, 0.14);\n --pm-blue: #ff8a3d;\n --pm-blue-soft: rgba(255, 138, 61, 0.14);\n --pm-shadow-1: 0 0 0 0.5px rgba(255, 255, 255, 0.06);\n --pm-shadow-2: 0 0 0 0.5px rgba(255, 255, 255, 0.08),\n 0 20px 50px -16px rgba(0, 0, 0, 0.8);\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) .pm-root {\n color-scheme: dark;\n --pm-bg: #000000;\n --pm-surface: #1c1c1e;\n --pm-surface-2: #2c2c2e;\n --pm-surface-3: #3a3a3c;\n --pm-ink: #f5f5f7;\n --pm-ink-2: #a1a1a6;\n --pm-ink-3: #8e8e93;\n --pm-line: rgba(255, 255, 255, 0.08);\n --pm-line-2: rgba(255, 255, 255, 0.15);\n --pm-accent: #ff8a3d;\n --pm-accent-2: #ff9f5a;\n --pm-accent-text: #ff9f5a;\n --pm-accent-soft: rgba(255, 138, 61, 0.16);\n --pm-accent-ink: #1a0e05;\n --pm-gold: #ff8a3d;\n --pm-gold-soft: rgba(255, 138, 61, 0.16);\n --pm-gold-text: #ff9f5a;\n --pm-ok: #b39bff;\n --pm-ok-soft: rgba(179, 155, 255, 0.16);\n --pm-danger: #ff6961;\n --pm-danger-soft: rgba(255, 105, 97, 0.16);\n --pm-warn: #ffb020;\n --pm-warn-soft: rgba(255, 176, 32, 0.16);\n --pm-violet: #ff9f5a;\n --pm-violet-soft: rgba(255, 159, 90, 0.14);\n --pm-blue: #ff8a3d;\n --pm-blue-soft: rgba(255, 138, 61, 0.14);\n --pm-shadow-1: 0 0 0 0.5px rgba(255, 255, 255, 0.06);\n --pm-shadow-2: 0 0 0 0.5px rgba(255, 255, 255, 0.08),\n 0 20px 50px -16px rgba(0, 0, 0, 0.8);\n }\n}\n\n.pm-root *,\n.pm-root *::before,\n.pm-root *::after {\n box-sizing: border-box;\n}\n\n.pm-shell {\n position: relative;\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n padding-top: var(--dsh-frame-top-clearance, 0px);\n background: var(--pm-bg);\n overflow: hidden;\n}\n\n.pm-drag {\n position: absolute;\n inset: 0 0 auto 0;\n height: max(var(--dsh-frame-top-clearance, 0px), 12px);\n -webkit-app-region: drag;\n z-index: 4;\n}\n\n.pm-app {\n display: flex;\n flex: 1;\n min-height: 0;\n min-width: 0;\n background: var(--pm-bg);\n}\n\n.pm-sidebar {\n display: flex;\n flex-direction: column;\n flex: 0 0 264px;\n width: 264px;\n min-height: 0;\n padding: 26px 18px 16px;\n background: var(--pm-surface);\n border-right: 1px solid var(--pm-line);\n}\n\n.pm-brand {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 8px 24px;\n}\n\n.pm-brand-mark {\n display: grid;\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n place-items: center;\n filter: none;\n}\n\n.pm-logo {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.pm-brand-text {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.pm-brand-name {\n font-size: 21px;\n font-weight: 650;\n letter-spacing: -0.025em;\n line-height: 1.2;\n}\n\n.pm-brand-sub {\n margin-top: 1px;\n color: var(--pm-ink-3);\n font-size: 11.2px;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n}\n\n.pm-nav {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.pm-nav-btn {\n position: relative;\n display: flex;\n align-items: center;\n gap: 11px;\n width: 100%;\n height: 40px;\n padding: 0 11px;\n border: 0;\n border-radius: 10px;\n background: transparent;\n color: var(--pm-ink-2);\n font-family: inherit;\n font-size: 14.6px;\n font-weight: 500;\n text-align: left;\n cursor: pointer;\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.pm-nav-btn:hover {\n background: color-mix(in srgb, var(--pm-surface-2) 50%, transparent);\n color: var(--pm-ink);\n}\n\n.pm-nav-btn.is-on {\n background: var(--pm-surface-2);\n color: var(--pm-ink);\n box-shadow: inset 0 0 0 0.5px var(--pm-line);\n}\n\n\n.pm-nav-icon {\n display: grid;\n flex: 0 0 20px;\n place-items: center;\n color: var(--pm-ink-3);\n}\n\n.pm-nav-label {\n flex: 1;\n min-width: 0;\n}\n\n.pm-nav-count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 19px;\n height: 19px;\n padding: 0 5px;\n border-radius: 999px;\n background: var(--pm-accent);\n color: #1d1d1f;\n font-size: 11.2px;\n font-weight: 700;\n}\n\n.pm-sidebar-spacer {\n flex: 1;\n}\n\n.pm-side-card {\n margin: 18px 2px 12px;\n padding: 15px 15px 13px;\n border: 1px solid var(--pm-line);\n border-radius: 16px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n\n.pm-side-head {\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--pm-ink);\n font-size: 14.6px;\n font-weight: 600;\n}\n\n.pm-status-dot {\n display: inline-block;\n flex: 0 0 auto;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--pm-gold);\n box-shadow: 0 0 0 4px var(--pm-accent-soft);\n}\n\n.pm-side-stat {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-top: 11px;\n color: var(--pm-ink-3);\n font-size: 13.4px;\n}\n\n.pm-side-stat b {\n color: var(--pm-ink);\n font-family: var(--pm-num);\n font-size: 14px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n\n.pm-side-note {\n margin-top: 12px;\n padding-top: 10px;\n border-top: 1px solid var(--pm-line);\n color: var(--pm-ink-3);\n font-size: 11.8px;\n line-height: 1.5;\n}\n\n.pm-version {\n padding: 0 4px;\n color: var(--pm-ink-3);\n font-size: 11.8px;\n text-align: center;\n}\n\n.pm-main {\n flex: 1;\n min-width: 0;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--pm-line-2) transparent;\n}\n\n.pm-main::-webkit-scrollbar { width: 8px; height: 8px; }\n.pm-main::-webkit-scrollbar-thumb {\n border: 2px solid transparent;\n border-radius: 999px;\n background: var(--pm-line-2);\n background-clip: content-box;\n}\n\n.pm-hero {\n position: relative;\n padding: 54px 44px 30px;\n background:\n radial-gradient(120% 150% at 15% 0%, #fbd3b4 0%, rgba(251, 211, 180, 0) 58%),\n radial-gradient(120% 160% at 62% 0%, #fde7d6 0%, rgba(253, 231, 214, 0) 62%),\n var(--pm-bg);\n}\n\n:root[data-theme="dark"] .pm-hero,\n.dark .pm-hero,\n[data-theme="dark"] .pm-hero {\n background:\n radial-gradient(120% 150% at 15% 0%, #4a2415 0%, rgba(74, 36, 21, 0) 58%),\n radial-gradient(120% 160% at 62% 0%, #2e160d 0%, rgba(46, 22, 13, 0) 62%),\n var(--pm-bg);\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) .pm-hero {\n background:\n radial-gradient(120% 150% at 15% 0%, #4a2415 0%, rgba(74, 36, 21, 0) 58%),\n radial-gradient(120% 160% at 62% 0%, #2e160d 0%, rgba(46, 22, 13, 0) 62%),\n var(--pm-bg);\n }\n}\n\n.pm-hero--page { padding: 44px 44px 26px; }\n\n.pm-hero-inner {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: 24px;\n max-width: 1180px;\n margin: 0 auto;\n}\n\n.pm-eyebrow {\n margin-bottom: 8px;\n color: var(--pm-ink-3);\n font-size: 13.4px;\n letter-spacing: 0.02em;\n}\n\n.pm-hero h1 {\n margin: 0;\n color: var(--pm-ink);\n font-family: var(--pm-num);\n font-size: 38px;\n font-weight: 700;\n letter-spacing: -0.04em;\n line-height: 1.14;\n}\n\n.pm-hero h1 em {\n color: var(--pm-accent);\n font-style: normal;\n}\n\n.pm-hero p {\n max-width: 680px;\n margin: 9px 0 0;\n color: var(--pm-ink-2);\n font-size: 15.1px;\n line-height: 1.6;\n}\n\n.pm-hero--page h1 { font-size: 34px; letter-spacing: -0.04em; }\n\n.pm-hero-actions {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 8px;\n padding-bottom: 2px;\n}\n\n.pm-ai-pill {\n display: inline-flex;\n align-items: center;\n gap: 7px;\n height: 32px;\n padding: 0 11px;\n border: 1px solid var(--pm-line);\n border-radius: 999px;\n background: color-mix(in srgb, var(--pm-surface) 72%, transparent);\n color: var(--pm-ink-2);\n font-size: 12.9px;\n backdrop-filter: blur(12px);\n}\n\n\n.pm-content {\n max-width: 1180px;\n margin: 0 auto;\n padding: 0 44px 64px;\n}\n\n.pm-kpis {\n display: grid;\n grid-template-columns: repeat(4, minmax(0, 1fr));\n gap: 16px;\n}\n\n.pm-card {\n border: 1px solid var(--pm-line);\n border-radius: var(--pm-r-l);\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n\n.pm-kpi {\n display: flex;\n align-items: stretch;\n justify-content: space-between;\n gap: 10px;\n min-height: 122px;\n padding: 20px 22px;\n}\n\n.pm-kpi-main { min-width: 0; }\n.pm-kpi-label { color: var(--pm-ink-2); font-size: 13.4px; font-weight: 500; white-space: nowrap; }\n.pm-kpi-value {\n margin-top: 5px;\n color: var(--pm-ink);\n font-family: var(--pm-num);\n font-size: 32px;\n font-weight: 650;\n letter-spacing: -0.03em;\n line-height: 1.1;\n font-variant-numeric: tabular-nums;\n}\n.pm-kpi-value small {\n margin-left: 3px;\n color: var(--pm-ink-3);\n font-family: var(--pm-font);\n font-size: 12.3px;\n font-weight: 400;\n letter-spacing: 0;\n}\n.pm-kpi-sub {\n margin-top: 7px;\n color: var(--pm-ink-3);\n font-size: 11.8px;\n line-height: 1.4;\n}\n.pm-kpi-sub b { color: var(--pm-ok); font-weight: 600; }\n.pm-kpi-chart {\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n width: 66px;\n min-width: 52px;\n opacity: 0.95;\n}\n\n.pm-notice {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-top: 18px;\n padding: 15px 18px;\n border: 1px solid var(--pm-line);\n border-radius: 16px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-notice-ic {\n display: grid;\n flex: 0 0 42px;\n width: 42px;\n height: 42px;\n place-items: center;\n border-radius: 13px;\n background: var(--pm-ok-soft);\n color: var(--pm-ok);\n}\n.pm-notice-main { flex: 1; min-width: 0; }\n.pm-notice-title {\n display: flex;\n align-items: center;\n gap: 7px;\n color: var(--pm-ink);\n font-size: 14px;\n font-weight: 600;\n}\n.pm-notice-desc { margin-top: 2px; color: var(--pm-ink-3); font-size: 12.3px; }\n.pm-notice-actions { display: flex; align-items: center; gap: 8px; }\n\n.pm-tabbar {\n display: inline-flex;\n gap: 2px;\n margin-top: 22px;\n padding: 4px;\n border: 1px solid var(--pm-line);\n border-radius: 14px;\n background: var(--pm-surface-2);\n}\n\n.pm-tab {\n display: inline-flex;\n align-items: center;\n gap: 7px;\n height: 36px;\n padding: 0 17px;\n border: 0;\n border-radius: 10px;\n background: transparent;\n color: var(--pm-ink-2);\n font-family: inherit;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-tab:hover { color: var(--pm-ink); }\n.pm-tab.is-on {\n background: var(--pm-surface);\n color: var(--pm-ink);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-tab .pm-badge { height: 18px; padding: 0 6px; font-size: 11.2px; }\n\n.pm-section-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin: 26px 0 14px;\n}\n.pm-section-title { color: var(--pm-ink); font-size: 16.5px; font-weight: 620; letter-spacing: -0.015em; }\n.pm-section-sub { margin-top: 2px; color: var(--pm-ink-3); font-size: 12.9px; }\n.pm-section-actions { display: flex; align-items: center; gap: 8px; }\n\n.pm-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 38px;\n padding: 0 15px;\n border: 0;\n border-radius: 12px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 550;\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-btn:active { transform: translateY(0.5px); }\n.pm-btn:disabled { cursor: default; opacity: 0.5; }\n.pm-btn svg { flex: 0 0 auto; }\n.pm-btn--primary { background: var(--pm-accent); color: var(--pm-accent-ink); }\n.pm-btn--primary:hover { background: var(--pm-accent-2); }\n.pm-btn--secondary {\n background: var(--pm-surface-2);\n color: var(--pm-ink);\n box-shadow: inset 0 0 0 0.5px var(--pm-line);\n}\n.pm-btn--secondary:hover { background: var(--pm-surface-3); }\n.pm-btn--ghost { background: transparent; color: var(--pm-ink-2); }\n.pm-btn--ghost:hover { background: var(--pm-surface-2); color: var(--pm-ink); }\n.pm-btn--soft { background: var(--pm-accent-soft); color: var(--pm-accent-text); }\n.pm-btn--soft:hover { background: color-mix(in srgb, var(--pm-accent-soft) 75%, var(--pm-accent) 10%); }\n.pm-btn--danger { background: var(--pm-danger-soft); color: var(--pm-danger); }\n.pm-btn--sm { height: 32px; padding: 0 11px; border-radius: 9px; font-size: 13px; }\n.pm-btn--lg { height: 46px; padding: 0 20px; border-radius: 13px; font-size: 15px; }\n.pm-btn--block { width: 100%; }\n\n.pm-iconbtn {\n display: inline-grid;\n flex: 0 0 auto;\n width: 32px;\n height: 32px;\n place-items: center;\n border: 0;\n border-radius: 9px;\n background: transparent;\n color: var(--pm-ink-3);\n cursor: pointer;\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-iconbtn:hover { background: var(--pm-surface-2); color: var(--pm-ink); }\n.pm-iconbtn--danger:hover { background: var(--pm-danger-soft); color: var(--pm-danger); }\n\n.pm-badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 22px;\n padding: 0 7px;\n border-radius: 999px;\n font-size: 11.8px;\n font-weight: 550;\n line-height: 1;\n white-space: nowrap;\n}\n.pm-badge--neutral { background: var(--pm-surface-2); color: var(--pm-ink-2); }\n.pm-badge--orange { background: var(--pm-accent-soft); color: var(--pm-accent-text); }\n.pm-badge--green { background: var(--pm-ok-soft); color: var(--pm-ok); }\n.pm-badge--violet { background: var(--pm-violet-soft); color: var(--pm-violet); }\n.pm-badge--red { background: var(--pm-danger-soft); color: var(--pm-danger); }\n.pm-badge--blue { background: var(--pm-blue-soft); color: var(--pm-blue); }\n.pm-badge--dark { background: var(--pm-ink); color: var(--pm-surface); }\n.pm-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }\n\n.pm-topic-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 14px;\n}\n.pm-topic {\n display: flex;\n flex-direction: column;\n min-height: 194px;\n padding: 18px 20px 16px;\n border: 1px solid var(--pm-line);\n border-radius: 18px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-topic:hover {\n transform: translateY(-1px);\n border-color: var(--pm-line-2);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-topic-top { display: flex; align-items: center; gap: 8px; }\n.pm-topic-index {\n display: grid;\n flex: 0 0 25px;\n width: 25px;\n height: 25px;\n place-items: center;\n border-radius: 8px;\n background: var(--pm-accent-soft);\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 11.8px;\n font-weight: 650;\n}\n.pm-topic-top .pm-badge { height: 20px; font-size: 11.2px; }\n.pm-topic-top .pm-iconbtn { margin-left: auto; width: 26px; height: 26px; }\n.pm-topic h3 {\n margin: 12px 0 7px;\n color: var(--pm-ink);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: -0.01em;\n line-height: 1.45;\n}\n.pm-topic-reason {\n flex: 1;\n margin: 0;\n color: var(--pm-ink-2);\n font-size: 12.9px;\n line-height: 1.6;\n}\n.pm-topic-source {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 10px 0 0;\n color: var(--pm-ink-3);\n font-size: 11.8px;\n line-height: 1.4;\n}\n.pm-topic-actions { display: flex; gap: 6px; margin-top: 11px; }\n.pm-topic-actions .pm-btn { flex: 1; }\n\n.pm-form-card { padding: 24px; }\n.pm-form-head { margin-bottom: 16px; }\n.pm-form-head h2 { margin: 0; font-size: 19px; font-weight: 620; letter-spacing: -0.02em; }\n.pm-form-head p { margin: 4px 0 0; color: var(--pm-ink-3); font-size: 12.9px; }\n.pm-form-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }\n.pm-form-col { flex: 1; min-width: 180px; }\n.pm-form-actions { display: flex; align-items: center; gap: 8px; }\n.pm-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 6px;\n color: var(--pm-ink-2);\n font-size: 12.9px;\n font-weight: 550;\n}\n.pm-label span { color: var(--pm-ink-3); font-weight: 400; }\n.pm-input,\n.pm-textarea,\n.pm-select {\n width: 100%;\n border: 1px solid transparent;\n border-radius: 11px;\n background: var(--pm-surface-2);\n color: var(--pm-ink);\n font-family: inherit;\n font-size: 14px;\n outline: none;\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-input { height: 42px; padding: 0 13px; }\n.pm-textarea { min-height: 92px; padding: 10px 12px; line-height: 1.65; resize: vertical; }\n.pm-select { height: 42px; padding: 0 32px 0 12px; appearance: none; cursor: pointer; }\n.pm-input::placeholder,\n.pm-textarea::placeholder { color: var(--pm-ink-3); }\n.pm-input:focus,\n.pm-textarea:focus,\n.pm-select:focus {\n border-color: var(--pm-accent);\n background: var(--pm-surface);\n box-shadow: 0 0 0 3px var(--pm-accent-soft);\n}\n.pm-select-wrap { position: relative; }\n.pm-select-wrap::after {\n position: absolute;\n top: 50%;\n right: 11px;\n width: 6px;\n height: 6px;\n border-right: 1.5px solid var(--pm-ink-3);\n border-bottom: 1.5px solid var(--pm-ink-3);\n content: "";\n pointer-events: none;\n transform: translateY(-65%) rotate(45deg);\n}\n\n.pm-seg {\n display: inline-flex;\n gap: 2px;\n padding: 3px;\n border-radius: 10px;\n background: var(--pm-surface-2);\n}\n.pm-seg-btn {\n height: 30px;\n padding: 0 11px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: var(--pm-ink-2);\n font-family: inherit;\n font-size: 12.9px;\n font-weight: 500;\n cursor: pointer;\n}\n.pm-seg-btn.is-on {\n background: var(--pm-surface);\n color: var(--pm-ink);\n box-shadow: var(--pm-shadow-1);\n}\n\n.pm-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }\n.pm-chip {\n height: 26px;\n padding: 0 9px;\n border: 1px solid var(--pm-line);\n border-radius: 999px;\n background: var(--pm-surface);\n color: var(--pm-ink-2);\n font-family: inherit;\n font-size: 11.8px;\n cursor: pointer;\n}\n.pm-chip:hover { border-color: var(--pm-line-2); color: var(--pm-ink); }\n\n.pm-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.pm-filters .pm-select-wrap { min-width: 112px; }\n\n.pm-progress-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }\n.pm-progress-main { flex: 1; min-width: 0; }\n.pm-progress-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }\n.pm-progress-desc { margin-top: 3px; color: var(--pm-ink-3); font-size: 12.3px; }\n.pm-progress-track {\n height: 6px;\n margin-top: 9px;\n overflow: hidden;\n border-radius: 999px;\n background: var(--pm-surface-2);\n}\n.pm-progress-fill {\n height: 100%;\n border-radius: inherit;\n background: var(--pm-accent);\n transition: width 0.3s ease;\n}\n\n.pm-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 230px;\n padding: 34px 20px;\n border: 1px dashed var(--pm-line-2);\n border-radius: 18px;\n background: color-mix(in srgb, var(--pm-surface) 65%, transparent);\n text-align: center;\n}\n.pm-empty-ic {\n display: grid;\n width: 46px;\n height: 46px;\n margin-bottom: 12px;\n place-items: center;\n border-radius: 50%;\n background: var(--pm-surface-2);\n color: var(--pm-ink-3);\n}\n.pm-empty h3 { margin: 0; font-size: 16px; font-weight: 600; }\n.pm-empty p { max-width: 360px; margin: 5px 0 0; color: var(--pm-ink-3); font-size: 12.9px; line-height: 1.6; }\n.pm-empty .pm-btn { margin-top: 14px; }\n\n.pm-report { padding: 20px; }\n.pm-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }\n.pm-report-head h3 { margin: 0; font-size: 15px; font-weight: 620; }\n.pm-report-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; }\n.pm-report-block { padding: 14px; border-radius: 13px; background: var(--pm-surface-2); }\n.pm-report-block h4 { margin: 0 0 7px; color: var(--pm-ink-2); font-size: 12.3px; font-weight: 600; letter-spacing: 0.02em; }\n.pm-report-block p,\n.pm-report-block li { color: var(--pm-ink-2); font-size: 12.9px; line-height: 1.65; }\n.pm-report-block p { margin: 0; }\n.pm-report-block ul { margin: 0; padding-left: 16px; }\n.pm-report-block li + li { margin-top: 4px; }\n\n.pm-peer-account { display: flex; align-items: center; gap: 12px; }\n.pm-avatar {\n display: grid;\n flex: 0 0 auto;\n width: 42px;\n height: 42px;\n place-items: center;\n border-radius: 50%;\n background: linear-gradient(140deg, #f7a35c, #f37021 65%, #c4500a);\n color: #fff7ef;\n font-size: 14.6px;\n font-weight: 650;\n box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);\n}\n.pm-avatar--sm { width: 34px; height: 34px; font-size: 12.3px; }\n.pm-avatar--soft { background: var(--pm-accent-soft); color: var(--pm-accent-text); box-shadow: none; }\n.pm-account-name { font-size: 14.6px; font-weight: 600; }\n.pm-account-meta { margin-top: 2px; color: var(--pm-ink-3); font-size: 11.8px; }\n\n.pm-peer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }\n.pm-peer-row {\n display: flex;\n align-items: center;\n gap: 11px;\n padding: 10px 11px;\n border-radius: 13px;\n background: var(--pm-surface-2);\n}\n.pm-peer-rank {\n display: grid;\n flex: 0 0 24px;\n width: 24px;\n height: 24px;\n place-items: center;\n border-radius: 7px;\n background: var(--pm-surface);\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 11.2px;\n font-weight: 700;\n}\n.pm-peer-cover {\n position: relative;\n display: flex;\n flex: 0 0 44px;\n align-items: flex-end;\n width: 44px;\n height: 44px;\n padding: 5px;\n overflow: hidden;\n border-radius: 9px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 9px;\n line-height: 1.2;\n}\n.pm-peer-cover span { position: relative; z-index: 1; }\n.pm-peer-body { flex: 1; min-width: 0; }\n.pm-peer-title {\n overflow: hidden;\n color: var(--pm-ink);\n font-size: 13.4px;\n font-weight: 550;\n line-height: 1.4;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.pm-peer-meta { display: flex; gap: 8px; margin-top: 3px; color: var(--pm-ink-3); font-size: 11.2px; }\n.pm-peer-score {\n flex: 0 0 auto;\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 13.4px;\n font-weight: 650;\n}\n.pm-peer-score small { color: var(--pm-ink-3); font-family: var(--pm-font); font-size: 10.1px; font-weight: 400; }\n\n.pm-search-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.95fr); gap: 14px; align-items: start; }\n.pm-post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }\n.pm-post {\n display: flex;\n gap: 10px;\n padding: 10px;\n border: 1px solid var(--pm-line);\n border-radius: 14px;\n background: var(--pm-surface);\n}\n.pm-post-cover {\n position: relative;\n display: flex;\n flex: 0 0 54px;\n align-items: flex-end;\n width: 54px;\n height: 68px;\n padding: 6px;\n overflow: hidden;\n border-radius: 10px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 9px;\n line-height: 1.25;\n}\n.pm-post-cover.is-violet { background: linear-gradient(150deg, #c0a8ff, #7754e8); }\n.pm-post-cover.is-blue { background: linear-gradient(150deg, #9ebdff, #4c7ee8); }\n.pm-post-cover.is-green { background: linear-gradient(150deg, #c4b5fd, #7c5cff); }\n.pm-post-cover.is-sand { background: linear-gradient(150deg, #e8d1b0, #b58a55); }\n.pm-post-cover span { position: relative; z-index: 1; }\n.pm-post-body { flex: 1; min-width: 0; }\n.pm-post-title {\n display: -webkit-box;\n overflow: hidden;\n color: var(--pm-ink);\n font-size: 12.9px;\n font-weight: 550;\n line-height: 1.45;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.pm-post-meta { margin-top: 4px; color: var(--pm-ink-3); font-size: 10.6px; }\n.pm-post-stats { display: flex; gap: 7px; margin-top: 5px; color: var(--pm-ink-2); font-size: 10.6px; }\n.pm-post-stats b { color: var(--pm-ink); font-weight: 600; }\n\n.pm-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 16px; align-items: start; }\n.pm-detail { padding: 28px; }\n.pm-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }\n.pm-detail h2 { margin: 8px 0 4px; font-size: 23px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.3; }\n.pm-detail-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--pm-ink-3); font-size: 11.8px; }\n.pm-detail-body { margin-top: 20px; }\n.pm-detail-section { margin-top: 18px; }\n.pm-detail-section h3 { margin: 0 0 7px; color: var(--pm-ink); font-size: 14.6px; font-weight: 600; }\n.pm-detail-section p,\n.pm-detail-section li { margin: 0; color: var(--pm-ink-2); font-size: 14px; line-height: 1.75; }\n.pm-detail-section ul { margin: 0; padding-left: 17px; }\n.pm-detail-section li + li { margin-top: 4px; }\n.pm-detail-foot { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--pm-line); }\n\n.pm-chat {\n position: sticky;\n top: 16px;\n display: flex;\n flex-direction: column;\n height: 600px;\n overflow: hidden;\n}\n.pm-chat-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--pm-line); }\n.pm-chat-head-title { flex: 1; font-size: 13.4px; font-weight: 600; }\n.pm-chat-body {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: 15px;\n padding: 16px;\n overflow: auto;\n scroll-behavior: smooth;\n}\n.pm-msg {\n max-width: 92%;\n margin: 0;\n padding: 12px 14px;\n border-radius: 14px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 14px;\n line-height: 1.78;\n letter-spacing: -0.005em;\n}\n.pm-msg.is-ai {\n align-self: flex-start;\n border-bottom-left-radius: 5px;\n animation: pm-msg-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n.pm-msg.is-user {\n align-self: flex-end;\n margin-left: auto;\n border-bottom-right-radius: 5px;\n background: var(--pm-accent);\n color: var(--pm-accent-ink);\n font-size: 14px;\n line-height: 1.65;\n}\n.pm-msg.is-thinking {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n width: fit-content;\n color: var(--pm-ink-3);\n}\n.pm-thinking-dots { display: inline-flex; align-items: center; gap: 3px; }\n.pm-thinking-dots i {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: var(--pm-accent);\n animation: pm-thinking 1.1s ease-in-out infinite;\n}\n.pm-thinking-dots i:nth-child(2) { animation-delay: 0.14s; }\n.pm-thinking-dots i:nth-child(3) { animation-delay: 0.28s; }\n.pm-msg-suggestions { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }\n.pm-suggestion {\n padding: 8px 10px;\n border: 1px solid var(--pm-line);\n border-radius: 9px;\n background: var(--pm-surface);\n color: var(--pm-ink-2);\n font-family: inherit;\n font-size: 12.2px;\n line-height: 1.4;\n text-align: left;\n cursor: pointer;\n transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;\n}\n.pm-suggestion:hover { border-color: var(--pm-accent); color: var(--pm-ink); background: var(--pm-surface-2); }\n.pm-chat-input { display: flex; gap: 7px; padding: 11px; border-top: 1px solid var(--pm-line); }\n.pm-chat-input .pm-input { flex: 1; min-width: 0; height: 38px; font-size: 13.5px; }\n@keyframes pm-msg-in {\n from { opacity: 0; transform: translateY(7px); filter: blur(2px); }\n to { opacity: 1; transform: translateY(0); filter: blur(0); }\n}\n@keyframes pm-thinking {\n 0%, 100% { opacity: 0.35; transform: translateY(0); }\n 50% { opacity: 1; transform: translateY(-2px); }\n}\n\n.pm-settings-wrap { max-width: 960px; margin: 0 auto; }\n.pm-settings-stack { display: flex; flex-direction: column; gap: 16px; }\n.pm-settings-card { padding: 24px; }\n.pm-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }\n.pm-settings-head h2 { margin: 0; font-size: 18px; font-weight: 620; letter-spacing: -0.025em; }\n.pm-settings-head p { margin: 5px 0 0; color: var(--pm-ink-3); font-size: 13px; line-height: 1.55; }\n.pm-settings-head .pm-badge { flex: 0 0 auto; }\n\n.pm-member-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }\n.pm-member-expiry { color: var(--pm-ink-2); font-size: 13.5px; }\n.pm-member-expiry b { color: var(--pm-ink); font-weight: 600; }\n.pm-device-row {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 10px;\n padding: 9px 11px;\n border-radius: 10px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 12.3px;\n}\n.pm-device-row .pm-badge { margin-left: auto; }\n.pm-code-box { margin-top: 14px; }\n.pm-code-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }\n.pm-code-actions .pm-btn--primary { margin-left: auto; }\n\n.pm-qgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }\n.pm-qcard {\n padding: 18px;\n border: 1px solid var(--pm-line);\n border-radius: 15px;\n background: var(--pm-surface);\n}\n.pm-qhead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 5px; }\n.pm-qno {\n display: grid;\n flex: 0 0 20px;\n width: 20px;\n height: 20px;\n place-items: center;\n border-radius: 6px;\n background: var(--pm-accent-soft);\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 10.6px;\n font-weight: 650;\n}\n.pm-qtitle { color: var(--pm-ink); font-size: 14px; font-weight: 600; line-height: 1.45; }\n.pm-qhint { margin: 0 0 9px 28px; color: var(--pm-ink-3); font-size: 12px; line-height: 1.55; }\n.pm-qcard .pm-textarea { min-height: 96px; font-size: 14px; }\n.pm-qfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--pm-ink-3); font-size: 10.5px; }\n.pm-qfoot .is-saved { color: var(--pm-ok); }\n.pm-profile-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }\n.pm-profile-actions .pm-btn--primary { margin-left: auto; }\n\n.pm-platform-row {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px 0;\n border-bottom: 1px solid var(--pm-line);\n}\n.pm-platform-row:last-child { border-bottom: 0; }\n.pm-platform-ic {\n display: grid;\n flex: 0 0 32px;\n width: 32px;\n height: 32px;\n place-items: center;\n border-radius: 9px;\n background: var(--pm-surface-2);\n color: var(--pm-ink);\n font-size: 13.4px;\n font-weight: 700;\n}\n.pm-platform-main { flex: 1; min-width: 0; }\n.pm-platform-name { font-size: 13.5px; font-weight: 600; }\n.pm-platform-sub { margin-top: 3px; color: var(--pm-ink-3); font-size: 11.5px; }\n.pm-platform-row .pm-btn { margin-left: 4px; }\n\n.pm-model-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }\n.pm-model-name { font-size: 14px; font-weight: 600; }\n.pm-model-sub { margin-top: 3px; color: var(--pm-ink-3); font-size: 11.8px; line-height: 1.5; }\n.pm-switch {\n position: relative;\n flex: 0 0 auto;\n width: 38px;\n height: 22px;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: var(--pm-surface-3);\n cursor: pointer;\n transition: background 0.16s ease;\n}\n.pm-switch::after {\n position: absolute;\n top: 3px;\n left: 3px;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: #fff;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);\n content: "";\n transition: transform 0.16s ease;\n}\n.pm-switch.is-on { background: var(--pm-accent); }\n.pm-switch.is-on::after { transform: translateX(16px); }\n.pm-model-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }\n.pm-model-form .pm-form-col:last-child { grid-column: 1 / -1; }\n\n.pm-data-path {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 11px 13px;\n border-radius: 10px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-family: "SF Mono", Menlo, Consolas, monospace;\n font-size: 12px;\n word-break: break-all;\n}\n.pm-data-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }\n.pm-data-actions .pm-btn:last-child { margin-left: auto; }\n\n.pm-account-card { padding: 18px; }\n.pm-account-card.is-empty { border-style: dashed; box-shadow: none; background: color-mix(in srgb, var(--pm-surface) 65%, transparent); }\n.pm-account-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }\n.pm-account-form .pm-form-col { flex: 1; min-width: 190px; }\n\n.pm-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }\n.pm-plan-card { padding: 20px; }\n.pm-plan-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }\n.pm-plan-no {\n display: grid;\n width: 24px;\n height: 24px;\n place-items: center;\n border-radius: 7px;\n background: var(--pm-accent-soft);\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 11.2px;\n font-weight: 650;\n}\n.pm-plan-card h3 { margin: 0; font-size: 16px; font-weight: 620; letter-spacing: -0.015em; }\n.pm-plan-lead { margin: 0 0 10px; color: var(--pm-ink-3); font-size: 12.3px; line-height: 1.6; }\n.pm-plan-card ul { margin: 0; padding-left: 16px; }\n.pm-plan-card li { color: var(--pm-ink-2); font-size: 12.9px; line-height: 1.7; }\n.pm-plan-card li + li { margin-top: 5px; }\n\n.pm-sheet-overlay,\n.pm-modal-overlay {\n position: fixed;\n inset: 0;\n z-index: 70;\n background: rgba(0, 0, 0, 0.28);\n backdrop-filter: blur(5px);\n animation: pm-fade 0.18s ease both;\n}\n.pm-sheet-overlay { display: flex; justify-content: flex-end; }\n.pm-sheet {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 20px);\n height: 100%;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-2);\n animation: pm-slide 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n.pm-sheet-head {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 20px 22px 16px;\n border-bottom: 1px solid var(--pm-line);\n}\n.pm-sheet-head-main { flex: 1; min-width: 0; }\n.pm-sheet-head h2 { margin: 7px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.35; }\n.pm-sheet-body { flex: 1; padding: 20px 22px 28px; overflow: auto; }\n.pm-sheet-foot {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 13px 22px;\n border-top: 1px solid var(--pm-line);\n background: var(--pm-surface);\n}\n.pm-sheet-foot .pm-btn--primary { margin-left: auto; }\n.pm-script-section { margin-bottom: 20px; }\n.pm-script-section:last-child { margin-bottom: 0; }\n.pm-script-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 6px;\n color: var(--pm-ink-3);\n font-size: 11.8px;\n font-weight: 600;\n letter-spacing: 0.02em;\n}\n.pm-script-text { color: var(--pm-ink); font-size: 14.6px; line-height: 1.8; white-space: pre-wrap; }\n.pm-script-title { color: var(--pm-ink); font-family: var(--pm-num); font-size: 20px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.35; }\n.pm-image-list { display: flex; flex-direction: column; gap: 7px; }\n.pm-image-item {\n display: flex;\n gap: 9px;\n padding: 9px 10px;\n border-radius: 10px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 12.9px;\n line-height: 1.6;\n}\n.pm-image-no {\n flex: 0 0 20px;\n color: var(--pm-accent-text);\n font-family: var(--pm-num);\n font-size: 11.2px;\n font-weight: 650;\n}\n.pm-shot-table { width: 100%; border-collapse: collapse; font-size: 12.3px; }\n.pm-shot-table th {\n padding: 7px 6px;\n border-bottom: 1px solid var(--pm-line-2);\n color: var(--pm-ink-3);\n font-weight: 500;\n text-align: left;\n}\n.pm-shot-table td { padding: 8px 6px; border-bottom: 1px solid var(--pm-line); color: var(--pm-ink-2); line-height: 1.55; vertical-align: top; }\n.pm-shot-table td:first-child { color: var(--pm-accent-text); font-family: var(--pm-num); font-weight: 650; }\n.pm-tags { display: flex; gap: 5px; flex-wrap: wrap; }\n.pm-tag {\n padding: 4px 8px;\n border-radius: 7px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 11.8px;\n}\n.pm-skeleton {\n margin-bottom: 9px;\n border-radius: 8px;\n background: var(--pm-surface-2);\n animation: pm-skeleton-pulse 1.4s ease-in-out infinite;\n}\n\n.pm-modal-overlay { display: grid; place-items: center; padding: 20px; }\n.pm-modal {\n width: 420px;\n max-width: 100%;\n padding: 22px;\n border: 1px solid var(--pm-line);\n border-radius: 24px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-2);\n animation: pm-pop 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n.pm-modal h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }\n.pm-modal p { margin: 8px 0 0; color: var(--pm-ink-2); font-size: 13.4px; line-height: 1.65; }\n.pm-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }\n\n.pm-toast-wrap {\n position: fixed;\n bottom: 24px;\n left: 50%;\n z-index: 90;\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: min(410px, calc(100vw - 32px));\n pointer-events: none;\n transform: translateX(-50%);\n}\n.pm-toast {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 11px 12px;\n border: 1px solid var(--pm-line-2);\n border-radius: 16px;\n background: color-mix(in srgb, var(--pm-surface) 94%, transparent);\n box-shadow: var(--pm-shadow-2);\n backdrop-filter: blur(18px);\n animation: pm-toast 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n pointer-events: auto;\n}\n.pm-toast-ic {\n display: grid;\n flex: 0 0 30px;\n width: 32px;\n height: 32px;\n place-items: center;\n border-radius: 50%;\n background: var(--pm-ok-soft);\n color: var(--pm-ok);\n}\n.pm-toast--loading .pm-toast-ic { background: var(--pm-accent-soft); color: var(--pm-accent-text); }\n.pm-toast--error .pm-toast-ic { background: var(--pm-danger-soft); color: var(--pm-danger); }\n.pm-toast--info .pm-toast-ic { background: var(--pm-violet-soft); color: var(--pm-violet); }\n.pm-toast-main { flex: 1; min-width: 0; }\n.pm-toast-title { color: var(--pm-ink); font-size: 13.4px; font-weight: 600; line-height: 1.4; }\n.pm-toast-desc { margin-top: 2px; color: var(--pm-ink-3); font-size: 11.8px; line-height: 1.45; }\n.pm-toast .pm-iconbtn { width: 24px; height: 24px; }\n\n@keyframes pm-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes pm-slide { from { transform: translateX(40px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }\n@keyframes pm-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }\n@keyframes pm-toast { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }\n@keyframes pm-skeleton-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }\n\n@media (prefers-reduced-motion: reduce) {\n .pm-root *,\n .pm-root *::before,\n .pm-root *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n\n@media (max-width: 1180px) {\n .pm-sidebar { flex-basis: 212px; width: 212px; }\n .pm-hero { padding: 28px 28px 22px; }\n .pm-hero--page { padding: 24px 28px 20px; }\n .pm-content { padding: 0 28px 44px; }\n .pm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .pm-topic-grid { grid-template-columns: 1fr; }\n .pm-search-layout { grid-template-columns: 1fr; }\n .pm-review-layout { grid-template-columns: 1fr; }\n .pm-chat { position: static; height: 420px; }\n .pm-plan-grid { grid-template-columns: 1fr; }\n}\n\n@media (max-width: 900px) {\n .pm-sidebar { flex-basis: 76px; width: 76px; padding: 16px 10px 12px; }\n .pm-brand { justify-content: center; padding: 0 0 18px; }\n .pm-brand-text,\n .pm-nav-label,\n .pm-nav-count,\n .pm-side-card,\n .pm-ai-card,\n .pm-version { display: none; }\n .pm-nav { gap: 6px; }\n .pm-nav-btn { justify-content: center; height: 42px; padding: 0; }\n .pm-nav-icon { flex-basis: auto; }\n .pm-hero-inner { align-items: flex-start; }\n .pm-hero h1 { font-size: 27px; }\n .pm-hero--page h1 { font-size: 23px; }\n .pm-hero p { font-size: 13.4px; }\n .pm-hero-actions { display: none; }\n .pm-qgrid { grid-template-columns: 1fr; }\n .pm-model-form { grid-template-columns: 1fr; }\n .pm-model-form .pm-form-col:last-child { grid-column: auto; }\n .pm-post-grid { grid-template-columns: 1fr; }\n}\n\n@media (max-width: 640px) {\n .pm-hero { padding: 22px 18px 18px; }\n .pm-hero--page { padding: 20px 18px 16px; }\n .pm-content { padding: 0 18px 36px; }\n .pm-kpis { grid-template-columns: 1fr; }\n .pm-kpi { min-height: 92px; }\n .pm-notice { align-items: flex-start; }\n .pm-notice-actions { flex-direction: column; align-items: flex-end; }\n .pm-tabbar { width: 100%; }\n .pm-tab { flex: 1; justify-content: center; padding: 0 6px; }\n .pm-section-head { align-items: flex-start; }\n .pm-sheet { max-width: 100vw; width: 100vw; }\n .pm-sheet-head, .pm-sheet-body, .pm-sheet-foot { padding-left: 16px; padding-right: 16px; }\n .pm-toast-wrap { bottom: 16px; }\n .pm-report-grid { grid-template-columns: 1fr; }\n}\n\n/* Review list rows */\n.pm-list {\n overflow: hidden;\n}\n.pm-row {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 14px 16px;\n border-bottom: 1px solid var(--pm-line);\n cursor: pointer;\n transition: background 0.15s ease;\n}\n.pm-row:last-child {\n border-bottom: 0;\n}\n.pm-row:hover {\n background: var(--pm-surface-2);\n}\n.pm-row-icon {\n display: grid;\n flex: 0 0 38px;\n width: 38px;\n height: 38px;\n place-items: center;\n border-radius: 11px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n}\n.pm-row-main {\n flex: 1;\n min-width: 0;\n}\n.pm-row-main .pm-detail-meta {\n overflow: hidden;\n}\n.pm-row-main .pm-detail-meta span:first-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Host boot and connection notice */\n.pm-boot {\n display: flex;\n flex: 1;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n height: 100%;\n padding: 40px;\n background: var(--pm-bg);\n text-align: center;\n}\n.pm-boot h2 {\n margin: 10px 0 0;\n color: var(--pm-ink);\n font-size: 18px;\n font-weight: 620;\n letter-spacing: -0.02em;\n}\n.pm-boot p {\n margin: 0;\n color: var(--pm-ink-3);\n font-size: 12.9px;\n}\n.pm-host-error {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 9px 18px;\n border-bottom: 1px solid var(--pm-line);\n background: var(--pm-danger-soft);\n color: var(--pm-danger);\n font-size: 12.3px;\n}\n.pm-host-error span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Transitions: page, tab, toast exit */\n.pm-main {\n scroll-behavior: smooth;\n}\n.pm-page {\n min-height: 100%;\n animation: pm-page-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n.pm-tabpanel {\n animation: pm-tab-in 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n}\n.pm-toast.is-leaving {\n animation: pm-toast-out 0.25s cubic-bezier(0.25, 0.1, 0.25, 1) both;\n pointer-events: none;\n}\n.pm-settings-card,\n.pm-topic,\n.pm-kpi {\n transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-settings-card:hover {\n border-color: var(--pm-line-2);\n}\n@keyframes pm-page-in {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes pm-tab-in {\n from { opacity: 0; transform: translateY(6px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes pm-toast-out {\n from { opacity: 1; transform: translateY(0) scale(1); }\n to { opacity: 0; transform: translateY(8px) scale(0.98); }\n}\n\n/* Phosphor icon wrapper: SVG assets keep currentColor */\n.pm-icon {\n display: inline-grid;\n flex: 0 0 auto;\n place-items: center;\n line-height: 0;\n color: currentColor;\n}\n.pm-icon svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Orange is the primary accent; purple and red are status accents. */\n.pm-badge--gold {\n background: var(--pm-gold-soft);\n color: var(--pm-gold-text);\n}\n.pm-btn--gold {\n background: var(--pm-gold);\n color: var(--pm-accent-ink);\n}\n.pm-btn--gold:hover {\n background: var(--pm-accent-2);\n}\n.pm-empty-ic--gold {\n background: var(--pm-gold-soft);\n color: var(--pm-gold-text);\n}\n\n/* Secondary colors: red is for counts/urgent, blue/violet for content type. */\n.pm-root {\n --pm-warn: #b45309;\n --pm-warn-soft: rgba(245, 158, 11, 0.14);\n}\n:root[data-theme="dark"] .pm-root,\n.dark .pm-root,\n[data-theme="dark"] .pm-root {\n --pm-warn: #ffb020;\n --pm-warn-soft: rgba(255, 176, 32, 0.16);\n}\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) .pm-root {\n --pm-warn: #ffb020;\n --pm-warn-soft: rgba(255, 176, 32, 0.16);\n }\n}\n\n.pm-nav-btn.is-on .pm-nav-icon {\n color: var(--pm-ink);\n}\n\n.pm-nav-count {\n background: #e0352b;\n color: #ffffff;\n}\n.pm-nav-count--muted {\n background: var(--pm-surface-3);\n color: var(--pm-ink-2);\n}\n\n.pm-badge--amber {\n background: var(--pm-warn-soft);\n color: var(--pm-warn);\n}\n\n/* Apple-style interaction and type polish */\n.pm-hero h1,\n.pm-hero--page h1,\n.pm-detail h2,\n.pm-sheet-head h2,\n.pm-brand-name {\n font-weight: 600;\n letter-spacing: -0.03em;\n}\n\n.pm-btn,\n.pm-topic,\n.pm-row,\n.pm-chip,\n.pm-tab,\n.pm-nav-btn,\n.pm-iconbtn,\n.pm-seg-btn {\n -webkit-tap-highlight-color: transparent;\n}\n.pm-btn:active,\n.pm-topic:active,\n.pm-row:active,\n.pm-chip:active,\n.pm-tab:active,\n.pm-nav-btn:active,\n.pm-iconbtn:active,\n.pm-seg-btn:active {\n transform: scale(0.98);\n}\n\n.pm-topic-index,\n.pm-peer-cover,\n.pm-post-cover {\n transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n.pm-topic:hover .pm-topic-index,\n.pm-peer-row:hover .pm-peer-cover,\n.pm-post:hover .pm-post-cover {\n transform: scale(1.06);\n}\n\n.pm-root a {\n color: var(--pm-accent);\n text-decoration: none;\n}\n.pm-root a:hover {\n text-decoration: underline;\n}\n\n.pm-toast {\n backdrop-filter: blur(12px);\n}\n\n/* Original Pomelo motion and reference-style sidebar states */\n.pm-logo-fruit {\n transform-box: fill-box;\n transform-origin: 50% 92%;\n animation: pm-fruit-bounce 1.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;\n}\n\n@keyframes pm-fruit-bounce {\n 0%, 100% { transform: translateY(0) scale(1, 1); }\n 14% { transform: translateY(1px) scale(1.025, 0.975); }\n 34% { transform: translateY(-3px) scale(0.99, 1.01); }\n 52% { transform: translateY(0) scale(1.02, 0.98); }\n 68% { transform: translateY(-1px) scale(1, 1); }\n 82% { transform: translateY(0) scale(1.01, 0.99); }\n}\n\n.pm-brand-mark {\n filter: drop-shadow(0 3px 8px rgba(140, 190, 45, 0.16));\n}\n\n.pm-nav-btn.is-on {\n background: #ffffff;\n color: var(--pm-ink);\n box-shadow: 0 0 0 0.5px var(--pm-line), 0 4px 14px -8px rgba(0, 0, 0, 0.16);\n}\n\n:root[data-theme="dark"] .pm-nav-btn.is-on,\n.dark .pm-nav-btn.is-on,\n[data-theme="dark"] .pm-nav-btn.is-on {\n background: var(--pm-surface-2);\n box-shadow: inset 0 0 0 0.5px var(--pm-line);\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) .pm-nav-btn.is-on {\n background: var(--pm-surface-2);\n box-shadow: inset 0 0 0 0.5px var(--pm-line);\n }\n}\n\n/* Sidebar AI card, adapted from the reference layout */\n.pm-ai-card {\n margin-top: auto;\n padding: 14px;\n border: 1px solid var(--pm-line);\n border-radius: 16px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-ai-head {\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--pm-ink);\n font-size: 13.5px;\n font-weight: 600;\n}\n.pm-ai-orb {\n width: 9px;\n height: 9px;\n border-radius: 50%;\n background: conic-gradient(from 210deg, var(--pm-accent), var(--pm-violet), var(--pm-accent));\n box-shadow: 0 0 0 3px var(--pm-accent-soft);\n}\n.pm-eq {\n display: flex;\n align-items: flex-end;\n gap: 3px;\n height: 22px;\n margin: 14px 0 8px;\n}\n.pm-eq i {\n flex: 1;\n min-width: 2px;\n border-radius: 2px 2px 1px 1px;\n background: linear-gradient(180deg, var(--pm-violet), var(--pm-accent));\n transform-origin: bottom;\n animation: pm-eq 1.15s ease-in-out infinite;\n}\n@keyframes pm-eq {\n 0%, 100% { transform: scaleY(0.55); opacity: 0.55; }\n 35% { transform: scaleY(1); opacity: 1; }\n 68% { transform: scaleY(0.72); opacity: 0.8; }\n}\n\n/* Page entrance */\n.pm-app { animation: pm-app-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }\n.pm-sidebar { animation: pm-side-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both; }\n@keyframes pm-app-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes pm-side-in {\n from { opacity: 0; transform: translateX(-10px); }\n to { opacity: 1; transform: translateX(0); }\n}\n.pm-kpi {\n animation: pm-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n.pm-kpi:nth-child(2) { animation-delay: 0.06s; }\n.pm-kpi:nth-child(3) { animation-delay: 0.12s; }\n.pm-kpi:nth-child(4) { animation-delay: 0.18s; }\n.pm-topic {\n animation: pm-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n.pm-topic:nth-child(2) { animation-delay: 0.04s; }\n.pm-topic:nth-child(3) { animation-delay: 0.08s; }\n.pm-topic:nth-child(4) { animation-delay: 0.12s; }\n.pm-topic:nth-child(5) { animation-delay: 0.16s; }\n.pm-topic:nth-child(6) { animation-delay: 0.2s; }\n.pm-topic:nth-child(7) { animation-delay: 0.24s; }\n.pm-topic:nth-child(8) { animation-delay: 0.28s; }\n.pm-topic:nth-child(9) { animation-delay: 0.32s; }\n.pm-topic:nth-child(10) { animation-delay: 0.36s; }\n@keyframes pm-rise {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .pm-app, .pm-sidebar, .pm-kpi, .pm-topic, .pm-logo-fruit, .pm-eq i { animation: none !important; }\n}\n\n/* Reference workbench refinements */\n.pm-brand-mark { width: 44px; height: 44px; }\n.pm-brand-name { font-size: 22px; }\n\n.pm-nav-btn:hover {\n background: color-mix(in srgb, var(--pm-surface-2) 22%, transparent);\n color: var(--pm-ink);\n}\n.pm-nav-btn.is-on:hover { background: #ffffff; }\n:root[data-theme="dark"] .pm-nav-btn.is-on:hover,\n.dark .pm-nav-btn.is-on:hover,\n[data-theme="dark"] .pm-nav-btn.is-on:hover {\n background: var(--pm-surface-2);\n}\n\n.pm-kpi {\n gap: 6px;\n min-height: 118px;\n padding: 18px 20px;\n}\n.pm-kpi-main { flex: 1 1 auto; min-width: 0; }\n.pm-kpi-label { font-size: 13px; }\n.pm-kpi-value { font-size: 30px; }\n.pm-kpi-sub {\n margin-top: 6px;\n overflow: hidden;\n font-size: 11.2px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.pm-kpi-chart { width: 44px; min-width: 40px; opacity: 0.85; }\n\n.pm-notice { position: relative; overflow: hidden; padding-bottom: 18px; }\n.pm-notice-stats {\n display: flex;\n align-items: center;\n gap: 18px;\n padding: 0 4px;\n}\n.pm-notice-stats div { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }\n.pm-notice-stats b {\n color: var(--pm-ink);\n font-family: var(--pm-num);\n font-size: 19px;\n font-weight: 600;\n line-height: 1.15;\n font-variant-numeric: tabular-nums;\n}\n.pm-notice-stats span { color: var(--pm-ink-3); font-size: 10.5px; white-space: nowrap; }\n.pm-notice-progress {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 2px;\n background: linear-gradient(90deg, var(--pm-accent), var(--pm-violet));\n}\n\n.pm-renew {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n margin-top: 12px;\n padding: 12px 16px;\n border: 1px solid color-mix(in srgb, var(--pm-accent) 14%, var(--pm-line));\n border-radius: 16px;\n background: color-mix(in srgb, var(--pm-accent-soft) 55%, var(--pm-surface));\n}\n.pm-renew p { margin: 0; color: var(--pm-ink-2); font-size: 12.2px; line-height: 1.5; }\n.pm-renew p b { color: var(--pm-ink); font-weight: 600; }\n.pm-renew .pm-btn { flex: 0 0 auto; background: var(--pm-surface); }\n\n.pm-empty {\n border: 1px solid var(--pm-line);\n border-radius: 18px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n\n.pm-settings-wrap { max-width: 880px; }\n\n.pm-eq {\n height: 11px;\n gap: 2px;\n margin: 14px 0 9px;\n}\n.pm-eq i {\n flex: 1;\n min-width: 2px;\n border-radius: 2px;\n background: color-mix(in srgb, var(--pm-accent) 28%, var(--pm-surface-3));\n animation: pm-eq 1.35s ease-in-out infinite;\n}\n.pm-eq i:nth-child(3n) { background: color-mix(in srgb, var(--pm-accent) 55%, var(--pm-surface-3)); }\n.pm-eq i:nth-child(5n) { background: color-mix(in srgb, var(--pm-violet) 45%, var(--pm-surface-3)); }\n@keyframes pm-eq {\n 0%, 100% { transform: scaleY(0.7); opacity: 0.6; }\n 35% { transform: scaleY(1); opacity: 1; }\n 68% { transform: scaleY(0.82); opacity: 0.8; }\n}\n\n@media (max-width: 1120px) {\n .pm-notice-stats { display: none; }\n}\n\n/* Reference-style pipeline empty state */\n.pm-pipeline {\n padding: 20px 22px 18px;\n border: 1px solid var(--pm-line);\n border-radius: 18px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-pipeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }\n.pm-pipeline-head h3 { margin: 0; color: var(--pm-ink); font-size: 14px; font-weight: 600; }\n.pm-pipeline-head p { margin: 3px 0 0; color: var(--pm-ink-3); font-size: 11.5px; }\n.pm-pipeline-legend { display: flex; align-items: center; gap: 14px; padding-top: 2px; color: var(--pm-ink-3); font-size: 10.5px; }\n.pm-pipeline-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }\n.pm-pipeline-legend i { width: 7px; height: 7px; border-radius: 2px; }\n.pm-pipeline-legend .is-idle { background: var(--pm-surface-3); }\n.pm-pipeline-legend .is-run { background: var(--pm-violet); }\n.pm-pipeline-legend .is-done { background: var(--pm-accent); }\n.pm-pipeline-body {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 34px;\n min-height: 154px;\n padding: 14px 0 8px;\n}\n.pm-pipeline-bot {\n display: grid;\n width: 66px;\n height: 66px;\n place-items: center;\n border-radius: 50%;\n background: var(--pm-surface-2);\n color: var(--pm-ink-3);\n}\n.pm-pipeline-copy { max-width: 400px; text-align: center; }\n.pm-pipeline-copy h4 { margin: 0; color: var(--pm-ink); font-size: 16px; font-weight: 600; }\n.pm-pipeline-copy p { margin: 5px 0 0; color: var(--pm-ink-3); font-size: 12.5px; line-height: 1.6; }\n.pm-pipeline-copy .pm-btn { margin-top: 12px; }\n.pm-pipeline-jar {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 68px;\n height: 68px;\n border: 1px solid var(--pm-line);\n border-radius: 14px;\n background: var(--pm-surface-2);\n color: var(--pm-ink);\n}\n.pm-pipeline-jar b { font-family: var(--pm-num); font-size: 22px; font-weight: 600; line-height: 1.1; }\n.pm-pipeline-jar span { margin-top: 2px; color: var(--pm-ink-3); font-size: 10px; }\n.pm-pipeline-track { display: flex; gap: 4px; margin-top: 10px; }\n.pm-pipeline-track i { flex: 1; height: 4px; border-radius: 2px; background: var(--pm-surface-3); }\n.pm-pipeline-track i:nth-child(4n) { background: color-mix(in srgb, var(--pm-violet) 45%, var(--pm-surface-3)); }\n.pm-pipeline-track i:nth-child(7n) { background: color-mix(in srgb, var(--pm-accent) 55%, var(--pm-surface-3)); }\n\n.pm-notice { animation: pm-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }\n.pm-renew { animation: pm-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both; }\n.pm-tabbar { animation: pm-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }\n.pm-pipeline { animation: pm-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both; }\n@media (prefers-reduced-motion: reduce) {\n .pm-notice, .pm-renew, .pm-tabbar, .pm-pipeline { animation: none !important; }\n}\n\n/* KPI cards lift on hover */\n.pm-kpi {\n animation: pm-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;\n transition:\n translate 0.35s cubic-bezier(0.22, 1, 0.36, 1),\n scale 0.35s cubic-bezier(0.22, 1, 0.36, 1),\n box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),\n border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1);\n will-change: translate, scale;\n}\n@media (hover: hover) {\n .pm-kpi:hover {\n translate: 0 -3px;\n scale: 1.007;\n border-color: color-mix(in srgb, var(--pm-accent) 16%, var(--pm-line));\n box-shadow:\n 0 12px 24px -18px rgba(0, 0, 0, 0.18),\n 0 3px 8px rgba(0, 0, 0, 0.05);\n }\n :root[data-theme="dark"] .pm-kpi:hover,\n .dark .pm-kpi:hover,\n [data-theme="dark"] .pm-kpi:hover {\n box-shadow:\n 0 14px 28px -18px rgba(0, 0, 0, 0.55),\n 0 3px 8px rgba(0, 0, 0, 0.16);\n }\n .pm-kpi:hover .pm-kpi-chart {\n transform: translateY(-1px) scale(1.02);\n }\n}\n.pm-kpi:active {\n translate: 0 -1px;\n scale: 0.997;\n}\n.pm-kpi-chart {\n transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);\n}\n\n/* Real browser / platform logos */\n.pm-platform-brand {\n display: block;\n flex: 0 0 auto;\n}\n.pm-platform-brand svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Platform rows use real app icons, not letter tiles */\n.pm-platform-ic {\n width: 34px;\n height: 34px;\n background: transparent;\n border-radius: 0;\n}\n\n.pm-qfoot .is-empty,\n.pm-qfoot .is-saving { color: var(--pm-ink-3); }\n.pm-qfoot .is-error { color: var(--pm-danger); }\n\n/* License gate */\n.pm-gate-root {\n display: grid;\n min-height: 100vh;\n place-items: center;\n padding: 32px;\n background: var(--pm-bg);\n}\n.pm-gate {\n width: min(460px, 100%);\n text-align: center;\n}\n.pm-gate-brand {\n display: inline-flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 30px;\n text-align: left;\n}\n.pm-gate-brand .pm-brand-mark {\n width: 48px;\n height: 48px;\n}\n.pm-gate-name {\n color: var(--pm-ink);\n font-size: 22px;\n font-weight: 650;\n letter-spacing: -0.02em;\n line-height: 1.1;\n}\n.pm-gate-sub {\n margin-top: 3px;\n color: var(--pm-ink-3);\n font-size: 10px;\n letter-spacing: 0.14em;\n}\n.pm-gate h1 {\n margin: 0;\n color: var(--pm-ink);\n font-size: 34px;\n font-weight: 650;\n letter-spacing: -0.035em;\n line-height: 1.15;\n}\n.pm-gate-desc {\n max-width: 360px;\n margin: 10px auto 24px;\n color: var(--pm-ink-2);\n font-size: 13px;\n line-height: 1.65;\n}\n.pm-gate-form {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.pm-gate-form .pm-input {\n height: 44px;\n flex: 1;\n background: var(--pm-surface);\n border: 1px solid var(--pm-line);\n text-align: center;\n font-family: "SF Mono", Menlo, monospace;\n font-size: 13px;\n letter-spacing: 0.04em;\n}\n.pm-gate-form .pm-btn {\n height: 44px;\n flex: 0 0 auto;\n}\n.pm-gate-error {\n margin-top: 12px;\n color: var(--pm-danger);\n font-size: 12px;\n}\n.pm-gate-foot {\n margin: 24px 0 0;\n color: var(--pm-ink-3);\n font-size: 11.5px;\n line-height: 1.6;\n}\n.pm-gate-foot a {\n color: var(--pm-accent-text);\n text-decoration: none;\n}\n.pm-gate-foot a:hover { text-decoration: underline; }\n\n/* Animated topic pipeline while generating */\n.pm-run-pipeline {\n padding: 22px 24px 16px;\n border: 1px solid var(--pm-line);\n border-radius: 18px;\n background: var(--pm-surface);\n box-shadow: var(--pm-shadow-1);\n}\n.pm-run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }\n.pm-run-title { display: flex; align-items: center; gap: 14px; }\n.pm-run-head h3 { margin: 0; color: var(--pm-ink); font-size: 14px; font-weight: 600; }\n.pm-run-head p { margin: 4px 0 0; color: var(--pm-ink-3); font-size: 11.5px; }\n.pm-run-live {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 9px;\n border-radius: 999px;\n background: var(--pm-accent-soft);\n color: var(--pm-accent-text);\n font-size: 10.5px;\n white-space: nowrap;\n}\n.pm-run-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--pm-accent); animation: pm-run-blink 1.2s ease-in-out infinite; }\n\n.pm-run-robot { position: relative; flex: 0 0 70px; width: 70px; height: 76px; }\n.pm-run-halo {\n position: absolute;\n inset: 8px 0 0;\n border-radius: 50%;\n background: var(--pm-accent-soft);\n filter: blur(10px);\n animation: pm-run-halo 3.2s ease-in-out infinite;\n}\n.pm-run-head-face {\n position: absolute;\n top: 20px;\n left: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 9px;\n width: 48px;\n height: 38px;\n border: 1px solid rgba(255, 255, 255, 0.14);\n border-radius: 14px;\n background: linear-gradient(145deg, #4b4b50 0%, #2a2a2e 62%, #202024 100%);\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.18),\n 0 10px 22px -12px rgba(0, 0, 0, 0.9);\n transform: translateX(-50%);\n z-index: 2;\n}\n.pm-run-head-face i {\n width: 6px;\n height: 9px;\n border-radius: 3px;\n background: #ffb45e;\n box-shadow: 0 0 10px rgba(255, 150, 60, 0.85);\n animation: pm-run-eyes 2.4s ease-in-out infinite;\n}\n.pm-run-head-face i:nth-child(2) { animation-delay: 0.15s; }\n.pm-run-ear {\n position: absolute;\n top: 29px;\n width: 7px;\n height: 15px;\n border-radius: 4px;\n background: #333338;\n z-index: 1;\n}\n.pm-run-ear.is-left { left: 6px; }\n.pm-run-ear.is-right { right: 6px; }\n.pm-run-antenna {\n position: absolute;\n top: 6px;\n left: 50%;\n width: 2px;\n height: 14px;\n border-radius: 2px;\n background: #7a7a80;\n transform: translateX(-50%);\n z-index: 3;\n}\n.pm-run-antenna::after {\n position: absolute;\n top: -3px;\n left: -2px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--pm-accent);\n box-shadow: 0 0 8px color-mix(in srgb, var(--pm-accent) 65%, transparent);\n content: "";\n animation: pm-run-blink 1.5s ease-in-out infinite;\n}\n.pm-run-body {\n position: absolute;\n bottom: 3px;\n left: 50%;\n width: 36px;\n height: 13px;\n border-radius: 6px 6px 11px 11px;\n background: linear-gradient(180deg, #3b3b40, #242428);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);\n transform: translateX(-50%);\n z-index: 2;\n}\n.pm-run-steps {\n display: grid;\n grid-template-columns: repeat(4, minmax(0, 1fr));\n gap: 0;\n margin-top: 20px;\n}\n.pm-run-step { min-width: 0; padding-right: 16px; opacity: 0.42; transition: opacity 0.4s ease; }\n.pm-run-step.is-active { opacity: 1; }\n.pm-run-step.is-done { opacity: 0.78; }\n.pm-run-step-line { position: relative; height: 20px; margin-bottom: 8px; }\n.pm-run-step-line::before {\n position: absolute;\n top: 9px;\n right: 0;\n left: 22px;\n height: 1px;\n background: var(--pm-line);\n content: "";\n}\n.pm-run-step:last-child .pm-run-step-line::before { display: none; }\n.pm-run-step.is-done .pm-run-step-line::before,\n.pm-run-step.is-active .pm-run-step-line::before {\n background: color-mix(in srgb, var(--pm-accent) 38%, var(--pm-line));\n}\n.pm-run-step-dot {\n position: relative;\n z-index: 1;\n display: grid;\n width: 19px;\n height: 19px;\n place-items: center;\n border-radius: 50%;\n background: var(--pm-surface-2);\n color: var(--pm-ink-3);\n font-family: var(--pm-num);\n font-size: 8.5px;\n font-weight: 600;\n}\n.pm-run-step.is-active .pm-run-step-dot { background: var(--pm-accent); color: var(--pm-accent-ink); box-shadow: 0 0 0 4px var(--pm-accent-soft); }\n.pm-run-step.is-done .pm-run-step-dot { background: var(--pm-ok-soft); color: var(--pm-ok); }\n.pm-run-step b { display: block; color: var(--pm-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }\n.pm-run-step small { display: block; margin-top: 2px; overflow: hidden; color: var(--pm-ink-3); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }\n.pm-run-track { height: 2px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: var(--pm-surface-3); }\n.pm-run-track span { display: block; height: 100%; border-radius: inherit; background: var(--pm-accent); transition: width 1s cubic-bezier(0.22, 1, 0.36, 1); }\n@keyframes pm-run-halo { 0%, 100% { opacity: 0.5; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.06); } }\n@keyframes pm-run-blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }\n@keyframes pm-run-eyes { 0%, 88%, 100% { transform: scaleY(1); } 92% { transform: scaleY(0.15); } }\n@media (max-width: 760px) {\n .pm-run-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }\n .pm-run-step-line::before { display: none; }\n}\n.pm-progress-track.is-indeterminate { overflow: hidden; }\n.pm-progress-track.is-indeterminate .pm-progress-fill {\n width: 38% !important;\n animation: pm-indeterminate 1.4s cubic-bezier(.4,0,.2,1) infinite;\n}\n@keyframes pm-indeterminate {\n 0% { transform: translateX(-110%); }\n 100% { transform: translateX(310%); }\n}\n.pm-post-cover { position: relative; overflow: hidden; }\n.pm-post-cover img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0.9;\n}\n.pm-post-cover > span { position: relative; z-index: 1; }\n.pm-post-title { display: block; color: var(--pm-ink); text-decoration: none; }\n.pm-post-title:hover { color: var(--pm-accent-text); text-decoration: underline; }\n\n.pm-peer-cover img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.pm-peer-cover { position: relative; overflow: hidden; }\n.pm-peer-title { color: var(--pm-ink); text-decoration: none; }\n.pm-peer-title:hover { color: var(--pm-accent-text); text-decoration: underline; }\n\n/* KPI chart entrance: draw, grow, sweep */\n.pm-spark-line {\n stroke-dasharray: 1;\n stroke-dashoffset: 1;\n animation: pm-spark-draw 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;\n}\n.pm-spark-area {\n animation: pm-spark-area 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;\n}\n@keyframes pm-spark-draw {\n from { stroke-dashoffset: 1; }\n to { stroke-dashoffset: 0; }\n}\n@keyframes pm-spark-area {\n from { opacity: 0; }\n to { opacity: 0.08; }\n}\n.pm-spark-dot {\n transform-box: fill-box;\n transform-origin: center;\n animation: pm-chart-dot 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.85s both;\n}\n@keyframes pm-chart-dot {\n from { opacity: 0; transform: scale(0); }\n to { opacity: 1; transform: scale(1); }\n}\n\n.pm-mini-bar {\n transform-box: fill-box;\n transform-origin: bottom;\n animation: pm-bar-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n@keyframes pm-bar-grow {\n from { transform: scaleY(0); opacity: 0; }\n to { transform: scaleY(1); }\n}\n\n.pm-ring-progress {\n animation: pm-ring-draw 1s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;\n}\n@keyframes pm-ring-draw {\n from { stroke-dashoffset: var(--pm-ring-full); }\n to { stroke-dashoffset: var(--pm-ring-offset); }\n}\n.pm-ring-dot {\n transform-box: fill-box;\n transform-origin: center;\n animation: pm-chart-dot 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.62s both;\n}\n@media (prefers-reduced-motion: reduce) {\n .pm-spark-line, .pm-spark-area, .pm-spark-dot, .pm-mini-bar, .pm-ring-progress, .pm-ring-dot { animation: none !important; }\n}\n\n.pm-model-picker { margin-top: 14px; }\n.pm-model-picker .pm-select { max-width: 520px; }\n.pm-model-error { margin-top: 6px; color: var(--pm-danger); font-size: 11.5px; }\n\n/* Peer profile + card layout */\n.pm-peer-profile { padding: 20px 22px; }\n.pm-peer-profile-head { display: flex; align-items: center; gap: 14px; }\n.pm-peer-avatar { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; background: var(--pm-surface-2); }\n.pm-peer-avatar--fallback { display: grid; place-items: center; color: var(--pm-ink-2); font-size: 20px; font-weight: 600; }\n.pm-peer-profile-main { flex: 1; min-width: 0; }\n.pm-peer-profile-name { display: flex; align-items: center; gap: 8px; color: var(--pm-ink); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }\n.pm-peer-profile-meta { margin-top: 4px; color: var(--pm-ink-3); font-size: 11.5px; }\n.pm-peer-profile-actions { display: flex; align-items: center; gap: 8px; }\n.pm-platform-chip {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 7px 2px 3px;\n border-radius: 999px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 10.5px;\n font-weight: 500;\n}\n.pm-platform-chip .pm-platform-brand { width: 14px; height: 14px; }\n.pm-peer-insight { margin-top: 16px; padding: 18px 20px; }\n.pm-peer-summary { margin: 0; padding-left: 16px; color: var(--pm-ink-2); font-size: 12.5px; line-height: 1.75; }\n.pm-peer-summary li + li { margin-top: 4px; }\n.pm-peer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }\n.pm-post-platform {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 6px 2px 2px;\n border-radius: 999px;\n background: rgba(0, 0, 0, 0.38);\n color: #fff;\n font-size: 9.5px;\n font-weight: 500;\n}\n.pm-post-platform .pm-platform-brand { width: 14px; height: 14px; }\n.pm-post-meta { display: flex; align-items: center; gap: 6px; }\n.pm-post-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: var(--pm-surface-2); }\n.pm-post-title { cursor: pointer; }\n\n/* Platform identity uses the real app logo everywhere. */\n.pm-platform-badge {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 8px 3px 5px;\n border-radius: 999px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-2);\n font-size: 10.5px;\n font-weight: 500;\n line-height: 1.2;\n white-space: nowrap;\n}\n.pm-platform-badge-item { display: inline-flex; align-items: center; gap: 4px; }\n.pm-platform-badge .pm-platform-brand { width: 14px; height: 14px; }\n.pm-platform-badge.is-plain { padding: 0; background: transparent; color: inherit; font-size: 13px; }\n.pm-platform-badge.is-plain .pm-platform-brand { width: 15px; height: 15px; }\n.pm-platform-badge.is-plain .pm-platform-badge-item + .pm-platform-badge-item { margin-left: 3px; }\n\n/* Peer search history and update comparison */\n.pm-peer-history { margin-top: 12px; padding: 18px 20px; }\n.pm-peer-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }\n.pm-peer-history-list { display: grid; gap: 2px; }\n.pm-peer-history-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; transition: background 0.2s ease; }\n.pm-peer-history-row:hover { background: var(--pm-surface-2); }\n.pm-peer-history-avatar { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; background: var(--pm-surface-2); flex: 0 0 32px; }\n.pm-peer-history-avatar--fallback { display: grid; place-items: center; color: var(--pm-ink-2); font-size: 12px; font-weight: 600; }\n.pm-peer-history-main { flex: 1; min-width: 0; }\n.pm-peer-history-name { display: flex; align-items: center; gap: 6px; color: var(--pm-ink); font-size: 12px; font-weight: 600; }\n.pm-peer-history-meta { margin-top: 2px; color: var(--pm-ink-3); font-size: 10.5px; }\n.pm-peer-history-update { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--pm-line); border-radius: 8px; background: transparent; color: var(--pm-ink-2); font-size: 10.5px; cursor: pointer; }\n.pm-peer-history-update:hover { color: var(--pm-ink); border-color: var(--pm-ink-3); }\n.pm-peer-history-update:disabled { opacity: 0.45; cursor: default; }\n.pm-peer-compare { margin-top: 12px; padding: 16px 18px; }\n.pm-peer-compare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }\n.pm-peer-compare-stats { display: flex; gap: 28px; margin-top: 14px; }\n.pm-peer-compare-stats div { display: flex; flex-direction: column; gap: 2px; }\n.pm-peer-compare-stats b { color: var(--pm-ink); font-family: var(--pm-num); font-size: 20px; font-weight: 650; line-height: 1; }\n.pm-peer-compare-stats span { color: var(--pm-ink-3); font-size: 10.5px; }\n.pm-peer-new-list { display: grid; gap: 5px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--pm-line); }\n.pm-peer-new-item { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--pm-ink-2); font-size: 11.5px; }\n.pm-peer-new-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.pm-peer-new-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--pm-accent); }\n\n.pm-plan-generating {\n display: flex;\n align-items: center;\n gap: 9px;\n padding: 18px 20px;\n border: 1px solid var(--pm-line);\n border-radius: 14px;\n background: var(--pm-surface);\n color: var(--pm-ink-2);\n font-size: 12px;\n}\n.pm-plan-generating-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--pm-accent);\n animation: pm-run-blink 1.2s ease-in-out infinite;\n}\n\n.pm-back-link {\n display: inline-flex;\n align-items: center;\n gap: 7px;\n height: 34px;\n padding: 0 13px 0 11px;\n margin: 0 0 13px;\n border: 1px solid color-mix(in srgb, var(--pm-ink) 9%, transparent);\n border-radius: 10px;\n background: color-mix(in srgb, var(--pm-surface) 88%, transparent);\n color: var(--pm-ink-2);\n font-size: 12.5px;\n font-weight: 500;\n letter-spacing: -0.01em;\n cursor: pointer;\n box-shadow:\n 0 1px 0 rgba(255, 255, 255, 0.55) inset,\n 0 2px 6px color-mix(in srgb, var(--pm-ink) 5%, transparent);\n backdrop-filter: blur(8px);\n transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;\n}\n.pm-back-link .pm-ic { transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }\n.pm-back-link:hover {\n color: var(--pm-ink);\n border-color: color-mix(in srgb, var(--pm-accent) 26%, transparent);\n background: var(--pm-surface);\n box-shadow:\n 0 1px 0 rgba(255, 255, 255, 0.65) inset,\n 0 4px 12px color-mix(in srgb, var(--pm-ink) 7%, transparent);\n}\n.pm-back-link:hover .pm-ic { transform: translateX(-2px); }\n\n.pm-save-done { opacity: 0.72; }\n.pm-save-done:hover { opacity: 0.9; }\n\n/* Review split screen */\n.pm-review-layout { gap: 0; align-items: stretch; }\n.pm-review-layout.is-detail-full,\n.pm-review-layout.is-chat-full { grid-template-columns: minmax(0, 1fr); }\n.pm-review-layout.is-detail-full .pm-detail { width: 100%; max-width: none; }\n.pm-review-layout.is-chat-full .pm-chat {\n position: static;\n width: 100%;\n height: calc(100vh - 245px);\n min-height: 620px;\n}\n.pm-split-handle {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n width: 8px;\n cursor: col-resize;\n touch-action: none;\n}\n.pm-split-handle::before {\n position: absolute;\n top: 14px;\n bottom: 14px;\n width: 1px;\n border-radius: 1px;\n background: var(--pm-line);\n content: "";\n transition: background 0.18s ease, width 0.18s ease;\n}\n.pm-split-handle span {\n position: relative;\n z-index: 1;\n width: 3px;\n height: 30px;\n border-radius: 999px;\n background: var(--pm-ink-3);\n opacity: 0;\n transition: opacity 0.18s ease;\n}\n.pm-split-handle:hover::before,\n.pm-review-layout.is-resizing .pm-split-handle::before {\n width: 2px;\n background: color-mix(in srgb, var(--pm-accent) 58%, var(--pm-line));\n}\n.pm-split-handle:hover span,\n.pm-review-layout.is-resizing .pm-split-handle span { opacity: 0.75; }\n.pm-review-layout.is-resizing { cursor: col-resize; user-select: none; }\n.pm-panel-actions { display: flex; align-items: center; gap: 4px; }\n\n@media (max-width: 920px) {\n .pm-review-layout,\n .pm-review-layout.is-detail-full,\n .pm-review-layout.is-chat-full { grid-template-columns: minmax(0, 1fr); }\n .pm-split-handle { display: none; }\n .pm-review-layout.is-chat-full .pm-chat { height: 620px; }\n}\n\n/* Collapsible Pomelo sidebar */\n.pm-sidebar { transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), flex-basis 0.26s cubic-bezier(0.22, 1, 0.36, 1), padding 0.26s ease; }\n.pm-sidebar.is-collapsed { flex-basis: 76px; width: 76px; padding: 22px 12px 14px; overflow: hidden; }\n.pm-sidebar-toggle {\n display: grid;\n flex: 0 0 auto;\n width: 28px;\n height: 28px;\n margin-left: auto;\n place-items: center;\n border: 1px solid var(--pm-line);\n border-radius: 8px;\n background: var(--pm-surface-2);\n color: var(--pm-ink-3);\n cursor: pointer;\n transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;\n}\n.pm-sidebar-toggle:hover { color: var(--pm-ink); border-color: var(--pm-ink-3); background: var(--pm-surface-3); }\n.pm-sidebar.is-collapsed .pm-brand { flex-direction: column; gap: 9px; padding: 0 0 17px; }\n.pm-sidebar.is-collapsed .pm-brand-text { display: none; }\n.pm-sidebar.is-collapsed .pm-sidebar-toggle { margin-left: 0; }\n.pm-sidebar.is-collapsed .pm-nav { width: 100%; }\n.pm-sidebar.is-collapsed .pm-nav-btn { justify-content: center; padding: 10px 8px; }\n.pm-sidebar.is-collapsed .pm-nav-label { display: none; }\n.pm-sidebar.is-collapsed .pm-nav-count {\n position: absolute;\n top: 3px;\n right: 5px;\n min-width: 15px;\n height: 15px;\n padding: 0 4px;\n border-radius: 999px;\n font-size: 8.5px;\n}\n.pm-sidebar.is-collapsed .pm-sidebar-spacer { min-height: 16px; }\n.pm-side-compact {\n display: grid;\n width: 38px;\n height: 38px;\n margin: 0 auto;\n place-items: center;\n border: 1px solid var(--pm-line);\n border-radius: 12px;\n background: var(--pm-surface);\n}\n.pm-sidebar.is-collapsed .pm-ai-card { display: none; }\n.pm-sidebar.is-collapsed .pm-version { display: none; }\n@media (max-width: 900px) {\n .pm-sidebar.is-collapsed { flex-basis: 68px; width: 68px; padding-right: 8px; padding-left: 8px; }\n}\n\n.pm-ai-model {\n margin-top: 3px;\n overflow: hidden;\n color: var(--pm-ink-3);\n font-family: var(--pm-num);\n font-size: 10.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.pm-ai-activity {\n margin-bottom: 2px;\n color: var(--pm-ink-2);\n font-size: 11px;\n line-height: 1.45;\n}\n.pm-ai-orb.is-live { animation: pm-ai-live 1.4s ease-in-out infinite; }\n.pm-eq.is-idle i { animation-play-state: paused; opacity: 0.38; }\n.pm-ai-card { cursor: pointer; transition: border-color 0.18s ease, background 0.18s ease; }\n.pm-ai-card:hover { border-color: var(--pm-line-2); background: var(--pm-surface-2); }\n@keyframes pm-ai-live {\n 0%, 100% { box-shadow: 0 0 0 3px var(--pm-accent-soft); transform: scale(1); }\n 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pm-accent) 12%, transparent); transform: scale(1.12); }\n}\n\n/* Model-aware electronic pet */\n.pm-pet-row { display: flex; align-items: center; gap: 11px; margin: 10px 0 8px; min-height: 62px; }\n.pm-pet-info { flex: 1; min-width: 0; }\n.pm-pet {\n --pet-a: var(--pm-accent);\n --pet-b: var(--pm-violet);\n --pet-eye: #ffb45e;\n position: relative;\n display: grid;\n flex: 0 0 64px;\n width: 64px;\n height: 58px;\n place-items: center;\n}\n.pm-pet.is-deepseek { --pet-a: #f37021; --pet-b: #b39bff; --pet-eye: #ffb45e; }\n.pm-pet.is-openai { --pet-a: #7aa2ff; --pet-b: #a78bfa; --pet-eye: #a9c6ff; }\n.pm-pet.is-claude { --pet-a: #d97757; --pet-b: #f0b38a; --pet-eye: #ffc9a8; }\n.pm-pet.is-gemini { --pet-a: #8ab4f8; --pet-b: #c58af9; --pet-eye: #b9d2ff; }\n.pm-pet.is-qwen { --pet-a: #a78bfa; --pet-b: #f0abfc; --pet-eye: #d8c4ff; }\n.pm-pet-orbit { position: absolute; inset: 0; opacity: 0.5; }\n.pm-pet-orbit i {\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: var(--pet-a);\n box-shadow: 0 0 6px color-mix(in srgb, var(--pet-a) 55%, transparent);\n opacity: 0.55;\n}\n.pm-pet-orbit i:nth-child(1) { top: 8px; left: 7px; }\n.pm-pet-orbit i:nth-child(2) { top: 4px; right: 12px; background: var(--pet-b); }\n.pm-pet-orbit i:nth-child(3) { bottom: 9px; right: 5px; }\n.pm-pet.is-working .pm-pet-orbit { opacity: 1; animation: pm-pet-orbit 5s linear infinite; }\n.pm-pet-head {\n position: relative;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 38px;\n height: 31px;\n border: 1px solid rgba(255, 255, 255, 0.13);\n border-radius: 11px;\n background: linear-gradient(145deg, #46464b, #252529 72%);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 7px 14px -9px rgba(0, 0, 0, 0.9);\n animation: pm-pet-float 3.4s ease-in-out infinite;\n}\n.pm-pet-eye {\n width: 5px;\n height: 8px;\n border-radius: 3px;\n background: var(--pet-eye);\n box-shadow: 0 0 8px color-mix(in srgb, var(--pet-eye) 70%, transparent);\n animation: pm-pet-blink 4.6s ease-in-out infinite;\n}\n.pm-pet-antenna {\n position: absolute;\n z-index: 1;\n top: 7px;\n left: 50%;\n width: 2px;\n height: 9px;\n border-radius: 2px;\n background: var(--pet-b);\n transform: translateX(-50%);\n}\n.pm-pet-antenna::after {\n position: absolute;\n top: -3px;\n left: -2px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--pet-a);\n box-shadow: 0 0 7px color-mix(in srgb, var(--pet-a) 60%, transparent);\n content: "";\n}\n.pm-pet-base {\n position: absolute;\n z-index: 1;\n bottom: 5px;\n width: 27px;\n height: 7px;\n border-radius: 5px 5px 9px 9px;\n background: #303035;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);\n}\n.pm-pet-info { min-width: 0; }\n.pm-pet-model {\n overflow: hidden;\n color: var(--pm-ink-2);\n font-family: var(--pm-num);\n font-size: 10.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.pm-pet-row .pm-ai-activity { margin-top: 3px; margin-bottom: 0; overflow: hidden; color: var(--pm-ink-3); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }\n.pm-pet.is-working .pm-pet-head { animation: pm-pet-bounce 0.85s cubic-bezier(0.45, 0, 0.55, 1) infinite; }\n.pm-pet.is-openai.is-working .pm-pet-head { animation: pm-pet-tilt 1.15s ease-in-out infinite; }\n.pm-pet.is-claude.is-working .pm-pet-head { animation: pm-pet-breathe 1.7s ease-in-out infinite; }\n.pm-pet.is-gemini.is-working .pm-pet-head { animation: pm-pet-pop 1.05s ease-in-out infinite; }\n.pm-pet.is-qwen.is-working .pm-pet-head { animation: pm-pet-wobble 1.2s ease-in-out infinite; }\n.pm-pet.is-openai.is-working .pm-pet-orbit { animation-direction: reverse; animation-duration: 7s; }\n.pm-pet.is-claude.is-working .pm-pet-orbit { animation-duration: 9s; }\n.pm-pet.is-gemini.is-working .pm-pet-orbit i { animation: pm-pet-spark 1.2s ease-in-out infinite; }\n.pm-pet.is-gemini.is-working .pm-pet-orbit i:nth-child(2) { animation-delay: 0.3s; }\n.pm-pet.is-gemini.is-working .pm-pet-orbit i:nth-child(3) { animation-delay: 0.6s; }\n@keyframes pm-pet-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }\n@keyframes pm-pet-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(-1.5deg); } }\n@keyframes pm-pet-tilt { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-2px); } }\n@keyframes pm-pet-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }\n@keyframes pm-pet-pop { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-3px) scale(1.04); } 70% { transform: translateY(0) scale(0.99); } }\n@keyframes pm-pet-wobble { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2px) rotate(-2deg); } 75% { transform: translateX(2px) rotate(2deg); } }\n@keyframes pm-pet-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }\n@keyframes pm-pet-blink { 0%, 42%, 46%, 100% { transform: scaleY(1); } 44% { transform: scaleY(0.12); } }\n@keyframes pm-pet-spark { 0%, 100% { opacity: 0.25; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.5); } }\n\n/* AI state stage */\n.pm-ai-family {\n margin-left: auto;\n color: var(--pm-ink-3);\n font-family: var(--pm-num);\n font-size: 10px;\n font-weight: 500;\n letter-spacing: 0.01em;\n}\n.pm-ai-modelline {\n margin-top: 2px;\n overflow-wrap: anywhere;\n color: var(--pm-ink-2);\n font-family: var(--pm-num);\n font-size: 11.5px;\n line-height: 1.4;\n}\n.pm-ai-stage {\n --stage-a: var(--pm-accent);\n --stage-b: var(--pm-violet);\n position: relative;\n display: grid;\n height: 118px;\n margin: 11px -4px 1px;\n place-items: center;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--pm-ink) 7%, transparent);\n border-radius: 13px;\n background:\n radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--stage-a) 13%, transparent), transparent 64%),\n linear-gradient(180deg, var(--pm-surface-2), color-mix(in srgb, var(--pm-surface-2) 60%, transparent));\n}\n.pm-ai-stage.is-deepseek { --stage-a: #f37021; --stage-b: #b39bff; }\n.pm-ai-stage.is-openai { --stage-a: #7aa2ff; --stage-b: #a78bfa; }\n.pm-ai-stage.is-claude { --stage-a: #d97757; --stage-b: #f0b38a; }\n.pm-ai-stage.is-gemini { --stage-a: #8ab4f8; --stage-b: #c58af9; }\n.pm-ai-stage.is-qwen { --stage-a: #a78bfa; --stage-b: #f0abfc; }\n.pm-stage-ring {\n position: absolute;\n inset: 0;\n margin: auto;\n border: 1px solid color-mix(in srgb, var(--stage-a) 25%, transparent);\n border-radius: 50%;\n animation: pm-stage-spin 22s linear infinite;\n}\n.pm-stage-ring.is-one { width: 86px; height: 86px; }\n.pm-stage-ring.is-two { width: 116px; height: 116px; border-color: color-mix(in srgb, var(--stage-b) 18%, transparent); animation-direction: reverse; animation-duration: 30s; }\n.pm-stage-ring.is-two::after {\n position: absolute;\n top: 9px;\n left: 14px;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: var(--stage-b);\n box-shadow: 0 0 8px color-mix(in srgb, var(--stage-b) 60%, transparent);\n content: "";\n}\n.pm-ai-stage.is-openai .pm-stage-ring.is-one { border-style: dashed; }\n.pm-ai-stage.is-claude .pm-stage-ring { border-color: color-mix(in srgb, var(--stage-a) 15%, transparent); filter: blur(0.6px); }\n.pm-ai-stage.is-gemini .pm-stage-ring.is-one { border-color: color-mix(in srgb, var(--stage-a) 35%, transparent); }\n.pm-ai-stage.is-qwen .pm-stage-ring.is-two { border-style: dotted; }\n.pm-stage-spark {\n position: absolute;\n width: 3px;\n height: 3px;\n border-radius: 50%;\n background: var(--stage-a);\n opacity: 0.35;\n animation: pm-stage-spark 5.5s ease-in-out infinite;\n}\n.pm-stage-spark.is-a { top: 22px; left: 34px; }\n.pm-stage-spark.is-b { top: 34px; right: 36px; animation-delay: 1.7s; background: var(--stage-b); }\n.pm-stage-spark.is-c { bottom: 24px; left: 74px; animation-delay: 3.1s; }\n.pm-ai-stage.is-gemini .pm-stage-spark { animation-duration: 2.4s; }\n.pm-ai-stage .pm-pet { z-index: 2; transform: scale(1.02); }\n.pm-stage-state {\n position: absolute;\n right: 0;\n bottom: 8px;\n left: 0;\n overflow: hidden;\n color: var(--pm-ink-3);\n font-size: 9.5px;\n line-height: 1.3;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.pm-ai-stage.is-working { background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--stage-a) 21%, transparent), transparent 68%), linear-gradient(180deg, var(--pm-surface-2), var(--pm-surface-2)); }\n.pm-ai-stage.is-working .pm-stage-ring { animation-duration: 6s; border-color: color-mix(in srgb, var(--stage-a) 44%, transparent); }\n.pm-ai-stage.is-working .pm-stage-ring.is-two { animation-duration: 8s; }\n.pm-ai-stage.is-working .pm-stage-spark { animation-duration: 2.2s; opacity: 0.8; }\n.pm-ai-stage.is-working .pm-stage-state { color: var(--pm-ink-2); }\n@keyframes pm-stage-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }\n@keyframes pm-stage-spark { 0%, 100% { opacity: 0.15; transform: scale(0.7); } 50% { opacity: 0.9; transform: scale(1.35); } }\n\n.pm-nav-alert {\n width: 6px;\n height: 6px;\n margin-left: auto;\n border-radius: 50%;\n background: var(--pm-danger, #e5484d);\n box-shadow: 0 0 0 3px color-mix(in srgb, #e5484d 14%, transparent);\n}\n.pm-sidebar.is-collapsed .pm-nav-alert { position: absolute; top: 7px; right: 8px; margin: 0; }\n.pm-plan-stale {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 14px;\n padding: 14px 16px;\n border-color: color-mix(in srgb, var(--pm-accent) 26%, var(--pm-line));\n background: color-mix(in srgb, var(--pm-accent-soft) 42%, var(--pm-surface));\n}\n.pm-plan-stale-ic {\n display: grid;\n flex: 0 0 32px;\n width: 32px;\n height: 32px;\n place-items: center;\n border-radius: 10px;\n background: var(--pm-accent-soft);\n color: var(--pm-accent-text);\n}\n.pm-plan-stale-main { flex: 1; min-width: 0; }\n.pm-plan-stale-title { color: var(--pm-ink); font-size: 13px; font-weight: 600; }\n.pm-plan-stale-desc { margin-top: 2px; color: var(--pm-ink-3); font-size: 11.5px; line-height: 1.5; }\n\n.pm-pet-hint { margin-top: 2px; color: var(--pm-ink-3); font-size: 9.5px; }\n.pm-ai-stage { height: 92px; margin-top: 8px; }\n.pm-ai-stage .pm-stage-ring.is-one { width: 72px; height: 72px; }\n.pm-ai-stage .pm-stage-ring.is-two { width: 98px; height: 98px; }\n.pm-stage-core {\n position: absolute;\n inset: 0;\n margin: auto;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--stage-a);\n box-shadow: 0 0 18px color-mix(in srgb, var(--stage-a) 60%, transparent);\n opacity: 0.55;\n animation: pm-stage-core 2.8s ease-in-out infinite;\n}\n@keyframes pm-stage-core {\n 0%, 100% { transform: scale(0.7); opacity: 0.28; }\n 50% { transform: scale(1.5); opacity: 0.8; }\n}\n.pm-ai-stage.is-working .pm-stage-core { animation-duration: 1.2s; }\n\n/* Effects follow the AI task, not the model vendor. */\n.pm-stage-scan {\n position: absolute;\n right: 12px;\n left: 12px;\n height: 1px;\n background: linear-gradient(90deg, transparent, var(--stage-a), transparent);\n opacity: 0;\n}\n.pm-stage-typing {\n position: absolute;\n bottom: 15px;\n left: 50%;\n display: flex;\n transform: translateX(-50%);\n gap: 4px;\n opacity: 0;\n}\n.pm-stage-typing i {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: var(--stage-a);\n}\n.pm-ai-stage.is-task-topics .pm-stage-scan { opacity: 0.7; animation: pm-task-scan 2.2s ease-in-out infinite; }\n.pm-ai-stage.is-task-topics .pm-stage-ring.is-one { animation: pm-task-pulse 2.2s ease-out infinite; }\n.pm-ai-stage.is-task-topics .pm-stage-ring.is-two { animation: pm-task-pulse 2.2s ease-out 0.7s infinite; }\n.pm-ai-stage.is-task-topics .pm-stage-core { animation: pm-task-blink 1.1s ease-in-out infinite; }\n.pm-ai-stage.is-task-plan .pm-stage-ring.is-one { animation: pm-task-plan-ring 3.2s ease-in-out infinite; }\n.pm-ai-stage.is-task-plan .pm-stage-ring.is-two { animation: pm-task-plan-ring 3.2s ease-in-out 0.5s infinite; }\n.pm-ai-stage.is-task-plan .pm-stage-core { animation: pm-task-plan-core 3.2s ease-in-out infinite; }\n.pm-ai-stage.is-task-script .pm-stage-scan { opacity: 0.7; animation: pm-task-type-line 1.6s linear infinite; }\n.pm-ai-stage.is-task-script .pm-stage-ring { animation: pm-task-drift 6s ease-in-out infinite; }\n.pm-ai-stage.is-task-script .pm-stage-typing { opacity: 1; }\n.pm-ai-stage.is-task-script .pm-stage-typing i { animation: pm-task-dot 1.1s ease-in-out infinite; }\n.pm-ai-stage.is-task-script .pm-stage-typing i:nth-child(2) { animation-delay: 0.16s; }\n.pm-ai-stage.is-task-script .pm-stage-typing i:nth-child(3) { animation-delay: 0.32s; }\n.pm-ai-stage.is-task-review .pm-stage-typing { opacity: 1; bottom: 16px; }\n.pm-ai-stage.is-task-review .pm-stage-typing i { animation: pm-task-dot 1.4s ease-in-out infinite; }\n.pm-ai-stage.is-task-review .pm-stage-typing i:nth-child(2) { animation-delay: 0.22s; }\n.pm-ai-stage.is-task-review .pm-stage-typing i:nth-child(3) { animation-delay: 0.44s; }\n.pm-ai-stage.is-task-review .pm-stage-ring { animation: pm-task-review-ring 4s ease-in-out infinite; }\n.pm-ai-stage.is-task-review .pm-stage-spark { animation: pm-task-review-dot 2.4s ease-in-out infinite; }\n.pm-ai-stage.is-task-review .pm-stage-core { opacity: 0.25; animation: none; }\n.pm-pet.is-task-topics.is-working .pm-pet-head { animation: pm-pet-bounce 0.85s cubic-bezier(0.45, 0, 0.55, 1) infinite; }\n.pm-pet.is-task-plan.is-working .pm-pet-head { animation: pm-pet-breathe 1.6s ease-in-out infinite; }\n.pm-pet.is-task-script.is-working .pm-pet-head { animation: pm-pet-tilt 1.1s ease-in-out infinite; }\n.pm-pet.is-task-review.is-working .pm-pet-head { animation: pm-pet-wobble 1.25s ease-in-out infinite; }\n@keyframes pm-task-scan { 0% { top: 14%; opacity: 0; } 15% { opacity: 0.7; } 85% { opacity: 0.7; } 100% { top: 86%; opacity: 0; } }\n@keyframes pm-task-pulse { 0% { transform: scale(0.72); opacity: 0; } 35% { opacity: 0.9; } 100% { transform: scale(1.16); opacity: 0; } }\n@keyframes pm-task-blink { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.5); } }\n@keyframes pm-task-plan-ring { 0%, 100% { transform: scale(0.92); opacity: 0.25; } 50% { transform: scale(1.05); opacity: 0.7; } }\n@keyframes pm-task-plan-core { 0%, 100% { transform: scale(0.9); opacity: 0.35; } 50% { transform: scale(1.8); opacity: 0.9; } }\n@keyframes pm-task-type-line { 0% { top: 18%; opacity: 0; } 12% { opacity: 0.7; } 88% { opacity: 0.7; } 100% { top: 82%; opacity: 0; } }\n@keyframes pm-task-drift { 0%, 100% { transform: rotate(-4deg) scale(0.95); } 50% { transform: rotate(4deg) scale(1.03); } }\n@keyframes pm-task-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }\n@keyframes pm-task-review-ring { 0%, 100% { transform: scale(0.94); opacity: 0.3; } 50% { transform: scale(1.06); opacity: 0.65; } }\n@keyframes pm-task-review-dot { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 0.9; transform: scale(1.4); } }\n\n.pm-ai-card { cursor: default; }\n.pm-ai-card:hover { border-color: var(--pm-line); background: var(--pm-surface); }\n.pm-ecg {\n --ecg-a: #f37021;\n --ecg-b: #b39bff;\n position: relative;\n height: 38px;\n margin: 9px -2px 2px;\n overflow: hidden;\n border-radius: 8px;\n background: linear-gradient(180deg, color-mix(in srgb, var(--pm-surface-2) 55%, transparent), transparent 78%);\n}\n.pm-ecg.is-deepseek { --ecg-a: #f37021; --ecg-b: #b39bff; }\n.pm-ecg.is-openai { --ecg-a: #7aa2ff; --ecg-b: #a78bfa; }\n.pm-ecg.is-claude { --ecg-a: #d97757; --ecg-b: #f0b38a; }\n.pm-ecg.is-gemini { --ecg-a: #8ab4f8; --ecg-b: #c58af9; }\n.pm-ecg.is-qwen { --ecg-a: #a78bfa; --ecg-b: #f0abfc; }\n.pm-ecg svg { display: block; width: 100%; height: 100%; overflow: visible; }\n.pm-ecg-base, .pm-ecg-pulse { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }\n.pm-ecg-base { stroke: color-mix(in srgb, var(--ecg-a) 17%, transparent); stroke-width: 1; }\n.pm-ecg-pulse {\n stroke: var(--ecg-a);\n stroke-width: 1.5;\n stroke-dasharray: 30 220;\n stroke-dashoffset: 0;\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ecg-a) 65%, transparent));\n animation: pm-ecg-run 3s linear infinite;\n}\n.pm-ecg.is-task-idle .pm-ecg-pulse { stroke-dasharray: 16 220; animation-duration: 6.5s; opacity: 0.45; }\n.pm-ecg.is-task-topics .pm-ecg-pulse { stroke-dasharray: 38 220; animation-duration: 1.8s; }\n.pm-ecg.is-task-plan .pm-ecg-pulse { stroke-dasharray: 54 220; animation-duration: 3.4s; stroke: var(--ecg-b); }\n.pm-ecg.is-task-script .pm-ecg-pulse { stroke-dasharray: 20 220; animation-duration: 2.1s; }\n.pm-ecg.is-task-review .pm-ecg-pulse { stroke-dasharray: 26 220; animation-duration: 4.2s; stroke: var(--ecg-b); }\n.pm-ecg.is-working { background: linear-gradient(180deg, color-mix(in srgb, var(--ecg-a) 8%, transparent), transparent 82%); }\n@keyframes pm-ecg-run { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -250; } }\n\n.pm-nav-tail { display: flex; align-items: center; justify-content: flex-end; min-width: 34px; margin-left: auto; gap: 4px; }\n.pm-nav-count { min-width: 24px; height: 20px; font-size: 10.5px; }\n.pm-nav-count--violet { background: color-mix(in srgb, var(--pm-ok) 18%, transparent); color: var(--pm-ok); }\n.pm-nav-state { color: #ff7a7a; font-size: 9px; font-weight: 500; white-space: nowrap; }\n.pm-sidebar.is-collapsed .pm-nav-tail { position: absolute; top: 3px; right: 4px; min-width: 0; margin: 0; }\n.pm-sidebar.is-collapsed .pm-nav-state { display: none; }\n\n.pm-plan-card { padding: 22px; }\n.pm-plan-card h3 { font-size: 17px; }\n.pm-plan-lead { font-size: 13.8px; line-height: 1.7; }\n.pm-plan-card li { font-size: 14px; line-height: 1.78; }\n.pm-plan-card li + li { margin-top: 7px; }\n.pm-plan-card.is-placeholder { background: color-mix(in srgb, var(--pm-surface) 72%, transparent); box-shadow: none; }\n.pm-plan-card.is-placeholder h3 { color: var(--pm-ink-2); }\n.pm-plan-placeholder { margin: 0; color: var(--pm-ink-3); font-size: 13.2px; line-height: 1.7; }\n\n.pm-nav-dot {\n width: 6px;\n height: 6px;\n margin-right: 9px;\n border-radius: 50%;\n background: var(--pm-accent);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--pm-accent) 13%, transparent);\n}\n.pm-sidebar.is-collapsed .pm-nav-dot { margin: 0; }\n\n.pm-nav-flag {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 22px;\n padding: 0 8px;\n border: 1px solid color-mix(in srgb, var(--pm-accent) 26%, transparent);\n border-radius: 7px;\n background: color-mix(in srgb, var(--pm-accent) 7%, transparent);\n color: var(--pm-accent-text);\n font-size: 10.5px;\n font-weight: 600;\n letter-spacing: 0.02em;\n white-space: nowrap;\n}\n.pm-sidebar.is-collapsed .pm-nav-flag { display: none; }\n\n/* Give the collapsed rail more breathing room. */\n.pm-sidebar.is-collapsed {\n flex-basis: 84px;\n width: 84px;\n padding: 20px 13px 16px;\n}\n.pm-sidebar.is-collapsed .pm-brand {\n gap: 10px;\n padding: 0 0 20px;\n}\n.pm-sidebar.is-collapsed .pm-nav {\n gap: 8px;\n}\n.pm-sidebar.is-collapsed .pm-nav-btn {\n height: 46px;\n padding: 0;\n border-radius: 12px;\n}\n.pm-sidebar.is-collapsed .pm-nav-count,\n.pm-sidebar.is-collapsed .pm-nav-flag {\n display: none;\n}\n.pm-sidebar.is-collapsed .pm-side-compact {\n width: 40px;\n height: 40px;\n}\n@media (max-width: 900px) {\n .pm-sidebar.is-collapsed { flex-basis: 80px; width: 80px; padding-right: 11px; padding-left: 11px; }\n}\n\n/* Collapsed logo and toggle should read as one block, not two islands. */\n.pm-sidebar.is-collapsed .pm-brand {\n gap: 4px;\n padding-bottom: 18px;\n}\n\n.pm-sidebar.is-collapsed .pm-brand {\n gap: 16px;\n padding-bottom: 20px;\n}\n\n/* Working state is faster and carries a small electric arc. */\n.pm-ecg.is-working.is-task-topics .pm-ecg-pulse { animation-duration: 0.9s; stroke-dasharray: 44 220; }\n.pm-ecg.is-working.is-task-plan .pm-ecg-pulse { animation-duration: 1.15s; stroke-dasharray: 60 220; }\n.pm-ecg.is-working.is-task-script .pm-ecg-pulse { animation-duration: 0.95s; stroke-dasharray: 26 220; }\n.pm-ecg.is-working.is-task-review .pm-ecg-pulse { animation-duration: 1.5s; stroke-dasharray: 32 220; }\n.pm-ecg.is-working .pm-ecg-pulse { stroke-width: 1.8; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--ecg-a) 80%, transparent)); }\n.pm-ecg.is-working .pm-ecg-base { stroke: color-mix(in srgb, var(--ecg-a) 30%, transparent); }\n.pm-ecg-bolt {\n position: absolute;\n z-index: 2;\n width: 12px;\n height: 25px;\n background: linear-gradient(180deg, #fff, var(--ecg-b));\n clip-path: polygon(58% 0%, 28% 48%, 50% 48%, 34% 100%, 80% 38%, 56% 38%, 78% 0%);\n filter: drop-shadow(0 0 6px var(--ecg-a));\n opacity: 0;\n pointer-events: none;\n will-change: opacity, transform;\n}\n.pm-ecg-bolt.is-a { top: 0; right: 23%; }\n.pm-ecg-bolt.is-b { right: 63%; bottom: 0; width: 8px; height: 17px; transform: scaleX(-1); }\n.pm-ecg.is-working .pm-ecg-bolt.is-a { animation: pm-ecg-bolt 1.1s steps(1, end) infinite; }\n.pm-ecg.is-working .pm-ecg-bolt.is-b { animation: pm-ecg-bolt 1.35s steps(1, end) 0.32s infinite; }\n@keyframes pm-ecg-bolt {\n 0%, 8% { opacity: 0; transform: scale(0.6) translateY(2px); }\n 10% { opacity: 1; transform: scale(1.1) translateY(0); }\n 16% { opacity: 0.15; }\n 20% { opacity: 0.95; }\n 30% { opacity: 0; }\n 100% { opacity: 0; }\n}\n\n/* Real electric arcs, not a static bolt icon. */\n.pm-ecg-arc {\n fill: none;\n stroke: color-mix(in srgb, #fff 38%, var(--ecg-a));\n stroke-width: 1.35;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 26 26;\n stroke-dashoffset: 26;\n opacity: 0;\n filter: drop-shadow(0 0 4px var(--ecg-a));\n}\n.pm-ecg-spark {\n fill: #fff;\n opacity: 0;\n filter: drop-shadow(0 0 4px var(--ecg-a));\n}\n.pm-ecg.is-working .pm-ecg-arc.is-a { animation: pm-ecg-arc 0.62s steps(1, end) infinite; }\n.pm-ecg.is-working .pm-ecg-arc.is-b { animation: pm-ecg-arc 0.74s steps(1, end) 0.18s infinite; }\n.pm-ecg.is-working .pm-ecg-arc.is-c { animation: pm-ecg-arc 0.86s steps(1, end) 0.36s infinite; }\n.pm-ecg.is-working .pm-ecg-spark.is-a { animation: pm-ecg-spark 0.62s steps(1, end) infinite; }\n.pm-ecg.is-working .pm-ecg-spark.is-b { animation: pm-ecg-spark 0.74s steps(1, end) 0.18s infinite; }\n@keyframes pm-ecg-arc {\n 0%, 62%, 100% { opacity: 0; stroke-dashoffset: 26; }\n 4% { opacity: 1; stroke-dashoffset: 0; }\n 10% { opacity: 0.12; }\n 14% { opacity: 1; }\n 26% { opacity: 0; }\n}\n@keyframes pm-ecg-spark {\n 0%, 60%, 100% { opacity: 0; transform: scale(0.5); transform-origin: center; }\n 5% { opacity: 1; transform: scale(1.8); }\n 16% { opacity: 0; transform: scale(0.8); }\n}\n\n.pm-ecg::after {\n position: absolute;\n inset: 0;\n background: radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.16), transparent 32%);\n opacity: 0;\n content: "";\n pointer-events: none;\n}\n.pm-ecg.is-working::after { animation: pm-ecg-screenflash 1.1s steps(1, end) infinite; }\n@keyframes pm-ecg-screenflash {\n 0%, 12%, 100% { opacity: 0; }\n 4% { opacity: 0.7; }\n 8% { opacity: 0.15; }\n}\n\n.pm-avatar--img { object-fit: cover; border-radius: 12px; }\n';
|
|
2092
|
+
|
|
2093
|
+
// client/src/index.jsx
|
|
2094
|
+
window.__ModuleLoader__.load({
|
|
2095
|
+
id: "@pomelolabs/leads",
|
|
2096
|
+
factory(require2) {
|
|
2097
|
+
if (!window.__POMELO_TOKEN__ && typeof window.fetch === "function") {
|
|
2098
|
+
let attempts = 0;
|
|
2099
|
+
const reconnect = async () => {
|
|
2100
|
+
if (window.__POMELO_TOKEN__) return;
|
|
2101
|
+
attempts += 1;
|
|
2102
|
+
try {
|
|
2103
|
+
const streamBase = window.__DSH_TRANSPORT__?.streamBaseUrl;
|
|
2104
|
+
const injectedRpc = window.__POMELO_RPC__;
|
|
2105
|
+
const probeUrl = window.location.protocol === "dsh-app:" ? new URL("/pomelo-rpc/token", window.location.origin).toString() : injectedRpc && !String(injectedRpc).startsWith("dsh-app:") ? `${injectedRpc}/token` : new URL("/pomelo-rpc/token", streamBase || window.location.origin).toString();
|
|
2106
|
+
const response = await fetch(probeUrl, { cache: "no-store" });
|
|
2107
|
+
if (response.ok) {
|
|
2108
|
+
const data = await response.json();
|
|
2109
|
+
if (data?.token && !window.__POMELO_TOKEN__) {
|
|
2110
|
+
window.__POMELO_TOKEN__ = data.token;
|
|
2111
|
+
window.location.reload();
|
|
2112
|
+
return;
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
} catch {
|
|
2116
|
+
}
|
|
2117
|
+
if (attempts < 4) window.setTimeout(reconnect, 1500);
|
|
2118
|
+
};
|
|
2119
|
+
reconnect();
|
|
2120
|
+
}
|
|
2121
|
+
const React = require2("react");
|
|
2122
|
+
const App = createApp(React, styles_default);
|
|
2123
|
+
function PomeloIcon({ size = 20 }) {
|
|
2124
|
+
const edge = 26;
|
|
2125
|
+
return /* @__PURE__ */ React.createElement(
|
|
2126
|
+
"svg",
|
|
2127
|
+
{
|
|
2128
|
+
width: edge,
|
|
2129
|
+
height: edge,
|
|
2130
|
+
viewBox: "0 0 64 64",
|
|
2131
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
2132
|
+
"aria-hidden": "true",
|
|
2133
|
+
focusable: "false",
|
|
2134
|
+
style: { display: "block", overflow: "visible" }
|
|
2135
|
+
},
|
|
2136
|
+
/* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", { id: "pm-dsh-body", x1: "32", y1: "16", x2: "32", y2: "62", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ React.createElement("stop", { stopColor: "#FFC24D" }), /* @__PURE__ */ React.createElement("stop", { offset: "0.5", stopColor: "#F37021" }), /* @__PURE__ */ React.createElement("stop", { offset: "1", stopColor: "#D9540C" })), /* @__PURE__ */ React.createElement("linearGradient", { id: "pm-dsh-leaf", x1: "28", y1: "1", x2: "46", y2: "14", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ React.createElement("stop", { stopColor: "#FFD36A" }), /* @__PURE__ */ React.createElement("stop", { offset: "1", stopColor: "#E86A00" })), /* @__PURE__ */ React.createElement("style", null, `
|
|
2137
|
+
@keyframes pmDshBounce {
|
|
2138
|
+
0%, 100% { transform: translateY(0) scale(1, 1); }
|
|
2139
|
+
14% { transform: translateY(1px) scale(1.025, 0.975); }
|
|
2140
|
+
34% { transform: translateY(-3px) scale(0.99, 1.01); }
|
|
2141
|
+
52% { transform: translateY(0) scale(1.02, 0.98); }
|
|
2142
|
+
68% { transform: translateY(-1px) scale(1, 1); }
|
|
2143
|
+
82% { transform: translateY(0) scale(1.01, 0.99); }
|
|
2144
|
+
}
|
|
2145
|
+
.pm-dsh-fruit {
|
|
2146
|
+
transform-box: fill-box;
|
|
2147
|
+
transform-origin: 50% 92%;
|
|
2148
|
+
animation: pmDshBounce 1.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
|
|
2149
|
+
}
|
|
2150
|
+
`)),
|
|
2151
|
+
/* @__PURE__ */ React.createElement("g", { className: "pm-dsh-fruit" }, /* @__PURE__ */ React.createElement("path", { d: "M 30.45 16.23 L 26.95 16.85 L 25.30 17.46 L 23.86 18.08 L 22.62 18.70 L 21.79 19.32 L 20.76 19.94 L 19.94 20.56 L 19.11 21.18 L 18.29 21.79 L 17.26 22.41 L 16.64 23.03 L 15.81 23.65 L 14.99 24.27 L 14.37 24.89 L 13.55 25.51 L 12.93 26.12 L 12.31 26.74 L 11.69 27.36 L 11.28 27.98 L 10.66 28.60 L 10.25 29.22 L 9.63 29.84 L 9.22 30.45 L 8.80 31.07 L 8.60 31.69 L 8.19 32.31 L 7.77 32.93 L 7.57 33.55 L 7.15 34.16 L 6.95 34.78 L 6.74 35.40 L 6.33 36.02 L 6.12 36.64 L 5.92 37.26 L 5.92 37.88 L 5.71 38.49 L 5.51 39.11 L 5.51 39.73 L 5.30 40.35 L 5.30 40.97 L 5.09 41.59 L 5.09 42.21 L 5.09 42.82 L 5.09 43.44 L 5.09 44.06 L 5.09 44.68 L 5.09 45.30 L 5.09 45.92 L 5.30 46.54 L 5.30 47.15 L 5.51 47.77 L 5.71 48.39 L 5.92 49.01 L 5.92 49.63 L 6.12 50.25 L 6.54 50.87 L 6.74 51.48 L 6.95 52.10 L 7.36 52.72 L 7.77 53.34 L 7.98 53.96 L 8.60 54.58 L 9.01 55.20 L 9.42 55.81 L 10.04 56.43 L 10.66 57.05 L 11.48 57.67 L 12.10 58.29 L 13.13 58.91 L 14.16 59.53 L 15.40 60.14 L 16.85 60.76 L 18.91 61.38 L 22.82 62.00 L 41.38 62.00 L 45.30 61.38 L 47.36 60.76 L 49.01 60.14 L 50.25 59.53 L 51.28 58.91 L 52.10 58.29 L 52.93 57.67 L 53.55 57.05 L 54.16 56.43 L 54.78 55.81 L 55.20 55.20 L 55.61 54.58 L 56.02 53.96 L 56.43 53.34 L 56.85 52.72 L 57.05 52.10 L 57.46 51.48 L 57.67 50.87 L 57.88 50.25 L 58.08 49.63 L 58.29 49.01 L 58.49 48.39 L 58.49 47.77 L 58.70 47.15 L 58.70 46.54 L 58.91 45.92 L 58.91 45.30 L 58.91 44.68 L 58.91 44.06 L 58.91 43.44 L 58.91 42.82 L 58.91 42.21 L 58.91 41.59 L 58.91 40.97 L 58.70 40.35 L 58.70 39.73 L 58.49 39.11 L 58.29 38.49 L 58.29 37.88 L 58.08 37.26 L 57.88 36.64 L 57.67 36.02 L 57.46 35.40 L 57.05 34.78 L 56.85 34.16 L 56.64 33.55 L 56.23 32.93 L 55.81 32.31 L 55.61 31.69 L 55.20 31.07 L 54.78 30.45 L 54.37 29.84 L 53.75 29.22 L 53.34 28.60 L 52.72 27.98 L 52.31 27.36 L 51.69 26.74 L 51.07 26.12 L 50.45 25.51 L 49.63 24.89 L 49.01 24.27 L 48.19 23.65 L 47.36 23.03 L 46.74 22.41 L 45.92 21.79 L 45.09 21.18 L 44.06 20.56 L 43.24 19.94 L 42.41 19.32 L 41.38 18.70 L 40.14 18.08 L 38.70 17.46 L 37.05 16.85 L 33.55 16.23 Z", fill: "url(#pm-dsh-body)" }), /* @__PURE__ */ React.createElement("path", { d: "M 42.82 1.00 L 38.29 1.62 L 36.43 2.24 L 35.20 2.86 L 34.16 3.47 L 33.34 4.09 L 32.52 4.71 L 31.90 5.33 L 31.28 5.95 L 30.87 6.57 L 30.25 7.19 L 29.84 7.80 L 29.63 8.42 L 29.22 9.04 L 29.01 9.66 L 28.80 10.28 L 28.60 10.90 L 28.39 11.52 L 28.19 12.13 L 28.19 12.75 L 27.98 13.37 L 28.19 13.58 L 28.39 13.58 L 30.04 13.37 L 34.99 12.75 L 37.26 12.13 L 38.91 11.52 L 40.14 10.90 L 41.18 10.28 L 42.00 9.66 L 42.62 9.04 L 43.03 8.42 L 43.65 7.80 L 43.86 7.19 L 44.27 6.57 L 44.47 5.95 L 44.89 5.33 L 45.09 4.71 L 45.30 4.09 L 45.30 3.47 L 45.51 2.86 L 45.51 2.24 L 45.71 1.62 L 42.82 1.00 Z", fill: "url(#pm-dsh-leaf)" }))
|
|
2152
|
+
);
|
|
2153
|
+
}
|
|
2154
|
+
return {
|
|
2155
|
+
inject: ["slots"],
|
|
2156
|
+
apply(ctx) {
|
|
2157
|
+
let collapsedShellSidebar = false;
|
|
2158
|
+
const findShellSidebar = () => {
|
|
2159
|
+
const nodes = [...document.querySelectorAll("aside, nav, div")].filter((el) => {
|
|
2160
|
+
if (el.closest(".pm-root")) return false;
|
|
2161
|
+
const text = el.textContent || "";
|
|
2162
|
+
if (!text.includes("\u63D2\u4EF6\u5E02\u573A") || !text.includes("\u65B0\u4F1A\u8BDD")) return false;
|
|
2163
|
+
const rect = el.getBoundingClientRect();
|
|
2164
|
+
return rect.width > 120 && rect.height > 280 && rect.left < 24;
|
|
2165
|
+
});
|
|
2166
|
+
nodes.sort((a, b) => a.getBoundingClientRect().width - b.getBoundingClientRect().width);
|
|
2167
|
+
return nodes[0] || null;
|
|
2168
|
+
};
|
|
2169
|
+
function PomeloMain(props) {
|
|
2170
|
+
React.useEffect(() => {
|
|
2171
|
+
let disposed = false;
|
|
2172
|
+
let entered = false;
|
|
2173
|
+
let attempts = 0;
|
|
2174
|
+
let interval = 0;
|
|
2175
|
+
const enter = () => {
|
|
2176
|
+
if (disposed || entered) return;
|
|
2177
|
+
attempts += 1;
|
|
2178
|
+
const layout = ctx.get?.("layout");
|
|
2179
|
+
if (!layout || typeof layout.toggleSidebar !== "function") {
|
|
2180
|
+
if (attempts > 30) window.clearInterval(interval);
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
const root = document.querySelector(".pm-root");
|
|
2184
|
+
if (!root || root.getBoundingClientRect().width < 240) return;
|
|
2185
|
+
const shell = findShellSidebar();
|
|
2186
|
+
if (!shell) return;
|
|
2187
|
+
entered = true;
|
|
2188
|
+
collapsedShellSidebar = true;
|
|
2189
|
+
window.clearInterval(interval);
|
|
2190
|
+
layout.toggleSidebar();
|
|
2191
|
+
};
|
|
2192
|
+
interval = window.setInterval(enter, 150);
|
|
2193
|
+
enter();
|
|
2194
|
+
return () => {
|
|
2195
|
+
disposed = true;
|
|
2196
|
+
window.clearInterval(interval);
|
|
2197
|
+
if (!collapsedShellSidebar) return;
|
|
2198
|
+
collapsedShellSidebar = false;
|
|
2199
|
+
window.setTimeout(() => {
|
|
2200
|
+
try {
|
|
2201
|
+
const layout = ctx.get?.("layout");
|
|
2202
|
+
if (layout && typeof layout.toggleSidebar === "function" && !findShellSidebar()) layout.toggleSidebar();
|
|
2203
|
+
} catch {
|
|
2204
|
+
}
|
|
2205
|
+
}, 30);
|
|
2206
|
+
};
|
|
2207
|
+
}, []);
|
|
2208
|
+
return React.createElement(App, props);
|
|
2209
|
+
}
|
|
2210
|
+
ctx.slots.inject(
|
|
2211
|
+
"sidebar.panellist",
|
|
2212
|
+
() => ctx.slots.register(
|
|
2213
|
+
{
|
|
2214
|
+
name: "sidebar.panellist",
|
|
2215
|
+
id: "pomelo",
|
|
2216
|
+
order: 20,
|
|
2217
|
+
label: "\u67DA\u5BA2"
|
|
2218
|
+
},
|
|
2219
|
+
PomeloIcon
|
|
2220
|
+
)
|
|
2221
|
+
);
|
|
2222
|
+
ctx.slots.inject(
|
|
2223
|
+
"main",
|
|
2224
|
+
() => ctx.slots.register(
|
|
2225
|
+
{
|
|
2226
|
+
name: "main",
|
|
2227
|
+
key: "pomelo"
|
|
2228
|
+
},
|
|
2229
|
+
PomeloMain
|
|
2230
|
+
)
|
|
2231
|
+
);
|
|
2232
|
+
}
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
})();
|