diff --git a/.gitignore b/.gitignore index c01a338..e554f74 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,12 @@ node_modules/ edict/frontend/node_modules/ *.tsbuildinfo +# Vite cache +.vite/ + +# IDE +.vscode/ + # Backups *.bak* data diff --git a/.vite/deps/_metadata.json b/.vite/deps/_metadata.json deleted file mode 100644 index 0c4a99b..0000000 --- a/.vite/deps/_metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "hash": "2321d508", - "configHash": "3e6eab4b", - "lockfileHash": "e3b0c442", - "browserHash": "5408e294", - "optimized": {}, - "chunks": {} -} \ No newline at end of file diff --git a/.vite/deps/package.json b/.vite/deps/package.json deleted file mode 100644 index 3dbc1ca..0000000 --- a/.vite/deps/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f5d69d8..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - // 使用 frontend 项目自带的 TypeScript,确保 moduleResolution:"bundler" 生效 - "typescript.tsdk": "edict/frontend/node_modules/typescript/lib", - // 让 VS Code 优先使用工作区 TypeScript 而非内置版本 - "typescript.enablePromptUseWorkspaceTsdk": true -} diff --git a/Edict Agent Architecture.pdf b/Edict Agent Architecture.pdf deleted file mode 100644 index f135f88..0000000 Binary files a/Edict Agent Architecture.pdf and /dev/null differ diff --git a/dashboard/dist/assets/index-BTnShicZ.css b/dashboard/dist/assets/index-BTnShicZ.css deleted file mode 100644 index cd77f51..0000000 --- a/dashboard/dist/assets/index-BTnShicZ.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.-inset-2{top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.inset-0{top:0;right:0;bottom:0;left:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-50{z-index:50}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.min-h-\[320px\]{min-height:320px}.w-10{width:2.5rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[80\%\]{max-width:80%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize-none{resize:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[var\(--acc\)\]{border-color:var(--acc)}.border-\[var\(--line\)\]{border-color:var(--line)}.border-amber-600\/30{border-color:#d977064d}.border-amber-600\/40{border-color:#d9770666}.border-amber-700\/30{border-color:#b453094d}.border-amber-800\/40{border-color:#92400e66}.border-cyan-600\/40{border-color:#0891b266}.border-cyan-700\/20{border-color:#0e749033}.border-cyan-700\/30{border-color:#0e74904d}.border-cyan-800\/40{border-color:#155e7566}.border-emerald-700\/20{border-color:#04785733}.border-green-600\/40{border-color:#16a34a66}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.border-purple-600\/40{border-color:#9333ea66}.border-purple-700\/30{border-color:#7e22ce4d}.bg-\[var\(--acc\)\]{background-color:var(--acc)}.bg-\[var\(--panel\)\]{background-color:var(--panel)}.bg-\[var\(--panel2\)\]{background-color:var(--panel2)}.bg-black\/30{background-color:#0000004d}.bg-cyan-900\/20{background-color:#164e6333}.bg-green-900\/20{background-color:#14532d33}.bg-green-900\/40{background-color:#14532d66}.bg-purple-950\/40{background-color:#3b076466}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-400{--tw-gradient-from: #fbbf24 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 191 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-600{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-800\/40{--tw-gradient-from: rgb(146 64 14 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(146 64 14 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-900\/30{--tw-gradient-from: rgb(120 53 15 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(120 53 15 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-900\/40{--tw-gradient-from: rgb(120 53 15 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(120 53 15 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-amber-950\/40{--tw-gradient-from: rgb(69 26 3 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(69 26 3 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-600{--tw-gradient-from: #0891b2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-950\/30{--tw-gradient-from: rgb(8 51 68 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(8 51 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-950\/40{--tw-gradient-from: rgb(8 51 68 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(8 51 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-emerald-950\/30{--tw-gradient-from: rgb(2 44 34 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(2 44 34 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-purple-900\/30{--tw-gradient-to: rgb(88 28 135 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(88 28 135 / .3) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-amber-800\/20{--tw-gradient-to: rgb(146 64 14 / .2) var(--tw-gradient-to-position)}.to-amber-900\/30{--tw-gradient-to: rgb(120 53 15 / .3) var(--tw-gradient-to-position)}.to-amber-950\/40{--tw-gradient-to: rgb(69 26 3 / .4) var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-blue-950\/20{--tw-gradient-to: rgb(23 37 84 / .2) var(--tw-gradient-to-position)}.to-blue-950\/30{--tw-gradient-to: rgb(23 37 84 / .3) var(--tw-gradient-to-position)}.to-green-950\/20{--tw-gradient-to: rgb(5 46 22 / .2) var(--tw-gradient-to-position)}.to-purple-400{--tw-gradient-to: #c084fc var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position)}.to-purple-950\/30{--tw-gradient-to: rgb(59 7 100 / .3) var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.text-\[var\(--acc\)\]{color:var(--acc)}.text-\[var\(--muted\)\]{color:var(--muted)}.text-\[var\(--text\)\]{color:var(--text)}.text-amber-300\/60{color:#fcd34d99}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-cyan-300\/60{color:#67e8f999}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/80{color:#c084fccc}.text-red-400\/60{color:#f8717199}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-50{opacity:.5}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-500{transition-duration:.5s}:root{--bg: #07090f;--panel: #0f1219;--panel2: #141824;--line: #1c2236;--text: #dde4f8;--muted: #5a6b92;--ok: #2ecc8a;--warn: #f5c842;--danger: #ff5270;--acc: #6a9eff;--acc2: #a07aff}*{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);font-family:PingFang SC,Inter,-apple-system,Segoe UI,sans-serif;min-height:100vh}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#1e2538;border-radius:4px}.wrap{max-width:1400px;margin:0 auto;padding:16px}.hdr{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}.logo{font-size:20px;font-weight:800;background:linear-gradient(135deg,#6a9eff,#a07aff);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.sub-text{font-size:11px;color:var(--muted)}.hdr-r{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.chip{font-size:11px;padding:3px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted)}.chip.ok{border-color:#2ecc8a44;color:var(--ok)}.chip.warn{border-color:#f5c84244;color:var(--warn)}.chip.err{border-color:#ff527044;color:var(--danger)}.btn-refresh{font-size:11px;padding:4px 10px;border:1px solid var(--acc);border-radius:6px;background:transparent;color:var(--acc);cursor:pointer}.btn-refresh:hover{background:#0a1228}.tabs{display:flex;gap:2px;margin-bottom:18px;border-bottom:1px solid var(--line);overflow-x:auto}.tab{font-size:13px;padding:8px 16px;border-radius:8px 8px 0 0;cursor:pointer;color:var(--muted);border:1px solid transparent;border-bottom:none;white-space:nowrap;position:relative;bottom:-1px;transition:all .15s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tab:hover{color:var(--text);background:var(--panel)}.tab.active{color:var(--text);background:var(--panel);border-color:var(--line);font-weight:600}.tbadge{font-size:10px;padding:1px 5px;border-radius:999px;background:#1a2040;color:var(--acc);margin-left:4px}.edict-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}.edict-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px;cursor:pointer;transition:border-color .15s,transform .1s,box-shadow .15s}.edict-card:hover{border-color:var(--acc);transform:translateY(-2px);box-shadow:0 4px 20px #6a9eff1a}.edict-card.archived{opacity:.55;border-style:dashed}.edict-card.archived:hover{opacity:.85}.ec-pipe{display:flex;align-items:center;gap:0;margin-bottom:14px;overflow-x:auto;padding-bottom:2px}.ep-node{display:flex;flex-direction:column;align-items:center;gap:1px;padding:5px 8px;border-radius:6px;flex-shrink:0;min-width:52px}.ep-node.done{background:#0a2018}.ep-node.active{background:#0f1a38;border:1px solid var(--acc)}.ep-node.pending{opacity:.3}.ep-icon{font-size:14px}.ep-name{font-size:9px;color:var(--muted);white-space:nowrap}.ep-node.done .ep-name{color:var(--ok)}.ep-node.active .ep-name{color:var(--acc);font-weight:700}.ep-arrow{font-size:10px;color:#1c2236;padding:0 1px;flex-shrink:0}.ec-id{font-size:10px;color:var(--acc);font-weight:700;letter-spacing:.04em;margin-bottom:5px}.ec-title{font-size:15px;font-weight:700;line-height:1.4;margin-bottom:10px;color:var(--text)}.ec-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:8px}.tag{font-size:10px;padding:2px 7px;border-radius:4px;border:1px solid;display:inline-block;white-space:nowrap}.st-Inbox{border-color:#3a4a7a44;color:#7a9aff;background:#0a1028}.st-Taizi{border-color:#e8a04044;color:#e8a040;background:#281a08}.st-Zhongshu{border-color:#a07aff44;color:#a07aff;background:#110a28}.st-Menxia{border-color:#ff9a6a44;color:#ff9a6a;background:#280f0a}.st-Assigned,.st-Doing{border-color:#6a9eff44;color:#6a9eff;background:#0a1428}.st-Review{border-color:#f5c84244;color:#f5c842;background:#201a08}.st-Done{border-color:#2ecc8a44;color:var(--ok);background:#0a2018}.st-Blocked{border-color:#ff527044;color:var(--danger);background:#200a10}.st-Cancelled{border-color:#8884;color:#888;background:#1a1a1a}.st-Next{border-color:#4a9adf44;color:#4a9adf;background:#0a1424}.st-Pending{border-color:#3a4a7a44;color:#7a9aff;background:#0a1028}.dt-中书省{border-color:#a07aff44;color:#a07aff;background:#1a0f38}.dt-门下省{border-color:#6a9eff44;color:#6a9eff;background:#0f1a38}.dt-尚书省{border-color:#6aef9a44;color:#6aef9a;background:#0a2018}.dt-礼部{border-color:#f5c84244;color:#f5c842;background:#201a08}.dt-户部{border-color:#ff9a6a44;color:#ff9a6a;background:#28100a}.dt-兵部{border-color:#ff527044;color:#ff5270;background:#280a10}.dt-刑部{border-color:#c444;color:#c44;background:#280808}.dt-工部{border-color:#4af4;color:#4af;background:#081828}.ec-footer{display:flex;align-items:center;justify-content:space-between;margin-top:10px;flex-wrap:wrap;gap:6px}.hb{font-size:10px;padding:2px 7px;border-radius:999px;border:1px solid var(--line)}.hb.active{border-color:#2ecc8a44;color:var(--ok)}.hb.warn{border-color:#f5c84244;color:var(--warn)}.hb.stalled{border-color:#ff527044;color:var(--danger);animation:pulse 1.5s infinite}.hb.unknown{color:var(--muted)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.4}}.modal-bg{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;z-index:100;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);overflow-y:auto;display:flex;align-items:flex-start;justify-content:center;padding:40px 16px}.modal{background:var(--panel);border:1px solid var(--line);border-radius:18px;width:100%;max-width:760px;padding:28px;position:relative;box-shadow:0 20px 60px #0009}.modal-close{position:absolute;top:16px;right:16px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;font-size:18px;color:var(--muted);background:none;border:none}.modal-close:hover{background:var(--panel2);color:var(--text)}.modal-id{font-size:11px;color:var(--acc);font-weight:700;letter-spacing:.04em;margin-bottom:6px}.modal-title{font-size:22px;font-weight:800;line-height:1.3;margin-bottom:18px}.m-pipe{display:flex;align-items:stretch;gap:0;overflow-x:auto;padding:16px;background:var(--panel2);border-radius:12px;margin-bottom:20px}.mp-stage{display:flex;align-items:center;flex-shrink:0}.mp-node{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 14px;border-radius:10px;min-width:80px;position:relative}.mp-node.done{background:#0a2018;border:1px solid #2ecc8a44}.mp-node.active{background:#0f1838;border:2px solid var(--acc);box-shadow:0 0 14px #6a9eff33}.mp-node.pending{opacity:.25;border:1px dashed var(--line)}.mp-icon{font-size:22px}.mp-dept{font-size:12px;font-weight:700;margin-top:2px}.mp-node.done .mp-dept{color:var(--ok)}.mp-node.active .mp-dept{color:var(--acc)}.mp-node.pending .mp-dept{color:var(--muted)}.mp-action{font-size:10px;color:var(--muted);margin-top:1px}.mp-node.active .mp-action{color:#6a9eff88}.mp-done-tick{position:absolute;top:-6px;right:-6px;width:16px;height:16px;background:var(--ok);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;color:#000;font-weight:700}.mp-arrow{color:#1c2236;font-size:18px;padding:0 6px;margin-top:-10px}.cur-stage{display:flex;align-items:center;gap:10px;padding:12px 16px;background:#0a1228;border:1px solid var(--acc);border-radius:10px;margin-bottom:18px}.cs-icon{font-size:24px}.cs-info .cs-dept{font-size:16px;font-weight:700;color:var(--acc)}.cs-info .cs-action{font-size:12px;color:var(--muted);margin-top:2px}.cs-hb{margin-left:auto}.m-section{margin-bottom:18px}.m-sec-label{font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--line)}.fl-timeline{display:flex;flex-direction:column;gap:0;position:relative}.fl-timeline:before{content:"";position:absolute;left:60px;top:0;bottom:0;width:1px;background:var(--line)}.fl-item{display:flex;gap:0;position:relative;padding:8px 0}.fl-time{min-width:60px;font-size:10px;color:var(--muted);text-align:right;padding-right:14px;flex-shrink:0;padding-top:3px}.fl-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;margin-top:3px;position:relative;z-index:1}.fl-content{padding-left:12px;flex:1}.fl-who{font-size:12px;margin-bottom:2px}.fl-who .from,.fl-who .to{font-weight:700}.fl-rem{font-size:11px;color:var(--muted);line-height:1.5}.m-rows{display:grid;grid-template-columns:1fr 1fr;gap:8px}.m-row{background:var(--panel2);border-radius:8px;padding:10px 12px}.mr-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}.mr-val{font-size:13px;font-weight:600;word-break:break-all}.duty-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:12px}.duty-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden;transition:border-color .15s}.duty-card:hover{border-color:#2e3d6a}.duty-card.active-card{border-color:var(--acc)}.duty-card.blocked-card{border-color:#ff527055}.dc-hdr{display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--panel2);border-bottom:1px solid var(--line)}.dc-emoji{font-size:22px}.dc-info{flex:1}.dc-name{font-size:14px;font-weight:800}.dc-role{font-size:10px;color:var(--muted)}.dc-status{display:flex;align-items:center;gap:5px;font-size:11px}.dc-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dc-dot.active{background:var(--ok)}.dc-dot.busy{background:var(--warn);animation:pulse 1.5s infinite}.dc-dot.blocked{background:var(--danger);animation:pulse 1s infinite}.dc-dot.idle{background:#2a3a5a}.dc-body{padding:14px 16px}.dc-idle{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;padding:6px 0}.dc-task{display:flex;flex-direction:column;gap:6px;cursor:pointer;padding:6px;border-radius:8px;border:1px solid var(--line);margin-bottom:6px}.dc-task:hover{border-color:var(--acc)}.dc-task-id{font-size:10px;color:var(--acc);font-weight:700;letter-spacing:.04em}.dc-task-title{font-size:14px;font-weight:700;color:var(--text);line-height:1.3}.dc-task-now{font-size:12px;color:var(--muted);line-height:1.5;margin-top:2px}.dc-task-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px}.dc-footer{padding:8px 16px;border-top:1px solid var(--line);display:flex;align-items:center;gap:8px;background:var(--panel2)}.dc-model{font-size:10px;color:var(--muted)}.dc-la{font-size:10px;color:var(--muted);margin-left:auto}.as-panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin-bottom:16px}.as-header{display:flex;align-items:center;gap:10px;margin-bottom:12px}.as-title{font-size:13px;font-weight:700}.as-gw{font-size:11px;padding:3px 10px;border-radius:999px;margin-left:auto}.as-gw.ok{background:#0a2018;border:1px solid #2ecc8a44;color:var(--ok)}.as-gw.err{background:#200a10;border:1px solid #ff527044;color:var(--danger)}.as-gw.warn{background:#201a08;border:1px solid #f5c84244;color:var(--warn)}.as-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}.as-card{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s;position:relative}.as-card:hover{border-color:var(--acc);background:#0a1228}.as-dot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%}.as-dot.running{background:#2ecc8a;box-shadow:0 0 6px #2ecc8a88;animation:pulse 1.5s infinite}.as-dot.idle{background:#4a5568}.as-dot.offline{background:#ff5270;animation:pulse 1.2s infinite}.as-dot.unconfigured{background:#6b7280}.as-wake-btn{font-size:10px;padding:2px 8px;border-radius:6px;border:1px solid var(--acc);color:var(--acc);background:transparent;cursor:pointer;margin-top:6px;transition:background .15s}.as-wake-btn:hover{background:var(--acc);color:#fff}.as-summary{font-size:11px;color:var(--muted);display:flex;gap:12px;margin-top:10px;padding-top:8px;border-top:1px solid var(--line)}.task-actions{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}.btn-action{font-size:12px;padding:7px 16px;border-radius:8px;border:none;cursor:pointer;font-weight:700;transition:all .15s}.btn-stop{background:#ff527022;color:#ff5270;border:1px solid #ff527044}.btn-stop:hover{background:#ff527044}.btn-cancel-action{background:#8882;color:#888;border:1px solid #88888844}.btn-cancel-action:hover{background:#8884}.btn-resume{background:#2ecc8a22;color:#2ecc8a;border:1px solid #2ecc8a44}.btn-resume:hover{background:#2ecc8a44}.sched-section{margin-bottom:18px;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:12px}.sched-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.sched-title{font-size:11px;font-weight:700;letter-spacing:.06em;color:var(--acc)}.sched-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:10px}.sched-kpi{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px 10px}.sched-kpi .k{font-size:10px;color:var(--muted);margin-bottom:2px}.sched-kpi .v{font-size:13px;font-weight:700}.sched-btn{font-size:11px;padding:5px 10px;border-radius:6px;border:1px solid var(--line);background:transparent;color:var(--muted);cursor:pointer;transition:all .15s}.sched-btn:hover{border-color:var(--acc);color:var(--text)}.todo-section{margin-bottom:18px}.todo-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.todo-progress{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.todo-bar{width:120px;height:6px;background:#0e1320;border-radius:3px;overflow:hidden}.todo-bar-fill{height:100%;border-radius:3px;background:var(--ok);transition:width .3s}.todo-list{display:flex;flex-direction:column;gap:4px}.todo-item{display:flex;flex-direction:column;background:var(--panel2);border-radius:8px;font-size:12px;transition:opacity .15s}.todo-item.done{opacity:.55}.todo-item .t-row{display:flex;align-items:center;gap:8px;padding:7px 10px}.todo-item .t-icon{font-size:14px;flex-shrink:0}.todo-item .t-title{flex:1;color:var(--text)}.todo-item.done .t-title{text-decoration:line-through;color:var(--muted)}.todo-item .t-status{font-size:10px;padding:2px 6px;border-radius:4px}.todo-item .t-status.s-done{color:var(--ok);background:#0a2018;border:1px solid #2ecc8a44}.todo-item .t-status.s-progress{color:var(--acc);background:#0a1228;border:1px solid #6a9eff44}.todo-item .t-status.s-notstarted{color:var(--muted);background:var(--panel);border:1px solid var(--line)}.ec-todo-bar{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--muted);margin-top:6px}.ec-todo-track{flex:1;max-width:80px;height:4px;background:#0e1320;border-radius:2px;overflow:hidden}.ec-todo-fill{height:100%;background:var(--ok);border-radius:2px}.ec-actions{display:flex;gap:4px;margin-top:8px}.ec-actions .mini-act{font-size:10px;padding:3px 8px;border-radius:5px;border:1px solid var(--line);background:transparent;cursor:pointer;color:var(--muted);transition:all .12s}.ec-actions .mini-act:hover{border-color:var(--acc);color:var(--text)}.ec-actions .mini-act.danger:hover{border-color:#ff5270;color:#ff5270}.archive-bar{display:flex;align-items:center;gap:8px;margin-bottom:14px;flex-wrap:wrap}.ab-label{font-size:12px;color:var(--muted);margin-right:4px}.ab-btn{font-size:11px;padding:4px 12px;border-radius:6px;border:1px solid var(--line);background:transparent;cursor:pointer;color:var(--muted);transition:all .15s;font-weight:600}.ab-btn:hover{border-color:var(--acc);color:var(--text)}.ab-btn.active{border-color:var(--acc);color:var(--acc);background:#0f1a38}.ab-count{font-size:10px;color:var(--muted);margin-left:auto}.ab-scan{font-size:11px;padding:4px 12px;border-radius:6px;border:1px solid #6a9eff44;background:transparent;cursor:pointer;color:var(--acc);font-weight:600;transition:all .15s}.ab-scan:hover{background:#0a1228;border-color:var(--acc)}.ab-scan-status{font-size:10px;color:var(--muted)}.la-section{margin-bottom:18px}.la-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.la-title{font-size:11px;font-weight:700;color:var(--acc);letter-spacing:.06em}.la-log{max-height:320px;overflow-y:auto;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;font-size:12px}.la-entry{display:flex;gap:8px;align-items:flex-start;padding:5px 8px;border-radius:6px;line-height:1.5;word-break:break-all}.la-entry:hover{background:#6a9eff0a}.la-empty{text-align:center;color:var(--muted);padding:20px;font-size:12px}.model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin-bottom:18px}.mc-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px}.mc-top{display:flex;align-items:center;gap:10px;margin-bottom:12px}.mc-emoji{font-size:22px}.mc-name{font-size:15px;font-weight:700}.mc-role{font-size:11px;color:var(--muted)}.mc-cur{font-size:11px;color:var(--muted);margin-bottom:8px}.mc-cur b{color:var(--text)}.msel{width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:7px 10px;font-size:12px;outline:none;cursor:pointer}.msel:focus{border-color:var(--acc)}.mc-btns{display:flex;gap:6px;margin-top:8px}.btn{font-size:12px;padding:6px 14px;border-radius:7px;border:none;cursor:pointer;font-weight:600}.btn-p{background:var(--acc);color:#000}.btn-p:hover{filter:brightness(1.15)}.btn-p:disabled{background:#2a3a6a;color:var(--muted);cursor:not-allowed}.btn-g{background:transparent;border:1px solid var(--line);color:var(--muted)}.btn-g:hover{border-color:#2e3d6a;color:var(--text)}.cl-wrap{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px}.cl-title{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;margin-bottom:10px}.cl-row{display:flex;gap:10px;font-size:11px;padding:5px 0;border-bottom:1px solid var(--line)}.cl-row:last-child{border-bottom:none}.skills-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}.sk-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:hidden}.sk-hdr{display:flex;align-items:center;gap:9px;padding:11px 14px;background:var(--panel2);border-bottom:1px solid var(--line)}.sk-list{padding:10px}.sk-item{display:flex;gap:8px;padding:8px 10px;border-radius:7px;font-size:12px;margin-bottom:3px;cursor:pointer;border:1px solid transparent;transition:all .12s}.sk-item:hover{background:var(--panel2);border-color:var(--line)}.sess-filters{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;align-items:center}.sess-filter{font-size:11px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--muted);cursor:pointer;transition:all .12s}.sess-filter:hover{border-color:var(--acc);color:var(--text)}.sess-filter.active{border-color:var(--acc);color:var(--acc);background:#0a1228}.sess-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:10px}.sess-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px;transition:border-color .12s;cursor:pointer}.sess-card:hover{border-color:#2e3d6a}.off-activity{display:flex;align-items:center;gap:8px;padding:8px 14px;background:#0a1228;border:1px solid #1a2a4a;border-radius:10px;margin-bottom:14px;font-size:12px;flex-wrap:wrap}.off-kpi{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}.kpi{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 16px}.kpi-v{font-size:24px;font-weight:800;margin-bottom:3px}.kpi-l{font-size:11px;color:var(--muted)}.off-layout{display:grid;grid-template-columns:260px 1fr;gap:14px}@media(max-width:700px){.off-layout{grid-template-columns:1fr}.off-kpi{grid-template-columns:repeat(2,1fr)}}.off-ranklist{background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden}.orl-hdr{padding:10px 14px;background:var(--panel2);border-bottom:1px solid var(--line);font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.06em;text-transform:uppercase}.orl-item{display:flex;align-items:center;gap:10px;padding:10px 14px;cursor:pointer;border-bottom:1px solid var(--line);transition:background .1s}.orl-item:last-child{border-bottom:none}.orl-item:hover{background:var(--panel2)}.orl-item.selected{background:#0a1228;border-left:3px solid var(--acc)}.off-detail{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:22px;min-height:400px}.mem-list{display:flex;flex-direction:column;gap:8px}.mem-card{display:flex;gap:14px;align-items:flex-start;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 16px;cursor:pointer;transition:border-color .12s}.mem-card:hover{border-color:var(--acc)}.tpl-cats{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.tpl-cat{font-size:12px;padding:6px 14px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--muted);cursor:pointer;transition:all .12s}.tpl-cat:hover{border-color:var(--acc);color:var(--text)}.tpl-cat.active{border-color:var(--acc);color:var(--acc);background:#0a1228}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}.tpl-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;transition:border-color .12s;cursor:pointer;display:flex;flex-direction:column}.tpl-card:hover{border-color:var(--acc)}.mb-hdr{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:10px}.mb-title{font-size:20px;font-weight:800;background:linear-gradient(135deg,#f5c842,#ff9a4a);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.mb-sub{font-size:12px;color:var(--muted);margin-top:3px}.mb-cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}.mb-cat{background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden}.mb-cat-hdr{display:flex;align-items:center;gap:8px;padding:10px 16px;border-bottom:1px solid var(--line)}.mb-news-list{padding:10px}.mb-card{display:flex;gap:12px;padding:10px 8px;border-radius:10px;margin-bottom:6px;cursor:pointer;transition:background .12s;border-bottom:1px solid var(--line)}.mb-card:last-child{border-bottom:none}.mb-card:hover{background:var(--panel2)}.ceremony-bg{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:#07090f;display:flex;flex-direction:column;align-items:center;justify-content:center;opacity:0;animation:crmFadeIn .6s ease forwards;cursor:pointer}.ceremony-bg.out{animation:crmFadeOut .5s ease forwards}.crm-glow{position:absolute;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,rgba(106,158,255,.08),transparent 70%);animation:crmPulse 3s ease-in-out infinite}.crm-line1{font-family:"Noto Serif SC",serif;font-size:52px;font-weight:900;color:#dde4f8;letter-spacing:.15em;opacity:0;transform:translateY(20px)}.crm-line2{font-family:"Noto Serif SC",serif;font-size:22px;font-weight:700;color:var(--acc);letter-spacing:.2em;margin-top:12px;opacity:0;transform:translateY(15px)}.crm-line3{font-size:14px;color:var(--muted);margin-top:24px;opacity:0;letter-spacing:.05em}.crm-date{font-size:12px;color:#2a3555;margin-top:40px;opacity:0;letter-spacing:.08em}.crm-skip{font-size:11px;color:#2a3555;margin-top:18px;opacity:0;animation:crmChar .4s 2.5s forwards}.crm-line1.in{animation:crmSlideUp .6s .3s ease forwards}.crm-line2.in{animation:crmSlideUp .5s 1.1s ease forwards}.crm-line3.in{animation:crmSlideUp .5s 1.6s ease forwards}.crm-date.in{animation:crmChar .4s 2s ease forwards}@keyframes crmFadeIn{to{opacity:1}}@keyframes crmFadeOut{to{opacity:0;pointer-events:none}}@keyframes crmSlideUp{to{opacity:1;transform:translateY(0)}}@keyframes crmChar{to{opacity:1}}@keyframes crmPulse{0%,to{transform:scale(1);opacity:.5}50%{transform:scale(1.1);opacity:.8}}.confirm-bg{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;z-index:200;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center}.confirm-box{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:24px;max-width:420px;width:90%;box-shadow:0 20px 60px #0009}.confirm-title{font-size:16px;font-weight:700;margin-bottom:8px}.confirm-msg{font-size:13px;color:var(--muted);margin-bottom:14px;line-height:1.5}.confirm-input{width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:8px 10px;font-size:12px;outline:none;margin-bottom:14px}.confirm-input:focus{border-color:var(--acc)}.confirm-btns{display:flex;gap:8px;justify-content:flex-end}.toaster{position:fixed;bottom:20px;right:20px;display:flex;flex-direction:column;gap:8px;z-index:300;pointer-events:none}.toast{font-size:13px;padding:10px 16px;border-radius:10px;border:1px solid var(--line);background:var(--panel);color:var(--text);box-shadow:0 4px 20px #0006;animation:tin .2s;max-width:320px;pointer-events:auto}.toast.ok{border-color:#2ecc8a55;background:#0a1a10}.toast.err{border-color:#ff527055;background:#200a10}@keyframes tin{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}.sub-config{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:18px}.sub-section{margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}.sub-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.sub-sec-title{font-size:13px;font-weight:700;margin-bottom:10px}.sub-input{background:var(--panel2);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:7px 10px;font-size:12px;outline:none;min-width:0}.sub-input:focus{border-color:var(--acc)}.si-name{font-weight:600;min-width:100px}.si-desc{color:var(--muted);flex:1;line-height:1.4}.si-arrow{color:var(--muted);font-size:14px;opacity:.3;transition:opacity .12s}.sk-item:hover .si-arrow{opacity:1}.sk-emoji{font-size:18px}.sk-name{font-size:14px;font-weight:700}.sk-cnt{font-size:11px;color:var(--muted);margin-left:auto}.sk-empty{font-size:12px;color:var(--muted);padding:12px;text-align:center;opacity:.6}.sk-add{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;font-size:12px;color:var(--acc);cursor:pointer;border-top:1px solid var(--line);transition:background .12s}.sk-add:hover{background:var(--panel2)}.sk-modal-body{max-height:70vh;overflow-y:auto}.sk-md{font-size:13px;line-height:1.7;color:var(--text)}.sk-md h1,.sk-md h2,.sk-md h3{margin:16px 0 8px;color:var(--text)}.sk-md h1{font-size:18px}.sk-md h2{font-size:15px;border-bottom:1px solid var(--line);padding-bottom:6px}.sk-md h3{font-size:13px}.sk-md p{margin:6px 0}.sk-md ul,.sk-md ol{padding-left:20px;margin:6px 0}.sk-md li{margin:3px 0}.sk-md code{font-size:11px;background:var(--panel2);padding:2px 6px;border-radius:4px;font-family:monospace}.sk-md pre{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:12px;overflow-x:auto;margin:8px 0}.sk-md pre code{background:none;padding:0}.sk-md table{width:100%;border-collapse:collapse;font-size:12px;margin:8px 0}.sk-md th,.sk-md td{padding:6px 10px;border:1px solid var(--line);text-align:left}.sk-md th{background:var(--panel2)}.sk-md hr{border:none;border-top:1px solid var(--line);margin:14px 0}.sk-path{font-size:10px;color:var(--muted);padding:8px 0;word-break:break-all;border-top:1px solid var(--line);margin-top:12px}.sc-top{display:flex;align-items:center;gap:10px;margin-bottom:8px}.sc-emoji{font-size:20px}.sc-agent{font-size:13px;font-weight:700}.sc-org{font-size:11px;color:var(--muted)}.sc-title{font-size:13px;font-weight:600;margin-bottom:6px;line-height:1.4}.sc-now{font-size:11px;color:var(--muted);line-height:1.5;margin-bottom:6px}.sc-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.sc-id{font-size:10px;color:var(--acc);font-weight:600}.sc-time{font-size:10px;color:var(--muted);margin-left:auto}.mc-st{font-size:11px;margin-top:6px;padding:4px 8px;border-radius:5px;display:none}.mc-st.ok{display:block;background:#0a2018;color:var(--ok);border:1px solid #2ecc8a44}.mc-st.err{display:block;background:#200a10;color:var(--danger);border:1px solid #ff527044}.mc-st.pending{display:block;background:#0a1228;color:var(--acc);border:1px solid #6a9eff44}.cl-t{color:var(--muted);min-width:115px}.cl-a{color:var(--acc);min-width:80px}.cl-c{color:var(--muted)}.cl-c b{color:var(--text)}.cl-list{display:flex;flex-direction:column}.mem-icon{font-size:28px;flex-shrink:0;margin-top:2px}.mem-info{flex:1;min-width:0}.mem-title{font-size:14px;font-weight:700;margin-bottom:4px}.mem-sub{font-size:11px;color:var(--muted);line-height:1.5}.mem-tags{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}.mem-tag{font-size:10px;padding:2px 8px;border-radius:4px;background:var(--panel2);color:var(--muted);border:1px solid var(--line)}.mem-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0}.mem-date{font-size:10px;color:var(--muted)}.mem-cost{font-size:10px;color:var(--acc)}.mem-empty{text-align:center;padding:40px;color:var(--muted);font-size:13px}.md-timeline{position:relative;padding-left:24px;margin:16px 0}.md-timeline:before{content:"";position:absolute;left:7px;top:0;bottom:0;width:2px;background:var(--line)}.md-tl-item{position:relative;margin-bottom:14px;padding-bottom:14px;border-bottom:1px solid var(--line)}.md-tl-item:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.md-tl-dot{position:absolute;left:-20px;top:3px;width:10px;height:10px;border-radius:50%;background:var(--acc);border:2px solid var(--bg)}.md-tl-dot.green{background:var(--ok)}.md-tl-dot.yellow{background:var(--warn)}.md-tl-dot.red{background:var(--danger)}.md-tl-from{font-size:11px;font-weight:700;color:var(--acc)}.md-tl-to{font-size:11px;color:var(--muted)}.md-tl-remark{font-size:12px;margin-top:3px;line-height:1.5}.md-tl-time{font-size:10px;color:var(--muted);margin-top:2px}.tpl-top{display:flex;align-items:center;gap:10px;margin-bottom:10px}.tpl-icon{font-size:24px}.tpl-name{font-size:14px;font-weight:700}.tpl-pop{font-size:10px;color:var(--muted);margin-left:auto}.tpl-desc{font-size:12px;color:var(--muted);line-height:1.5;margin-bottom:10px;flex:1}.tpl-footer{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.tpl-dept{font-size:10px;padding:2px 6px;border-radius:4px;background:var(--panel2);color:var(--acc)}.tpl-est{font-size:10px;color:var(--muted);margin-left:auto}.tpl-go{font-size:11px;padding:5px 14px;border-radius:6px;background:var(--acc);color:#fff;border:none;cursor:pointer;font-weight:600;margin-left:8px;transition:opacity .12s}.tpl-go:hover{opacity:.85}.tpl-form{margin-top:18px}.tpl-field{margin-bottom:14px}.tpl-label{font-size:12px;font-weight:600;display:block;margin-bottom:6px}.tpl-input{width:100%;padding:10px 12px;background:var(--bg);border:1px solid var(--line);border-radius:8px;color:var(--text);font-size:13px;outline:none}.mb-img{width:72px;height:52px;border-radius:7px;-o-object-fit:cover;object-fit:cover;flex-shrink:0;background:var(--panel2);display:flex;align-items:center;justify-content:center;font-size:22px;overflow:hidden}.mb-img img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;border-radius:7px}.mb-info{flex:1;min-width:0}.mb-headline{font-size:13px;font-weight:700;line-height:1.4;margin-bottom:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mb-summary{font-size:11px;color:var(--muted);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mb-meta{display:flex;align-items:center;gap:8px;margin-top:5px}.mb-source{font-size:10px;color:var(--acc)}.mb-time{font-size:10px;color:var(--muted)}.mb-cat-icon{font-size:20px}.mb-cat-name{font-size:14px;font-weight:800}.mb-cat-cnt{font-size:11px;color:var(--muted);margin-left:auto}.mb-empty{text-align:center;padding:30px;color:var(--muted);font-size:13px}.mb-loading{display:flex;align-items:center;justify-content:center;padding:60px;color:var(--muted);font-size:14px;gap:10px}.la-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ok);margin-right:4px;animation:pulse 1.5s infinite}.la-dot.idle{background:var(--muted);animation:none}.la-agent{font-size:11px;color:var(--muted)}.la-icon{flex-shrink:0;font-size:13px;margin-top:1px}.la-body{flex:1;min-width:0}.la-time{font-size:10px;color:var(--muted);flex-shrink:0;min-width:44px;text-align:right}.la-assistant{color:var(--text)}.la-thinking{color:#a07aff;font-style:italic;opacity:.75}.la-tool{color:#4af}.la-tool-result{color:var(--muted);font-size:11px}.la-tool-result.ok{color:var(--ok)}.la-tool-result.err{color:var(--danger)}.la-user{color:var(--warn)}.la-tool-name{font-weight:700;margin-right:4px}.la-trunc{color:var(--muted);font-size:10px;opacity:.6}.la-flow-wrap{display:flex;flex-direction:column;gap:6px}.la-groups{display:flex;flex-direction:column;gap:8px;margin-top:4px}.la-group{border:1px solid var(--line);border-radius:8px;background:var(--panel)}.la-group-hd{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted)}.la-group-hd .name{font-weight:700;color:var(--text)}.la-group-bd{display:flex;flex-direction:column;gap:4px;padding:6px}.sched-status{font-size:10px;color:var(--muted)}.sched-line{font-size:11px;color:var(--muted);display:flex;gap:12px;flex-wrap:wrap;margin-bottom:10px}.sched-actions{display:flex;gap:6px;flex-wrap:wrap}.sched-btn.warn:hover{border-color:#f5c842;color:#f5c842}.sched-btn.danger:hover{border-color:#ff5270;color:#ff5270}.btn-cancel{background:#8882;color:#888;border:1px solid #88888844}.btn-cancel:hover{background:#8884}.btn-action:disabled{opacity:.4;cursor:not-allowed}.todo-detail{display:none;padding:4px 10px 10px 36px;font-size:11px;line-height:1.6;color:var(--text);white-space:pre-wrap;word-break:break-word;border-top:1px solid var(--line);margin:0 6px;opacity:.85}.todo-item.expanded .todo-detail{display:block}.todo-item .t-expand{color:var(--muted);font-size:10px;transition:transform .2s;flex-shrink:0}.todo-item.expanded .t-expand{transform:rotate(90deg)}.todo-item .t-id{color:var(--muted);font-size:10px;min-width:20px}.todo-item.has-detail .t-row{cursor:pointer}.act-label{color:var(--muted);flex-shrink:0}.act-dot{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;background:#0f1a38;border:1px solid #1e2e50;margin:2px}.act-dot.alive{border-color:#2ecc8a44;background:#0a2018;color:var(--ok)}.act-dot.warn{border-color:#f5c84244;background:#201a08;color:var(--warn)}.act-dot.idle{color:var(--muted)}.orl-medal{font-size:16px;min-width:20px;text-align:center}.orl-emoji{font-size:18px}.orl-name{flex:1}.orl-role{font-size:12px;font-weight:700}.orl-org{font-size:10px;color:var(--muted)}.orl-score{font-size:11px;font-weight:700;color:var(--acc)}.orl-hbdot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.orl-hbdot.active{background:var(--ok)}.orl-hbdot.warn{background:var(--warn)}.orl-hbdot.stalled{background:var(--danger);animation:pulse 1.2s infinite}.orl-hbdot.idle{background:#2a3a5a}.od-empty{display:flex;align-items:center;justify-content:center;height:100%;color:var(--muted);font-size:13px;min-height:200px}.od-hero{display:flex;align-items:center;gap:16px;margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--line)}.od-emoji{font-size:40px}.od-name{font-size:22px;font-weight:800}.od-role{font-size:13px;color:var(--muted);margin-top:2px}.od-rank-badge{font-size:11px;padding:3px 9px;border-radius:999px;border:1px solid #f5c84244;color:#f5c842;background:#201a08;margin-top:4px;display:inline-block}.od-hb{margin-left:auto;text-align:right}.od-section{margin-bottom:18px}.od-sec-title{font-size:10px;font-weight:700;color:var(--muted);letter-spacing:.07em;text-transform:uppercase;margin-bottom:10px}.od-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.ods{background:var(--panel2);border-radius:8px;padding:10px;text-align:center}.ods-v{font-size:20px;font-weight:800}.ods-l{font-size:10px;color:var(--muted);margin-top:2px}.tbar{margin-bottom:7px}.tbar-hdr{display:flex;justify-content:space-between;font-size:11px;margin-bottom:3px}.tbar-label{color:var(--muted)}.tbar-val{font-weight:600}.tbar-track{height:6px;background:#0e1320;border-radius:3px;overflow:hidden}.tbar-fill{height:100%;border-radius:3px}.od-cost-row{display:flex;gap:10px;flex-wrap:wrap}.cost-chip{font-size:12px;padding:5px 12px;border-radius:8px;border:1px solid var(--line);background:var(--panel2)}.cost-chip b{font-size:15px}.cost-chip.hi{border-color:#ff527044}.cost-chip.md{border-color:#f5c84244}.cost-chip.lo{border-color:#2ecc8a44}.od-edict-list{display:flex;flex-direction:column;gap:5px}.oe-item{display:flex;align-items:center;gap:8px;padding:7px 10px;background:var(--panel2);border-radius:7px;font-size:12px;cursor:pointer}.oe-item:hover{background:#141c30}.oe-id{font-size:10px;color:var(--acc);font-weight:700;min-width:110px}.oe-title{flex:1;color:var(--text)}.oe-state{font-size:10px}.kpi-v.gold{color:#f5c842}.kpi-v.green{color:var(--ok)}.kpi-v.blue{color:var(--acc)}.kpi-v.warn{color:var(--warn)}.sub-cats{display:flex;flex-wrap:wrap;gap:8px}.sub-cat{display:flex;align-items:center;gap:6px;padding:7px 12px;border-radius:8px;border:1px solid var(--line);background:var(--panel2);cursor:pointer;transition:all .15s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sub-cat:hover{border-color:var(--acc)}.sub-cat.active{border-color:var(--ok);background:#0a2018}.sub-cat .sc-check{width:16px;height:16px;border-radius:4px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:10px;transition:all .15s}.sub-cat.active .sc-check{background:var(--ok);border-color:var(--ok);color:#000}.sub-cat .sc-label{font-size:12px;font-weight:600}.sub-cat .sc-count{font-size:10px;color:var(--muted)}.sub-kw-list{display:flex;flex-wrap:wrap;gap:6px}.sub-kw{display:flex;align-items:center;gap:4px;padding:4px 8px 4px 10px;border-radius:999px;background:#0f1a38;border:1px solid #1e2e50;font-size:11px;color:var(--acc)}.sub-kw .kw-del{cursor:pointer;opacity:.5;font-size:13px;padding:0 2px}.sub-kw .kw-del:hover{opacity:1;color:var(--danger)}.sub-feed-list{display:flex;flex-direction:column;gap:4px}.sub-feed{display:flex;align-items:center;gap:8px;padding:6px 10px;background:var(--panel2);border-radius:7px;font-size:12px}.sub-feed .sf-name{font-weight:600;min-width:80px;color:var(--acc)}.sub-feed .sf-url{flex:1;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sub-feed .sf-cat{font-size:10px;padding:2px 6px;border-radius:4px;border:1px solid var(--line)}.sub-feed .sf-del{cursor:pointer;color:var(--muted);font-size:14px}.sub-feed .sf-del:hover{color:var(--danger)}.as-card .as-emoji{font-size:22px;margin-bottom:3px}.as-card .as-label{font-size:12px;font-weight:700}.as-card .as-role{font-size:10px;color:var(--muted)}.as-card .as-status{font-size:10px;margin-top:4px}.as-card .as-time{font-size:9px;color:var(--muted);margin-top:2px}.as-wake-btn:disabled{opacity:.4;cursor:not-allowed}.as-refresh{font-size:11px;padding:4px 12px;border-radius:8px;border:1px solid var(--line);color:var(--muted);background:transparent;cursor:pointer;transition:background .15s}.as-refresh:hover{background:var(--panel2);color:var(--text)}.as-wake-all{font-size:11px;padding:4px 12px;border-radius:8px;border:1px solid var(--warn);color:var(--warn);background:transparent;cursor:pointer;transition:background .15s;margin-left:6px}.as-wake-all:hover{background:var(--warn);color:#fff}.as-summary span{display:flex;align-items:center;gap:4px}.archive-bar .ab-archive-all{font-size:11px;padding:4px 12px;border-radius:6px;border:1px solid #2ecc8a44;background:transparent;cursor:pointer;color:var(--ok);font-weight:600;transition:all .15s}.archive-bar .ab-archive-all:hover{background:#0a2018;border-color:var(--ok)}.archive-bar .ab-scan-detail{font-size:11px;padding:4px 10px;border-radius:6px;border:1px solid var(--line);background:transparent;cursor:pointer;color:var(--muted);font-weight:600;transition:all .15s}.archive-bar .ab-scan-detail:hover{border-color:var(--acc);color:var(--text)}.archive-bar .ab-scan-detail.active{border-color:var(--acc);color:var(--acc);background:#0f1a38}.archive-bar .ab-scan-copy{font-size:11px;padding:4px 10px;border-radius:6px;border:1px solid #2ecc8a44;background:transparent;cursor:pointer;color:var(--ok);font-weight:600;transition:all .15s}.archive-bar .ab-scan-copy:hover{background:#0a2018;border-color:var(--ok)}.global-scan-detail{display:none;margin-top:-4px;margin-bottom:12px;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}.global-scan-detail.open{display:block}.global-scan-detail .gs-empty{font-size:11px;color:var(--muted)}.global-scan-detail .gs-list{display:flex;flex-direction:column;gap:6px}.global-scan-detail .gs-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;background:var(--panel);border:1px solid var(--line);font-size:11px}.global-scan-detail .gs-tag{font-size:10px;border-radius:10px;padding:2px 8px;font-weight:700;border:1px solid var(--line);color:var(--muted)}.global-scan-detail .gs-tag.retry{color:var(--acc);border-color:#6a9eff55}.global-scan-detail .gs-tag.escalate{color:#f5c842;border-color:#f5c84255}.global-scan-detail .gs-tag.rollback{color:#ff5270;border-color:#ff527055}.global-scan-detail .gs-task{font-weight:700;color:var(--text)}.global-scan-detail .gs-meta{color:var(--muted)}.global-scan-detail .gs-hint{margin-top:8px;font-size:10px;color:var(--muted)}.confirm-reason{width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:8px 10px;font-size:12px;outline:none;margin-bottom:14px;resize:vertical;min-height:60px}.confirm-reason:focus{border-color:var(--acc)}.empty{text-align:center;padding:40px 20px;color:var(--muted);font-size:13px}.sec-title{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.07em;text-transform:uppercase;margin-bottom:12px}code{font-size:11px;background:var(--panel2);padding:2px 6px;border-radius:4px;font-family:monospace}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes pulse{0%,to{opacity:.6}50%{opacity:1}}@keyframes bounceIn{0%{transform:scale(0)}60%{transform:scale(1.3)}to{transform:scale(1)}}.hover\:border-\[var\(--acc\)\]:hover{border-color:var(--acc)}.hover\:border-\[var\(--warn\)\]:hover{border-color:var(--warn)}.hover\:border-green-600\/40:hover{border-color:#16a34a66}.hover\:bg-\[var\(--acc\)\]:hover{background-color:var(--acc)}.hover\:bg-amber-900\/20:hover{background-color:#78350f33}.hover\:bg-purple-900\/20:hover{background-color:#581c8733}.hover\:text-\[var\(--acc\)\]:hover{color:var(--acc)}.hover\:text-\[var\(--text\)\]:hover{color:var(--text)}.hover\:text-\[var\(--warn\)\]:hover{color:var(--warn)}.hover\:text-cyan-400:hover{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.hover\:text-green-400:hover{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.focus\:border-\[var\(--acc\)\]:focus{border-color:var(--acc)}.focus\:border-amber-600:focus{--tw-border-opacity: 1;border-color:rgb(217 119 6 / var(--tw-border-opacity, 1))}.focus\:border-cyan-600:focus{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.group:hover .group-hover\:opacity-100{opacity:1}@media(min-width:640px){.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:768px){.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:1024px){.lg\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}} diff --git a/dashboard/dist/assets/index-CY1sWECA.js b/dashboard/dist/assets/index-CY1sWECA.js deleted file mode 100644 index f4cdf96..0000000 --- a/dashboard/dist/assets/index-CY1sWECA.js +++ /dev/null @@ -1,86 +0,0 @@ -(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const y of document.querySelectorAll('link[rel="modulepreload"]'))v(y);new MutationObserver(y=>{for(const D of y)if(D.type==="childList")for(const T of D.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&v(T)}).observe(document,{childList:!0,subtree:!0});function c(y){const D={};return y.integrity&&(D.integrity=y.integrity),y.referrerPolicy&&(D.referrerPolicy=y.referrerPolicy),y.crossOrigin==="use-credentials"?D.credentials="include":y.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function v(y){if(y.ep)return;y.ep=!0;const D=c(y);fetch(y.href,D)}})();function lo(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Qi={exports:{}},Or={},Ki={exports:{}},ye={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Kc;function mf(){if(Kc)return ye;Kc=1;var o=Symbol.for("react.element"),f=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),T=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),d=Symbol.iterator;function N(h){return h===null||typeof h!="object"?null:(h=d&&h[d]||h["@@iterator"],typeof h=="function"?h:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,S={};function M(h,I,me){this.props=h,this.context=I,this.refs=S,this.updater=me||j}M.prototype.isReactComponent={},M.prototype.setState=function(h,I){if(typeof h!="object"&&typeof h!="function"&&h!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,h,I,"setState")},M.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function x(){}x.prototype=M.prototype;function A(h,I,me){this.props=h,this.context=I,this.refs=S,this.updater=me||j}var Q=A.prototype=new x;Q.constructor=A,$(Q,M.prototype),Q.isPureReactComponent=!0;var P=Array.isArray,re=Object.prototype.hasOwnProperty,pe={current:null},ve={key:!0,ref:!0,__self:!0,__source:!0};function he(h,I,me){var fe,g={},H=null,ne=null;if(I!=null)for(fe in I.ref!==void 0&&(ne=I.ref),I.key!==void 0&&(H=""+I.key),I)re.call(I,fe)&&!ve.hasOwnProperty(fe)&&(g[fe]=I[fe]);var ke=arguments.length-2;if(ke===1)g.children=me;else if(1>>1,I=b[h];if(0>>1;hy(g,U))Hy(ne,g)?(b[h]=ne,b[H]=U,h=H):(b[h]=g,b[fe]=U,h=fe);else if(Hy(ne,U))b[h]=ne,b[H]=U,h=H;else break e}}return G}function y(b,G){var U=b.sortIndex-G.sortIndex;return U!==0?U:b.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;o.unstable_now=function(){return D.now()}}else{var T=Date,E=T.now();o.unstable_now=function(){return T.now()-E}}var L=[],_=[],z=1,d=null,N=3,j=!1,$=!1,S=!1,M=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Q(b){for(var G=c(_);G!==null;){if(G.callback===null)v(_);else if(G.startTime<=b)v(_),G.sortIndex=G.expirationTime,f(L,G);else break;G=c(_)}}function P(b){if(S=!1,Q(b),!$)if(c(L)!==null)$=!0,_e(re);else{var G=c(_);G!==null&&xe(P,G.startTime-b)}}function re(b,G){$=!1,S&&(S=!1,x(he),he=-1),j=!0;var U=N;try{for(Q(G),d=c(L);d!==null&&(!(d.expirationTime>G)||b&&!ae());){var h=d.callback;if(typeof h=="function"){d.callback=null,N=d.priorityLevel;var I=h(d.expirationTime<=G);G=o.unstable_now(),typeof I=="function"?d.callback=I:d===c(L)&&v(L),Q(G)}else v(L);d=c(L)}if(d!==null)var me=!0;else{var fe=c(_);fe!==null&&xe(P,fe.startTime-G),me=!1}return me}finally{d=null,N=U,j=!1}}var pe=!1,ve=null,he=-1,Be=5,X=-1;function ae(){return!(o.unstable_now()-Xb||125h?(b.sortIndex=U,f(_,b),c(L)===null&&b===c(_)&&(S?(x(he),he=-1):S=!0,xe(P,U-h))):(b.sortIndex=I,f(L,b),$||j||($=!0,_e(re))),b},o.unstable_shouldYield=ae,o.unstable_wrapCallback=function(b){var G=N;return function(){var U=N;N=G;try{return b.apply(this,arguments)}finally{N=U}}}})(Xi)),Xi}var Jc;function yf(){return Jc||(Jc=1,Yi.exports=gf()),Yi.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qc;function xf(){if(qc)return at;qc=1;var o=Br(),f=yf();function c(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L=Object.prototype.hasOwnProperty,_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,z={},d={};function N(e){return L.call(d,e)?!0:L.call(z,e)?!1:_.test(e)?d[e]=!0:(z[e]=!0,!1)}function j(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $(e,t,n,r){if(t===null||typeof t>"u"||j(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var M={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){M[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];M[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){M[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){M[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){M[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){M[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){M[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){M[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){M[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function A(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(x,A);M[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(x,A);M[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(x,A);M[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){M[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),M.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){M[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function Q(e,t,n,r){var s=M.hasOwnProperty(t)?M[t]:null;(s!==null?s.type!==0:r||!(2u||s[a]!==i[u]){var p=` -`+s[a].replace(" at new "," at ");return e.displayName&&p.includes("")&&(p=p.replace("",e.displayName)),p}while(1<=a&&0<=u);break}}}finally{me=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function g(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=fe(e.type,!1),e;case 11:return e=fe(e.type.render,!1),e;case 1:return e=fe(e.type,!0),e;default:return""}}function H(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ve:return"Fragment";case pe:return"Portal";case Be:return"Profiler";case he:return"StrictMode";case se:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ae:return(e.displayName||"Context")+".Consumer";case X:return(e._context.displayName||"Context")+".Provider";case Se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ce:return t=e.displayName||null,t!==null?t:H(e.type)||"Memo";case _e:t=e._payload,e=e._init;try{return H(e(t))}catch{}}return null}function ne(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(t);case 8:return t===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $e(e){var t=je(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mt(e){e._valueTracker||(e._valueTracker=$e(e))}function er(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=je(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function pn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tr(e,t){var n=t.checked;return U({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ur(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Hr(e,t){t=t.checked,t!=null&&Q(e,"checked",t,!1)}function nr(e,t){Hr(e,t);var n=ke(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bn(e,t.type,n):t.hasOwnProperty("defaultValue")&&bn(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bn(e,t,n){(t!=="number"||pn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ut=Array.isArray;function Ht(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jt=["Webkit","ms","Moz","O"];Object.keys(Vt).forEach(function(e){jt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vt[t]=Vt[e]})});function oo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vt.hasOwnProperty(e)&&Vt[e]?(""+t).trim():t+"px"}function ao(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=oo(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var yu=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ls(e,t){if(t){if(yu[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(c(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(c(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(c(61))}if(t.style!=null&&typeof t.style!="object")throw Error(c(62))}}function ss(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var is=null;function os(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var as=null,Tn=null,Ln=null;function co(e){if(e=Nr(e)){if(typeof as!="function")throw Error(c(280));var t=e.stateNode;t&&(t=pl(t),as(e.stateNode,e.type,t))}}function uo(e){Tn?Ln?Ln.push(e):Ln=[e]:Tn=e}function fo(){if(Tn){var e=Tn,t=Ln;if(Ln=Tn=null,co(e),t)for(e=0;e>>=0,e===0?32:31-(zu(e)/Tu|0)|0}var Yr=64,Xr=4194304;function ir(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var u=a&~s;u!==0?r=ir(u):(i&=a,i!==0&&(r=ir(i)))}else a=n&~s,a!==0?r=ir(a):i!==0&&(r=ir(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&s)===0&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function or(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Du(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=hr),Fo=" ",Bo=!1;function Wo(e,t){switch(e){case"keyup":return ad.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dn=!1;function ud(e,t){switch(e){case"compositionend":return Uo(t);case"keypress":return t.which!==32?null:(Bo=!0,Fo);case"textInput":return e=t.data,e===Fo&&Bo?null:e;default:return null}}function dd(e,t){if(Dn)return e==="compositionend"||!_s&&Wo(e,t)?(e=Do(),nl=ks=Xt=null,Dn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xo(n)}}function Jo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qo(){for(var e=window,t=pn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pn(e.document)}return t}function zs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function kd(e){var t=qo(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jo(n.ownerDocument.documentElement,n)){if(r!==null&&zs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Zo(n,i);var a=Zo(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,In=null,Ts=null,xr=null,Ls=!1;function ea(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ls||In==null||In!==pn(r)||(r=In,"selectionStart"in r&&zs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xr&&yr(xr,r)||(xr=r,r=ul(Ts,"onSelect"),0Fn||(e.current=Us[Fn],Us[Fn]=null,Fn--)}function ze(e,t){Fn++,Us[Fn]=e.current,e.current=t}var en={},Ze=qt(en),rt=qt(!1),gn=en;function Bn(e,t){var n=e.type.contextTypes;if(!n)return en;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lt(e){return e=e.childContextTypes,e!=null}function ml(){Pe(rt),Pe(Ze)}function ha(e,t,n){if(Ze.current!==en)throw Error(c(168));ze(Ze,t),ze(rt,n)}function va(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(c(108,ne(e)||"Unknown",s));return U({},n,r)}function hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,gn=Ze.current,ze(Ze,e),ze(rt,rt.current),!0}function ga(e,t,n){var r=e.stateNode;if(!r)throw Error(c(169));n?(e=va(e,t,gn),r.__reactInternalMemoizedMergedChildContext=e,Pe(rt),Pe(Ze),ze(Ze,e)):Pe(rt),ze(rt,n)}var Mt=null,vl=!1,Hs=!1;function ya(e){Mt===null?Mt=[e]:Mt.push(e)}function Rd(e){vl=!0,ya(e)}function tn(){if(!Hs&&Mt!==null){Hs=!0;var e=0,t=Ee;try{var n=Mt;for(Ee=1;e>=a,s-=a,At=1<<32-St(t)+s|n<de?(Ge=oe,oe=null):Ge=oe.sibling;var Ne=O(k,oe,w[de],W);if(Ne===null){oe===null&&(oe=Ge);break}e&&oe&&Ne.alternate===null&&t(k,oe),m=i(Ne,m,de),ie===null?q=Ne:ie.sibling=Ne,ie=Ne,oe=Ge}if(de===w.length)return n(k,oe),De&&xn(k,de),q;if(oe===null){for(;dede?(Ge=oe,oe=null):Ge=oe.sibling;var dn=O(k,oe,Ne.value,W);if(dn===null){oe===null&&(oe=Ge);break}e&&oe&&dn.alternate===null&&t(k,oe),m=i(dn,m,de),ie===null?q=dn:ie.sibling=dn,ie=dn,oe=Ge}if(Ne.done)return n(k,oe),De&&xn(k,de),q;if(oe===null){for(;!Ne.done;de++,Ne=w.next())Ne=B(k,Ne.value,W),Ne!==null&&(m=i(Ne,m,de),ie===null?q=Ne:ie.sibling=Ne,ie=Ne);return De&&xn(k,de),q}for(oe=r(k,oe);!Ne.done;de++,Ne=w.next())Ne=K(oe,k,de,Ne.value,W),Ne!==null&&(e&&Ne.alternate!==null&&oe.delete(Ne.key===null?de:Ne.key),m=i(Ne,m,de),ie===null?q=Ne:ie.sibling=Ne,ie=Ne);return e&&oe.forEach(function(pf){return t(k,pf)}),De&&xn(k,de),q}function Fe(k,m,w,W){if(typeof w=="object"&&w!==null&&w.type===ve&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case re:e:{for(var q=w.key,ie=m;ie!==null;){if(ie.key===q){if(q=w.type,q===ve){if(ie.tag===7){n(k,ie.sibling),m=s(ie,w.props.children),m.return=k,k=m;break e}}else if(ie.elementType===q||typeof q=="object"&&q!==null&&q.$$typeof===_e&&Na(q)===ie.type){n(k,ie.sibling),m=s(ie,w.props),m.ref=Cr(k,ie,w),m.return=k,k=m;break e}n(k,ie);break}else t(k,ie);ie=ie.sibling}w.type===ve?(m=En(w.props.children,k.mode,W,w.key),m.return=k,k=m):(W=Hl(w.type,w.key,w.props,null,k.mode,W),W.ref=Cr(k,m,w),W.return=k,k=W)}return a(k);case pe:e:{for(ie=w.key;m!==null;){if(m.key===ie)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){n(k,m.sibling),m=s(m,w.children||[]),m.return=k,k=m;break e}else{n(k,m);break}else t(k,m);m=m.sibling}m=Bi(w,k.mode,W),m.return=k,k=m}return a(k);case _e:return ie=w._init,Fe(k,m,ie(w._payload),W)}if(Ut(w))return Z(k,m,w,W);if(G(w))return J(k,m,w,W);kl(k,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(n(k,m.sibling),m=s(m,w),m.return=k,k=m):(n(k,m),m=Fi(w,k.mode,W),m.return=k,k=m),a(k)):n(k,m)}return Fe}var Vn=Ca(!0),_a=Ca(!1),jl=qt(null),Sl=null,Qn=null,Xs=null;function Zs(){Xs=Qn=Sl=null}function Js(e){var t=jl.current;Pe(jl),e._currentValue=t}function qs(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Kn(e,t){Sl=e,Xs=Qn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(st=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Xs!==e)if(e={context:e,memoizedValue:t,next:null},Qn===null){if(Sl===null)throw Error(c(308));Qn=e,Sl.dependencies={lanes:0,firstContext:e}}else Qn=Qn.next=e;return t}var kn=null;function ei(e){kn===null?kn=[e]:kn.push(e)}function Ea(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,ei(t)):(n.next=s.next,s.next=n),t.interleaved=n,Ot(e,r)}function Ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var nn=!1;function ti(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(we&2)!==0){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Ot(e,n)}return s=r.interleaved,s===null?(t.next=t,ei(r)):(t.next=s.next,s.next=t),r.interleaved=t,Ot(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nl(e,t,n,r){var s=e.updateQueue;nn=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,u=s.shared.pending;if(u!==null){s.shared.pending=null;var p=u,C=p.next;p.next=null,a===null?i=C:a.next=C,a=p;var F=e.alternate;F!==null&&(F=F.updateQueue,u=F.lastBaseUpdate,u!==a&&(u===null?F.firstBaseUpdate=C:u.next=C,F.lastBaseUpdate=p))}if(i!==null){var B=s.baseState;a=0,F=C=p=null,u=i;do{var O=u.lane,K=u.eventTime;if((r&O)===O){F!==null&&(F=F.next={eventTime:K,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var Z=e,J=u;switch(O=t,K=n,J.tag){case 1:if(Z=J.payload,typeof Z=="function"){B=Z.call(K,B,O);break e}B=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=J.payload,O=typeof Z=="function"?Z.call(K,B,O):Z,O==null)break e;B=U({},B,O);break e;case 2:nn=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,O=s.effects,O===null?s.effects=[u]:O.push(u))}else K={eventTime:K,lane:O,tag:u.tag,payload:u.payload,callback:u.callback,next:null},F===null?(C=F=K,p=B):F=F.next=K,a|=O;if(u=u.next,u===null){if(u=s.shared.pending,u===null)break;O=u,u=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);if(F===null&&(p=B),s.baseState=p,s.firstBaseUpdate=C,s.lastBaseUpdate=F,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);wn|=a,e.lanes=a,e.memoizedState=B}}function Ta(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ii.transition;ii.transition={};try{e(!1),t()}finally{Ee=n,ii.transition=r}}function Ya(){return yt().memoizedState}function Md(e,t,n){var r=an(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xa(e))Za(t,n);else if(n=Ea(e,t,n,r),n!==null){var s=nt();bt(n,e,r,s),Ja(n,t,r)}}function Ad(e,t,n){var r=an(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xa(e))Za(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,u=i(a,n);if(s.hasEagerState=!0,s.eagerState=u,wt(u,a)){var p=t.interleaved;p===null?(s.next=s,ei(t)):(s.next=p.next,p.next=s),t.interleaved=s;return}}catch{}finally{}n=Ea(e,t,s,r),n!==null&&(s=nt(),bt(n,e,r,s),Ja(n,t,r))}}function Xa(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function Za(e,t){zr=El=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ja(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}var Tl={readContext:gt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},$d={readContext:gt,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Ba,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bl(4194308,4,Ha.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return bl(4,2,e,t)},useMemo:function(e,t){var n=Pt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Md.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:Oa,useDebugValue:pi,useDeferredValue:function(e){return Pt().memoizedState=e},useTransition:function(){var e=Oa(!1),t=e[0];return e=Id.bind(null,e[1]),Pt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Me,s=Pt();if(De){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Ke===null)throw Error(c(349));(Sn&30)!==0||Da(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Ba(Ma.bind(null,r,i,e),[e]),r.flags|=2048,Rr(9,Ia.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Pt(),t=Ke.identifierPrefix;if(De){var n=$t,r=At;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Tr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Lt]=t,e[wr]=r,yc(e,t,!1,!1),t.stateNode=e;e:{switch(a=ss(n,r),n){case"dialog":Re("cancel",e),Re("close",e),s=r;break;case"iframe":case"object":case"embed":Re("load",e),s=r;break;case"video":case"audio":for(s=0;sJn&&(t.flags|=128,r=!0,Pr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Cl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Pr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!De)return qe(t),null}else 2*Oe()-i.renderingStartTime>Jn&&n!==1073741824&&(t.flags|=128,r=!0,Pr(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Oe(),t.sibling=null,n=Ie.current,ze(Ie,r?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return Ai(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(pt&1073741824)!==0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(c(156,t.tag))}function Qd(e,t){switch(Qs(t),t.tag){case 1:return lt(t.type)&&ml(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gn(),Pe(rt),Pe(Ze),si(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ri(t),null;case 13:if(Pe(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Hn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(Ie),null;case 4:return Gn(),null;case 10:return Js(t.type._context),null;case 22:case 23:return Ai(),null;case 24:return null;default:return null}}var Dl=!1,et=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Xn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(e,t,r)}else n.current=null}function Ci(e,t,n){try{n()}catch(r){Ae(e,t,r)}}var jc=!1;function Gd(e,t){if(As=el,e=qo(),zs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,u=-1,p=-1,C=0,F=0,B=e,O=null;t:for(;;){for(var K;B!==n||s!==0&&B.nodeType!==3||(u=a+s),B!==i||r!==0&&B.nodeType!==3||(p=a+r),B.nodeType===3&&(a+=B.nodeValue.length),(K=B.firstChild)!==null;)O=B,B=K;for(;;){if(B===e)break t;if(O===n&&++C===s&&(u=a),O===i&&++F===r&&(p=a),(K=B.nextSibling)!==null)break;B=O,O=B.parentNode}B=K}n=u===-1||p===-1?null:{start:u,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for($s={focusedElem:e,selectionRange:n},el=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var Z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Z!==null){var J=Z.memoizedProps,Fe=Z.memoizedState,k=t.stateNode,m=k.getSnapshotBeforeUpdate(t.elementType===t.type?J:Ct(t.type,J),Fe);k.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(W){Ae(t,t.return,W)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return Z=jc,jc=!1,Z}function Dr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ci(t,n,i)}s=s.next}while(s!==r)}}function Il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function _i(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[wr],delete t[Ws],delete t[Td],delete t[Ld])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wc(e){return e.tag===5||e.tag===3||e.tag===4}function Nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ei(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fl));else if(r!==4&&(e=e.child,e!==null))for(Ei(e,t,n),e=e.sibling;e!==null;)Ei(e,t,n),e=e.sibling}function bi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bi(e,t,n),e=e.sibling;e!==null;)bi(e,t,n),e=e.sibling}var Ye=null,_t=!1;function ln(e,t,n){for(n=n.child;n!==null;)Cc(e,t,n),n=n.sibling}function Cc(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Gr,n)}catch{}switch(n.tag){case 5:et||Xn(n,t);case 6:var r=Ye,s=_t;Ye=null,ln(e,t,n),Ye=r,_t=s,Ye!==null&&(_t?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(_t?(e=Ye,n=n.stateNode,e.nodeType===8?Bs(e.parentNode,n):e.nodeType===1&&Bs(e,n),fr(e)):Bs(Ye,n.stateNode));break;case 4:r=Ye,s=_t,Ye=n.stateNode.containerInfo,_t=!0,ln(e,t,n),Ye=r,_t=s;break;case 0:case 11:case 14:case 15:if(!et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&Ci(n,t,a),s=s.next}while(s!==r)}ln(e,t,n);break;case 1:if(!et&&(Xn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Ae(n,t,u)}ln(e,t,n);break;case 21:ln(e,t,n);break;case 22:n.mode&1?(et=(r=et)||n.memoizedState!==null,ln(e,t,n),et=r):ln(e,t,n);break;default:ln(e,t,n)}}function _c(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Kd),t.forEach(function(r){var s=rf.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Et(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xd(r/1960))-r,10e?16:e,on===null)var r=!1;else{if(e=on,on=null,Fl=0,(we&6)!==0)throw Error(c(331));var s=we;for(we|=4,Y=e.current;Y!==null;){var i=Y,a=i.child;if((Y.flags&16)!==0){var u=i.deletions;if(u!==null){for(var p=0;pOe()-Li?Cn(e,0):Ti|=n),ot(e,t)}function Oc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Xr,Xr<<=1,(Xr&130023424)===0&&(Xr=4194304)));var n=nt();e=Ot(e,t),e!==null&&(or(e,t,n),ot(e,n))}function nf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Oc(e,n)}function rf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(c(314))}r!==null&&r.delete(t),Oc(e,n)}var Fc;Fc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)st=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return st=!1,Hd(e,t,n);st=(e.flags&131072)!==0}else st=!1,De&&(t.flags&1048576)!==0&&xa(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pl(e,t),e=t.pendingProps;var s=Bn(t,Ze.current);Kn(t,n),s=ai(null,t,r,e,s,n);var i=ci();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(i=!0,hl(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ti(t),s.updater=Ll,t.stateNode=s,s._reactInternals=t,hi(t,r,e,n),t=xi(null,t,r,!0,i,n)):(t.tag=0,De&&i&&Vs(t),tt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=sf(r),e=Ct(r,e),s){case 0:t=yi(null,t,r,e,n);break e;case 1:t=fc(null,t,r,e,n);break e;case 11:t=oc(null,t,r,e,n);break e;case 14:t=ac(null,t,r,Ct(r.type,e),n);break e}throw Error(c(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),yi(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),fc(e,t,r,s,n);case 3:e:{if(pc(t),e===null)throw Error(c(387));r=t.pendingProps,i=t.memoizedState,s=i.element,ba(e,t),Nl(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Yn(Error(c(423)),t),t=mc(e,t,r,n,s);break e}else if(r!==s){s=Yn(Error(c(424)),t),t=mc(e,t,r,n,s);break e}else for(ft=Jt(t.stateNode.containerInfo.firstChild),dt=t,De=!0,Nt=null,n=_a(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hn(),r===s){t=Bt(e,t,n);break e}tt(e,t,r,n)}t=t.child}return t;case 5:return La(t),e===null&&Gs(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Os(r,s)?a=null:i!==null&&Os(r,i)&&(t.flags|=32),dc(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&Gs(t),null;case 13:return hc(e,t,n);case 4:return ni(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Vn(t,null,r,n):tt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),oc(e,t,r,s,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,ze(jl,r._currentValue),r._currentValue=a,i!==null)if(wt(i.value,a)){if(i.children===s.children&&!rt.current){t=Bt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){a=i.child;for(var p=u.firstContext;p!==null;){if(p.context===r){if(i.tag===1){p=Ft(-1,n&-n),p.tag=2;var C=i.updateQueue;if(C!==null){C=C.shared;var F=C.pending;F===null?p.next=p:(p.next=F.next,F.next=p),C.pending=p}}i.lanes|=n,p=i.alternate,p!==null&&(p.lanes|=n),qs(i.return,n,t),u.lanes|=n;break}p=p.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(c(341));a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),qs(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}tt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Kn(t,n),s=gt(s),r=r(s),t.flags|=1,tt(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),ac(e,t,r,s,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Pl(e,t),t.tag=1,lt(r)?(e=!0,hl(t)):e=!1,Kn(t,n),ec(t,r,s),hi(t,r,s,n),xi(null,t,r,!0,e,n);case 19:return gc(e,t,n);case 22:return uc(e,t,n)}throw Error(c(156,t.tag))};function Bc(e,t){return ko(e,t)}function lf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,n,r){return new lf(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sf(e){if(typeof e=="function")return Oi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===Ce)return 14}return 2}function un(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hl(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Oi(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ve:return En(n.children,s,i,t);case he:a=8,s|=8;break;case Be:return e=kt(12,n,t,s|2),e.elementType=Be,e.lanes=i,e;case se:return e=kt(13,n,t,s),e.elementType=se,e.lanes=i,e;case ee:return e=kt(19,n,t,s),e.elementType=ee,e.lanes=i,e;case xe:return Vl(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:a=10;break e;case ae:a=9;break e;case Se:a=11;break e;case Ce:a=14;break e;case _e:a=16,r=null;break e}throw Error(c(130,e==null?e:typeof e,""))}return t=kt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function En(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function Vl(e,t,n,r){return e=kt(22,e,r,t),e.elementType=xe,e.lanes=n,e.stateNode={isHidden:!1},e}function Fi(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function Bi(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function of(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ms(0),this.expirationTimes=ms(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ms(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Wi(e,t,n,r,s,i,a,u,p){return e=new of(e,t,n,u,p),t===1?(t=1,i===!0&&(t|=8)):t=0,i=kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ti(i),e}function af(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(f){console.error(f)}}return o(),Gi.exports=xf(),Gi.exports}var tu;function jf(){if(tu)return Jl;tu=1;var o=kf();return Jl.createRoot=o.createRoot,Jl.hydrateRoot=o.hydrateRoot,Jl}var Sf=jf();const wf=lo(Sf),Nf={},nu=o=>{let f;const c=new Set,v=(z,d)=>{const N=typeof z=="function"?z(f):z;if(!Object.is(N,f)){const j=f;f=d??(typeof N!="object"||N===null)?N:Object.assign({},f,N),c.forEach($=>$(f,j))}},y=()=>f,L={setState:v,getState:y,getInitialState:()=>_,subscribe:z=>(c.add(z),()=>c.delete(z)),destroy:()=>{(Nf?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),c.clear()}},_=f=o(v,y,L);return L},Cf=o=>o?nu(o):nu;var Zi={exports:{}},Ji={},qi={exports:{}},eo={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ru;function _f(){if(ru)return eo;ru=1;var o=Br();function f(d,N){return d===N&&(d!==0||1/d===1/N)||d!==d&&N!==N}var c=typeof Object.is=="function"?Object.is:f,v=o.useState,y=o.useEffect,D=o.useLayoutEffect,T=o.useDebugValue;function E(d,N){var j=N(),$=v({inst:{value:j,getSnapshot:N}}),S=$[0].inst,M=$[1];return D(function(){S.value=j,S.getSnapshot=N,L(S)&&M({inst:S})},[d,j,N]),y(function(){return L(S)&&M({inst:S}),d(function(){L(S)&&M({inst:S})})},[d]),T(j),j}function L(d){var N=d.getSnapshot;d=d.value;try{var j=N();return!c(d,j)}catch{return!0}}function _(d,N){return N()}var z=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_:E;return eo.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:z,eo}var lu;function Ef(){return lu||(lu=1,qi.exports=_f()),qi.exports}/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var su;function bf(){if(su)return Ji;su=1;var o=Br(),f=Ef();function c(_,z){return _===z&&(_!==0||1/_===1/z)||_!==_&&z!==z}var v=typeof Object.is=="function"?Object.is:c,y=f.useSyncExternalStore,D=o.useRef,T=o.useEffect,E=o.useMemo,L=o.useDebugValue;return Ji.useSyncExternalStoreWithSelector=function(_,z,d,N,j){var $=D(null);if($.current===null){var S={hasValue:!1,value:null};$.current=S}else S=$.current;$=E(function(){function x(pe){if(!A){if(A=!0,Q=pe,pe=N(pe),j!==void 0&&S.hasValue){var ve=S.value;if(j(ve,pe))return P=ve}return P=pe}if(ve=P,v(Q,pe))return ve;var he=N(pe);return j!==void 0&&j(ve,he)?(Q=pe,ve):(Q=pe,P=he)}var A=!1,Q,P,re=d===void 0?null:d;return[function(){return x(z())},re===null?void 0:function(){return x(re())}]},[z,d,N,j]);var M=y(_,$[0],$[1]);return T(function(){S.hasValue=!0,S.value=M},[M]),L(M),M},Ji}var iu;function zf(){return iu||(iu=1,Zi.exports=bf()),Zi.exports}var Tf=zf();const Lf=lo(Tf),du={},{useDebugValue:Rf}=uu,{useSyncExternalStoreWithSelector:Pf}=Lf;let ou=!1;const Df=o=>o;function If(o,f=Df,c){(du?"production":void 0)!=="production"&&c&&!ou&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ou=!0);const v=Pf(o.subscribe,o.getState,o.getServerState||o.getInitialState,f,c);return Rf(v),v}const au=o=>{(du?"production":void 0)!=="production"&&typeof o!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const f=typeof o=="function"?Cf(o):o,c=(v,y)=>If(f,v,y);return Object.assign(c,f),c},Mf=o=>o?au(o):au,ge="";async function ct(o){const f=await fetch(o,{cache:"no-store"});if(!f.ok)throw new Error(String(f.status));return f.json()}async function Te(o,f){return(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)})).json()}const ce={liveStatus:()=>ct(`${ge}/api/live-status`),agentConfig:()=>ct(`${ge}/api/agent-config`),modelChangeLog:()=>ct(`${ge}/api/model-change-log`).catch(()=>[]),officialsStats:()=>ct(`${ge}/api/officials-stats`),morningBrief:()=>ct(`${ge}/api/morning-brief`),morningConfig:()=>ct(`${ge}/api/morning-config`),agentsStatus:()=>ct(`${ge}/api/agents-status`),taskActivity:o=>ct(`${ge}/api/task-activity/${encodeURIComponent(o)}`),schedulerState:o=>ct(`${ge}/api/scheduler-state/${encodeURIComponent(o)}`),skillContent:(o,f)=>ct(`${ge}/api/skill-content/${encodeURIComponent(o)}/${encodeURIComponent(f)}`),setModel:(o,f)=>Te(`${ge}/api/set-model`,{agentId:o,model:f}),setDispatchChannel:o=>Te(`${ge}/api/set-dispatch-channel`,{channel:o}),agentWake:o=>Te(`${ge}/api/agent-wake`,{agentId:o}),taskAction:(o,f,c)=>Te(`${ge}/api/task-action`,{taskId:o,action:f,reason:c}),reviewAction:(o,f,c)=>Te(`${ge}/api/review-action`,{taskId:o,action:f,comment:c}),advanceState:(o,f)=>Te(`${ge}/api/advance-state`,{taskId:o,comment:f}),archiveTask:(o,f)=>Te(`${ge}/api/archive-task`,{taskId:o,archived:f}),archiveAllDone:()=>Te(`${ge}/api/archive-task`,{archiveAllDone:!0}),schedulerScan:(o=180)=>Te(`${ge}/api/scheduler-scan`,{thresholdSec:o}),schedulerRetry:(o,f)=>Te(`${ge}/api/scheduler-retry`,{taskId:o,reason:f}),schedulerEscalate:(o,f)=>Te(`${ge}/api/scheduler-escalate`,{taskId:o,reason:f}),schedulerRollback:(o,f)=>Te(`${ge}/api/scheduler-rollback`,{taskId:o,reason:f}),refreshMorning:()=>Te(`${ge}/api/morning-brief/refresh`,{}),saveMorningConfig:o=>Te(`${ge}/api/morning-config`,o),addSkill:(o,f,c,v)=>Te(`${ge}/api/add-skill`,{agentId:o,skillName:f,description:c,trigger:v}),addRemoteSkill:(o,f,c,v)=>Te(`${ge}/api/add-remote-skill`,{agentId:o,skillName:f,sourceUrl:c,description:v||""}),remoteSkillsList:()=>ct(`${ge}/api/remote-skills-list`),updateRemoteSkill:(o,f)=>Te(`${ge}/api/update-remote-skill`,{agentId:o,skillName:f}),removeRemoteSkill:(o,f)=>Te(`${ge}/api/remove-remote-skill`,{agentId:o,skillName:f}),createTask:o=>Te(`${ge}/api/create-task`,o),courtDiscussStart:(o,f,c)=>Te(`${ge}/api/court-discuss/start`,{topic:o,officials:f,taskId:c}),courtDiscussAdvance:(o,f,c)=>Te(`${ge}/api/court-discuss/advance`,{sessionId:o,userMessage:f,decree:c}),courtDiscussConclude:o=>Te(`${ge}/api/court-discuss/conclude`,{sessionId:o}),courtDiscussDestroy:o=>Te(`${ge}/api/court-discuss/destroy`,{sessionId:o}),courtDiscussFate:()=>ct(`${ge}/api/court-discuss/fate`),courtDiscussList:()=>ct(`${ge}/api/court-discuss/list`),courtDiscussSession:o=>ct(`${ge}/api/court-discuss/session/${o}`),courtDiscussSearch:(o,f,c)=>Te(`${ge}/api/court-discuss/search`,{sessionId:o,query:f,officialId:c}),courtDiscussResearch:(o,f)=>Te(`${ge}/api/court-discuss/research`,{sessionId:o,query:f}),courtDiscussExport:(o,f,c)=>Te(`${ge}/api/court-discuss/export`,{sessionId:o,format:f||"markdown",title:c})},fu=[{key:"Inbox",dept:"皇上",icon:"👑",action:"下旨"},{key:"Taizi",dept:"太子",icon:"🤴",action:"分拣"},{key:"Zhongshu",dept:"中书省",icon:"📜",action:"起草"},{key:"Menxia",dept:"门下省",icon:"🔍",action:"审议"},{key:"Assigned",dept:"尚书省",icon:"📮",action:"派发"},{key:"Doing",dept:"六部",icon:"⚙️",action:"执行"},{key:"Review",dept:"尚书省",icon:"🔎",action:"汇总"},{key:"Done",dept:"回奏",icon:"✅",action:"完成"}],Af={Inbox:0,Pending:0,Taizi:1,Zhongshu:2,Menxia:3,Assigned:4,Doing:5,Review:6,Done:7,Blocked:5,Cancelled:5,Next:4},$f={太子:"#e8a040",中书省:"#a07aff",门下省:"#6a9eff",尚书省:"#6aef9a",礼部:"#f5c842",户部:"#ff9a6a",兵部:"#ff5270",刑部:"#cc4444",工部:"#44aaff",吏部:"#9b59b6",皇上:"#ffd700",回奏:"#2ecc8a"},Wr={Inbox:"收件",Pending:"待处理",Taizi:"太子分拣",Zhongshu:"中书起草",Menxia:"门下审议",Assigned:"已派发",Doing:"执行中",Review:"待审查",Done:"已完成",Blocked:"阻塞",Cancelled:"已取消",Next:"待执行"};function ql(o){return $f[o]||"#6a9eff"}function so(o){const f=o.review_round||0;return o.state==="Menxia"&&f>1?`门下审议(第${f}轮)`:o.state==="Zhongshu"&&f>0?`中书修订(第${f}轮)`:Wr[o.state]||o.state}function fn(o){return/^JJC-/i.test(o.id||"")}function ts(o){return o.archived||["Done","Cancelled"].includes(o.state)}function io(o){const f=Af[o.state]??4;return fu.map((c,v)=>({...c,status:v({liveStatus:null,agentConfig:null,changeLog:[],officialsData:null,agentsStatusData:null,morningBrief:null,subConfig:null,activeTab:"edicts",edictFilter:"active",sessFilter:"all",tplCatFilter:"全部",selectedOfficial:null,modalTaskId:null,countdown:5,toasts:[],setActiveTab:c=>{o({activeTab:c});const v=f();["models","skills","sessions"].includes(c)&&!v.agentConfig&&v.loadAgentConfig(),c==="officials"&&!v.officialsData&&v.loadOfficials(),c==="monitor"&&v.loadAgentsStatus(),c==="morning"&&!v.morningBrief&&v.loadMorning()},setEdictFilter:c=>o({edictFilter:c}),setSessFilter:c=>o({sessFilter:c}),setTplCatFilter:c=>o({tplCatFilter:c}),setSelectedOfficial:c=>o({selectedOfficial:c}),setModalTaskId:c=>o({modalTaskId:c}),setCountdown:c=>o({countdown:c}),toast:(c,v="ok")=>{const y=++Wf;o(D=>({toasts:[...D.toasts,{id:y,msg:c,type:v}]})),setTimeout(()=>{o(D=>({toasts:D.toasts.filter(T=>T.id!==y)}))},3e3)},loadLive:async()=>{try{const c=await ce.liveStatus();o({liveStatus:c}),f().officialsData||ce.officialsStats().then(y=>o({officialsData:y})).catch(()=>{})}catch{}},loadAgentConfig:async()=>{try{const c=await ce.agentConfig(),v=await ce.modelChangeLog();o({agentConfig:c,changeLog:v})}catch{}},loadOfficials:async()=>{try{const c=await ce.officialsStats();o({officialsData:c})}catch{}},loadAgentsStatus:async()=>{try{const c=await ce.agentsStatus();o({agentsStatusData:c})}catch{o({agentsStatusData:null})}},loadMorning:async()=>{try{const[c,v]=await Promise.all([ce.morningBrief(),ce.morningConfig()]);o({morningBrief:c,subConfig:v})}catch{}},loadSubConfig:async()=>{try{const c=await ce.morningConfig();o({subConfig:c})}catch{}},loadAll:async()=>{const c=f();await c.loadLive();const v=c.activeTab;["models","skills"].includes(v)&&await c.loadAgentConfig()}}));let Fr=null;function Uf(){Fr||(te.getState().loadAll(),Fr=setInterval(()=>{const o=te.getState(),f=o.countdown-1;f<=0?(o.setCountdown(5),o.loadAll()):o.setCountdown(f)},1e3))}function Hf(){Fr&&(clearInterval(Fr),Fr=null)}function Vf(o){if(!o)return"";try{const f=new Date(o.includes("T")?o:o.replace(" ","T")+"Z");if(isNaN(f.getTime()))return"";const c=Date.now()-f.getTime(),v=Math.floor(c/6e4);if(v<1)return"刚刚";if(v<60)return v+"分钟前";const y=Math.floor(v/60);return y<24?y+"小时前":Math.floor(y/24)+"天前"}catch{return""}}const cu={Doing:0,Review:1,Assigned:2,Menxia:3,Zhongshu:4,Taizi:5,Inbox:6,Blocked:7,Next:8,Done:9,Cancelled:10};function Qf({task:o}){const f=io(o);return l.jsx("div",{className:"ec-pipe",children:f.map((c,v)=>l.jsxs("span",{style:{display:"contents"},children:[l.jsxs("div",{className:`ep-node ${c.status}`,children:[l.jsx("div",{className:"ep-icon",children:c.icon}),l.jsx("div",{className:"ep-name",children:c.dept})]}),vx.setModalTaskId),c=te(x=>x.toast),v=te(x=>x.loadAll),y=o.heartbeat||{status:"unknown",label:"⚪"},D="st-"+(o.state||""),T="dt-"+(o.org||"").replace(/\s/g,""),E=fu.find((x,A)=>io(o)[A].status==="active"),L=o.todos||[],_=L.filter(x=>x.status==="completed").length,z=L.length,d=!["Done","Blocked","Cancelled"].includes(o.state),N=["Blocked","Cancelled"].includes(o.state),j=ts(o),$=o.block&&o.block!=="无"&&o.block!=="-",S=async(x,A)=>{if(A.stopPropagation(),x==="stop"||x==="cancel"){const Q=prompt(x==="stop"?"请输入叫停原因:":"请输入取消原因:");if(Q===null)return;try{const P=await ce.taskAction(o.id,x,Q);P.ok?(c(P.message||"操作成功"),v()):c(P.error||"操作失败","err")}catch{c("服务器连接失败","err")}}else if(x==="resume")try{const Q=await ce.taskAction(o.id,"resume","恢复执行");Q.ok?(c(Q.message||"已恢复"),v()):c(Q.error||"操作失败","err")}catch{c("服务器连接失败","err")}},M=async x=>{x.stopPropagation();try{const A=await ce.archiveTask(o.id,!o.archived);A.ok?(c(A.message||"操作成功"),v()):c(A.error||"操作失败","err")}catch{c("服务器连接失败","err")}};return l.jsxs("div",{className:`edict-card${j?" archived":""}`,onClick:()=>f(o.id),children:[l.jsx(Qf,{task:o}),l.jsx("div",{className:"ec-id",children:o.id}),l.jsx("div",{className:"ec-title",children:o.title||"(无标题)"}),l.jsxs("div",{className:"ec-meta",children:[l.jsx("span",{className:`tag ${D}`,children:so(o)}),o.org&&l.jsx("span",{className:`tag ${T}`,children:o.org}),E&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["当前: ",l.jsxs("b",{style:{color:ql(E.dept)},children:[E.dept," · ",E.action]})]})]}),o.now&&o.now!=="-"&&l.jsx("div",{style:{fontSize:11,color:"var(--muted)",lineHeight:1.5,marginBottom:6},children:o.now.substring(0,80)}),(o.review_round||0)>0&&l.jsxs("div",{style:{fontSize:11,marginBottom:6},children:[Array.from({length:o.review_round||0},(x,A)=>l.jsx("span",{style:{display:"inline-block",width:14,height:14,borderRadius:"50%",background:A<(o.review_round||0)-1?"#1a3a6a22":"var(--acc)22",border:`1px solid ${A<(o.review_round||0)-1?"#2a4a8a":"var(--acc)"}`,fontSize:9,textAlign:"center",lineHeight:"13px",marginRight:2,color:A<(o.review_round||0)-1?"#4a6aaa":"var(--acc)"},children:A+1},A)),l.jsxs("span",{style:{color:"var(--muted)",fontSize:10},children:["第 ",o.review_round," 轮磋商"]})]}),z>0&&l.jsxs("div",{className:"ec-todo-bar",children:[l.jsxs("span",{children:["📋 ",_,"/",z]}),l.jsx("div",{className:"ec-todo-track",children:l.jsx("div",{className:"ec-todo-fill",style:{width:`${Math.round(_/z*100)}%`}})}),l.jsx("span",{children:_===z?"✅ 全部完成":"🔄 进行中"})]}),l.jsxs("div",{className:"ec-footer",children:[l.jsx("span",{className:`hb ${y.status}`,children:y.label}),$&&l.jsxs("span",{className:"tag",style:{borderColor:"#ff527044",color:"var(--danger)",background:"#200a10"},children:["🚫 ",o.block]}),o.eta&&o.eta!=="-"&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["📅 ",o.eta]})]}),l.jsxs("div",{className:"ec-actions",onClick:x=>x.stopPropagation(),children:[d&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"mini-act",onClick:x=>S("stop",x),children:"⏸ 叫停"}),l.jsx("button",{className:"mini-act danger",onClick:x=>S("cancel",x),children:"🚫 取消"})]}),N&&l.jsx("button",{className:"mini-act",onClick:x=>S("resume",x),children:"▶ 恢复"}),j&&!o.archived&&l.jsx("button",{className:"mini-act",onClick:M,children:"📦 归档"}),o.archived&&l.jsx("button",{className:"mini-act",onClick:M,children:"📤 取消归档"})]})]})}function Gf(){const o=te(j=>j.liveStatus),f=te(j=>j.edictFilter),c=te(j=>j.setEdictFilter),v=te(j=>j.toast),y=te(j=>j.loadAll),T=((o==null?void 0:o.tasks)||[]).filter(fn),E=T.filter(j=>!ts(j)),L=T.filter(j=>ts(j));let _;f==="active"?_=E:f==="archived"?_=L:_=T,_.sort((j,$)=>(cu[j.state]??9)-(cu[$.state]??9));const z=T.filter(j=>!j.archived&&["Done","Cancelled"].includes(j.state)),d=async()=>{if(confirm("将所有已完成/已取消的旨意移入归档?"))try{const j=await ce.archiveAllDone();j.ok?(v(`📦 ${j.count||0} 道旨意已归档`),y()):v(j.error||"批量归档失败","err")}catch{v("服务器连接失败","err")}},N=async()=>{try{const j=await ce.schedulerScan();j.ok?v(`🧭 太子巡检完成:${j.count||0} 个动作`):v(j.error||"巡检失败","err"),y()}catch{v("服务器连接失败","err")}};return l.jsxs("div",{children:[l.jsxs("div",{className:"archive-bar",children:[l.jsx("span",{className:"ab-label",children:"筛选:"}),["active","archived","all"].map(j=>l.jsx("button",{className:`ab-btn ${f===j?"active":""}`,onClick:()=>c(j),children:j==="active"?"活跃":j==="archived"?"归档":"全部"},j)),z.length>0&&l.jsx("button",{className:"ab-btn",onClick:d,children:"📦 一键归档"}),l.jsxs("span",{className:"ab-count",children:["活跃 ",E.length," · 归档 ",L.length," · 共 ",T.length]}),l.jsx("button",{className:"ab-scan",onClick:N,children:"🧭 太子巡检"})]}),l.jsx("div",{className:"edict-grid",children:_.length===0?l.jsxs("div",{className:"empty",style:{gridColumn:"1/-1"},children:["暂无旨意",l.jsx("br",{}),l.jsx("small",{style:{fontSize:11,marginTop:6,display:"block",color:"var(--muted)"},children:"通过飞书向太子发送任务,太子分拣后转中书省处理"})]}):_.map(j=>l.jsx(Kf,{task:j},j.id))})]})}function Yf(){var Q;const o=te(P=>P.liveStatus),f=te(P=>P.agentsStatusData),c=te(P=>P.officialsData),v=te(P=>P.loadAgentsStatus),y=te(P=>P.setModalTaskId),D=te(P=>P.toast);V.useEffect(()=>{v()},[v]);const E=((o==null?void 0:o.tasks)||[]).filter(P=>fn(P)&&P.state!=="Done"&&P.state!=="Next"),L={};c!=null&&c.officials&&c.officials.forEach(P=>{L[P.id]=P});const _=async P=>{try{const re=await ce.agentWake(P);D(re.message||"唤醒指令已发出"),setTimeout(()=>v(),3e4)}catch{D("唤醒失败","err")}},z=async()=>{if(!f)return;const P=f.agents.filter(re=>re.id!=="main"&&re.status!=="running"&&re.status!=="unconfigured");if(!P.length){D("所有 Agent 均已在线");return}D(`正在唤醒 ${P.length} 个 Agent...`);for(const re of P)try{await ce.agentWake(re.id)}catch{}D(`${P.length} 个唤醒指令已发出,30秒后刷新状态`),setTimeout(()=>v(),3e4)},d=f,N=((Q=d==null?void 0:d.agents)==null?void 0:Q.filter(P=>P.id!=="main"))||[],j=N.filter(P=>P.status==="running").length,$=N.filter(P=>P.status==="idle").length,S=N.filter(P=>P.status==="offline").length,M=N.filter(P=>P.status==="unconfigured").length,x=d==null?void 0:d.gateway,A=x!=null&&x.probe?"ok":x!=null&&x.alive?"warn":"err";return l.jsxs("div",{children:[d&&d.ok&&l.jsxs("div",{className:"as-panel",children:[l.jsxs("div",{className:"as-header",children:[l.jsx("span",{className:"as-title",children:"🔌 Agent 在线状态"}),l.jsxs("span",{className:`as-gw ${A}`,children:["Gateway: ",(x==null?void 0:x.status)||"未知"]}),l.jsx("button",{className:"btn-refresh",onClick:()=>v(),style:{marginLeft:8},children:"🔄 刷新"}),S+M>0&&l.jsx("button",{className:"btn-refresh",onClick:z,style:{marginLeft:4,borderColor:"var(--warn)",color:"var(--warn)"},children:"⚡ 全部唤醒"})]}),l.jsx("div",{className:"as-grid",children:N.map(P=>{const re=P.status!=="running"&&P.status!=="unconfigured"&&(x==null?void 0:x.alive);return l.jsxs("div",{className:"as-card",title:`${P.role} · ${P.statusLabel}`,children:[l.jsx("div",{className:`as-dot ${P.status}`}),l.jsx("div",{style:{fontSize:22},children:P.emoji}),l.jsx("div",{style:{fontSize:12,fontWeight:700},children:P.label}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:P.role}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:P.statusLabel}),P.lastActive?l.jsxs("div",{style:{fontSize:10,color:"var(--muted)"},children:["⏰ ",P.lastActive]}):l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:"无活动记录"}),re&&l.jsx("button",{className:"as-wake-btn",onClick:pe=>{pe.stopPropagation(),_(P.id)},children:"⚡ 唤醒"})]},P.id)})}),l.jsxs("div",{className:"as-summary",children:[l.jsxs("span",{children:[l.jsx("span",{className:"as-dot running",style:{position:"static",width:8,height:8}})," ",j," 运行中"]}),l.jsxs("span",{children:[l.jsx("span",{className:"as-dot idle",style:{position:"static",width:8,height:8}})," ",$," 待命"]}),S>0&&l.jsxs("span",{children:[l.jsx("span",{className:"as-dot offline",style:{position:"static",width:8,height:8}})," ",S," 离线"]}),M>0&&l.jsxs("span",{children:[l.jsx("span",{className:"as-dot unconfigured",style:{position:"static",width:8,height:8}})," ",M," 未配置"]}),l.jsxs("span",{style:{marginLeft:"auto",fontSize:10,color:"var(--muted)"},children:["检测于 ",(d.checkedAt||"").substring(11,19)]})]})]}),l.jsx("div",{className:"duty-grid",children:pu.map(P=>{const re=E.filter(se=>se.org===P.label),pe=re.some(se=>se.state==="Doing"),ve=re.some(se=>se.state==="Blocked"),he=L[P.id],Be=(he==null?void 0:he.heartbeat)||{status:"idle"},X=ve?"blocked":pe?"busy":Be.status==="active"?"active":"idle",ae=ve?"⚠️ 阻塞":pe?"⚙️ 执行中":Be.status==="active"?"🟢 活跃":"⚪ 候命",Se=ve?"blocked-card":pe?"active-card":"";return l.jsxs("div",{className:`duty-card ${Se}`,children:[l.jsxs("div",{className:"dc-hdr",children:[l.jsx("span",{className:"dc-emoji",children:P.emoji}),l.jsxs("div",{className:"dc-info",children:[l.jsx("div",{className:"dc-name",children:P.label}),l.jsxs("div",{className:"dc-role",children:[P.role," · ",P.rank]})]}),l.jsxs("div",{className:"dc-status",children:[l.jsx("span",{className:`dc-dot ${X}`}),l.jsx("span",{children:ae})]})]}),l.jsx("div",{className:"dc-body",children:re.length>0?re.map(se=>l.jsxs("div",{className:"dc-task",onClick:()=>y(se.id),children:[l.jsx("div",{className:"dc-task-id",children:se.id}),l.jsx("div",{className:"dc-task-title",children:se.title||"(无标题)"}),se.now&&se.now!=="-"&&l.jsx("div",{className:"dc-task-now",children:se.now.substring(0,70)}),l.jsxs("div",{className:"dc-task-meta",children:[l.jsx("span",{className:`tag st-${se.state}`,children:so(se)}),se.block&&se.block!=="无"&&l.jsxs("span",{className:"tag",style:{borderColor:"#ff527044",color:"var(--danger)"},children:["🚫",se.block]})]})]},se.id)):l.jsxs("div",{className:"dc-idle",children:[l.jsx("span",{style:{fontSize:20},children:"🪭"}),l.jsx("span",{children:"候命中"})]})}),l.jsxs("div",{className:"dc-footer",children:[l.jsxs("span",{className:"dc-model",children:["🤖 ",(he==null?void 0:he.model_short)||"待配置"]}),(he==null?void 0:he.last_active)&&l.jsxs("span",{className:"dc-la",children:["⏰ ",he.last_active]})]})]},P.id)})})]})}const Xf=["🥇","🥈","🥉"];function Zf(){var d;const o=te(N=>N.officialsData),f=te(N=>N.selectedOfficial),c=te(N=>N.setSelectedOfficial),v=te(N=>N.loadOfficials),y=te(N=>N.setModalTaskId);if(V.useEffect(()=>{v()},[v]),!(o!=null&&o.officials))return l.jsx("div",{className:"empty",children:"⚠️ 请确保本地服务器已启动"});const D=o.officials,T=o.totals||{tasks_done:0,cost_cny:0},E=Math.max(...D.map(N=>N.tokens_in+N.tokens_out+N.cache_read+N.cache_write),1),L=D.filter(N=>{var j;return((j=N.heartbeat)==null?void 0:j.status)==="active"}),_=D.find(N=>{var j;return N.id===(f||((j=D[0])==null?void 0:j.id))}),z=(_==null?void 0:_.id)||((d=D[0])==null?void 0:d.id);return l.jsxs("div",{children:[L.length>0&&l.jsxs("div",{className:"off-activity",children:[l.jsx("span",{children:"🟢 当前活跃:"}),L.map(N=>l.jsxs("span",{style:{fontSize:12},children:[N.emoji," ",N.role]},N.id)),l.jsx("span",{style:{color:"var(--muted)",fontSize:11,marginLeft:"auto"},children:"其余官员待命"})]}),l.jsxs("div",{className:"off-kpi",children:[l.jsxs("div",{className:"kpi",children:[l.jsx("div",{className:"kpi-v",style:{color:"var(--acc)"},children:D.length}),l.jsx("div",{className:"kpi-l",children:"在职官员"})]}),l.jsxs("div",{className:"kpi",children:[l.jsx("div",{className:"kpi-v",style:{color:"#f5c842"},children:T.tasks_done||0}),l.jsx("div",{className:"kpi-l",children:"累计完成旨意"})]}),l.jsxs("div",{className:"kpi",children:[l.jsxs("div",{className:"kpi-v",style:{color:(T.cost_cny||0)>20?"var(--warn)":"var(--ok)"},children:["¥",T.cost_cny||0]}),l.jsx("div",{className:"kpi-l",children:"累计费用(含缓存)"})]}),l.jsxs("div",{className:"kpi",children:[l.jsx("div",{className:"kpi-v",style:{fontSize:16,paddingTop:4},children:o.top_official||"—"}),l.jsx("div",{className:"kpi-l",children:"功绩最高"})]})]}),l.jsxs("div",{className:"off-layout",children:[l.jsxs("div",{className:"off-ranklist",children:[l.jsx("div",{className:"orl-hdr",children:"功绩排行"}),D.map(N=>{const j=N.heartbeat||{status:"idle"};return l.jsxs("div",{className:`orl-item${z===N.id?" selected":""}`,onClick:()=>c(N.id),children:[l.jsx("span",{style:{minWidth:24,textAlign:"center"},children:N.merit_rank<=3?Xf[N.merit_rank-1]:"#"+N.merit_rank}),l.jsx("span",{children:N.emoji}),l.jsxs("span",{style:{flex:1},children:[l.jsx("div",{style:{fontSize:12,fontWeight:700},children:N.role}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:N.label})]}),l.jsxs("span",{style:{fontSize:11},children:[N.merit_score,"分"]}),l.jsx("span",{className:`dc-dot ${j.status}`,style:{width:8,height:8}})]},N.id)})]}),l.jsx("div",{className:"off-detail",children:_?l.jsx(Jf,{official:_,maxTk:E,onOpenTask:y}):l.jsx("div",{className:"empty",children:"选择左侧官员查看详情"})})]})]})}function Jf({official:o,maxTk:f,onOpenTask:c}){const v=o.heartbeat||{status:"idle",label:"⚪ 待命"},y=o.tokens_in+o.tokens_out+o.cache_read+o.cache_write,D=o.participated_edicts||[],T=[{l:"输入",v:o.tokens_in,color:"#6a9eff"},{l:"输出",v:o.tokens_out,color:"#a07aff"},{l:"缓存读",v:o.cache_read,color:"#2ecc8a"},{l:"缓存写",v:o.cache_write,color:"#f5c842"}];return l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center",marginBottom:20},children:[l.jsx("div",{style:{fontSize:40},children:o.emoji}),l.jsxs("div",{style:{flex:1},children:[l.jsx("div",{style:{fontSize:18,fontWeight:800},children:o.role}),l.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:[o.label," · ",l.jsx("span",{style:{color:"var(--acc)"},children:o.model_short||o.model})]}),l.jsxs("div",{style:{fontSize:11,color:"var(--muted)",marginTop:2},children:["🏅 ",o.rank," · 功绩分 ",o.merit_score]})]}),l.jsxs("div",{style:{textAlign:"right"},children:[l.jsx("div",{className:`hb ${v.status}`,style:{marginBottom:4},children:v.label}),o.last_active&&l.jsxs("div",{style:{fontSize:10,color:"var(--muted)"},children:["活跃 ",o.last_active]}),l.jsxs("div",{style:{fontSize:10,color:"var(--muted)",marginTop:2},children:[o.sessions," 个会话 · ",o.messages," 条消息"]})]})]}),l.jsxs("div",{style:{marginBottom:18},children:[l.jsx("div",{className:"sec-title",children:"功绩统计"}),l.jsxs("div",{style:{display:"flex",gap:16},children:[l.jsxs("div",{style:{textAlign:"center"},children:[l.jsx("div",{style:{fontSize:20,fontWeight:800,color:"var(--ok)"},children:o.tasks_done}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:"完成旨意"})]}),l.jsxs("div",{style:{textAlign:"center"},children:[l.jsx("div",{style:{fontSize:20,fontWeight:800,color:"var(--warn)"},children:o.tasks_active}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:"执行中"})]}),l.jsxs("div",{style:{textAlign:"center"},children:[l.jsx("div",{style:{fontSize:20,fontWeight:800,color:"var(--acc)"},children:o.flow_participations}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:"流转参与"})]})]})]}),l.jsxs("div",{style:{marginBottom:18},children:[l.jsx("div",{className:"sec-title",children:"Token 消耗"}),T.map(E=>l.jsxs("div",{style:{marginBottom:6},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,marginBottom:2},children:[l.jsx("span",{style:{color:"var(--muted)"},children:E.l}),l.jsx("span",{children:E.v.toLocaleString()})]}),l.jsx("div",{style:{height:6,background:"#0e1320",borderRadius:3},children:l.jsx("div",{style:{height:"100%",width:`${f>0?Math.round(E.v/f*100):0}%`,background:E.color,borderRadius:3}})})]},E.l))]}),l.jsxs("div",{style:{marginBottom:18},children:[l.jsx("div",{className:"sec-title",children:"累计费用"}),l.jsxs("div",{style:{display:"flex",gap:10},children:[l.jsxs("span",{style:{fontSize:12,color:o.cost_cny>10?"var(--danger)":o.cost_cny>3?"var(--warn)":"var(--ok)"},children:[l.jsxs("b",{children:["¥",o.cost_cny]})," 人民币"]}),l.jsxs("span",{style:{fontSize:12},children:[l.jsxs("b",{children:["$",o.cost_usd]})," 美元"]}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["总计 ",y.toLocaleString()," tokens"]})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"sec-title",children:["参与旨意(",D.length," 道)"]}),D.length===0?l.jsx("div",{style:{fontSize:12,color:"var(--muted)",padding:"8px 0"},children:"暂无旨意记录"}):l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:D.map(E=>l.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"6px 8px",borderRadius:6,cursor:"pointer",border:"1px solid var(--line)"},onClick:()=>c(E.id),children:[l.jsx("span",{style:{fontSize:10,color:"var(--acc)",fontWeight:700},children:E.id}),l.jsx("span",{style:{flex:1,fontSize:12},children:E.title.substring(0,35)}),l.jsx("span",{className:`tag st-${E.state}`,style:{fontSize:10},children:Wr[E.state]||E.state})]},E.id))})]})]})}const qf=[{id:"anthropic/claude-sonnet-4-6",l:"Claude Sonnet 4.6",p:"Anthropic"},{id:"anthropic/claude-opus-4-5",l:"Claude Opus 4.5",p:"Anthropic"},{id:"anthropic/claude-haiku-3-5",l:"Claude Haiku 3.5",p:"Anthropic"},{id:"openai/gpt-4o",l:"GPT-4o",p:"OpenAI"},{id:"openai/gpt-4o-mini",l:"GPT-4o Mini",p:"OpenAI"},{id:"google/gemini-2.5-pro",l:"Gemini 2.5 Pro",p:"Google"},{id:"copilot/claude-sonnet-4",l:"Claude Sonnet 4",p:"Copilot"},{id:"copilot/claude-opus-4.5",l:"Claude Opus 4.5",p:"Copilot"},{id:"copilot/gpt-4o",l:"GPT-4o",p:"Copilot"},{id:"copilot/gemini-2.5-pro",l:"Gemini 2.5 Pro",p:"Copilot"}],ep=[{id:"feishu",label:"飞书 Feishu"},{id:"telegram",label:"Telegram"},{id:"wecom",label:"企业微信 WeCom"},{id:"discord",label:"Discord"},{id:"slack",label:"Slack"},{id:"signal",label:"Signal"},{id:"tui",label:"TUI (终端)"}];function tp(){var M;const o=te(x=>x.agentConfig),f=te(x=>x.changeLog),c=te(x=>x.loadAgentConfig),v=te(x=>x.toast),[y,D]=V.useState({}),[T,E]=V.useState({}),[L,_]=V.useState("feishu"),[z,d]=V.useState("");if(V.useEffect(()=>{c()},[c]),V.useEffect(()=>{if(o!=null&&o.agents){const x={};o.agents.forEach(A=>{x[A.id]=A.model}),D(x)}o!=null&&o.dispatchChannel&&_(o.dispatchChannel)},[o]),!(o!=null&&o.agents))return l.jsx("div",{className:"empty",style:{gridColumn:"1/-1"},children:"⚠️ 请先启动本地服务器"});const N=(M=o.knownModels)!=null&&M.length?o.knownModels.map(x=>({id:x.id,l:x.label,p:x.provider})):qf,j=(x,A)=>{D(Q=>({...Q,[x]:A}))},$=x=>{const A=o.agents.find(Q=>Q.id===x);A&&D(Q=>({...Q,[x]:A.model}))},S=async x=>{const A=y[x];if(A){E(Q=>({...Q,[x]:{cls:"pending",text:"⟳ 提交中…"}}));try{const Q=await ce.setModel(x,A);Q.ok?(E(P=>({...P,[x]:{cls:"ok",text:"✅ 已提交,Gateway 重启中(约5秒)"}})),v(x+" 模型已更改","ok"),setTimeout(()=>c(),5500)):E(P=>({...P,[x]:{cls:"err",text:"❌ "+(Q.error||"错误")}}))}catch{E(Q=>({...Q,[x]:{cls:"err",text:"❌ 无法连接服务器"}}))}}};return l.jsxs("div",{children:[l.jsx("div",{className:"model-grid",children:o.agents.map(x=>{const A=y[x.id]||x.model,Q=A!==x.model,P=T[x.id];return l.jsxs("div",{className:"mc-card",children:[l.jsxs("div",{className:"mc-top",children:[l.jsx("span",{className:"mc-emoji",children:x.emoji||"🏛️"}),l.jsxs("div",{children:[l.jsxs("div",{className:"mc-name",children:[x.label," ",l.jsx("span",{style:{fontSize:11,color:"var(--muted)"},children:x.id})]}),l.jsx("div",{className:"mc-role",children:x.role})]})]}),l.jsxs("div",{className:"mc-cur",children:["当前: ",l.jsx("b",{children:x.model})]}),l.jsx("select",{className:"msel",value:A,onChange:re=>j(x.id,re.target.value),children:N.map(re=>l.jsxs("option",{value:re.id,children:[re.l," (",re.p,")"]},re.id))}),l.jsxs("div",{className:"mc-btns",children:[l.jsx("button",{className:"btn btn-p",disabled:!Q,onClick:()=>S(x.id),children:"应用"}),l.jsx("button",{className:"btn btn-g",onClick:()=>$(x.id),children:"重置"})]}),P&&l.jsx("div",{className:`mc-st ${P.cls}`,children:P.text})]},x.id)})}),l.jsxs("div",{style:{marginTop:24,marginBottom:8},children:[l.jsx("div",{className:"sec-title",children:"派发渠道"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0"},children:[l.jsx("select",{className:"msel",value:L,onChange:x=>_(x.target.value),style:{maxWidth:220},children:ep.map(x=>l.jsx("option",{value:x.id,children:x.label},x.id))}),l.jsx("button",{className:"btn btn-p",disabled:L===((o==null?void 0:o.dispatchChannel)||"feishu"),onClick:async()=>{try{const x=await ce.setDispatchChannel(L);x.ok?(d("✅ 已保存"),v("派发渠道已切换","ok"),c()):d("❌ "+(x.error||"失败"))}catch{d("❌ 无法连接")}setTimeout(()=>d(""),3e3)},children:"应用"}),z&&l.jsx("span",{style:{fontSize:12,color:z.startsWith("✅")?"var(--success)":"var(--danger)"},children:z})]}),l.jsx("div",{style:{fontSize:11,color:"var(--muted)"},children:"自动派发时使用的 OpenClaw 通知渠道(需已在 openclaw.json 中配置对应 channel)"})]}),l.jsxs("div",{style:{marginTop:24},children:[l.jsx("div",{className:"sec-title",children:"变更日志"}),l.jsx("div",{className:"cl-list",children:f!=null&&f.length?[...f].reverse().slice(0,15).map((x,A)=>l.jsxs("div",{className:"cl-row",children:[l.jsx("span",{className:"cl-t",children:(x.at||"").substring(0,16).replace("T"," ")}),l.jsx("span",{className:"cl-a",children:x.agentId}),l.jsxs("span",{className:"cl-c",children:[l.jsx("b",{children:x.oldModel})," → ",l.jsx("b",{children:x.newModel}),x.rolledBack&&l.jsx("span",{style:{color:"var(--danger)",fontSize:10,border:"1px solid #ff527044",padding:"1px 5px",borderRadius:3,marginLeft:4},children:"⚠ 已回滚"})]})]},A)):l.jsx("div",{style:{fontSize:12,color:"var(--muted)",padding:"8px 0"},children:"暂无变更"})})]})]})}const np=[{label:"obra/superpowers",emoji:"⚡",stars:"66.9k",desc:"完整开发工作流技能集",skills:[{name:"brainstorming",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/brainstorming/SKILL.md"},{name:"test-driven-development",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/test-driven-development/SKILL.md"},{name:"systematic-debugging",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/systematic-debugging/SKILL.md"},{name:"subagent-driven-development",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/subagent-driven-development/SKILL.md"},{name:"writing-plans",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/writing-plans/SKILL.md"},{name:"executing-plans",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/executing-plans/SKILL.md"},{name:"requesting-code-review",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/requesting-code-review/SKILL.md"},{name:"root-cause-tracing",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/root-cause-tracing/SKILL.md"},{name:"verification-before-completion",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/verification-before-completion/SKILL.md"},{name:"dispatching-parallel-agents",url:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/dispatching-parallel-agents/SKILL.md"}]},{label:"anthropics/skills",emoji:"🏛️",stars:"官方",desc:"Anthropic 官方技能库",skills:[{name:"docx",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/docx/SKILL.md"},{name:"pdf",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/pdf/SKILL.md"},{name:"xlsx",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/xlsx/SKILL.md"},{name:"pptx",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/pptx/SKILL.md"},{name:"mcp-builder",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/mcp-builder/SKILL.md"},{name:"frontend-design",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/frontend-design/SKILL.md"},{name:"web-artifacts-builder",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/web-artifacts-builder/SKILL.md"},{name:"webapp-testing",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/webapp-testing/SKILL.md"},{name:"algorithmic-art",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/algorithmic-art/SKILL.md"},{name:"canvas-design",url:"https://raw.githubusercontent.com/anthropics/skills/main/skills/canvas-design/SKILL.md"}]},{label:"ComposioHQ/awesome-claude-skills",emoji:"🌐",stars:"39.2k",desc:"100+ 社区精选技能",skills:[{name:"github-integration",url:"https://raw.githubusercontent.com/ComposioHQ/awesome-claude-skills/master/github-integration/SKILL.md"},{name:"data-analysis",url:"https://raw.githubusercontent.com/ComposioHQ/awesome-claude-skills/master/data-analysis/SKILL.md"},{name:"code-review",url:"https://raw.githubusercontent.com/ComposioHQ/awesome-claude-skills/master/code-review/SKILL.md"}]}];function rp(){const o=te(g=>g.agentConfig),f=te(g=>g.loadAgentConfig),c=te(g=>g.toast),[v,y]=V.useState(null),[D,T]=V.useState(null),[E,L]=V.useState({name:"",desc:"",trigger:""}),[_,z]=V.useState(!1),[d,N]=V.useState("local"),[j,$]=V.useState([]),[S,M]=V.useState(!1),[x,A]=V.useState(!1),[Q,P]=V.useState({agentId:"",skillName:"",sourceUrl:"",description:""}),[re,pe]=V.useState(!1),[ve,he]=V.useState(null),[Be,X]=V.useState(null),[ae,Se]=V.useState(null),[se,ee]=V.useState("");V.useEffect(()=>{f()},[f]),V.useEffect(()=>{d==="remote"&&Ce()},[d]);const Ce=async()=>{M(!0);try{const g=await ce.remoteSkillsList();g.ok&&$(g.remoteSkills||[])}catch{c("远程技能列表加载失败","err")}M(!1)},_e=async(g,H)=>{y({agentId:g,name:H,content:"⟳ 加载中…",path:""});try{const ne=await ce.skillContent(g,H);ne.ok?y({agentId:g,name:H,content:ne.content||"",path:ne.path||""}):y({agentId:g,name:H,content:"❌ "+(ne.error||"无法读取"),path:""})}catch{y({agentId:g,name:H,content:"❌ 服务器连接失败",path:""})}},xe=(g,H)=>{T({agentId:g,agentLabel:H}),L({name:"",desc:"",trigger:""})},b=async g=>{if(g.preventDefault(),!(!D||!E.name)){z(!0);try{const H=await ce.addSkill(D.agentId,E.name,E.desc,E.trigger);H.ok?(c(`✅ 技能 ${E.name} 已添加到 ${D.agentLabel}`,"ok"),T(null),f()):c(H.error||"添加失败","err")}catch{c("服务器连接失败","err")}z(!1)}},G=async g=>{g.preventDefault();const{agentId:H,skillName:ne,sourceUrl:ke,description:je}=Q;if(!(!H||!ne||!ke)){pe(!0);try{const $e=await ce.addRemoteSkill(H,ne,ke,je);$e.ok?(c(`✅ 远程技能 ${ne} 已添加到 ${H}`,"ok"),A(!1),P({agentId:"",skillName:"",sourceUrl:"",description:""}),Ce(),f()):c($e.error||"添加失败","err")}catch{c("服务器连接失败","err")}pe(!1)}},U=async g=>{const H=`${g.agentId}/${g.skillName}`;he(H);try{const ne=await ce.updateRemoteSkill(g.agentId,g.skillName);ne.ok?(c(`✅ 技能 ${g.skillName} 已更新`,"ok"),Ce()):c(ne.error||"更新失败","err")}catch{c("服务器连接失败","err")}he(null)},h=async g=>{const H=`${g.agentId}/${g.skillName}`;X(H);try{const ne=await ce.removeRemoteSkill(g.agentId,g.skillName);ne.ok?(c(`🗑️ 技能 ${g.skillName} 已移除`,"ok"),Ce(),f()):c(ne.error||"移除失败","err")}catch{c("服务器连接失败","err")}X(null)},I=async(g,H)=>{if(!se){c("请先选择目标 Agent","err");return}try{const ne=await ce.addRemoteSkill(se,H,g,"");ne.ok?(c(`✅ ${H} → ${se}`,"ok"),Ce(),f()):c(ne.error||"导入失败","err")}catch{c("服务器连接失败","err")}};if(!(o!=null&&o.agents))return l.jsx("div",{className:"empty",children:"无法加载"});const me=l.jsx("div",{children:l.jsx("div",{className:"skills-grid",children:o.agents.map(g=>l.jsxs("div",{className:"sk-card",children:[l.jsxs("div",{className:"sk-hdr",children:[l.jsx("span",{className:"sk-emoji",children:g.emoji||"🏛️"}),l.jsx("span",{className:"sk-name",children:g.label}),l.jsxs("span",{className:"sk-cnt",children:[(g.skills||[]).length," 技能"]})]}),l.jsx("div",{className:"sk-list",children:(g.skills||[]).length?(g.skills||[]).map(H=>l.jsxs("div",{className:"sk-item",onClick:()=>_e(g.id,H.name),children:[l.jsxs("span",{className:"si-name",children:["📦 ",H.name]}),l.jsx("span",{className:"si-desc",children:H.description||"无描述"}),l.jsx("span",{className:"si-arrow",children:"›"})]},H.name)):l.jsx("div",{className:"sk-empty",children:"暂无 Skills"})}),l.jsx("div",{className:"sk-add",onClick:()=>xe(g.id,g.label),children:"+ 添加技能"})]},g.id))})}),fe=l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",gap:10,marginBottom:20,flexWrap:"wrap",alignItems:"center"},children:[l.jsx("button",{style:{padding:"8px 18px",background:"var(--acc)",color:"#fff",border:"none",borderRadius:8,cursor:"pointer",fontWeight:600,fontSize:13},onClick:()=>{A(!0),Se(null)},children:"+ 添加远程 Skill"}),l.jsx("button",{style:{padding:"8px 14px",background:"transparent",color:"var(--acc)",border:"1px solid var(--acc)",borderRadius:8,cursor:"pointer",fontSize:12},onClick:Ce,children:"⟳ 刷新列表"}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)",marginLeft:4},children:["共 ",j.length," 个远程技能"]})]}),l.jsxs("div",{style:{marginBottom:24},children:[l.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--muted)",letterSpacing:".06em",marginBottom:10},children:"🌐 社区技能源 — 一键导入"}),l.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:np.map(g=>l.jsxs("div",{onClick:()=>Se((ae==null?void 0:ae.label)===g.label?null:g),style:{padding:"8px 14px",background:(ae==null?void 0:ae.label)===g.label?"#0d1f45":"var(--panel)",border:`1px solid ${(ae==null?void 0:ae.label)===g.label?"var(--acc)":"var(--line)"}`,borderRadius:10,cursor:"pointer",fontSize:12,transition:"all .15s"},children:[l.jsx("span",{style:{marginRight:6},children:g.emoji}),l.jsx("b",{style:{color:"var(--text)"},children:g.label}),l.jsxs("span",{style:{marginLeft:6,color:"#f0b429",fontSize:11},children:["★ ",g.stars]}),l.jsx("span",{style:{marginLeft:8,color:"var(--muted)"},children:g.desc})]},g.label))}),ae&&l.jsxs("div",{style:{marginTop:14,background:"var(--panel)",border:"1px solid var(--line)",borderRadius:12,padding:16},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[l.jsx("span",{style:{fontSize:12,fontWeight:600},children:"目标 Agent:"}),l.jsxs("select",{value:se,onChange:g=>ee(g.target.value),style:{padding:"6px 10px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:12},children:[l.jsx("option",{value:"",children:"— 选择 Agent —"}),o.agents.map(g=>l.jsxs("option",{value:g.id,children:[g.emoji," ",g.label," (",g.id,")"]},g.id))]})]}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:8},children:ae.skills.map(g=>{const H=j.some(ne=>ne.skillName===g.name&&ne.agentId===se);return l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:"var(--panel2)",borderRadius:8,border:"1px solid var(--line)"},children:[l.jsxs("div",{children:[l.jsxs("div",{style:{fontSize:12,fontWeight:600},children:["📦 ",g.name]}),l.jsx("div",{style:{fontSize:10,color:"var(--muted)",wordBreak:"break-all",maxWidth:180},children:g.url.split("/").slice(-2).join("/")})]}),H?l.jsx("span",{style:{fontSize:10,color:"#4caf88",fontWeight:600},children:"✓ 已导入"}):l.jsx("button",{onClick:()=>I(g.url,g.name),style:{padding:"4px 10px",background:"var(--acc)",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontSize:11,whiteSpace:"nowrap"},children:"导入"})]},g.name)})})]})]}),S?l.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--muted)",fontSize:13},children:"⟳ 加载中…"}):j.length===0?l.jsxs("div",{style:{textAlign:"center",padding:"40px",background:"var(--panel)",borderRadius:12,border:"1px dashed var(--line)"},children:[l.jsx("div",{style:{fontSize:32,marginBottom:10},children:"🌐"}),l.jsx("div",{style:{fontSize:14,color:"var(--muted)"},children:"尚无远程技能"}),l.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:6},children:"从社区技能源快速导入,或手动添加 URL"})]}):l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:j.map(g=>{var $e;const H=`${g.agentId}/${g.skillName}`,ne=ve===H,ke=Be===H,je=o.agents.find(mt=>mt.id===g.agentId);return l.jsxs("div",{style:{background:"var(--panel)",border:"1px solid var(--line)",borderRadius:12,padding:"14px 18px",display:"grid",gridTemplateColumns:"1fr auto",gap:12,alignItems:"center"},children:[l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[l.jsxs("span",{style:{fontSize:14,fontWeight:700},children:["📦 ",g.skillName]}),l.jsx("span",{style:{fontSize:10,padding:"2px 8px",borderRadius:999,background:g.status==="valid"?"#0d3322":"#3d1111",color:g.status==="valid"?"#4caf88":"#ff5270",fontWeight:600},children:g.status==="valid"?"✓ 有效":"✗ 文件丢失"}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)",background:"var(--panel2)",padding:"2px 8px",borderRadius:6},children:[je==null?void 0:je.emoji," ",(je==null?void 0:je.label)||g.agentId]})]}),g.description&&l.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginBottom:4},children:g.description}),l.jsxs("div",{style:{fontSize:10,color:"var(--muted)",display:"flex",gap:16,flexWrap:"wrap"},children:[l.jsxs("span",{children:["🔗 ",l.jsx("a",{href:g.sourceUrl,target:"_blank",rel:"noreferrer",style:{color:"var(--acc)",textDecoration:"none"},children:g.sourceUrl.length>60?g.sourceUrl.slice(0,60)+"…":g.sourceUrl})]}),l.jsxs("span",{children:["📅 ",g.lastUpdated?g.lastUpdated.slice(0,10):($e=g.addedAt)==null?void 0:$e.slice(0,10)]})]})]}),l.jsxs("div",{style:{display:"flex",gap:8},children:[l.jsx("button",{onClick:()=>_e(g.agentId,g.skillName),style:{padding:"6px 12px",background:"transparent",color:"var(--muted)",border:"1px solid var(--line)",borderRadius:6,cursor:"pointer",fontSize:11},children:"查看"}),l.jsx("button",{onClick:()=>U(g),disabled:ne,style:{padding:"6px 12px",background:"transparent",color:"var(--acc)",border:"1px solid var(--acc)",borderRadius:6,cursor:"pointer",fontSize:11},children:ne?"⟳":"更新"}),l.jsx("button",{onClick:()=>h(g),disabled:ke,style:{padding:"6px 12px",background:"transparent",color:"#ff5270",border:"1px solid #ff5270",borderRadius:6,cursor:"pointer",fontSize:11},children:ke?"⟳":"删除"})]})]},H)})})]});return l.jsxs("div",{children:[l.jsx("div",{style:{display:"flex",gap:4,marginBottom:20,borderBottom:"1px solid var(--line)",paddingBottom:0},children:[{key:"local",label:"🏛️ 本地技能",count:o.agents.reduce((g,H)=>{var ne;return g+(((ne=H.skills)==null?void 0:ne.length)||0)},0)},{key:"remote",label:"🌐 远程技能",count:j.length}].map(g=>l.jsxs("div",{onClick:()=>N(g.key),style:{padding:"8px 18px",cursor:"pointer",fontSize:13,borderRadius:"8px 8px 0 0",fontWeight:d===g.key?700:400,background:d===g.key?"var(--panel)":"transparent",color:d===g.key?"var(--text)":"var(--muted)",border:d===g.key?"1px solid var(--line)":"1px solid transparent",borderBottom:d===g.key?"1px solid var(--panel)":"1px solid transparent",position:"relative",bottom:-1,transition:"all .15s"},children:[g.label,g.count>0&&l.jsx("span",{style:{marginLeft:6,fontSize:10,padding:"1px 6px",borderRadius:999,background:"#1a2040",color:"var(--acc)"},children:g.count})]},g.key))}),d==="local"?me:fe,v&&l.jsx("div",{className:"modal-bg open",onClick:()=>y(null),children:l.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:()=>y(null),children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{style:{fontSize:11,color:"var(--acc)",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:v.agentId.toUpperCase()}),l.jsxs("div",{style:{fontSize:20,fontWeight:800,marginBottom:16},children:["📦 ",v.name]}),l.jsxs("div",{className:"sk-modal-body",children:[l.jsx("div",{className:"sk-md",style:{whiteSpace:"pre-wrap",fontSize:12,lineHeight:1.7},children:v.content}),v.path&&l.jsxs("div",{className:"sk-path",style:{fontSize:10,color:"var(--muted)",marginTop:12},children:["📂 ",v.path]})]})]})]})}),D&&l.jsx("div",{className:"modal-bg open",onClick:()=>T(null),children:l.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:()=>T(null),children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsxs("div",{style:{fontSize:11,color:"var(--acc)",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:["为 ",D.agentLabel," 添加技能"]}),l.jsx("div",{style:{fontSize:20,fontWeight:800,marginBottom:18},children:"+ 新增 Skill"}),l.jsxs("div",{style:{background:"var(--panel2)",border:"1px solid var(--line)",borderRadius:10,padding:14,marginBottom:18,fontSize:12,lineHeight:1.7,color:"var(--muted)"},children:[l.jsx("b",{style:{color:"var(--text)"},children:"📋 Skill 规范说明"}),l.jsx("br",{}),"• 技能名称使用",l.jsx("b",{style:{color:"var(--text)"},children:"小写英文 + 连字符"}),l.jsx("br",{}),"• 创建后会生成模板文件 SKILL.md",l.jsx("br",{}),"• 技能会在 agent 收到相关任务时",l.jsx("b",{style:{color:"var(--text)"},children:"自动激活"})]}),l.jsxs("form",{onSubmit:b,style:{display:"flex",flexDirection:"column",gap:14},children:[l.jsxs("div",{children:[l.jsxs("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:["技能名称 ",l.jsx("span",{style:{color:"#ff5270"},children:"*"})]}),l.jsx("input",{type:"text",required:!0,placeholder:"如 data-analysis, code-review",value:E.name,onChange:g=>L(H=>({...H,name:g.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13,outline:"none"}})]}),l.jsxs("div",{children:[l.jsx("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:"技能描述"}),l.jsx("input",{type:"text",placeholder:"一句话说明用途",value:E.desc,onChange:g=>L(H=>({...H,desc:g.target.value})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13,outline:"none"}})]}),l.jsxs("div",{children:[l.jsx("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:"触发条件(可选)"}),l.jsx("input",{type:"text",placeholder:"何时激活此技能",value:E.trigger,onChange:g=>L(H=>({...H,trigger:g.target.value})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13,outline:"none"}})]}),l.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",marginTop:4},children:[l.jsx("button",{type:"button",className:"btn btn-g",onClick:()=>T(null),style:{padding:"8px 20px"},children:"取消"}),l.jsx("button",{type:"submit",disabled:_,style:{padding:"8px 20px",fontSize:13,background:"var(--acc)",color:"#fff",border:"none",borderRadius:8,cursor:"pointer",fontWeight:600},children:_?"⟳ 创建中…":"📦 创建技能"})]})]})]})]})}),x&&l.jsx("div",{className:"modal-bg open",onClick:()=>A(!1),children:l.jsxs("div",{className:"modal",style:{maxWidth:520},onClick:g=>g.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:()=>A(!1),children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{style:{fontSize:11,color:"#a07aff",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:"远程技能管理"}),l.jsx("div",{style:{fontSize:20,fontWeight:800,marginBottom:18},children:"🌐 添加远程 Skill"}),l.jsxs("div",{style:{background:"var(--panel2)",border:"1px solid var(--line)",borderRadius:10,padding:12,marginBottom:18,fontSize:11,color:"var(--muted)",lineHeight:1.7},children:["支持 GitHub Raw URL,如:",l.jsx("br",{}),l.jsx("code",{style:{color:"var(--acc)",fontSize:10},children:"https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/skills/brainstorming/SKILL.md"})]}),l.jsxs("form",{onSubmit:G,style:{display:"flex",flexDirection:"column",gap:14},children:[l.jsxs("div",{children:[l.jsxs("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:["目标 Agent ",l.jsx("span",{style:{color:"#ff5270"},children:"*"})]}),l.jsxs("select",{required:!0,value:Q.agentId,onChange:g=>P(H=>({...H,agentId:g.target.value})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13},children:[l.jsx("option",{value:"",children:"— 选择 Agent —"}),o.agents.map(g=>l.jsxs("option",{value:g.id,children:[g.emoji," ",g.label," (",g.id,")"]},g.id))]})]}),l.jsxs("div",{children:[l.jsxs("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:["技能名称 ",l.jsx("span",{style:{color:"#ff5270"},children:"*"})]}),l.jsx("input",{type:"text",required:!0,placeholder:"如 brainstorming, code-review",value:Q.skillName,onChange:g=>P(H=>({...H,skillName:g.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13,outline:"none"}})]}),l.jsxs("div",{children:[l.jsxs("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:["源 URL ",l.jsx("span",{style:{color:"#ff5270"},children:"*"})]}),l.jsx("input",{type:"url",required:!0,placeholder:"https://raw.githubusercontent.com/...",value:Q.sourceUrl,onChange:g=>P(H=>({...H,sourceUrl:g.target.value})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:12,outline:"none"}})]}),l.jsxs("div",{children:[l.jsx("label",{style:{fontSize:12,fontWeight:600,display:"block",marginBottom:6},children:"描述(可选)"}),l.jsx("input",{type:"text",placeholder:"一句话说明用途",value:Q.description,onChange:g=>P(H=>({...H,description:g.target.value})),style:{width:"100%",padding:"10px 12px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,color:"var(--text)",fontSize:13,outline:"none"}})]}),l.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",marginTop:4},children:[l.jsx("button",{type:"button",className:"btn btn-g",onClick:()=>A(!1),style:{padding:"8px 20px"},children:"取消"}),l.jsx("button",{type:"submit",disabled:re,style:{padding:"8px 20px",fontSize:13,background:"#a07aff",color:"#fff",border:"none",borderRadius:8,cursor:"pointer",fontWeight:600},children:re?"⟳ 下载中…":"🌐 添加远程技能"})]})]})]})]})})]})}function lp(){const o=te(v=>v.agentConfig),f={},c={};return o!=null&&o.agents&&o.agents.forEach(v=>{f[v.id]=v.emoji||"🏛️",c[v.id]=v.label||v.id}),{emojiMap:f,labelMap:c}}function es(o){const f=(o.id||"").match(/^OC-(\w+)-/);return f?f[1]:(o.org||"").replace(/省|部/g,"").toLowerCase()}function mu(o,f){let c=o.title||"";if(c==="heartbeat 会话")return"💓 心跳检测";const v=c.match(/^agent:(\w+):(\w+)/);if(v){const y=f[v[1]]||v[1];return v[2]==="main"?y+" · 主会话":v[2]==="subagent"?y+" · 子任务执行":v[2]==="cron"?y+" · 定时任务":y+" · "+v[2]}return c.replace(/ 会话$/,"")||o.id}function hu(o){const f=o.now||"";return f.includes("feishu/direct")?{icon:"💬",text:"飞书对话"}:f.includes("feishu")?{icon:"💬",text:"飞书"}:f.includes("webchat")?{icon:"🌐",text:"WebChat"}:f.includes("cron")?{icon:"⏰",text:"定时"}:f.includes("direct")?{icon:"📨",text:"直连"}:{icon:"🔗",text:"会话"}}function sp(o){const f=o.activity||[];for(let c=f.length-1;c>=0;c--){const v=f[c];if(v.kind==="assistant"){let y=v.text||"";if(y.startsWith("NO_REPLY")||y.startsWith("Reasoning:"))continue;return y=y.replace(/\[\[.*?\]\]/g,"").replace(/\*\*/g,"").replace(/^#+\s/gm,"").trim(),y.substring(0,120)+(y.length>120?"…":"")}}return""}function ip(){const o=te(d=>d.liveStatus),f=te(d=>d.sessFilter),c=te(d=>d.setSessFilter),{emojiMap:v,labelMap:y}=lp(),[D,T]=V.useState(null),L=((o==null?void 0:o.tasks)||[]).filter(d=>!fn(d));let _=L;f==="active"?_=L.filter(d=>!["Done","Cancelled"].includes(d.state)):f!=="all"&&(_=L.filter(d=>es(d)===f));const z=[...new Set(L.map(es))];return l.jsxs("div",{children:[l.jsx("div",{style:{display:"flex",gap:6,marginBottom:16,flexWrap:"wrap"},children:[{key:"all",label:`全部 (${L.length})`},{key:"active",label:"活跃"},...z.slice(0,8).map(d=>({key:d,label:y[d]||d}))].map(d=>l.jsx("span",{className:`sess-filter${f===d.key?" active":""}`,onClick:()=>c(d.key),children:d.label},d.key))}),l.jsx("div",{className:"sess-grid",children:_.length?_.map(d=>{const N=es(d),j=v[N]||"🏛️",$=y[N]||d.org||N,S=d.heartbeat||{status:"unknown",label:""},M=hu(d),x=mu(d,y),A=sp(d),P=(d.sourceMeta||{}).totalTokens,re=d.eta||"",pe=S.status==="active"?"🟢":S.status==="warn"?"🟡":S.status==="stalled"?"🔴":"⚪",ve=d.state||"Unknown";return l.jsxs("div",{className:"sess-card",onClick:()=>T(d),children:[l.jsxs("div",{className:"sc-top",children:[l.jsx("span",{className:"sc-emoji",children:j}),l.jsx("div",{style:{flex:1,minWidth:0},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx("span",{className:"sc-agent",children:$}),l.jsxs("span",{style:{fontSize:10,color:"var(--muted)",background:"var(--panel2)",padding:"2px 6px",borderRadius:4},children:[M.icon," ",M.text]})]})}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx("span",{title:S.label||"",children:pe}),l.jsx("span",{className:`tag st-${ve}`,style:{fontSize:10},children:Wr[ve]||ve})]})]}),l.jsx("div",{className:"sc-title",children:x}),A&&l.jsx("div",{style:{fontSize:11,color:"var(--muted)",lineHeight:1.5,marginBottom:8,borderLeft:"2px solid var(--line)",paddingLeft:8,maxHeight:40,overflow:"hidden"},children:A}),l.jsxs("div",{className:"sc-meta",children:[P?l.jsxs("span",{style:{fontSize:10,color:"var(--muted)"},children:["🪙 ",P.toLocaleString()," tokens"]}):null,re?l.jsx("span",{className:"sc-time",children:Vf(re)}):null]})]},d.id)}):l.jsx("div",{style:{fontSize:13,color:"var(--muted)",padding:24,textAlign:"center",gridColumn:"1/-1"},children:"暂无小任务/会话数据"})}),D&&l.jsx(op,{task:D,labelMap:y,emojiMap:v,onClose:()=>T(null)})]})}function op({task:o,labelMap:f,emojiMap:c,onClose:v}){const y=es(o),D=c[y]||"🏛️",T=mu(o,f),E=hu(o),L=o.heartbeat||{label:""},_=o.sourceMeta||{},z=o.activity||[],d=o.state||"Unknown",N=_.totalTokens,j=_.inputTokens,$=_.outputTokens;return l.jsx("div",{className:"modal-bg open",onClick:v,children:l.jsxs("div",{className:"modal",onClick:S=>S.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:v,children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{style:{fontSize:11,color:"var(--acc)",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:o.id}),l.jsxs("div",{style:{fontSize:20,fontWeight:800,marginBottom:6},children:[D," ",T]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:18,flexWrap:"wrap"},children:[l.jsx("span",{className:`tag st-${d}`,children:Wr[d]||d}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:[E.icon," ",E.text]}),L.label&&l.jsx("span",{style:{fontSize:11},children:L.label})]}),l.jsxs("div",{style:{display:"flex",gap:14,marginBottom:18,flexWrap:"wrap"},children:[N!=null&&l.jsxs("div",{style:{background:"var(--panel2)",padding:"10px 16px",borderRadius:8,fontSize:12},children:[l.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--acc)"},children:N.toLocaleString()}),l.jsx("div",{style:{color:"var(--muted)",fontSize:10},children:"总 Tokens"})]}),j!=null&&l.jsxs("div",{style:{background:"var(--panel2)",padding:"10px 16px",borderRadius:8,fontSize:12},children:[l.jsx("div",{style:{fontSize:16,fontWeight:700},children:j.toLocaleString()}),l.jsx("div",{style:{color:"var(--muted)",fontSize:10},children:"输入"})]}),$!=null&&l.jsxs("div",{style:{background:"var(--panel2)",padding:"10px 16px",borderRadius:8,fontSize:12},children:[l.jsx("div",{style:{fontSize:16,fontWeight:700},children:$.toLocaleString()}),l.jsx("div",{style:{color:"var(--muted)",fontSize:10},children:"输出"})]})]}),l.jsxs("div",{style:{fontSize:12,fontWeight:700,marginBottom:8},children:["📋 最近活动 ",l.jsxs("span",{style:{fontWeight:400,color:"var(--muted)"},children:["(",z.length," 条)"]})]}),l.jsx("div",{style:{maxHeight:350,overflowY:"auto",border:"1px solid var(--line)",borderRadius:10,background:"var(--panel2)"},children:z.length?z.slice(-15).reverse().map((S,M)=>{const x=S.kind||"",A=x==="assistant"?"🤖":x==="tool"?"🔧":x==="user"?"👤":"📝",Q=x==="assistant"?"回复":x==="tool"?"工具":x==="user"?"用户":"事件";let P=(S.text||"").replace(/\[\[.*?\]\]/g,"").replace(/\*\*/g,"").trim();P.length>200&&(P=P.substring(0,200)+"…");const re=(S.at||"").substring(11,19);return l.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--line)",fontSize:12,lineHeight:1.5},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[l.jsx("span",{children:A}),l.jsx("span",{style:{fontWeight:600,fontSize:11},children:Q}),l.jsx("span",{style:{color:"var(--muted)",fontSize:10,marginLeft:"auto"},children:re})]}),l.jsx("div",{style:{color:"var(--muted)"},children:P})]},M)}):l.jsx("div",{style:{padding:16,color:"var(--muted)",fontSize:12,textAlign:"center"},children:"暂无活动记录"})}),o.output&&o.output!=="-"&&l.jsxs("div",{style:{fontSize:10,color:"var(--muted)",marginTop:12,wordBreak:"break-all",borderTop:"1px solid var(--line)",paddingTop:8},children:["📂 ",o.output]})]})]})})}function ap(){const o=te(_=>_.liveStatus),[f,c]=V.useState("all"),[v,y]=V.useState(null),D=te(_=>_.toast);let E=((o==null?void 0:o.tasks)||[]).filter(_=>fn(_)&&["Done","Cancelled"].includes(_.state));f!=="all"&&(E=E.filter(_=>_.state===f));const L=_=>{const z=_.flow_log||[];let d=`# 📜 奏折 · ${_.title} - -`;if(d+=`- **任务编号**: ${_.id} -`,d+=`- **状态**: ${_.state} -`,d+=`- **负责部门**: ${_.org} -`,z.length){const N=z[0].at?z[0].at.substring(0,19).replace("T"," "):"未知",j=z[z.length-1].at?z[z.length-1].at.substring(0,19).replace("T"," "):"未知";d+=`- **开始时间**: ${N} -`,d+=`- **完成时间**: ${j} -`}d+=` -## 流转记录 - -`;for(const N of z)d+=`- **${N.from}** → **${N.to}** - ${N.remark} - _${(N.at||"").substring(0,19)}_ - -`;_.output&&_.output!=="-"&&(d+=`## 产出物 - -\`${_.output}\` -`),navigator.clipboard.writeText(d).then(()=>D("✅ 奏折已复制为 Markdown","ok"),()=>D("复制失败","err"))};return l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,alignItems:"center"},children:[l.jsx("span",{style:{fontSize:12,color:"var(--muted)"},children:"筛选:"}),[{key:"all",label:"全部"},{key:"Done",label:"✅ 已完成"},{key:"Cancelled",label:"🚫 已取消"}].map(_=>l.jsx("span",{className:`sess-filter${f===_.key?" active":""}`,onClick:()=>c(_.key),children:_.label},_.key))]}),l.jsx("div",{className:"mem-list",children:E.length?E.map(_=>{const z=_.flow_log||[],d=[...new Set(z.map(S=>S.from).concat(z.map(S=>S.to)).filter(S=>S&&S!=="皇上"))],N=z.length?(z[0].at||"").substring(0,16).replace("T"," "):"",j=z.length?(z[z.length-1].at||"").substring(0,16).replace("T"," "):"",$=_.state==="Done"?"✅":"🚫";return l.jsxs("div",{className:"mem-card",onClick:()=>y(_),children:[l.jsx("div",{className:"mem-icon",children:"📜"}),l.jsxs("div",{className:"mem-info",children:[l.jsxs("div",{className:"mem-title",children:[$," ",_.title||_.id]}),l.jsxs("div",{className:"mem-sub",children:[_.id," · ",_.org||""," · 流转 ",z.length," 步"]}),l.jsx("div",{className:"mem-tags",children:d.slice(0,5).map(S=>l.jsx("span",{className:"mem-tag",children:S},S))})]}),l.jsxs("div",{className:"mem-right",children:[l.jsx("span",{className:"mem-date",children:N}),j!==N&&l.jsx("span",{className:"mem-date",children:j})]})]},_.id)}):l.jsx("div",{className:"mem-empty",children:"暂无奏折 — 任务完成后自动生成"})}),v&&l.jsx(cp,{task:v,onClose:()=>y(null),onExport:L})]})}function cp({task:o,onClose:f,onExport:c}){const v=o.flow_log||[],y=o.state||"Unknown",D=y==="Done"?"✅":y==="Cancelled"?"🚫":"🔄",T=[...new Set(v.map(j=>j.from).concat(v.map(j=>j.to)).filter(j=>j&&j!=="皇上"))],E=[],L=[],_=[],z=[],d=[];for(const j of v)j.from==="皇上"?E.push(j):j.to==="中书省"||j.from==="中书省"?L.push(j):j.to==="门下省"||j.from==="门下省"?_.push(j):j.remark&&(j.remark.includes("完成")||j.remark.includes("回奏"))?d.push(j):z.push(j);const N=(j,$,S)=>S.length?l.jsxs("div",{style:{marginBottom:18},children:[l.jsxs("div",{style:{fontSize:13,fontWeight:700,marginBottom:10},children:[$," ",j]}),l.jsx("div",{className:"md-timeline",children:S.map((M,x)=>{var Q,P;const A=(Q=M.remark)!=null&&Q.includes("✅")?"green":(P=M.remark)!=null&&P.includes("驳")?"red":"";return l.jsxs("div",{className:"md-tl-item",children:[l.jsx("div",{className:`md-tl-dot ${A}`}),l.jsxs("div",{style:{display:"flex",gap:6,alignItems:"baseline"},children:[l.jsx("span",{className:"md-tl-from",children:M.from}),l.jsxs("span",{className:"md-tl-to",children:["→ ",M.to]})]}),l.jsx("div",{className:"md-tl-remark",children:M.remark}),l.jsx("div",{className:"md-tl-time",children:(M.at||"").substring(0,19).replace("T"," ")})]},x)})})]}):null;return l.jsx("div",{className:"modal-bg open",onClick:f,children:l.jsxs("div",{className:"modal",onClick:j=>j.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:f,children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{style:{fontSize:11,color:"var(--acc)",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:o.id}),l.jsxs("div",{style:{fontSize:20,fontWeight:800,marginBottom:6},children:[D," ",o.title||o.id]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:18,flexWrap:"wrap"},children:[l.jsx("span",{className:`tag st-${y}`,children:Wr[y]||y}),l.jsx("span",{style:{fontSize:11,color:"var(--muted)"},children:o.org}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["流转 ",v.length," 步"]}),T.map(j=>l.jsx("span",{className:"mem-tag",children:j},j))]}),o.now&&l.jsx("div",{style:{background:"var(--panel2)",border:"1px solid var(--line)",borderRadius:8,padding:"10px 14px",marginBottom:18,fontSize:12,color:"var(--muted)"},children:o.now}),N("圣旨原文","👑",E),N("中书规划","📋",L),N("门下审议","🔍",_),N("六部执行","⚔️",z),N("汇总回奏","📨",d),o.output&&o.output!=="-"&&l.jsxs("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid var(--line)"},children:[l.jsx("div",{style:{fontSize:11,fontWeight:600,marginBottom:4},children:"📦 产出物"}),l.jsx("code",{style:{fontSize:11,wordBreak:"break-all"},children:o.output})]}),l.jsx("div",{style:{display:"flex",gap:8,marginTop:16,justifyContent:"flex-end"},children:l.jsx("button",{className:"btn btn-g",onClick:()=>c(o),style:{fontSize:12,padding:"6px 16px"},children:"📋 复制奏折"})})]})]})})}function up(){const o=te(S=>S.tplCatFilter),f=te(S=>S.setTplCatFilter),c=te(S=>S.toast),v=te(S=>S.loadAll),[y,D]=V.useState(null),[T,E]=V.useState({}),[L,_]=V.useState("");let z=Ff;o!=="全部"&&(z=z.filter(S=>S.cat===o));const d=S=>{const M={};S.params.forEach(x=>{M[x.key]=x.default||""}),E(M),D(S),_("")},N=S=>{let M=S.command;for(const x of S.params)M=M.replace(new RegExp("\\{"+x.key+"\\}","g"),T[x.key]||x.default||"");return M},j=()=>{y&&_(N(y))},$=async S=>{if(S.preventDefault(),!y)return;const M=N(y);if(!M.trim()){c("请填写必填参数","err");return}try{const x=await ce.agentsStatus();if(x.ok&&x.gateway&&!x.gateway.alive&&(c("⚠️ Gateway 未启动,任务将无法派发!","err"),!confirm("Gateway 未启动,继续?")))return}catch{}if(confirm(`确认下旨? - -${M.substring(0,200)}${M.length>200?"…":""}`))try{const x={};for(const Q of y.params)x[Q.key]=T[Q.key]||Q.default||"";const A=await ce.createTask({title:M.substring(0,120),org:"中书省",targetDept:y.depts[0]||"",priority:"normal",templateId:y.id,params:x});A.ok?(c(`📜 ${A.taskId} 旨意已下达`,"ok"),D(null),v()):c(A.error||"下旨失败","err")}catch{c("⚠️ 服务器连接失败","err")}};return l.jsxs("div",{children:[l.jsx("div",{style:{display:"flex",gap:6,marginBottom:16,flexWrap:"wrap"},children:Bf.map(S=>l.jsxs("span",{className:`tpl-cat${o===S.name?" active":""}`,onClick:()=>f(S.name),children:[S.icon," ",S.name]},S.name))}),l.jsx("div",{className:"tpl-grid",children:z.map(S=>l.jsxs("div",{className:"tpl-card",children:[l.jsxs("div",{className:"tpl-top",children:[l.jsx("span",{className:"tpl-icon",children:S.icon}),l.jsx("span",{className:"tpl-name",children:S.name})]}),l.jsx("div",{className:"tpl-desc",children:S.desc}),l.jsxs("div",{className:"tpl-footer",children:[S.depts.map(M=>l.jsx("span",{className:"tpl-dept",children:M},M)),l.jsxs("span",{className:"tpl-est",children:[S.est," · ",S.cost]}),l.jsx("button",{className:"tpl-go",onClick:()=>d(S),children:"下旨"})]})]},S.id))}),y&&l.jsx("div",{className:"modal-bg open",onClick:()=>D(null),children:l.jsxs("div",{className:"modal",onClick:S=>S.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:()=>D(null),children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{style:{fontSize:11,color:"var(--acc)",fontWeight:700,letterSpacing:".04em",marginBottom:4},children:"圣旨模板"}),l.jsxs("div",{style:{fontSize:20,fontWeight:800,marginBottom:6},children:[y.icon," ",y.name]}),l.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginBottom:18},children:y.desc}),l.jsxs("div",{style:{display:"flex",gap:6,marginBottom:18,flexWrap:"wrap"},children:[y.depts.map(S=>l.jsx("span",{className:"tpl-dept",children:S},S)),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)",marginLeft:"auto"},children:[y.est," · ",y.cost]})]}),l.jsxs("form",{className:"tpl-form",onSubmit:$,children:[y.params.map(S=>l.jsxs("div",{className:"tpl-field",children:[l.jsxs("label",{className:"tpl-label",children:[S.label,S.required&&l.jsx("span",{style:{color:"#ff5270"},children:" *"})]}),S.type==="textarea"?l.jsx("textarea",{className:"tpl-input",style:{minHeight:80,resize:"vertical"},required:S.required,value:T[S.key]||"",onChange:M=>E(x=>({...x,[S.key]:M.target.value}))}):S.type==="select"?l.jsx("select",{className:"tpl-input",value:T[S.key]||S.default||"",onChange:M=>E(x=>({...x,[S.key]:M.target.value})),children:(S.options||[]).map(M=>l.jsx("option",{children:M},M))}):l.jsx("input",{className:"tpl-input",type:"text",required:S.required,value:T[S.key]||"",onChange:M=>E(x=>({...x,[S.key]:M.target.value}))})]},S.key)),L&&l.jsxs("div",{style:{background:"var(--panel2)",border:"1px solid var(--line)",borderRadius:8,padding:12,marginBottom:14,fontSize:12,color:"var(--muted)"},children:[l.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text)",marginBottom:6},children:"📜 将发送给中书省的旨意:"}),l.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.6},children:L})]}),l.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end"},children:[l.jsx("button",{type:"button",className:"btn btn-g",onClick:j,style:{padding:"8px 16px",fontSize:12},children:"👁 预览旨意"}),l.jsx("button",{type:"submit",className:"tpl-go",style:{padding:"8px 20px",fontSize:13},children:"📜 下旨"})]})]})]})]})})]})}const vu={政治:{icon:"🏛️",color:"#6a9eff",desc:"全球政治动态"},军事:{icon:"⚔️",color:"#ff5270",desc:"军事与冲突"},经济:{icon:"💹",color:"#2ecc8a",desc:"经济与市场"},AI大模型:{icon:"🤖",color:"#a07aff",desc:"AI与大模型进展"}},to=["政治","军事","经济","AI大模型"];function dp(){const o=te(X=>X.morningBrief),f=te(X=>X.subConfig),c=te(X=>X.loadMorning),v=te(X=>X.loadSubConfig),y=te(X=>X.toast),[D,T]=V.useState(!1),[E,L]=V.useState(null),[_,z]=V.useState(!1),[d,N]=V.useState("⟳ 立即采集"),j=V.useRef(null);V.useEffect(()=>{c()},[c]),V.useEffect(()=>{f&&L(JSON.parse(JSON.stringify(f)))},[f]),V.useEffect(()=>()=>{j.current&&clearInterval(j.current)},[]);const $=async()=>{z(!0),N("⟳ 采集中…");let X=null;try{X=(o==null?void 0:o.generated_at)||null}catch{}try{await ce.refreshMorning(),y("采集已触发,自动检测更新中…","ok");let ae=0;j.current&&clearInterval(j.current),j.current=setInterval(async()=>{if(ae++,ae>24){clearInterval(j.current),j.current=null,z(!1),N("⟳ 立即采集"),y("采集超时,请重试","err");return}try{const Se=await ce.morningBrief();Se.generated_at&&Se.generated_at!==X?(clearInterval(j.current),j.current=null,z(!1),N("⟳ 立即采集"),c(),y("✅ 天下要闻已更新","ok")):N(`⟳ 采集中… (${ae*5}s)`)}catch{}},5e3)}catch{y("触发失败","err"),z(!1),N("⟳ 立即采集")}},S=X=>{if(!E)return;const ae=[...E.categories||[]],Se=ae.find(se=>se.name===X);Se?Se.enabled=!Se.enabled:ae.push({name:X,enabled:!0}),L({...E,categories:ae})},M=X=>{if(!E||!X)return;const ae=[...E.keywords||[]];ae.includes(X)||ae.push(X),L({...E,keywords:ae})},x=X=>{if(!E)return;const ae=[...E.keywords||[]];ae.splice(X,1),L({...E,keywords:ae})},A=(X,ae,Se)=>{if(!E||!X||!ae){y("请填写源名称和URL","err");return}const se=[...E.custom_feeds||[]];se.push({name:X,url:ae,category:Se}),L({...E,custom_feeds:se})},Q=X=>{if(!E)return;const ae=[...E.custom_feeds||[]];ae.splice(X,1),L({...E,custom_feeds:ae})},P=async()=>{if(E)try{const X=await ce.saveMorningConfig(E);X.ok?(y("订阅配置已保存","ok"),v()):y(X.error||"保存失败","err")}catch{y("服务器连接失败","err")}},re=E?new Set((E.categories||[]).filter(X=>X.enabled).map(X=>X.name)):new Set(to),pe=((E==null?void 0:E.keywords)||[]).map(X=>X.toLowerCase()),ve=(o==null?void 0:o.categories)||{},he=o!=null&&o.date?o.date.replace(/(\d{4})(\d{2})(\d{2})/,"$1年$2月$3日"):"",Be=Object.values(ve).flat().length;return l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:20,fontWeight:800,marginBottom:4},children:"🌅 天下要闻"}),l.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:[he&&`${he} | `,(o==null?void 0:o.generated_at)&&`采集于 ${o.generated_at} | `,"共 ",Be," 条要闻"]})]}),l.jsxs("div",{style:{display:"flex",gap:8},children:[l.jsx("button",{className:"btn btn-g",onClick:()=>T(!D),style:{fontSize:12,padding:"6px 14px"},children:"⚙ 订阅配置"}),l.jsx("button",{className:"tpl-go",disabled:_,onClick:$,style:{fontSize:12,padding:"6px 14px"},children:d})]})]}),D&&E&&l.jsx(fp,{config:E,enabledSet:re,onToggleCat:S,onAddKeyword:M,onRemoveKeyword:x,onAddFeed:A,onRemoveFeed:Q,onSave:P,onSetWebhook:X=>L({...E,feishu_webhook:X})}),Object.keys(ve).length?l.jsx("div",{className:"mb-cats",children:Object.entries(ve).map(([X,ae])=>{if(!re.has(X))return null;const Se=vu[X]||{icon:"📰",color:"var(--acc)"},se=ae.map(ee=>{const Ce=((ee.title||"")+(ee.summary||"")).toLowerCase(),_e=pe.filter(xe=>Ce.includes(xe)).length;return{...ee,_kwHits:_e}}).sort((ee,Ce)=>Ce._kwHits-ee._kwHits);return l.jsxs("div",{className:"mb-cat",children:[l.jsxs("div",{className:"mb-cat-hdr",children:[l.jsx("span",{className:"mb-cat-icon",children:Se.icon}),l.jsx("span",{className:"mb-cat-name",style:{color:Se.color},children:X}),l.jsxs("span",{className:"mb-cat-cnt",children:[se.length," 条"]})]}),l.jsx("div",{className:"mb-news-list",children:se.length?se.map((ee,Ce)=>{const _e=!!(ee.image&&ee.image.startsWith("http"));return l.jsxs("div",{className:"mb-card",onClick:()=>window.open(ee.link,"_blank"),children:[l.jsx("div",{className:"mb-img",children:_e?l.jsx("img",{src:ee.image,onError:xe=>{xe.target.style.display="none"},loading:"lazy",alt:""}):l.jsx("span",{children:Se.icon})}),l.jsxs("div",{className:"mb-info",children:[l.jsxs("div",{className:"mb-headline",children:[ee.title,ee._kwHits>0&&l.jsx("span",{style:{fontSize:9,padding:"1px 5px",borderRadius:999,background:"#a07aff22",color:"#a07aff",border:"1px solid #a07aff44",marginLeft:4},children:"⭐ 关注"})]}),l.jsx("div",{className:"mb-summary",children:ee.summary||ee.desc||""}),l.jsxs("div",{className:"mb-meta",children:[l.jsxs("span",{className:"mb-source",children:["📡 ",ee.source||""]}),ee.pub_date&&l.jsx("span",{className:"mb-time",children:ee.pub_date.substring(0,16)})]})]})]},Ce)}):l.jsx("div",{className:"mb-empty",style:{padding:16},children:"暂无新闻"})})]},X)})}):l.jsx("div",{className:"mb-empty",children:"暂无数据,点击右上角「立即采集」获取今日简报"})]})}function fp({config:o,enabledSet:f,onToggleCat:c,onAddKeyword:v,onRemoveKeyword:y,onAddFeed:D,onRemoveFeed:T,onSave:E,onSetWebhook:L}){const[_,z]=V.useState(""),[d,N]=V.useState(""),[j,$]=V.useState(""),[S,M]=V.useState(to[0]),x=[...to];return(o.categories||[]).forEach(A=>{x.includes(A.name)||x.push(A.name)}),l.jsxs("div",{className:"sub-config",style:{marginBottom:20,padding:16,background:"var(--panel2)",borderRadius:12,border:"1px solid var(--line)"},children:[l.jsx("div",{style:{fontSize:14,fontWeight:700,marginBottom:12},children:"⚙ 订阅配置"}),l.jsxs("div",{style:{marginBottom:14},children:[l.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:8},children:"订阅分类"}),l.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:x.map(A=>{const Q=vu[A]||{icon:"📰"},P=f.has(A);return l.jsxs("div",{className:`sub-cat ${P?"active":""}`,onClick:()=>c(A),style:{cursor:"pointer",padding:"6px 12px",borderRadius:8,border:`1px solid ${P?"var(--acc)":"var(--line)"}`,display:"flex",alignItems:"center",gap:6},children:[l.jsx("span",{children:Q.icon}),l.jsx("span",{style:{fontSize:12},children:A}),P&&l.jsx("span",{style:{fontSize:10,color:"var(--ok)"},children:"✓"})]},A)})})]}),l.jsxs("div",{style:{marginBottom:14},children:[l.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:8},children:"关注关键词"}),l.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:6},children:(o.keywords||[]).map((A,Q)=>l.jsxs("span",{className:"sub-kw",style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:"var(--bg)",border:"1px solid var(--line)"},children:[A,l.jsx("span",{style:{cursor:"pointer",marginLeft:4,color:"var(--danger)"},onClick:()=>y(Q),children:"✕"})]},Q))}),l.jsxs("div",{style:{display:"flex",gap:6},children:[l.jsx("input",{type:"text",value:_,onChange:A=>z(A.target.value),placeholder:"输入关键词",onKeyDown:A=>{A.key==="Enter"&&(v(_.trim()),z(""))},style:{flex:1,padding:"6px 10px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:12,outline:"none"}}),l.jsx("button",{className:"btn btn-g",onClick:()=>{v(_.trim()),z("")},style:{fontSize:11,padding:"4px 12px"},children:"添加"})]})]}),l.jsxs("div",{style:{marginBottom:14},children:[l.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:8},children:"自定义信息源"}),(o.custom_feeds||[]).map((A,Q)=>l.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",marginBottom:4,fontSize:11},children:[l.jsx("span",{style:{fontWeight:600},children:A.name}),l.jsx("span",{style:{color:"var(--muted)",flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:A.url}),l.jsx("span",{style:{color:"var(--acc)"},children:A.category}),l.jsx("span",{style:{cursor:"pointer",color:"var(--danger)"},onClick:()=>T(Q),children:"✕"})]},Q)),l.jsxs("div",{style:{display:"flex",gap:6,marginTop:6},children:[l.jsx("input",{placeholder:"源名称",value:d,onChange:A=>N(A.target.value),style:{width:100,padding:"6px 8px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:11,outline:"none"}}),l.jsx("input",{placeholder:"RSS / URL",value:j,onChange:A=>$(A.target.value),style:{flex:1,padding:"6px 8px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:11,outline:"none"}}),l.jsx("select",{value:S,onChange:A=>M(A.target.value),style:{padding:"6px 8px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:11,outline:"none"},children:x.map(A=>l.jsx("option",{value:A,children:A},A))}),l.jsx("button",{className:"btn btn-g",onClick:()=>{D(d,j,S),N(""),$("")},style:{fontSize:11,padding:"4px 12px"},children:"添加"})]})]}),l.jsxs("div",{style:{marginBottom:14},children:[l.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:"飞书 Webhook"}),l.jsx("input",{type:"text",value:o.feishu_webhook||"",onChange:A=>L(A.target.value),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",style:{width:"100%",padding:"8px 10px",background:"var(--bg)",border:"1px solid var(--line)",borderRadius:6,color:"var(--text)",fontSize:12,outline:"none"}})]}),l.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:l.jsx("button",{className:"tpl-go",onClick:E,style:{fontSize:12,padding:"6px 16px"},children:"💾 保存配置"})})]})}const gu={main:"太子",zhongshu:"中书省",menxia:"门下省",shangshu:"尚书省",libu:"礼部",hubu:"户部",bingbu:"兵部",xingbu:"刑部",gongbu:"工部",libu_hr:"吏部",zaochao:"钦天监"},pp={Taizi:"中书省起草",Zhongshu:"门下省审议",Menxia:"尚书省派发",Assigned:"开始执行",Doing:"进入审查",Review:"完成"};function mp(o){const f=Math.max(0,o);if(f<60)return`${f}秒`;if(f<3600)return`${Math.floor(f/60)}分${f%60}秒`;const c=Math.floor(f/3600),v=Math.floor(f%3600/60);return`${c}小时${v}分`}function no(o){if(!o)return"";if(typeof o=="number"){const f=new Date(o);return`${String(f.getHours()).padStart(2,"0")}:${String(f.getMinutes()).padStart(2,"0")}:${String(f.getSeconds()).padStart(2,"0")}`}return typeof o=="string"&&o.length>=19?o.substring(11,19):String(o).substring(0,8)}function hp(){var _e,xe;const o=te(b=>b.modalTaskId),f=te(b=>b.setModalTaskId),c=te(b=>b.liveStatus),v=te(b=>b.loadAll),y=te(b=>b.toast),[D,T]=V.useState(null),[E,L]=V.useState(null),_=V.useRef(null),z=V.useRef(null),d=((_e=c==null?void 0:c.tasks)==null?void 0:_e.find(b=>b.id===o))||null,N=V.useCallback(async()=>{if(o)try{const b=await ce.taskActivity(o);T(b)}catch{T(null)}},[o]),j=V.useCallback(async()=>{if(o)try{const b=await ce.schedulerState(o);L(b)}catch{L(null)}},[o]);if(V.useEffect(()=>!o||!d?void 0:(N(),j(),["Done","Cancelled"].includes(d.state)||(_.current=setInterval(()=>{N(),j()},4e3)),()=>{_.current&&(clearInterval(_.current),_.current=null)}),[o,d==null?void 0:d.state,N,j]),V.useEffect(()=>{z.current&&(z.current.scrollTop=z.current.scrollHeight)},[(xe=D==null?void 0:D.activity)==null?void 0:xe.length]),!o||!d)return null;const $=()=>f(null),S=io(d),M=S.find(b=>b.status==="active"),x=d.heartbeat||{status:"unknown",label:"⚪ 无数据"},A=d.flow_log||[],Q=d.todos||[],P=Q.filter(b=>b.status==="completed").length,re=Q.length,pe=!["Done","Blocked","Cancelled"].includes(d.state),ve=["Blocked","Cancelled"].includes(d.state),he=async(b,G)=>{try{const U=await ce.taskAction(d.id,b,G);U.ok?(y(U.message||"操作成功","ok"),v(),$()):y(U.error||"操作失败","err")}catch{y("服务器连接失败","err")}},Be=async b=>{const G={approve:"准奏",reject:"封驳"},U=prompt(`${G[b]} ${d.id} - -请输入批注(可留空):`);if(U!==null)try{const h=await ce.reviewAction(d.id,b,U||"");h.ok?(y(`✅ ${d.id} 已${G[b]}`,"ok"),v(),$()):y(h.error||"操作失败","err")}catch{y("服务器连接失败","err")}},X=async()=>{const b=pp[d.state]||"下一步",G=prompt(`⏩ 手动推进 ${d.id} -当前: ${d.state} → 下一步: ${b} - -请输入说明(可留空):`);if(G!==null)try{const U=await ce.advanceState(d.id,G||"");U.ok?(y(`⏩ ${U.message}`,"ok"),v(),$()):y(U.error||"推进失败","err")}catch{y("服务器连接失败","err")}},ae=async b=>{if(b==="scan"){try{const I=await ce.schedulerScan(180);I.ok?y(`🔍 扫描完成:${I.count||0} 个动作`,"ok"):y(I.error||"扫描失败","err"),j()}catch{y("服务器连接失败","err")}return}const U=prompt(`请输入${{retry:"重试",escalate:"升级",rollback:"回滚"}[b]}原因(可留空):`);if(U===null)return;const h={retry:ce.schedulerRetry,escalate:ce.schedulerEscalate,rollback:ce.schedulerRollback};try{const I=await h[b](d.id,U);I.ok?y(I.message||"操作成功","ok"):y(I.error||"操作失败","err"),j(),v()}catch{y("服务器连接失败","err")}},Se=()=>{const b=prompt("请输入叫停原因(可留空):");b!==null&&he("stop",b)},se=()=>{if(!confirm(`确定要取消 ${d.id} 吗?`))return;const b=prompt("请输入取消原因(可留空):");b!==null&&he("cancel",b)},ee=E==null?void 0:E.scheduler,Ce=(E==null?void 0:E.stalledSec)||0;return l.jsx("div",{className:"modal-bg open",onClick:$,children:l.jsxs("div",{className:"modal",onClick:b=>b.stopPropagation(),children:[l.jsx("button",{className:"modal-close",onClick:$,children:"✕"}),l.jsxs("div",{className:"modal-body",children:[l.jsx("div",{className:"modal-id",children:d.id}),l.jsx("div",{className:"modal-title",children:d.title||"(无标题)"}),M&&l.jsxs("div",{className:"cur-stage",children:[l.jsx("div",{className:"cs-icon",children:M.icon}),l.jsxs("div",{className:"cs-info",children:[l.jsx("div",{className:"cs-dept",style:{color:ql(M.dept)},children:M.dept}),l.jsxs("div",{className:"cs-action",children:["当前阶段:",M.action]})]}),l.jsx("span",{className:`hb ${x.status} cs-hb`,children:x.label})]}),l.jsx("div",{className:"m-pipe",children:S.map((b,G)=>l.jsxs("div",{className:"mp-stage",children:[l.jsxs("div",{className:`mp-node ${b.status}`,children:[b.status==="done"&&l.jsx("div",{className:"mp-done-tick",children:"✓"}),l.jsx("div",{className:"mp-icon",children:b.icon}),l.jsx("div",{className:"mp-dept",style:b.status==="active"?{color:"var(--acc)"}:b.status==="done"?{color:"var(--ok)"}:{},children:b.dept}),l.jsx("div",{className:"mp-action",children:b.action})]}),Ghe("resume","恢复执行"),children:"▶️ 恢复执行"}),["Review","Menxia"].includes(d.state)&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-action",style:{background:"#2ecc8a22",color:"#2ecc8a",border:"1px solid #2ecc8a44"},onClick:()=>Be("approve"),children:"✅ 准奏"}),l.jsx("button",{className:"btn-action",style:{background:"#ff527022",color:"#ff5270",border:"1px solid #ff527044"},onClick:()=>Be("reject"),children:"🚫 封驳"})]}),["Pending","Taizi","Zhongshu","Menxia","Assigned","Doing","Review","Next"].includes(d.state)&&l.jsx("button",{className:"btn-action",style:{background:"#7c5cfc18",color:"#7c5cfc",border:"1px solid #7c5cfc44"},onClick:X,children:"⏩ 推进到下一步"})]}),l.jsxs("div",{className:"sched-section",children:[l.jsxs("div",{className:"sched-head",children:[l.jsx("span",{className:"sched-title",children:"🧭 太子调度"}),l.jsx("span",{className:"sched-status",children:ee?`${ee.enabled===!1?"已禁用":"运行中"} · 阈值 ${ee.stallThresholdSec||180}s`:"加载中..."})]}),l.jsxs("div",{className:"sched-grid",children:[l.jsxs("div",{className:"sched-kpi",children:[l.jsx("div",{className:"k",children:"停滞时长"}),l.jsx("div",{className:"v",children:mp(Ce)})]}),l.jsxs("div",{className:"sched-kpi",children:[l.jsx("div",{className:"k",children:"重试次数"}),l.jsx("div",{className:"v",children:(ee==null?void 0:ee.retryCount)||0})]}),l.jsxs("div",{className:"sched-kpi",children:[l.jsx("div",{className:"k",children:"升级级别"}),l.jsx("div",{className:"v",children:ee!=null&&ee.escalationLevel?ee.escalationLevel===1?"门下省":"尚书省":"无"})]}),l.jsxs("div",{className:"sched-kpi",children:[l.jsx("div",{className:"k",children:"派发状态"}),l.jsx("div",{className:"v",children:(ee==null?void 0:ee.lastDispatchStatus)||"idle"})]})]}),ee&&l.jsxs("div",{className:"sched-line",children:[ee.lastProgressAt&&l.jsxs("span",{children:["最近进展 ",(ee.lastProgressAt||"").replace("T"," ").substring(0,19)]}),ee.lastDispatchAt&&l.jsxs("span",{children:["最近派发 ",(ee.lastDispatchAt||"").replace("T"," ").substring(0,19)]}),l.jsxs("span",{children:["自动回滚 ",ee.autoRollback===!1?"关闭":"开启"]}),ee.lastDispatchAgent&&l.jsxs("span",{children:["目标 ",ee.lastDispatchAgent]})]}),l.jsxs("div",{className:"sched-actions",children:[l.jsx("button",{className:"sched-btn",onClick:()=>ae("retry"),children:"🔁 重试派发"}),l.jsx("button",{className:"sched-btn warn",onClick:()=>ae("escalate"),children:"📣 升级协调"}),l.jsx("button",{className:"sched-btn danger",onClick:()=>ae("rollback"),children:"↩️ 回滚稳定点"}),l.jsx("button",{className:"sched-btn",onClick:()=>ae("scan"),children:"🔍 立即扫描"})]})]}),re>0&&l.jsx(vp,{todos:Q,todoDone:P,todoTotal:re}),l.jsx("div",{className:"m-section",children:l.jsxs("div",{className:"m-rows",children:[l.jsxs("div",{className:"m-row",children:[l.jsx("div",{className:"mr-label",children:"状态"}),l.jsxs("div",{className:"mr-val",children:[l.jsx("span",{className:`tag st-${d.state}`,children:so(d)}),(d.review_round||0)>0&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)",marginLeft:8},children:["共磋商 ",d.review_round," 轮"]})]})]}),l.jsxs("div",{className:"m-row",children:[l.jsx("div",{className:"mr-label",children:"执行部门"}),l.jsx("div",{className:"mr-val",children:l.jsx("span",{className:`tag dt-${(d.org||"").replace(/\s/g,"")}`,children:d.org||"—"})})]}),d.eta&&d.eta!=="-"&&l.jsxs("div",{className:"m-row",children:[l.jsx("div",{className:"mr-label",children:"预计完成"}),l.jsx("div",{className:"mr-val",children:d.eta})]}),d.block&&d.block!=="无"&&d.block!=="-"&&l.jsxs("div",{className:"m-row",children:[l.jsx("div",{className:"mr-label",style:{color:"var(--danger)"},children:"阻塞项"}),l.jsx("div",{className:"mr-val",style:{color:"var(--danger)"},children:d.block})]}),d.now&&d.now!=="-"&&l.jsxs("div",{className:"m-row",style:{gridColumn:"1/-1"},children:[l.jsx("div",{className:"mr-label",children:"当前进展"}),l.jsx("div",{className:"mr-val",style:{fontWeight:400,fontSize:12},children:d.now})]}),d.ac&&l.jsxs("div",{className:"m-row",style:{gridColumn:"1/-1"},children:[l.jsx("div",{className:"mr-label",children:"验收标准"}),l.jsx("div",{className:"mr-val",style:{fontWeight:400,fontSize:12},children:d.ac})]})]})}),A.length>0&&l.jsxs("div",{className:"m-section",children:[l.jsxs("div",{className:"m-sec-label",children:["流转日志(",A.length," 条)"]}),l.jsx("div",{className:"fl-timeline",children:A.map((b,G)=>{const U=ql(b.from||"");return l.jsxs("div",{className:"fl-item",children:[l.jsx("div",{className:"fl-time",children:b.at?b.at.substring(11,16):""}),l.jsx("div",{className:"fl-dot",style:{background:U}}),l.jsxs("div",{className:"fl-content",children:[l.jsxs("div",{className:"fl-who",children:[l.jsx("span",{className:"from",style:{color:U},children:b.from}),l.jsx("span",{style:{color:"var(--muted)"},children:" → "}),l.jsx("span",{className:"to",style:{color:ql(b.to||"")},children:b.to})]}),l.jsx("div",{className:"fl-rem",children:b.remark})]})]},G)})})]}),d.output&&d.output!=="-"&&d.output!==""&&l.jsxs("div",{className:"m-section",children:[l.jsx("div",{className:"m-sec-label",children:"产出物"}),l.jsx("code",{children:d.output})]}),l.jsx(gp,{data:D,isDone:["Done","Cancelled"].includes(d.state),logRef:z})]})]})})}function vp({todos:o,todoDone:f,todoTotal:c}){return l.jsxs("div",{className:"todo-section",children:[l.jsxs("div",{className:"todo-header",children:[l.jsxs("div",{className:"m-sec-label",style:{marginBottom:0,border:"none",padding:0},children:["子任务清单(",f,"/",c,")"]}),l.jsxs("div",{className:"todo-progress",children:[l.jsx("div",{className:"todo-bar",children:l.jsx("div",{className:"todo-bar-fill",style:{width:`${Math.round(f/c*100)}%`}})}),l.jsxs("span",{children:[Math.round(f/c*100),"%"]})]})]}),l.jsx("div",{className:"todo-list",children:o.map(v=>{const y=v.status==="completed"?"✅":v.status==="in-progress"?"🔄":"⬜",D=v.status==="completed"?"已完成":v.status==="in-progress"?"进行中":"待开始",T=v.status==="completed"?"s-done":v.status==="in-progress"?"s-progress":"s-notstarted",E=v.status==="completed"?"done":"";return l.jsxs("div",{className:`todo-item ${E}`,children:[l.jsxs("div",{className:"t-row",children:[l.jsx("span",{className:"t-icon",children:y}),l.jsxs("span",{className:"t-id",children:["#",v.id]}),l.jsx("span",{className:"t-title",children:v.title}),l.jsx("span",{className:`t-status ${T}`,children:D})]}),v.detail&&l.jsx("div",{className:"todo-detail",children:v.detail})]},v.id)})})]})}function gp({data:o,isDone:f,logRef:c}){if(!o)return null;const v=o.activity||[],y=(()=>{if(!v.length)return!1;const $=v[v.length-1];if(!$.at)return!1;const S=typeof $.at=="number"?$.at:new Date($.at).getTime();return Date.now()-S<3e5})(),D=[];o.agentLabel&&D.push(o.agentLabel),o.relatedAgents&&o.relatedAgents.length>1&&D.push(`${o.relatedAgents.length}个 Agent`),o.lastActive&&D.push(`最后活跃: ${o.lastActive}`);const T=o.phaseDurations||[],E=Math.max(...T.map($=>$.durationSec||1),1),L={皇上:"#eab308",太子:"#f97316",中书省:"#3b82f6",门下省:"#8b5cf6",尚书省:"#10b981",六部:"#06b6d4",礼部:"#ec4899",户部:"#f59e0b",兵部:"#ef4444",刑部:"#6366f1",工部:"#14b8a6",吏部:"#d946ef"},_=o.todosSummary,z=o.resourceSummary,d=v.filter($=>$.kind==="flow"),N=v.filter($=>$.kind!=="flow"),j=new Map;return N.forEach($=>{const S=$.agent||"unknown";j.has(S)||j.set(S,[]),j.get(S).push($)}),l.jsxs("div",{className:"la-section",children:[l.jsxs("div",{className:"la-header",children:[l.jsxs("span",{className:"la-title",children:[l.jsx("span",{className:`la-dot${y?"":" idle"}`}),f?"执行回顾":"实时动态"]}),l.jsx("span",{className:"la-agent",children:D.join(" · ")||"加载中..."})]}),T.length>0&&l.jsxs("div",{style:{padding:"4px 0 8px",borderBottom:"1px solid var(--line)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[l.jsx("span",{style:{fontSize:11,fontWeight:600},children:"⏱ 阶段耗时"}),o.totalDuration&&l.jsxs("span",{style:{marginLeft:"auto",fontSize:10,color:"var(--muted)"},children:["总耗时 ",o.totalDuration]})]}),T.map(($,S)=>{const M=Math.max(5,Math.round(($.durationSec||1)/E*100)),x=L[$.phase]||"#6b7280";return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,margin:"2px 0",fontSize:11},children:[l.jsx("span",{style:{minWidth:48,color:"var(--muted)",textAlign:"right"},children:$.phase}),l.jsx("div",{style:{flex:1,height:14,background:"var(--panel)",borderRadius:3,overflow:"hidden"},children:l.jsx("div",{style:{width:`${M}%`,height:"100%",background:x,borderRadius:3,opacity:$.ongoing?.6:.85}})}),l.jsxs("span",{style:{minWidth:60,fontSize:10,color:"var(--muted)"},children:[$.durationText,$.ongoing&&l.jsx("span",{style:{fontSize:9,color:"#60a5fa"},children:" ●进行中"})]})]},S)})]}),_&&l.jsxs("div",{style:{padding:"4px 0 8px",borderBottom:"1px solid var(--line)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[l.jsx("span",{style:{fontSize:11,fontWeight:600},children:"📊 执行进度"}),l.jsxs("span",{style:{fontSize:20,fontWeight:700,color:_.percent>=100?"#22c55e":_.percent>=50?"#60a5fa":"var(--text)"},children:[_.percent,"%"]}),l.jsxs("span",{style:{fontSize:10,color:"var(--muted)"},children:["✅",_.completed," 🔄",_.inProgress," ⬜",_.notStarted," / 共",_.total,"项"]})]}),l.jsxs("div",{style:{height:8,background:"var(--panel)",borderRadius:4,overflow:"hidden",display:"flex"},children:[l.jsx("div",{style:{width:`${_.total?_.completed/_.total*100:0}%`,background:"#22c55e",transition:"width .3s"}}),l.jsx("div",{style:{width:`${_.total?_.inProgress/_.total*100:0}%`,background:"#3b82f6",transition:"width .3s"}})]})]}),z&&(z.totalTokens||z.totalCost)&&l.jsxs("div",{style:{padding:"4px 0 8px",borderBottom:"1px solid var(--line)",display:"flex",gap:12,alignItems:"center"},children:[l.jsx("span",{style:{fontSize:11,fontWeight:600},children:"📈 资源消耗"}),z.totalTokens!=null&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["🔢 ",z.totalTokens.toLocaleString()," tokens"]}),z.totalCost!=null&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["💰 $",z.totalCost.toFixed(4)]}),z.totalElapsedSec!=null&&l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["⏳ ",z.totalElapsedSec>=60?`${Math.floor(z.totalElapsedSec/60)}分`:"",z.totalElapsedSec%60,"秒"]})]}),l.jsxs("div",{className:"la-log",ref:c,children:[d.length>0&&l.jsx("div",{className:"la-flow-wrap",children:d.map(($,S)=>l.jsxs("div",{className:"la-entry la-tool",children:[l.jsx("span",{className:"la-icon",children:"📋"}),l.jsxs("span",{className:"la-body",children:[l.jsx("b",{children:$.from})," → ",l.jsx("b",{children:$.to})," ",$.remark||""]}),l.jsx("span",{className:"la-time",children:no($.at)})]},`flow-${S}`))}),j.size>0?l.jsx("div",{className:"la-groups",children:Array.from(j.entries()).map(([$,S])=>{const M=gu[$]||$||"未标识",x=S[S.length-1],A=x!=null&&x.at?no(x.at):"--:--:--";return l.jsxs("div",{className:"la-group",children:[l.jsxs("div",{className:"la-group-hd",children:[l.jsx("span",{className:"name",children:M}),l.jsxs("span",{children:["最近更新 ",A]})]}),l.jsx("div",{className:"la-group-bd",children:S.map((Q,P)=>l.jsx(yp,{entry:Q},P))})]},$)})}):!d.length&&l.jsx("div",{className:"la-empty",children:o.message||o.error||"Agent 尚未上报进展(等待 Agent 调用 progress 命令)"})]})]})}function yp({entry:o}){var v,y,D;const f=no(o.at),c=o.agent?l.jsx("span",{style:{fontSize:9,color:"var(--muted)",background:"var(--panel)",padding:"1px 4px",borderRadius:3,marginRight:4},children:gu[o.agent]||o.agent}):null;if(o.kind==="progress")return l.jsxs("div",{className:"la-entry la-assistant",children:[l.jsx("span",{className:"la-icon",children:"🔄"}),l.jsxs("span",{className:"la-body",children:[c,l.jsx("b",{children:"当前进展:"}),o.text]}),l.jsx("span",{className:"la-time",children:f})]});if(o.kind==="todos"){const T=o.items||[],E=new Map;return o.diff&&((o.diff.changed||[]).forEach(L=>E.set(L.id,{type:"changed",from:L.from,to:L.to})),(o.diff.added||[]).forEach(L=>E.set(L.id,{type:"added"}))),l.jsxs("div",{className:"la-entry",style:{flexDirection:"column",alignItems:"flex-start",gap:2},children:[l.jsxs("div",{style:{fontSize:11,color:"var(--muted)",marginBottom:2},children:[c,"📝 执行计划"]}),T.map(L=>{const _=L.status==="completed"?"✅":L.status==="in-progress"?"🔄":"⬜",z=E.get(String(L.id)),d=L.status==="completed"?{opacity:.5,textDecoration:"line-through"}:L.status==="in-progress"?{color:"#60a5fa",fontWeight:"bold"}:{};return l.jsxs("div",{style:d,children:[_," ",L.title,z&&z.type==="changed"&&z.to==="completed"&&l.jsx("span",{style:{color:"#22c55e",fontSize:9,marginLeft:4},children:"✨刚完成"}),z&&z.type==="changed"&&z.to!=="completed"&&l.jsxs("span",{style:{color:"#f59e0b",fontSize:9,marginLeft:4},children:["↻",z.from,"→",z.to]}),z&&z.type==="added"&&l.jsx("span",{style:{color:"#3b82f6",fontSize:9,marginLeft:4},children:"🆕新增"})]},L.id)}),(y=(v=o.diff)==null?void 0:v.removed)==null?void 0:y.map(L=>l.jsxs("div",{style:{opacity:.4,textDecoration:"line-through"},children:["🗑 ",L.title]},L.id))]})}if(o.kind==="assistant")return l.jsxs(l.Fragment,{children:[o.thinking&&l.jsxs("div",{className:"la-entry la-thinking",children:[l.jsx("span",{className:"la-icon",children:"💭"}),l.jsxs("span",{className:"la-body",children:[c,o.thinking]}),l.jsx("span",{className:"la-time",children:f})]}),(D=o.tools)==null?void 0:D.map((T,E)=>l.jsxs("div",{className:"la-entry la-tool",children:[l.jsx("span",{className:"la-icon",children:"🔧"}),l.jsxs("span",{className:"la-body",children:[c,l.jsx("span",{className:"la-tool-name",children:T.name}),l.jsx("span",{className:"la-trunc",children:T.input_preview||""})]}),l.jsx("span",{className:"la-time",children:f})]},E)),o.text&&l.jsxs("div",{className:"la-entry la-assistant",children:[l.jsx("span",{className:"la-icon",children:"🤖"}),l.jsxs("span",{className:"la-body",children:[c,o.text]}),l.jsx("span",{className:"la-time",children:f})]})]});if(o.kind==="tool_result"){const T=o.exitCode===0||o.exitCode===null||o.exitCode===void 0;return l.jsxs("div",{className:`la-entry la-tool-result ${T?"ok":"err"}`,children:[l.jsx("span",{className:"la-icon",children:T?"✅":"❌"}),l.jsxs("span",{className:"la-body",children:[c,l.jsx("span",{className:"la-tool-name",children:o.tool||""}),o.output?o.output.substring(0,150):""]}),l.jsx("span",{className:"la-time",children:f})]})}return o.kind==="user"?l.jsxs("div",{className:"la-entry la-user",children:[l.jsx("span",{className:"la-icon",children:"📥"}),l.jsxs("span",{className:"la-body",children:[c,o.text||""]}),l.jsx("span",{className:"la-time",children:f})]}):null}function xp(){const o=te(f=>f.toasts);return o.length?l.jsx("div",{className:"toaster",children:o.map(f=>l.jsx("div",{className:`toast ${f.type}`,children:f.msg},f.id))}):null}function kp(){const o=te($=>$.liveStatus),[f,c]=V.useState(!1),[v,y]=V.useState(!1);V.useEffect(()=>{const $=localStorage.getItem("openclaw_court_date"),S=new Date().toISOString().substring(0,10);if(!JSON.parse(localStorage.getItem("openclaw_court_pref")||'{"enabled":true}').enabled||$===S)return;localStorage.setItem("openclaw_court_date",S),c(!0);const x=setTimeout(()=>D(),3500);return()=>clearTimeout(x)},[]);const D=()=>{y(!0),setTimeout(()=>c(!1),500)};if(!f)return null;const E=((o==null?void 0:o.tasks)||[]).filter(fn),L=E.filter($=>!["Done","Cancelled"].includes($.state)).length,_=E.filter($=>$.state==="Done").length,z=E.filter($=>$.state!=="Done"&&$.state!=="Cancelled"&&$.eta&&new Date($.eta.replace(" ","T"))0&&` · ⚠ 超期 ${z} 件`]}),l.jsx("div",{className:"crm-date in",children:j}),l.jsx("div",{className:"crm-skip",children:"点击任意处跳过"})]})}const ro={taizi:"#e8a040",zhongshu:"#a07aff",menxia:"#6a9eff",shangshu:"#2ecc8a",libu:"#f5c842",hubu:"#ff9a6a",bingbu:"#ff5270",xingbu:"#cc4444",gongbu:"#44aaff",libu_hr:"#9b59b6"},ns={neutral:"",confident:"😏",worried:"😟",angry:"😤",thinking:"🤔",amused:"😄",happy:"😊"},jp={zhongshu:{x:15,y:25},menxia:{x:15,y:45},shangshu:{x:15,y:65},libu:{x:85,y:20},hubu:{x:85,y:35},bingbu:{x:85,y:50},xingbu:{x:85,y:65},gongbu:{x:85,y:80},taizi:{x:50,y:20},libu_hr:{x:50,y:80}};function Sp(){var zn;const[o,f]=V.useState("setup"),[c,v]=V.useState(new Set),[y,D]=V.useState(""),[T,E]=V.useState(null),[L,_]=V.useState(!1),[z,d]=V.useState(!1),N=V.useRef(!1),[j,$]=V.useState(""),[S,M]=V.useState(!1),[x,A]=V.useState(""),[Q,P]=V.useState(!1),[re,pe]=V.useState(!1),[ve,he]=V.useState(null),[Be,X]=V.useState(null),[ae,Se]=V.useState({}),[se,ee]=V.useState([]),[Ce,_e]=V.useState(!1),[xe,b]=V.useState(""),[G,U]=V.useState(!1),[h,I]=V.useState(!1),me=V.useRef(null),fe=te(R=>R.toast),g=te(R=>R.liveStatus);V.useEffect(()=>{ce.courtDiscussList().then(R=>{var le;R.ok&&((le=R.sessions)!=null&&le.length)&&ee(R.sessions)}).catch(()=>{})},[]);const H=async R=>{_(!0);try{const le=await ce.courtDiscussSession(R);if(!le.ok)throw new Error(le.error||"恢复失败");E(le),f("session")}catch(le){fe(le.message||"恢复失败","err")}finally{_(!1)}},ne=async()=>{if(!(!T||!xe.trim()||G)){U(!0);try{const R=await ce.courtDiscussResearch(T.session_id,xe.trim());if(!R.ok)throw new Error(R.error||"搜索失败");b(""),_e(!1),E(ue=>{if(!ue)return ue;const be=[];R.search_summary&&be.push({type:"search_result",content:`🔍 查阅资料「${xe}」: -${R.search_summary}`,timestamp:Date.now()/1e3});const We=(R.new_messages||[]).map(Le=>({type:"official",official_id:Le.official_id,official_name:Le.name,content:Le.content,emotion:Le.emotion,action:Le.action,timestamp:Date.now()/1e3}));return R.scene_note&&be.push({type:"scene_note",content:R.scene_note,timestamp:Date.now()/1e3}),{...ue,round:R.round??ue.round+1,messages:[...ue.messages,...be,...We]}});const le=R.new_messages||[];if(le.length>0){const ue={};let be=0;const We=()=>{be({...Le,...ue}))}}catch(R){fe(R.message||"搜索失败","err")}finally{U(!1)}}},ke=async(R="markdown")=>{if(!(!T||h)){I(!0);try{const le=await ce.courtDiscussExport(T.session_id,R);if(!le.ok)throw new Error("导出失败");fe(`文档已保存:${le.filename}(${(le.size/1024).toFixed(1)}KB)`,"ok")}catch(le){fe(le.message||"导出失败","err")}finally{I(!1)}}};V.useEffect(()=>{var R;(R=me.current)==null||R.scrollIntoView({behavior:"smooth"})},[(zn=T==null?void 0:T.messages)==null?void 0:zn.length]),V.useEffect(()=>{N.current=z},[z]),V.useEffect(()=>{if(!z||!T||L)return;const R=setInterval(()=>{N.current&&!L&&mt()},5e3);return()=>clearInterval(R)},[z,T,L]);const je=R=>{v(le=>{const ue=new Set(le);return ue.has(R)?ue.delete(R):ue.size<8&&ue.add(R),ue})},$e=async()=>{if(!(!y.trim()||c.size<2||L)){_(!0);try{const R=await ce.courtDiscussStart(y,Array.from(c));if(!R.ok)throw new Error(R.error||"启动失败");E(R),f("session")}catch(R){fe(R.message||"启动失败","err")}finally{_(!1)}}},mt=V.useCallback(async(R,le)=>{if(!(!T||L)){_(!0);try{const ue=await ce.courtDiscussAdvance(T.session_id,R,le);if(!ue.ok)throw new Error(ue.error||"推进失败");E(We=>{var zt,Vt;if(!We)return We;const Le=[];R&&Le.push({type:"emperor",content:R,timestamp:Date.now()/1e3}),le&&Le.push({type:"decree",content:le,timestamp:Date.now()/1e3}),(zt=ue.search_results)!=null&&zt.length&&ue.search_context&&Le.push({type:"search_result",content:`🔍 太子搜集资料: -${ue.search_context}`,timestamp:Date.now()/1e3});const mn=(ue.new_messages||[]).map(jt=>({type:"official",official_id:jt.official_id,official_name:jt.name,content:jt.content,emotion:jt.emotion,action:jt.action,timestamp:Date.now()/1e3}));if(ue.scene_note&&Le.push({type:"scene_note",content:ue.scene_note,timestamp:Date.now()/1e3}),(Vt=ue.tool_results)!=null&&Vt.length)for(const jt of ue.tool_results)Le.push({type:"tool_result",content:jt.summary,official_id:jt.official_id,official_name:jt.official_name,timestamp:Date.now()/1e3});return{...We,round:ue.round??We.round+1,messages:[...We.messages,...Le,...mn]}});const be=ue.new_messages||[];if(be.length>0){const We={};let Le=0;const mn=()=>{Le({...zt,...We}))}}catch{}finally{_(!1)}}},[T,L]),er=()=>{const R=j.trim();R&&($(""),mt(R))},pn=()=>{const R=x.trim();R&&(A(""),M(!1),P(!0),setTimeout(()=>P(!1),800),mt(void 0,R))},tr=async()=>{if(L||re)return;pe(!0),he(null);let R=0;const le=setInterval(async()=>{if(R++,he("🎲 命运轮转中..."),R>=6){clearInterval(le);try{const be=(await ce.courtDiscussFate()).event||"边疆急报传来";he(be),pe(!1),mt(void 0,`【命运骰子】${be}`)}catch{he("命运之力暂时无法触及"),pe(!1)}}},200)},Ur=async()=>{if(T){_(!0);try{const R=await ce.courtDiscussConclude(T.session_id);R.summary&&E(le=>le&&{...le,phase:"concluded",messages:[...le.messages,{type:"system",content:`📋 朝堂议政结束 — ${R.summary}`,timestamp:Date.now()/1e3}]}),d(!1)}catch{fe("结束失败","err")}finally{_(!1)}}},Hr=()=>{f("setup"),E(null),d(!1),Se({}),X(null),he(null),_e(!1),ce.courtDiscussList().then(R=>{R.ok&&ee(R.sessions||[])}).catch(()=>{})},nr=R=>{ce.courtDiscussDestroy(R).catch(()=>{}),ee(le=>le.filter(ue=>ue.session_id!==R)),(T==null?void 0:T.session_id)===R&&(f("setup"),E(null))},bn=[...((g==null?void 0:g.tasks)||[]).filter(R=>/^JJC-/i.test(R.id)&&!["Done","Cancelled"].includes(R.state)).slice(0,3).map(R=>({text:`讨论旨意 ${R.id}:${R.title}`,taskId:R.id,icon:"📜"})),{text:"讨论系统架构优化方案",taskId:"",icon:"🏗️"},{text:"评估当前项目进展和风险",taskId:"",icon:"📊"},{text:"制定下周工作计划",taskId:"",icon:"📋"},{text:"紧急问题:线上Bug排查方案",taskId:"",icon:"🚨"}];if(o==="setup")return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center py-4",children:[l.jsx("h2",{className:"text-xl font-bold bg-gradient-to-r from-amber-400 to-purple-400 bg-clip-text text-transparent",children:"🏛 朝堂议政"}),l.jsx("p",{className:"text-xs text-[var(--muted)] mt-1",children:"择臣上殿,围绕议题展开讨论 · 陛下可随时发言或降下天意改变走向"})]}),l.jsxs("div",{className:"bg-[var(--panel)] rounded-xl p-4 border border-[var(--line)]",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-sm font-semibold",children:"👔 选择参朝官员"}),l.jsxs("span",{className:"text-xs text-[var(--muted)]",children:["(",c.size,"/8,至少2位)"]})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-2",children:pu.map(R=>{const le=c.has(R.id),ue=ro[R.id]||"#6a9eff";return l.jsx("button",{onClick:()=>je(R.id),className:"p-2.5 rounded-lg border transition-all text-left",style:{borderColor:le?ue+"80":"var(--line)",background:le?ue+"15":"var(--panel2)",boxShadow:le?`0 0 12px ${ue}20`:"none"},children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-lg",children:R.emoji}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-semibold",style:{color:le?ue:"var(--text)"},children:R.label}),l.jsx("div",{className:"text-[10px] text-[var(--muted)]",children:R.role})]}),le&&l.jsx("span",{className:"ml-auto w-4 h-4 rounded-full flex items-center justify-center text-[10px] text-white",style:{background:ue},children:"✓"})]})},R.id)})})]}),l.jsxs("div",{className:"bg-[var(--panel)] rounded-xl p-4 border border-[var(--line)]",children:[l.jsx("div",{className:"text-sm font-semibold mb-2",children:"📜 设定议题"}),bn.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:bn.map((R,le)=>l.jsxs("button",{onClick:()=>D(R.text),className:"text-xs px-2.5 py-1.5 rounded-lg border border-[var(--line)] hover:border-[var(--acc)] hover:text-[var(--acc)] transition-colors",style:{background:y===R.text?"var(--acc)18":"transparent",borderColor:y===R.text?"var(--acc)":void 0,color:y===R.text?"var(--acc)":void 0},children:[R.icon," ",R.text]},le))}),l.jsx("textarea",{className:"w-full bg-[var(--panel2)] rounded-lg p-3 text-sm border border-[var(--line)] focus:border-[var(--acc)] outline-none resize-none",rows:2,placeholder:"或自定义议题...",value:y,onChange:R=>D(R.target.value)})]}),se.length>0&&l.jsxs("div",{className:"bg-[var(--panel)] rounded-xl p-4 border border-[var(--line)]",children:[l.jsx("div",{className:"text-sm font-semibold mb-2",children:"📂 历史朝议(点击继续)"}),l.jsx("div",{className:"space-y-1.5",children:se.map(R=>l.jsxs("div",{className:"flex items-center gap-2 group",children:[l.jsx("button",{onClick:()=>H(R.session_id),className:"flex-1 text-left text-xs px-3 py-2 rounded-lg border border-[var(--line)] hover:border-[var(--acc)] hover:bg-[var(--acc)]08 transition-colors",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:R.phase==="concluded"?"text-green-400":"text-amber-400",children:R.phase==="concluded"?"✓":"●"}),l.jsx("span",{className:"font-medium truncate",children:R.topic}),l.jsxs("span",{className:"text-[var(--muted)] ml-auto whitespace-nowrap",children:[R.round,"轮 · ",R.official_count,"人 · ",R.message_count,"条"]})]})}),l.jsx("button",{onClick:le=>{le.stopPropagation(),nr(R.session_id)},className:"opacity-0 group-hover:opacity-100 text-[10px] text-red-400/60 hover:text-red-400 px-1 transition-opacity",title:"删除此会话",children:"✕"})]},R.session_id))})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:["👑 皇帝发言","⚡ 天命降临","🎲 命运骰子","🔄 自动推进","🔍 网页调研","📄 导出文档"].map(R=>l.jsx("span",{className:"text-[10px] px-2 py-1 rounded-full border border-[var(--line)] text-[var(--muted)]",children:R},R))}),l.jsx("button",{onClick:$e,disabled:c.size<2||!y.trim()||L,className:"w-full py-3 rounded-xl font-semibold text-sm transition-all border-0",style:{background:c.size>=2&&y.trim()?"linear-gradient(135deg, #6a9eff, #a07aff)":"var(--panel2)",color:c.size>=2&&y.trim()?"#fff":"var(--muted)",opacity:L?.6:1,cursor:c.size>=2&&y.trim()&&!L?"pointer":"not-allowed"},children:L?"召集中...":`🏛 开始朝议(${c.size}位上殿)`})]});const Ut=(T==null?void 0:T.officials)||[],Ht=(T==null?void 0:T.messages)||[];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 bg-[var(--panel)] rounded-xl px-4 py-2 border border-[var(--line)]",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-bold",children:"🏛 朝堂议政"}),l.jsxs("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-[var(--acc)]20 text-[var(--acc)] border border-[var(--acc)]30",children:["第",(T==null?void 0:T.round)||0,"轮"]}),(T==null?void 0:T.phase)==="concluded"&&l.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-green-900/40 text-green-400 border border-green-800",children:"已结束"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("button",{onClick:()=>M(!S),className:"text-xs px-2.5 py-1 rounded-lg border border-amber-600/40 text-amber-400 hover:bg-amber-900/20 transition",title:"天命降临 — 上帝视角干预",children:"⚡ 天命"}),l.jsxs("button",{onClick:tr,disabled:re||L,className:"text-xs px-2.5 py-1 rounded-lg border border-purple-600/40 text-purple-400 hover:bg-purple-900/20 transition",title:"命运骰子 — 随机事件",children:["🎲 ",re?"...":"骰子"]}),l.jsx("button",{onClick:()=>_e(!Ce),className:`text-xs px-2.5 py-1 rounded-lg border transition ${Ce?"border-cyan-600/40 text-cyan-400 bg-cyan-900/20":"border-[var(--line)] text-[var(--muted)] hover:text-cyan-400"}`,title:"网页调研 — 搜索真实信息后讨论",children:"🔍 调研"}),l.jsxs("button",{onClick:()=>ke("markdown"),disabled:h,className:"text-xs px-2.5 py-1 rounded-lg border border-[var(--line)] text-[var(--muted)] hover:text-green-400 hover:border-green-600/40 transition",title:"导出讨论记录为文档",children:["📄 ",h?"...":"导出"]}),l.jsx("button",{onClick:()=>d(!z),className:`text-xs px-2.5 py-1 rounded-lg border transition ${z?"border-green-600/40 text-green-400 bg-green-900/20":"border-[var(--line)] text-[var(--muted)] hover:text-[var(--text)]"}`,children:z?"⏸ 暂停":"▶ 自动"}),(T==null?void 0:T.phase)!=="concluded"&&l.jsx("button",{onClick:Ur,className:"text-xs px-2.5 py-1 rounded-lg border border-[var(--line)] text-[var(--muted)] hover:text-[var(--warn)] hover:border-[var(--warn)]40 transition",children:"📋 散朝"}),l.jsx("button",{onClick:Hr,className:"text-xs px-2 py-1 rounded-lg border border-[var(--line)] text-[var(--muted)] hover:text-[var(--text)] transition",title:"返回(会话不会丢失)",children:"↩"})]})]}),S&&l.jsxs("div",{className:"bg-gradient-to-br from-amber-950/40 to-purple-950/30 rounded-xl p-4 border border-amber-700/30",style:{animation:"fadeIn .3s"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-sm font-bold text-amber-400",children:"⚡ 天命降临 — 上帝视角"}),l.jsx("button",{onClick:()=>M(!1),className:"text-xs text-[var(--muted)]",children:"✕"})]}),l.jsx("p",{className:"text-[10px] text-amber-300/60 mb-2",children:"降下天意改变讨论走向,所有官员将对此做出反应"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{value:x,onChange:R=>A(R.target.value),onKeyDown:R=>R.key==="Enter"&&pn(),placeholder:"例如:突然发现预算多出一倍...",className:"flex-1 bg-black/30 rounded-lg px-3 py-1.5 text-sm border border-amber-800/40 outline-none focus:border-amber-600"}),l.jsx("button",{onClick:pn,disabled:!x.trim(),className:"px-4 py-1.5 rounded-lg bg-gradient-to-r from-amber-600 to-purple-600 text-white text-xs font-semibold disabled:opacity-40",children:"降旨"})]})]}),Ce&&l.jsxs("div",{className:"bg-gradient-to-br from-cyan-950/40 to-blue-950/30 rounded-xl p-4 border border-cyan-700/30",style:{animation:"fadeIn .3s"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-sm font-bold text-cyan-400",children:"🔍 网页调研 — 查阅真实资料后议政"}),l.jsx("button",{onClick:()=>_e(!1),className:"text-xs text-[var(--muted)]",children:"✕"})]}),l.jsx("p",{className:"text-[10px] text-cyan-300/60 mb-2",children:"搜索互联网获取最新资料,官员将基于真实信息讨论并给出方案"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{value:xe,onChange:R=>b(R.target.value),onKeyDown:R=>R.key==="Enter"&&ne(),placeholder:"例如:React 19 新特性、2026年AI趋势...",className:"flex-1 bg-black/30 rounded-lg px-3 py-1.5 text-sm border border-cyan-800/40 outline-none focus:border-cyan-600"}),l.jsx("button",{onClick:ne,disabled:!xe.trim()||G,className:"px-4 py-1.5 rounded-lg bg-gradient-to-r from-cyan-600 to-blue-600 text-white text-xs font-semibold disabled:opacity-40",children:G?"搜索中...":"搜索并议政"})]})]}),ve&&l.jsxs("div",{className:"bg-purple-950/40 rounded-lg px-3 py-2 border border-purple-700/30 text-xs text-purple-300 flex items-center gap-2",style:{animation:"fadeIn .3s"},children:[l.jsx("span",{className:"text-lg",children:"🎲"}),ve]}),Q&&l.jsx("div",{className:"fixed inset-0 pointer-events-none z-50",style:{background:"radial-gradient(circle, rgba(255,200,50,0.3), transparent 70%)",animation:"fadeOut .8s forwards"}}),l.jsxs("div",{className:"text-xs text-center text-[var(--muted)] py-1",children:["📜 ",(T==null?void 0:T.topic)||""]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-3",children:[l.jsxs("div",{className:"bg-[var(--panel)] rounded-xl p-3 border border-[var(--line)] relative overflow-hidden min-h-[320px]",children:[l.jsx("div",{className:"text-center mb-2",children:l.jsxs("div",{className:"inline-block px-3 py-1 rounded-lg bg-gradient-to-b from-amber-800/40 to-amber-950/40 border border-amber-700/30",children:[l.jsx("span",{className:"text-lg",children:"👑"}),l.jsx("div",{className:"text-[10px] text-amber-400/80",children:"龙 椅"})]})}),l.jsxs("div",{className:"relative",style:{minHeight:250},children:[l.jsx("div",{className:"absolute left-0 top-0 text-[9px] text-[var(--muted)] opacity-50",children:"三省"}),l.jsx("div",{className:"absolute right-0 top-0 text-[9px] text-[var(--muted)] opacity-50",children:"六部"}),Ut.map(R=>{const le=jp[R.id]||{x:50,y:50},ue=ro[R.id]||"#6a9eff",be=Be===R.id,We=ae[R.id]||"neutral";return l.jsxs("div",{className:"absolute transition-all duration-500",style:{left:`${le.x}%`,top:`${le.y}%`,transform:"translate(-50%, -50%)"},children:[be&&l.jsx("div",{className:"absolute -inset-2 rounded-full",style:{background:`radial-gradient(circle, ${ue}40, transparent)`,animation:"pulse 1s infinite"}}),l.jsxs("div",{className:"relative w-10 h-10 rounded-full flex items-center justify-center text-lg border-2 transition-all",style:{borderColor:be?ue:ue+"40",background:be?ue+"30":ue+"10",transform:be?"scale(1.2)":"scale(1)",boxShadow:be?`0 0 16px ${ue}50`:"none"},children:[R.emoji,ns[We]&&l.jsx("span",{className:"absolute -top-1 -right-1 text-xs",style:{animation:"bounceIn .3s"},children:ns[We]})]}),l.jsx("div",{className:"text-[9px] text-center mt-0.5 whitespace-nowrap",style:{color:be?ue:"var(--muted)"},children:R.name})]},R.id)})]})]}),l.jsxs("div",{className:"bg-[var(--panel)] rounded-xl border border-[var(--line)] flex flex-col",style:{maxHeight:500},children:[l.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",style:{minHeight:200},children:[Ht.map((R,le)=>l.jsx(wp,{msg:R,officials:Ut},le)),L&&l.jsx("div",{className:"text-xs text-[var(--muted)] text-center py-2",style:{animation:"pulse 1.5s infinite"},children:"🔍 太子正在搜集信息,群臣分析中..."}),l.jsx("div",{ref:me})]}),(T==null?void 0:T.phase)!=="concluded"&&l.jsxs("div",{className:"border-t border-[var(--line)] p-2 flex gap-2",children:[l.jsx("input",{value:j,onChange:R=>$(R.target.value),onKeyDown:R=>R.key==="Enter"&&er(),placeholder:"朕有话说...",className:"flex-1 bg-[var(--panel2)] rounded-lg px-3 py-1.5 text-sm border border-[var(--line)] outline-none focus:border-amber-600"}),l.jsx("button",{onClick:er,disabled:!j.trim()||L,className:"px-4 py-1.5 rounded-lg text-xs font-semibold border-0 disabled:opacity-40",style:{background:j.trim()?"linear-gradient(135deg, #e8a040, #f5c842)":"var(--panel2)",color:j.trim()?"#000":"var(--muted)"},children:"👑 发言"}),l.jsx("button",{onClick:()=>mt(),disabled:L,className:"px-3 py-1.5 rounded-lg text-xs border border-[var(--acc)]40 text-[var(--acc)] hover:bg-[var(--acc)]10 disabled:opacity-40 transition",children:"▶ 下一轮"})]})]})]})]})}function wp({msg:o,officials:f}){var y;const c=ro[o.official_id||""]||"#6a9eff",v=f.find(D=>D.id===o.official_id);return o.type==="system"?l.jsx("div",{className:"text-center text-[10px] text-[var(--muted)] py-1 border-b border-[var(--line)] border-dashed",children:o.content}):o.type==="scene_note"?l.jsxs("div",{className:"text-center text-[10px] text-purple-400/80 py-1 italic",children:["✦ ",o.content," ✦"]}):o.type==="emperor"?l.jsx("div",{className:"flex justify-end",children:l.jsxs("div",{className:"max-w-[80%] bg-gradient-to-br from-amber-900/40 to-amber-800/20 rounded-xl px-3 py-2 border border-amber-700/30",children:[l.jsx("div",{className:"text-[10px] text-amber-400 mb-0.5",children:"👑 皇帝"}),l.jsx("div",{className:"text-sm",children:o.content})]})}):o.type==="decree"?l.jsx("div",{className:"text-center py-2",children:l.jsxs("div",{className:"inline-block bg-gradient-to-r from-amber-900/30 via-purple-900/30 to-amber-900/30 rounded-lg px-4 py-2 border border-amber-600/30",children:[l.jsx("div",{className:"text-xs text-amber-400 font-bold",children:"⚡ 天命降临"}),l.jsx("div",{className:"text-sm mt-0.5",children:o.content})]})}):o.type==="search_result"?l.jsxs("div",{className:"bg-gradient-to-br from-cyan-950/30 to-blue-950/20 rounded-xl px-3 py-2 border border-cyan-700/20",children:[l.jsx("div",{className:"text-[10px] text-cyan-400 font-semibold mb-1",children:"🔍 搜索调研"}),l.jsx("div",{className:"text-xs leading-relaxed text-[var(--text)] whitespace-pre-wrap",children:o.content})]}):o.type==="tool_result"?l.jsxs("div",{className:"bg-gradient-to-br from-emerald-950/30 to-green-950/20 rounded-xl px-3 py-2 border border-emerald-700/20",children:[l.jsxs("div",{className:"text-[10px] text-emerald-400 font-semibold mb-1",children:["🛠 ",o.official_name||"官员","补充查阅"]}),l.jsx("div",{className:"text-xs leading-relaxed text-[var(--text)] whitespace-pre-wrap",children:o.content})]}):l.jsxs("div",{className:"flex gap-2 items-start",style:{animation:"fadeIn .4s"},children:[l.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-sm flex-shrink-0 border",style:{borderColor:c+"60",background:c+"15"},children:(v==null?void 0:v.emoji)||"💬"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[l.jsx("span",{className:"text-[11px] font-semibold",style:{color:c},children:o.official_name||"官员"}),o.emotion&&ns[o.emotion]&&l.jsx("span",{className:"text-xs",children:ns[o.emotion]})]}),l.jsx("div",{className:"text-sm leading-relaxed",children:(y=o.content)==null?void 0:y.split(/(\*[^*]+\*)/).map((D,T)=>D.startsWith("*")&&D.endsWith("*")?l.jsx("span",{className:"text-[var(--muted)] italic text-xs",children:D.slice(1,-1)},T):l.jsx("span",{children:D},T))})]})]})}function Np(){const o=te(d=>d.activeTab),f=te(d=>d.setActiveTab),c=te(d=>d.liveStatus),v=te(d=>d.countdown),y=te(d=>d.loadAll);V.useEffect(()=>(Uf(),()=>Hf()),[]);const D=(c==null?void 0:c.tasks)||[],T=D.filter(fn),E=T.filter(d=>!ts(d)),L=c==null?void 0:c.syncStatus,_=L==null?void 0:L.ok,z=d=>d==="edicts"?String(E.length):d==="sessions"?String(D.filter(N=>!fn(N)).length):d==="memorials"?String(T.filter(N=>["Done","Cancelled"].includes(N.state)).length):d==="monitor"?D.filter(j=>fn(j)&&j.state==="Doing").length+"活跃":"";return l.jsxs("div",{className:"wrap",children:[l.jsxs("div",{className:"hdr",children:[l.jsxs("div",{children:[l.jsx("div",{className:"logo",children:"三省六部 · 总控台"}),l.jsx("div",{className:"sub-text",children:"OpenClaw Sansheng-Liubu Dashboard"})]}),l.jsxs("div",{className:"hdr-r",children:[l.jsx("span",{className:`chip ${_?"ok":_===!1?"err":""}`,children:_?"✅ 同步正常":_===!1?"❌ 服务器未启动":"⏳ 连接中…"}),l.jsxs("span",{className:"chip",children:[E.length," 道旨意"]}),l.jsx("button",{className:"btn-refresh",onClick:()=>y(),children:"⟳ 刷新"}),l.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:["⟳ ",v,"s"]})]})]}),l.jsx("div",{className:"tabs",children:Of.map(d=>l.jsxs("div",{className:`tab ${o===d.key?"active":""}`,onClick:()=>f(d.key),children:[d.icon," ",d.label,z(d.key)&&l.jsx("span",{className:"tbadge",children:z(d.key)})]},d.key))}),o==="edicts"&&l.jsx(Gf,{}),o==="court"&&l.jsx(Sp,{}),o==="monitor"&&l.jsx(Yf,{}),o==="officials"&&l.jsx(Zf,{}),o==="models"&&l.jsx(tp,{}),o==="skills"&&l.jsx(rp,{}),o==="sessions"&&l.jsx(ip,{}),o==="memorials"&&l.jsx(ap,{}),o==="templates"&&l.jsx(up,{}),o==="morning"&&l.jsx(dp,{}),l.jsx(hp,{}),l.jsx(xp,{}),l.jsx(kp,{})]})}wf.createRoot(document.getElementById("root")).render(l.jsx(uu.StrictMode,{children:l.jsx(Np,{})}));