Files
ONE-OS/axhub-make/admin/assets/chunks/use-feedback-bridge.js
王冕 a27e3b8e43 feat: sync full workspace including web modules, docs, and configurations to Gitea
Optimized the root .gitignore to exclude virtual environments, node modules,
and temp folders to ensure clean and lightweight version tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:12:25 +08:00

300 lines
127 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/vendor-export.js","assets/chunks/_commonjsHelpers.js"])))=>i.map(i=>d[i]);
import{R as s,c as Br,j as n,a as Ar}from"./vendor-react.js?v=1775123024591";import{P as Z,z as bn,M as kt,A as _o,B as re,h as jn,T as Mo,U as Lr,V as Nt,W as Dr,X as zr,Y as xn,Z as Bo,$ as Ao,a0 as eo,E as Or,a1 as we,S as Vt,a2 as Lo,a3 as at,a4 as Hr,a5 as Wr,a6 as Gr,a7 as Fr,G as De,a8 as Nr,a9 as $r,aa as Do,ab as zo,ac as sn,ad as Vr,H as to,ae as Yr,af as Ur,ag as Xr,ah as no,ai as Kr}from"./vendor-antd.js?v=1775123024591";import{_ as qr}from"./preload-helper.js?v=1775123024591";import{db as Ke,dc as ee}from"./vendor-common.js?v=1775123024591";const Zr=500,oo={enabled:!1,middleClickEnabled:!1,shortcuts:[null,null]},Qr=new Set(["Shift","Alt","Control","Meta"]);function yn(t){if(typeof t!="string")return null;const e=t.trim();return e?e==="Ctrl"?"Control":e==="Command"||e==="Cmd"?"Meta":Qr.has(e)?e:null:null}function Jr(t){return t==="Control"?"Ctrl":t==="Meta"?"Command":t??"未设置"}function cn(t){const e=Array.isArray(t==null?void 0:t.shortcuts)?t==null?void 0:t.shortcuts:[];return{enabled:!!(t!=null&&t.enabled),middleClickEnabled:!!(t!=null&&t.middleClickEnabled),shortcuts:[yn(e[0]),yn(e[1])]}}function ei(t,e){return t.enabled===e.enabled&&t.middleClickEnabled===e.middleClickEnabled&&t.shortcuts[0]===e.shortcuts[0]&&t.shortcuts[1]===e.shortcuts[1]}let wt=null;function ue(){if(wt!==null)return wt;if(typeof window>"u"||typeof navigator>"u")return wt=!1,!1;const t="ontouchstart"in window||navigator.maxTouchPoints!=null&&navigator.maxTouchPoints>0,e=window.innerWidth<=768;return wt=t&&e,wt}function el(){if(typeof document>"u")return;const t=document.body;if(!t)return;const e=t.style.transform;t.style.transform="translateZ(0)",requestAnimationFrame(()=>{t.style.transform=e||""})}let Oo=null;function ro(t){Oo=t}function St(){return Oo}const Ho=s.forwardRef((t,e)=>{const[r,o]=s.useState(t.defaultValue??""),[i,l]=s.useState(""),a=s.useRef(null);s.useImperativeHandle(e,()=>({getValue:()=>r,setError:c=>{l(c)},focus:c=>{const d=a.current;d&&(d.focus(),c&&d.select())}}),[r]);const g=c=>{o(c.target.value),i&&l("")},f=t.multiline?s.createElement(Z.TextArea,{ref:c=>{var d;a.current=((d=c==null?void 0:c.resizableTextArea)==null?void 0:d.textArea)??null},value:r,rows:t.rows??8,readOnly:t.readOnly,placeholder:t.placeholder,onChange:g}):s.createElement(Z,{ref:c=>{a.current=(c==null?void 0:c.input)??null},value:r,readOnly:t.readOnly,placeholder:t.placeholder,onChange:g});return s.createElement("div",{style:{display:"grid",gap:10}},t.content?s.createElement("div",{style:{whiteSpace:"pre-line"}},t.content):null,t.label?s.createElement("div",{style:{fontSize:12,fontWeight:600,color:"rgba(0,0,0,0.88)"}},t.label):null,f,i?s.createElement("div",{style:{fontSize:12,color:"#ff4d4f"}},i):null)});Ho.displayName="PromptDialogContent";function dn(t){if(t)return t;if(typeof document<"u")return document.body;throw new Error("No dialog container available")}function ti(t,e){const r=document.createElement("div");t.appendChild(r);const o=Br(r);return new Promise(i=>{const l=s.createRef(),a=()=>{window.setTimeout(()=>{o.unmount(),r.remove()},0)},g=c=>{i(c),a()},f=()=>s.createElement(_o,null,s.createElement(kt,{open:!0,title:e.title,okText:e.confirmText,cancelText:e.cancelText,centered:!0,closable:!0,maskClosable:!0,destroyOnHidden:!0,zIndex:2147483647,cancelButtonProps:e.cancelText?void 0:{style:{display:"none"}},onOk:async()=>{var d,m,u,b;const c=((d=l.current)==null?void 0:d.getValue())??e.defaultValue??"";if(!e.readOnly){const S=((m=e.validate)==null?void 0:m.call(e,c))??null;if(S)return(u=l.current)==null||u.setError(S),(b=l.current)==null||b.focus(!!e.selectOnOpen),Promise.reject()}g(c)},onCancel:()=>{g(null)}},s.createElement(Ho,{ref:l,content:e.content,label:e.label,defaultValue:e.defaultValue,placeholder:e.placeholder,readOnly:e.readOnly,multiline:e.multiline,rows:e.rows})));o.render(s.createElement(f)),window.setTimeout(()=>{var c;(c=l.current)==null||c.focus(!!e.selectOnOpen)},0)})}function tl(t){function e(l){if(typeof window>"u")return Promise.resolve(!!l.cancelText);const a=t.getUiRoot(),g=dn(a);return new Promise(f=>{let c=!1;const d=u=>{c||(c=!0,f(u))},m=St();if(m){m.confirm({title:l.title,content:l.content,okText:l.confirmText,cancelText:l.cancelText,okType:l.confirmTone==="primary"?"primary":"default",getContainer:()=>g,onOk:()=>d(!0),onCancel:()=>d(!1)});return}kt.confirm({title:l.title,content:l.content,okText:l.confirmText,cancelText:l.cancelText,okType:l.confirmTone==="primary"?"primary":"default",centered:!0,closable:!0,maskClosable:!0,getContainer:()=>g,onOk:()=>d(!0),onCancel:()=>d(!1)})})}function r(l){if(typeof window>"u")return Promise.resolve();const a=t.getUiRoot(),g=dn(a);return new Promise(f=>{const c=St();if(c){c.alert({title:l.title,content:l.content,okText:l.confirmText,okType:l.confirmTone==="primary"?"primary":"default",getContainer:()=>g,onOk:f});return}kt.confirm({title:l.title,content:l.content,okText:l.confirmText,okType:l.confirmTone==="primary"?"primary":"default",centered:!0,closable:!0,maskClosable:!0,getContainer:()=>g,cancelButtonProps:{style:{display:"none"}},onOk:f})})}function o(l){if(typeof window>"u")return Promise.resolve(l.defaultValue??null);const a=t.getUiRoot(),g=dn(a),f=St();return f?new Promise(c=>{f.prompt({title:l.title,content:l.content,label:l.label,defaultValue:l.defaultValue,placeholder:l.placeholder,okText:l.confirmText,cancelText:l.cancelText,readOnly:l.readOnly,multiline:l.multiline,rows:l.rows,selectOnOpen:l.selectOnOpen,validate:l.validate,getContainer:()=>g,onOk:d=>c(d),onCancel:()=>c(null)})}):ti(g,l)}function i(l,a){if(!(typeof window>"u"))try{const g=t.getUiRoot(),f=St();if(g&&f){f.message({type:l,content:a});return}g&&bn.config({getContainer:()=>g}),bn.open({type:l,content:a})}catch{}}return{confirm:e,alert:r,prompt:o,toast:i}}const ni=12,oi=12,Yt=268,ri=20,ii=24,lt=16,Lt=24,wn=280,io=104,Wo="编辑当前文本",Go="填写本元素的修改需求",Dt=16,En=10040,ai=10,un=8,li=28,it=44,pn=251,$t=44,si=36,te="data-we-popup-root",Fo=15,ci=1.8,ao=28,nl="__WEB_EDITOR_V2_PASTE_DEBUG__",No="#008F5D",$o="#00A36A",Vo="#007A4F",Yo="rgba(0, 143, 93, 0.16)",Uo="rgba(0, 143, 93, 0.28)",di="rgba(0, 143, 93, 0.28)",Xo="#00D68F",ui="#A1A1AA",pi="#71717A",ol="__webEditorV2ParentPasteBridgeCleanup__",gi={accent:No,accentBright:Xo,accentHover:$o,accentActive:Vo,accentSoft:Yo,accentRing:Uo,surface:"#FFFFFF",surfaceElevated:"#FFFFFF",surfaceMuted:"#FAFAFA",surfaceInteractive:"#F4F4F5",surfaceOverlay:"rgba(255, 255, 255, 0.96)",border:"rgba(39, 39, 42, 0.10)",borderStrong:"rgba(39, 39, 42, 0.16)",divider:"rgba(228, 228, 231, 0.95)",textPrimary:"#18181B",textSecondary:"#3F3F46",textMuted:"#A1A1AA",textSleeping:"#A1A1AA",textSleepingStrong:"#71717A",textDanger:"#DC2626",hoverSubtle:"rgba(244, 244, 245, 1)",hoverGhost:"rgba(15, 23, 42, 0.035)",toolbarShellBorder:"rgba(228, 228, 231, 0.80)",toolbarShellInset:"inset 0 1px 0 rgba(255, 255, 255, 0.88)",toolbarGlow:"0 0 20px -5px rgba(0, 143, 93, 0.20)",shadow:"0 24px 60px rgba(15, 23, 42, 0.14), 0 8px 24px rgba(15, 23, 42, 0.08)",shadowCompact:"0 18px 38px rgba(15, 23, 42, 0.14), 0 6px 16px rgba(15, 23, 42, 0.08)",overlayCloseBackground:"rgba(255, 255, 255, 0.94)"},fi={accent:No,accentBright:Xo,accentHover:$o,accentActive:Vo,accentSoft:Yo,accentRing:Uo,surface:"#121212",surfaceElevated:"#161616",surfaceMuted:"#18181B",surfaceInteractive:"#27272A",surfaceOverlay:"rgba(18, 18, 18, 0.96)",border:"rgba(255, 255, 255, 0.08)",borderStrong:"rgba(255, 255, 255, 0.12)",divider:"rgba(39, 39, 42, 0.95)",textPrimary:"rgba(255, 255, 255, 0.94)",textSecondary:"#D4D4D8",textMuted:"#A1A1AA",textSleeping:ui,textSleepingStrong:pi,textDanger:"#ff7875",hoverSubtle:"rgba(39, 39, 42, 0.80)",hoverGhost:"rgba(255, 255, 255, 0.04)",toolbarShellBorder:"rgba(39, 39, 42, 0.82)",toolbarShellInset:"inset 0 1px 0 rgba(255, 255, 255, 0.02)",toolbarGlow:"0 0 20px -5px rgba(0, 143, 93, 0.15)",shadow:"0 18px 48px rgba(0, 0, 0, 0.42), 0 4px 18px rgba(0, 0, 0, 0.28)",shadowCompact:"0 16px 32px rgba(0, 0, 0, 0.36), 0 4px 14px rgba(0, 0, 0, 0.22)",overlayCloseBackground:"rgba(18, 18, 18, 0.92)"};function X(t){return`var(${t})`}const h={accent:X("--we-editor-accent"),accentSoft:X("--we-editor-accent-soft"),accentRing:X("--we-editor-accent-ring"),surface:X("--we-editor-surface"),surfaceElevated:X("--we-editor-surface-elevated"),surfaceMuted:X("--we-editor-surface-muted"),surfaceInteractive:X("--we-editor-surface-interactive"),surfaceOverlay:X("--we-editor-surface-overlay"),border:X("--we-editor-border"),borderStrong:X("--we-editor-border-strong"),divider:X("--we-editor-divider"),textPrimary:X("--we-editor-text-primary"),textSecondary:X("--we-editor-text-secondary"),textMuted:X("--we-editor-text-muted"),textSleepingStrong:X("--we-editor-text-sleeping-strong"),textDanger:X("--we-editor-text-danger"),hoverSubtle:X("--we-editor-hover-subtle"),hoverGhost:X("--we-editor-hover-ghost"),toolbarShellBorder:X("--we-editor-toolbar-shell-border"),toolbarShellInset:X("--we-editor-toolbar-shell-inset"),toolbarGlow:X("--we-editor-toolbar-glow"),shadow:X("--we-editor-shadow"),shadowCompact:X("--we-editor-shadow-compact")};function Ko(t){return t==="dark"?fi:gi}function rl(t){const e=Ko(t);return{"--we-editor-accent":e.accent,"--we-editor-accent-bright":e.accentBright,"--we-editor-accent-hover":e.accentHover,"--we-editor-accent-active":e.accentActive,"--we-editor-accent-soft":e.accentSoft,"--we-editor-accent-ring":e.accentRing,"--we-editor-surface":e.surface,"--we-editor-surface-elevated":e.surfaceElevated,"--we-editor-surface-muted":e.surfaceMuted,"--we-editor-surface-interactive":e.surfaceInteractive,"--we-editor-surface-overlay":e.surfaceOverlay,"--we-editor-border":e.border,"--we-editor-border-strong":e.borderStrong,"--we-editor-divider":e.divider,"--we-editor-text-primary":e.textPrimary,"--we-editor-text-secondary":e.textSecondary,"--we-editor-text-muted":e.textMuted,"--we-editor-text-sleeping":e.textSleeping,"--we-editor-text-sleeping-strong":e.textSleepingStrong,"--we-editor-text-danger":e.textDanger,"--we-editor-hover-subtle":e.hoverSubtle,"--we-editor-hover-ghost":e.hoverGhost,"--we-editor-toolbar-shell-border":e.toolbarShellBorder,"--we-editor-toolbar-shell-inset":e.toolbarShellInset,"--we-editor-toolbar-glow":e.toolbarGlow,"--we-editor-shadow":e.shadow,"--we-editor-shadow-compact":e.shadowCompact,"--we-editor-overlay-close-background":e.overlayCloseBackground}}function il(t){const e=Ko(t);return{token:{colorPrimary:e.accent,colorInfo:e.accent,colorSuccess:e.accent,colorLink:e.accent,colorPrimaryHover:e.accentHover,colorPrimaryActive:e.accentActive,colorPrimaryBorder:e.accent,colorPrimaryBorderHover:e.accentHover,colorPrimaryBg:e.accentSoft,colorPrimaryBgHover:"rgba(0, 143, 93, 0.22)",borderRadius:8,fontSize:11,fontSizeSM:11,colorBgBase:e.surface,colorBgContainer:e.surfaceElevated,colorBgElevated:e.surfaceElevated,colorFill:t==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(15, 23, 42, 0.06)",colorFillSecondary:e.surfaceMuted,colorFillTertiary:e.surfaceInteractive,colorText:e.textPrimary,colorTextSecondary:e.textSecondary,colorTextTertiary:e.textMuted,colorBorder:e.border,colorBorderSecondary:e.borderStrong,colorTextPlaceholder:e.textMuted,colorSplit:e.border,boxShadowSecondary:e.shadow,colorIcon:e.textSecondary,colorIconHover:e.textPrimary,controlOutline:e.accentSoft,controlOutlineWidth:2,controlHeight:32,controlHeightSM:28},components:{Button:{borderRadius:12,paddingInlineSM:8,controlHeightSM:28,defaultShadow:"none",primaryShadow:"none",dangerShadow:"none",textTextColor:e.textPrimary,textHoverBg:e.hoverSubtle,defaultBg:e.surfaceMuted,defaultColor:e.textPrimary,defaultBorderColor:e.border,defaultHoverBg:e.surfaceInteractive,defaultHoverColor:e.textPrimary,defaultHoverBorderColor:e.borderStrong},Collapse:{contentBg:"transparent",headerBg:"transparent",borderlessContentBg:"transparent",contentPadding:"0 0 8px",borderlessContentPadding:"0 0 8px"},Input:{colorBgContainer:e.surfaceMuted,activeBg:e.surfaceInteractive,hoverBg:e.surfaceInteractive,activeBorderColor:e.accent,hoverBorderColor:e.borderStrong,activeShadow:`0 0 0 2px ${e.accentSoft}`},InputNumber:{colorBgContainer:e.surfaceMuted,activeBg:e.surfaceInteractive,hoverBg:e.surfaceInteractive,activeBorderColor:e.accent,hoverBorderColor:e.borderStrong,activeShadow:`0 0 0 2px ${e.accentSoft}`},Select:{optionSelectedBg:e.accentSoft,optionActiveBg:e.hoverSubtle,selectorBg:e.surfaceMuted,activeBorderColor:e.accent,hoverBorderColor:e.borderStrong},Segmented:{trackBg:e.surfaceMuted,itemSelectedBg:e.surfaceInteractive,itemSelectedColor:e.textPrimary},Slider:{colorPrimary:e.accent,handleSize:8,railBg:t==="dark"?"rgba(255, 255, 255, 0.12)":"rgba(15, 23, 42, 0.12)",railHoverBg:t==="dark"?"rgba(255, 255, 255, 0.18)":"rgba(15, 23, 42, 0.18)",trackBg:e.accent,trackHoverBg:e.accentHover},ColorPicker:{colorPrimary:e.accent},Dropdown:{colorBgElevated:e.surfaceElevated,colorText:e.textPrimary,colorTextDescription:e.textSecondary,controlItemBgHover:e.hoverSubtle,controlItemBgActive:e.accentSoft,borderRadiusLG:16},Modal:{contentBg:e.surfaceElevated,headerBg:e.surfaceElevated,titleColor:e.textPrimary,titleFontSize:14,borderRadiusLG:18},Tooltip:{colorBgSpotlight:t==="dark"?"#050608":"#0F172A",colorTextLightSolid:"#FFFFFF"},Popover:{colorBgElevated:e.surfaceElevated,colorText:e.textPrimary}}}}const al={position:"fixed",inset:0,pointerEvents:"none",zIndex:10020},gn={position:"absolute",zIndex:10008,top:ii,right:lt,width:Yt,maxWidth:"calc(100vw - 32px)",display:"flex",flexDirection:"column",borderRadius:ri,background:h.surface,border:`1px solid ${h.border}`,boxShadow:h.shadow,pointerEvents:"auto",overflow:"hidden"},mi={position:"relative",flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",padding:"2px 14px 10px",display:"flex",flexDirection:"column",gap:2,scrollbarWidth:"none",msOverflowStyle:"none"},hi=`
@keyframes we-runtime-genie-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes we-runtime-genie-task-scan {
0% {
top: calc(-1 * var(--we-runtime-genie-task-scan-size, 88px));
opacity: 0;
}
12% {
opacity: 1;
}
100% {
top: 100%;
opacity: 0;
}
}
.we-runtime-prop-panel__body {
display: flex;
flex-direction: column;
gap: 4px;
color: ${h.textPrimary};
}
.we-runtime-prop-panel__collapse.ant-collapse {
background: transparent;
}
.we-runtime-prop-panel__collapse.ant-collapse > .ant-collapse-item {
border-bottom: 1px solid ${h.divider};
}
.we-runtime-prop-panel__collapse.ant-collapse > .ant-collapse-item:last-child {
border-bottom: 0;
}
.we-runtime-prop-panel__collapse.ant-collapse
> .ant-collapse-item
> .ant-collapse-header
{
padding: 10px 0 8px;
align-items: center;
}
.we-runtime-prop-panel__collapse.ant-collapse
> .ant-collapse-item
> .ant-collapse-header
.ant-collapse-expand-icon {
color: ${h.textMuted};
}
.we-runtime-prop-panel__collapse.ant-collapse
> .ant-collapse-item
> .ant-collapse-header
.ant-collapse-header-text {
font-size: 12px;
font-weight: 600;
color: ${h.textPrimary};
}
.we-runtime-prop-panel__collapse.ant-collapse > .ant-collapse-item > .ant-collapse-content {
background: transparent;
border-top: 0;
}
.we-runtime-prop-panel__body .ant-input,
.we-runtime-prop-panel__body .ant-input-affix-wrapper,
.we-runtime-prop-panel__body .ant-input-number,
.we-runtime-prop-panel__body .ant-select-selector {
background: ${h.surfaceMuted};
border-color: ${h.border};
box-shadow: none;
}
.we-runtime-prop-panel__body .ant-input:hover,
.we-runtime-prop-panel__body .ant-input-number:hover,
.we-runtime-prop-panel__body .ant-select:hover .ant-select-selector {
border-color: ${h.borderStrong};
background: ${h.surfaceInteractive};
}
.we-runtime-prop-panel__body .ant-input:focus,
.we-runtime-prop-panel__body .ant-input-focused,
.we-runtime-prop-panel__body .ant-input-number-focused,
.we-runtime-prop-panel__body .ant-select-focused .ant-select-selector {
background: ${h.surfaceInteractive};
}
.we-runtime-prop-panel__body .ant-segmented {
background: ${h.surfaceMuted};
padding: 2px;
border-radius: 10px;
}
.we-runtime-prop-panel__body .ant-segmented-item {
min-height: 28px;
display: flex;
align-items: stretch;
justify-content: center;
}
.we-runtime-prop-panel__body .ant-segmented-item-selected {
box-shadow: inset 0 0 0 1px ${h.borderStrong};
border-radius: 8px;
}
.we-runtime-prop-panel__body .ant-segmented-item-label {
width: 100%;
min-height: 28px;
display: inline-flex;
align-items: center;
justify-content: center;
line-height: 1.2;
text-align: center;
}
.we-runtime-prop-panel__body .ant-slider {
margin-block: 4px;
}
.we-runtime-prop-panel__body .ant-btn.ant-btn-text {
padding-inline: 6px;
color: ${h.textSecondary};
}
.we-runtime-prop-panel__body .ant-btn.ant-btn-text:hover {
color: ${h.textPrimary};
background: ${h.hoverGhost};
}
.we-runtime-prop-panel__body .ant-empty-description {
color: ${h.textSecondary};
}
.we-runtime-prop-panel__body .ant-color-picker-trigger {
align-items: center;
}
.we-runtime-prop-panel__body .we-runtime-prop-panel__unit-input {
width: 100%;
}
.we-runtime-prop-panel__body .we-runtime-prop-panel__unit-input-amount {
text-align: left;
font-variant-numeric: tabular-nums;
}
.we-runtime-prop-panel__body .we-runtime-prop-panel__unit-input .ant-select.ant-select-sm,
.we-runtime-prop-panel__body .we-runtime-prop-panel__unit-input .ant-input.ant-input-sm {
min-width: 0;
}
.we-runtime-prop-panel__unit-select-popup {
min-width: 76px !important;
}
.we-runtime-prop-panel__unit-select-popup .ant-select-item-option-content,
.we-runtime-prop-panel__unit-select-popup .ant-select-item {
white-space: nowrap;
}
.we-runtime-prop-panel__body .ant-input-number-input,
.we-runtime-prop-panel__body .ant-select-selection-item,
.we-runtime-prop-panel__body .ant-select-selection-placeholder,
.we-runtime-prop-panel__body .ant-input,
.we-runtime-prop-panel__body textarea {
color: ${h.textPrimary};
}
.we-runtime-prop-panel__body .ant-select,
.we-runtime-prop-panel__body .ant-input-number,
.we-runtime-prop-panel__body .ant-input,
.we-runtime-prop-panel__body .ant-input-affix-wrapper {
width: 100%;
min-width: 0;
}
.we-runtime-prop-panel__body .ant-select .ant-select-arrow {
color: ${h.textMuted};
}
.we-runtime-prop-panel__body .ant-switch {
background: ${h.borderStrong};
flex: 0 0 auto;
}
.we-runtime-prop-panel__body .ant-switch.ant-switch-checked {
background: ${h.accent};
}
.we-runtime-prop-panel__drag-handle {
cursor: grab;
}
.we-runtime-prop-panel__drag-handle[data-dragging="true"] {
cursor: grabbing !important;
}
.we-runtime-toolbar__spinner {
position: absolute;
inset: -150%;
animation: we-runtime-genie-spin linear infinite;
}
.we-runtime-genie-task__scanner {
position: absolute;
left: 0;
right: 0;
height: var(--we-runtime-genie-task-scan-size, 88px);
top: calc(-1 * var(--we-runtime-genie-task-scan-size, 88px));
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(
180deg,
transparent 0%,
color-mix(in srgb, var(--we-runtime-genie-task-accent) 14%, transparent) 38%,
color-mix(in srgb, var(--we-runtime-genie-task-accent) 20%, transparent) 50%,
color-mix(in srgb, var(--we-runtime-genie-task-accent) 14%, transparent) 62%,
transparent 100%
);
animation: we-runtime-genie-task-scan 2.8s linear infinite;
}
.we-runtime-genie-task__scanner::after {
content: "";
width: 100%;
height: 1px;
background: color-mix(in srgb, var(--we-runtime-genie-task-accent) 72%, white);
box-shadow: 0 0 14px color-mix(in srgb, var(--we-runtime-genie-task-accent) 64%, transparent);
}
`,ll=`
[${te}="true"] {
position: fixed;
inset: 0;
pointer-events: none;
z-index: ${En};
}
[${te}="true"] > * {
pointer-events: auto;
}
[${te}="true"] .ant-dropdown,
[${te}="true"] .ant-dropdown-menu,
[${te}="true"] .ant-dropdown-menu-submenu,
[${te}="true"] .ant-dropdown-menu-item,
[${te}="true"] .ant-dropdown-menu-submenu-title,
[${te}="true"] .ant-dropdown-menu-title-content,
[${te}="true"] .ant-dropdown-menu-item-icon,
[${te}="true"] .ant-dropdown-menu-submenu-arrow,
[${te}="true"] .ant-dropdown-menu-item a {
color: ${h.textPrimary} !important;
}
[${te}="true"] .ant-dropdown-menu,
[${te}="true"] .ant-dropdown .ant-dropdown-menu {
background: ${h.surfaceElevated} !important;
border: 1px solid ${h.border} !important;
box-shadow: ${h.shadow} !important;
}
[${te}="true"] .ant-dropdown-menu-item-disabled,
[${te}="true"] .ant-dropdown-menu-item-disabled .ant-dropdown-menu-title-content {
color: ${h.textMuted} !important;
}
`,lo={position:"fixed",zIndex:En+10,width:wn,maxWidth:"calc(100vw - 24px)",padding:10,borderRadius:14,background:h.surfaceOverlay,border:`1px solid ${h.border}`,color:h.textPrimary,boxShadow:h.shadow,pointerEvents:"auto",isolation:"isolate",display:"flex",flexDirection:"column",gap:8},bi="/api/export/image-proxy",xi=80;function so(t){return Number.isFinite(t)?Math.max(1,Math.round(t)):1}function yi(t){return String(t??"").trim().replace(/[^a-zA-Z0-9._-]+/g,"-")||"element"}function wi(){return new Promise(t=>{requestAnimationFrame(()=>t())})}async function vi(t=2){const e=Math.max(1,Math.floor(t));for(let r=0;r<e;r+=1)await wi()}function vn(t){var e;if(typeof window>"u"||!((e=window.location)!=null&&e.origin))return null;try{const r=new URL(t,document.baseURI).href,o=new URL(r);return!/^https?:$/i.test(o.protocol)||o.origin===window.location.origin?null:`${window.location.origin}${bi}?url=${encodeURIComponent(r)}`}catch{return null}}function qo(t){const e=[];if(!t||t==="none")return e;const r=/url\((['"]?)(.*?)\1\)/g;let o=null;for(;(o=r.exec(t))!==null;){const i=String(o[2]||"").trim();i&&e.push(i)}return e}function Si(t){try{return new URL(t,document.baseURI).href}catch{return null}}function Ci(t){const e=String(t??"").trim().toLowerCase();if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)"||e==="rgba(0,0,0,0)"||e==="hsla(0, 0%, 0%, 0)"||e==="hsla(0,0%,0%,0)")return!0;if(e.startsWith("#")){const l=e.slice(1);return l.length===4?l[3]==="0":l.length===8?l.slice(6)==="00":!1}const r=e.match(/^[a-z]+\((.+)\)$/);if(!r)return!1;const o=r[1].split(",").map(l=>l.trim()).filter(Boolean);if(o.length<4)return!1;const i=Number.parseFloat(o[3].replace("%",""));return Number.isFinite(i)?(o[3].includes("%"),i<=0):!1}function Ti(t){let e=t;for(;e;){const r=window.getComputedStyle(e);if(!Ci(r.backgroundColor))return r.backgroundColor;e=e.parentElement}}function ki(t){const e=t.getBoundingClientRect();let r=e.width,o=e.height;return t instanceof HTMLElement&&(r=Math.max(r,t.scrollWidth,t.clientWidth,t.offsetWidth),o=Math.max(o,t.scrollHeight,t.clientHeight,t.offsetHeight)),{width:so(r),height:so(o)}}function ji(t){const e=[];return[t,...Array.from(t.querySelectorAll("*"))].forEach(o=>{if(o instanceof HTMLImageElement){const m=o.getAttribute("src"),u=o.currentSrc||m,b=u?vn(u):null;if(!u||!b)return;const S=o.getAttribute("srcset"),T=o.getAttribute("sizes");o.setAttribute("src",b),o.removeAttribute("srcset"),o.removeAttribute("sizes"),e.push(()=>{m!==null?o.setAttribute("src",m):o.removeAttribute("src"),S!==null?o.setAttribute("srcset",S):o.removeAttribute("srcset"),T!==null?o.setAttribute("sizes",T):o.removeAttribute("sizes")});return}if(!(o instanceof HTMLElement))return;const i=o.style.backgroundImage,l=window.getComputedStyle(o).backgroundImage,a=i||l,g=qo(a);if(g.length===0)return;let f=a,c=!1;if(g.forEach(m=>{const u=vn(m);if(!u)return;const b=`url("${u}")`;f=f.replace(`url(${m})`,b).replace(`url('${m}')`,b).replace(`url("${m}")`,b),c=!0}),!c||f===a)return;const d=o.style.backgroundImage;o.style.setProperty("background-image",f,"important"),e.push(()=>{d?o.style.backgroundImage=d:o.style.removeProperty("background-image")})}),()=>{for(let o=e.length-1;o>=0;o-=1)e[o]()}}function co(t){return typeof t.decode=="function"?t.decode().catch(()=>{}):Promise.resolve()}async function Ei(t){const e=[t,...Array.from(t.querySelectorAll("img"))].filter(r=>r instanceof HTMLImageElement);await Promise.all(e.map(async r=>{if(r.complete){r.naturalWidth>0&&await co(r);return}await new Promise(o=>{const i=()=>{r.removeEventListener("load",l),r.removeEventListener("error",l)},l=()=>{i(),o()};r.addEventListener("load",l,{once:!0}),r.addEventListener("error",l,{once:!0})}),await co(r)}))}async function Ri(t){await new Promise(e=>{const r=new Image;r.decoding="async",r.loading="eager";const o=()=>{r.onload=null,r.onerror=null},i=()=>{o(),e()};r.onload=i,r.onerror=i,r.src=t,r.complete&&i()})}async function Pi(t){const e=new Set;[t,...Array.from(t.querySelectorAll("*"))].forEach(o=>{if(!(o instanceof HTMLElement))return;const i=window.getComputedStyle(o).backgroundImage;qo(i).forEach(l=>{const a=vn(l)??Si(l);a&&e.add(a)})}),await Promise.all(Array.from(e).map(o=>Ri(o)))}async function Ii(){if(!(typeof document>"u"||!("fonts"in document)))try{await document.fonts.ready}catch{}}async function _i(t){await Promise.all([Ii(),Ei(t),Pi(t)]),await vi(2),await new Promise(e=>window.setTimeout(e,xi))}async function Mi(t,e){if(!(t instanceof HTMLElement||t instanceof SVGElement))throw new Error("当前元素不支持截图。");const r=await qr(()=>import("./vendor-export.js?v=1775123024591").then(d=>d.i),__vite__mapDeps([0,1])),{width:o,height:i}=ki(t),l=Ti(t),a=Math.max(1,Math.min(2,window.devicePixelRatio||2)),g=ji(t),c={boxSizing:window.getComputedStyle(t).boxSizing||"border-box"};try{await _i(t);const d=await r.toPng(t,{width:o,height:i,canvasWidth:o,canvasHeight:i,pixelRatio:a,skipAutoScale:!0,backgroundColor:l,skipFonts:!1,cacheBust:!1,includeQueryParams:!0,style:c});return{name:`${yi(e)}.png`,data:d,width:o,height:i}}finally{g()}}const uo=En+5,Bi=.85,fn=120,Ai=16,Rn=12,Li="rgba(7, 10, 18, 0.18)",Di="rgba(18, 18, 18, 0.92)",zi="rgba(255, 255, 255, 0.10)";function Oi(t,e,r){try{const o=t.getBoundingClientRect();if(!o.width||!o.height)return null;const i=t.cloneNode(!0),l=window.getComputedStyle(t),a=["font-family","font-size","font-weight","line-height","letter-spacing","color","background","background-color","background-image","border","border-radius","box-shadow","padding","margin","text-align","display","flex-direction","align-items","justify-content","gap","overflow","white-space","text-overflow","text-decoration","opacity"];for(const u of a){const b=l.getPropertyValue(u);b&&i.style.setProperty(u,b)}i.style.pointerEvents="none",i.style.userSelect="none",i.style.margin="0";const g=Math.min(1,e/o.width,r/o.height),f=o.width*g,c=o.height*g,d=document.createElement("div");d.style.width=`${f}px`,d.style.height=`${c}px`,d.style.overflow="hidden",d.style.borderRadius=`${Rn}px`,d.style.position="relative";const m=document.createElement("div");return m.style.width=`${o.width}px`,m.style.height=`${o.height}px`,m.style.transform=`scale(${g})`,m.style.transformOrigin="top left",m.style.pointerEvents="none",m.appendChild(i),d.appendChild(m),{node:d,cleanup:()=>{d.remove()}}}catch{return null}}async function Hi(t,e,r){try{const o=t.getBoundingClientRect();if(!o.width||!o.height)return null;const i=await Mi(t,"selected-element-preview"),l=Math.min(1,e/i.width,r/i.height),a=i.width*l,g=i.height*l,f=document.createElement("div");f.style.width=`${a}px`,f.style.height=`${g}px`,f.style.overflow="hidden",f.style.borderRadius=`${Rn}px`,f.style.position="relative";const c=document.createElement("img");return c.src=i.data,c.alt="selected element preview",c.width=Math.max(1,Math.round(a)),c.height=Math.max(1,Math.round(g)),c.style.width=`${a}px`,c.style.height=`${g}px`,c.style.display="block",c.style.objectFit="contain",c.style.pointerEvents="none",c.style.userSelect="none",f.appendChild(c),{node:f,cleanup:()=>{c.src="",f.remove()}}}catch{return null}}function Wi(t){const{currentTarget:e,promptVisible:r,promptCardTop:o,onDismiss:i}=t,l=s.useRef(null),[a,g]=s.useState(!1),f=s.useRef(0),c=ue()&&r&&!!e;return s.useEffect(()=>{c&&(f.current=Date.now())},[c]),s.useEffect(()=>{if(!c){g(!1);return}const d=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(d)},[c]),s.useEffect(()=>{const d=l.current;if(!d||!e||!c){d&&(d.innerHTML="");return}const m=window.innerWidth*Bi;let u=!1,b=null;return d.innerHTML="",(async()=>{const S=await Hi(e,m,fn)??Oi(e,m,fn);if(!S){u||(d.innerHTML="");return}if(u){S.cleanup();return}b=S.cleanup,d.innerHTML="",d.appendChild(S.node)})(),()=>{u=!0,b==null||b(),d&&(d.innerHTML="")}},[e,c]),c?n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-mobile-selection-overlay":"true",[te]:"true",style:{position:"fixed",inset:0,zIndex:uo,background:Li,opacity:a?1:0,transition:"opacity 200ms ease-out",pointerEvents:"auto",touchAction:"none",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",WebkitTapHighlightColor:"transparent"},onPointerDown:d=>{d.preventDefault(),d.stopPropagation(),!(Date.now()-f.current<500)&&(i==null||i())},onClick:d=>{d.preventDefault(),d.stopPropagation()}}),n.jsxs("div",{"data-mobile-selection-thumbnail":"true",style:{position:"fixed",zIndex:uo+1,left:"50%",top:Math.max(8,o-Ai),transform:`translateX(-50%) translateY(calc(-100%)) ${a?"translateY(0px)":"translateY(8px)"}`,maxWidth:"calc(100vw - 32px)",maxHeight:fn,padding:8,background:Di,border:`1px solid ${zi}`,borderRadius:Rn+4,boxShadow:"0 8px 32px rgba(0, 0, 0, 0.36)",pointerEvents:"none",opacity:a?1:0,transition:"opacity 250ms ease-out, transform 250ms ease-out",display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("div",{style:{position:"absolute",top:-24,left:"50%",transform:"translateX(-50%)",fontSize:11,fontWeight:600,color:"rgba(255, 255, 255, 0.72)",whiteSpace:"nowrap",pointerEvents:"none",opacity:a?1:0,transition:"opacity 300ms ease-out 100ms"},children:"当前选中元素"}),n.jsx("div",{ref:l})]})]}):null}function Gi(){return typeof window<"u"&&window.visualViewport&&Number.isFinite(window.visualViewport.height)?window.visualViewport.height:typeof window<"u"?window.innerHeight:0}function Fi(t){const{anchorRect:e,cardWidth:r,cardHeight:o,viewportWidth:i,viewportHeight:l,propertyPanelEnabled:a,safePaddingPx:g=12,propertyPanelWidth:f=268,propertyPanelRight:c=16,anchorGapPx:d=12}=t;if(ue()){const E=Gi(),B=8,L=B,_=Math.max(B,E-o-B);return{left:Math.round(L),top:Math.round(_)}}const m=a?i-(f+c+g):i-g,u=Math.min(i-g-r,m-r),b=e.left+e.width/2,S=Math.min(u,Math.max(g,b-r/2)),T=e.top+e.height+d,k=e.top-d-o,I=l-T-g<o&&k>=g?k:T,D=Math.min(l-g-o,Math.max(g,I));return{left:Math.round(S),top:Math.round(D)}}function Ni(t){return`导出到 ${t}`}function $i(t){var l,a;const{tool:e}=t;if(!e)return{visible:!1,disabled:!0,title:"",label:""};const r=Ni(e),o=((l=t.canExportSelectionToDesignTool)==null?void 0:l.call(t,e,t.currentTarget))??!0;if(!t.onExportSelectionToDesignTool||o===!1)return{visible:!1,disabled:!0,title:r,label:r};const i=(a=t.getExportSelectionToDesignToolBlockReason)==null?void 0:a.call(t,e,t.currentTarget);return{visible:t.uiMode==="bubble-card"&&!t.toolMinimized,disabled:!t.currentTarget||!!i,title:i??r,label:r}}function Vi(t){const{tool:e,currentTarget:r,onExportSelectionToDesignTool:o}=t;return!e||!r||!r.isConnected||!o?!1:(o(e,r),!0)}function Sn(t){return t?"Genie 正在修改":"Genie 正在启动"}function Yi(t){var e;return t.uiMode==="bubble-card"&&!t.toolMinimized&&!!t.currentTarget&&!!t.onSendToGenie&&!!(((e=t.getGenieBridgeAvailable)==null?void 0:e.call(t))??!1)}function Ui(t){const{currentTarget:e,onSendToGenie:r}=t;return!e||!e.isConnected||!r?!1:(r(e),!0)}function Xi(t){var k,M;const e=!!(((k=t.getGenieBridgeConnected)==null?void 0:k.call(t))??!1),r=!!t.pageTaskRunning,o=!!t.pageTaskSessionReady,i=!!t.currentTaskRunning,l=!!t.currentTaskSessionReady,a=!!t.hasReusableConversation,g=a||r&&o,f=r&&!g,c=t.visualState==="awake"&&(e||r)?"awake":"sleeping",d=t.waking?"waking":r?"working":c,m=(M=t.getSendPromptToGenieBlockReason)==null?void 0:M.call(t),u=!t.toolMinimized&&(d==="awake"||d==="working"),b=m??(e?g?"继续追加到当前 Genie 对话":f?Sn(!1):"发送给 Genie":"Genie 连接未建立,请稍后重试。"),S=i?t.canInterrupt?"停止 Genie 修改":Sn(l):"停止 Genie 修改";return{robotState:d,robotDisabled:d==="working"||d==="waking",robotLoading:d==="waking",robotTitle:d==="working"?"正在为你修改":d==="waking"?"正在唤醒 Genie":d==="awake"?"Genie 已苏醒":"唤醒 Genie",sendVisible:u,sendDisabled:!t.onSendPromptToGenie||!e||f||!!m,sendLoading:!!t.sending,sendTitle:b,sendRequiresConfirm:!a&&!r,interruptVisible:u,interruptDisabled:!i||!t.canInterrupt||!!t.interrupting,interruptLoading:!!t.interrupting,interruptTitle:S}}function Ki(t){var d,m;const e=!!(((d=t.getGenieBridgeConnected)==null?void 0:d.call(t))??!1),r=!!t.pageTaskRunning,o=!!t.pageTaskSessionReady;t.currentTaskRunning;const l=!!t.hasReusableConversation||r&&o,a=r&&!l,g=t.visualState==="awake"&&(e||r)?"awake":"sleeping",f=(m=t.getSendCurrentElementPromptToGenieBlockReason)==null?void 0:m.call(t),c=f??(e?l?"继续追加到当前 Genie 对话":a?Sn(!1):"发送给 Genie":"Genie 连接未建立,请稍后重试。");return{visible:g==="awake",disabled:!t.onSendCurrentElementPromptToGenie||!e||a||!!f,loading:!!t.sending,title:c,requiresConfirm:!1}}async function qi(t){const{currentTarget:e,onConfirmText:r,onConfirmNote:o,onDismissSelection:i,onSendCurrentElementPromptToGenie:l}=t;return!e||!l?!1:(await r(),await o(),i==null||i(),await l(e),!0)}const Zi={neutral:{color:h.textPrimary},accent:{color:h.accent,background:"rgba(0, 143, 93, 0.14)"},danger:{color:h.textDanger,background:"rgba(255, 120, 117, 0.12)"},dark:{color:h.textPrimary}};function Zo(t){const{children:e,size:r=Fo,strokeWidth:o=ci}=t;return n.jsx("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{display:"block"},children:n.jsx("g",{stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",children:e})})}function Ut(){return n.jsx(Zo,{children:n.jsx("path",{d:"M8 2.5l1.4 4.1L13.5 8l-4.1 1.4L8 13.5 6.6 9.4 2.5 8l4.1-1.4L8 2.5z"})})}function Cn(){return n.jsxs(Zo,{children:[n.jsx("path",{d:"M4.5 4.5l7 7"}),n.jsx("path",{d:"M11.5 4.5l-7 7"})]})}function Qo(t){const{title:e,children:r,disabled:o}=t;return n.jsx(Mo,{title:e,children:n.jsx("span",{style:{display:"inline-flex"},children:s.cloneElement(r,{disabled:o})})})}function Ie(t){const{title:e,icon:r,onClick:o,disabled:i,loading:l,tone:a="neutral",style:g}=t,[f,c]=s.useState(!1),d=Zi[a],u=ue()?Math.max(ao,36):ao;return n.jsx(Qo,{title:e,disabled:i,children:n.jsx(re,{size:"small",type:"text","aria-label":e,icon:l?n.jsx(jn,{spin:!0}):r,disabled:i,onClick:o,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),danger:a==="danger",style:{width:u,minWidth:u,height:u,padding:0,fontSize:Fo,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",boxShadow:"none",touchAction:"manipulation",color:i?h.textMuted:d.color??h.textPrimary,background:i?"transparent":f?d.background??h.hoverSubtle:"transparent",transition:"background-color 220ms ease, color 220ms ease, transform 220ms ease",...g}})})}function Pe(t){const{title:e,icon:r,awake:o,disabled:i=!1,loading:l=!1,onClick:a,ariaLabel:g}=t,[f,c]=s.useState(!1),m=ue()?36:32,u=i?o?h.textMuted:h.textSleepingStrong:o?h.textSecondary:h.textSleepingStrong,b=f&&!i?o?h.hoverSubtle:h.hoverGhost:"transparent",S=h.textPrimary;return n.jsx(Qo,{title:e,disabled:i,children:n.jsx("button",{type:"button","aria-label":g??e,disabled:i,onClick:a,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{width:m,minWidth:m,height:m,padding:0,border:"none",borderRadius:999,background:b,color:f&&!i?S:u,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:i?"not-allowed":"pointer",touchAction:"manipulation",transition:"background-color 220ms ease, color 220ms ease, transform 220ms ease",transform:f&&!i?"translateY(-0.5px)":"translateY(0)"},children:n.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},children:l?n.jsx(jn,{spin:!0}):r})})})}function Qi(t){const{awake:e,children:r,dragHandleRef:o,fullWidth:i=!1,style:l}=t,a=h.toolbarShellBorder,g=h.toolbarShellInset,f=e?h.toolbarGlow:h.shadowCompact;return n.jsxs("div",{ref:o,className:"we-runtime-prop-panel__drag-handle",style:{position:"relative",display:"inline-flex",alignItems:"center",height:$t,boxSizing:"border-box",borderRadius:999,padding:1,overflow:"visible",boxShadow:f,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",transition:"box-shadow 260ms ease, transform 220ms ease",...l},children:[n.jsx("div",{style:{position:"absolute",inset:0,borderRadius:999,background:a}}),n.jsx(Ke,{children:e?n.jsxs(ee.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.8},style:{position:"absolute",inset:0,zIndex:0,overflow:"hidden",borderRadius:999},children:[n.jsx("div",{className:"we-runtime-toolbar__spinner",style:{background:"conic-gradient(from 0deg, transparent 0deg 320deg, rgba(0, 143, 93, 0.4) 360deg)",animationDuration:"6s"}}),n.jsx("div",{className:"we-runtime-toolbar__spinner",style:{background:"conic-gradient(from 0deg, transparent 0deg 320deg, rgba(0, 143, 93, 0.18) 360deg)",animationDuration:"8s",animationDirection:"reverse"}})]},"toolbar-ring"):null}),n.jsx("div",{style:{position:"relative",zIndex:1,display:"flex",alignItems:"center",gap:4,width:i?"100%":void 0,height:"100%",minHeight:"100%",boxSizing:"border-box",borderRadius:999,padding:"4px 6px",background:h.surface,boxShadow:g,minWidth:i?0:"unset"},children:r})]})}function zt(t){return(t==null?void 0:t.status)==="pending"||(t==null?void 0:t.status)==="created"}function Ji(t){return(t==null?void 0:t.status)==="completed"||(t==null?void 0:t.status)==="error"}function Jo(t){var c,d,m;const e=((c=t.getElementGenieTaskState)==null?void 0:c.call(t,t.currentTarget))??null,r=((d=t.getVisibleElementGenieTaskStates)==null?void 0:d.call(t))??[],o=r.some(u=>zt(u)),i=!!(zt(e)&&((e==null?void 0:e.status)==="created"||e!=null&&e.sessionId)),l=r.some(u=>zt(u)&&(u.status==="created"||!!u.sessionId)),a=!!(((m=t.getHasReusableGenieConversation)==null?void 0:m.call(t))??!1),g=t.getGenieBridgeConnected?!!t.getGenieBridgeConnected():!0,f=o||t.visualState==="awake"&&(g||a)?"awake":"sleeping";return{currentTask:e,currentTaskRunning:zt(e),currentTaskSessionReady:i,currentTaskTerminal:Ji(e),pageTaskRunning:o,pageTaskSessionReady:l,hasReusableConversation:a,effectiveVisualState:f}}const vt=28,ea=220,ta=160,mn=12;function er(t){const{images:e,onRemoveImage:r}=t,[o,i]=s.useState(null);return e.length===0?null:n.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:e.map(l=>{const a=o===l.id;return n.jsxs("div",{onMouseEnter:()=>i(l.id),onMouseLeave:()=>i(g=>g===l.id?null:g),style:{position:"relative",width:vt,height:vt},children:[a?n.jsx("div",{style:{position:"absolute",left:"50%",bottom:vt+10,transform:"translateX(-50%)",width:ea,height:ta,padding:8,borderRadius:mn,background:h.surface,border:`1px solid ${h.borderStrong}`,boxShadow:h.shadow,display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:n.jsx("img",{src:l.data,alt:l.name,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:mn,background:h.surfaceMuted}})}):null,n.jsx("button",{type:"button",onClick:()=>{a&&r(l.id)},style:{width:vt,height:vt,borderRadius:mn,overflow:"hidden",border:`1px solid ${a?h.borderStrong:h.border}`,background:a?h.surfaceElevated:h.surfaceMuted,padding:0,cursor:a?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:a?h.shadow:"none"},children:a?n.jsx(Lr,{style:{fontSize:12,color:h.textPrimary}}):n.jsx("img",{src:l.data,alt:l.name,style:{width:"100%",height:"100%",objectFit:"cover"}})})]},l.id)})})}function na(t){return t.replace(/^样式\s+/u,"").trim()}function oa(t,e=2){const r=t.map(a=>na(String(a??""))).filter(Boolean);if(r.length<=e)return r;const o=r.slice(0,e),i=r.length-e,l=r[r.length-1]??"";return l.startsWith("还有 ")?[...o.slice(0,Math.max(0,e-1)),l]:[...o,`还有 ${i} 项样式修改...`]}const sl=s.forwardRef(function(e,r){var Ve;const{options:o,currentTarget:i,anchorRect:l,uiMode:a,interactionProfile:g,designAdjustmentTool:f,toolMinimized:c,propertyPanelEnabled:d,styleDesignEnabled:m,genieVisualState:u,onSendCurrentElementPromptToGenie:b,getGenieBridgeConnected:S,getHasReusableGenieConversation:T,getSendCurrentElementPromptToGenieBlockReason:k,canExportSelectionToDesignTool:M,onExportSelectionToDesignTool:I,getExportSelectionToDesignToolBlockReason:D,onHoverSelectionSuppressedChange:E,onSelectionInteractionLockChange:B,onUiModeChange:L,onTargetChange:_,onAnchorRectChange:F,onPromptCardVisibleChange:j,canEditText:C,savedText:z,draftText:J,textDirty:je,onTextDraftChange:ct,onCancelText:qe,onConfirmText:pe,images:ve,onRemoveImage:Ee,onNotePasteCapture:ze,canEditNote:Oe,draftNote:Me,noteDirty:y,onDraftChange:w,onClearCurrentElementEdits:$,onCancelNote:ge,onConfirmNote:le,onDismissSelection:Q}=e,be=s.useRef(null),se=s.useRef(null),Se=s.useRef(null),[dt,ut]=s.useState(null),[ce,pt]=s.useState(null),[Be,gt]=s.useState(!1),[,qt]=s.useState(0);s.useImperativeHandle(r,()=>({setTarget(x){_(x)},setAnchorRect(x){F(x)},refresh(){qt(x=>x+1)}}),[F,_]);const jt=s.useCallback(()=>{var q,oe;const x=(q=se.current)==null?void 0:q.querySelector("input");if(!(x instanceof HTMLInputElement)||x.disabled)return!1;const A=document.activeElement;A instanceof HTMLElement&&A!==x&&!((oe=se.current)!=null&&oe.contains(A))&&A.blur(),x.focus({preventScroll:!0});try{x.setSelectionRange(x.value.length,x.value.length)}catch{}return!0},[]),Ae=s.useCallback(()=>{var oe,de;const x=(oe=Se.current)==null?void 0:oe.querySelector("textarea");if(!(x instanceof HTMLTextAreaElement)||x.disabled)return!1;const A=document.activeElement;A instanceof HTMLElement&&A!==x&&!((de=Se.current)!=null&&de.contains(A))&&A.blur(),x.focus({preventScroll:!0});const q=x.value.length;try{x.setSelectionRange(q,q)}catch{}return!0},[]),He=s.useCallback((x=6)=>{let A=0,q=x;const oe=()=>{var Re,Ye;const de=(Re=Se.current)==null?void 0:Re.querySelector("textarea");if(de instanceof HTMLTextAreaElement&&!de.disabled){if(document.activeElement===de)return;Ae()}else{const bt=(Ye=se.current)==null?void 0:Ye.querySelector("input");if(!(C&&bt instanceof HTMLInputElement&&!bt.disabled)||document.activeElement===bt)return;jt()}q-=1,q>0&&(A=window.requestAnimationFrame(oe))};return A=window.requestAnimationFrame(oe),()=>{A&&window.cancelAnimationFrame(A)}},[C,jt,Ae]),ie=!!(i&&l&&!c&&a==="bubble-card");s.useLayoutEffect(()=>{if(!ie){pt(null);return}const x=be.current;if(!x)return;const A=()=>{const oe=x.getBoundingClientRect();if(!Number.isFinite(oe.width)||!Number.isFinite(oe.height))return;const de={width:Math.max(wn,Math.round(oe.width)),height:Math.max(io,Math.round(oe.height))};pt(Re=>Re&&Re.width===de.width&&Re.height===de.height?Re:de)};if(A(),typeof ResizeObserver>"u")return;const q=new ResizeObserver(()=>A());return q.observe(x),()=>q.disconnect()},[C,Me,J,ve.length,ie,d]);const[Et,ft]=s.useState(0);s.useEffect(()=>{if(!ue())return;const x=window.visualViewport;if(!x)return;const A=()=>ft(q=>q+1);return x.addEventListener("resize",A),()=>x.removeEventListener("resize",A)},[]);const ye=s.useMemo(()=>{if(!i||!l||c||a!=="bubble-card")return null;const x=ue()?Math.max(200,window.innerWidth-16):(ce==null?void 0:ce.width)??wn;return Fi({anchorRect:l,cardWidth:x,cardHeight:(ce==null?void 0:ce.height)??io,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,propertyPanelEnabled:d,safePaddingPx:oi,propertyPanelWidth:Yt,propertyPanelRight:lt,anchorGapPx:ni})},[l,i,ce,d,c,a,Et]),ae=!!(i&&ye&&ce&&!c&&a==="bubble-card");s.useEffect(()=>(j==null||j(ae),()=>j==null?void 0:j(!1)),[j,ae]),s.useEffect(()=>{if(!ae||!i||c||a!=="bubble-card")return;if(!ue())return He();const x=window.setTimeout(()=>{He(10)},260);return()=>{window.clearTimeout(x)}},[i,He,ae,c,a]),s.useEffect(()=>{if(!ae||a!=="bubble-card")return;const x=A=>{const q=be.current;!q||!(A.target instanceof Node)||q.contains(A.target)&&(A.preventDefault(),A.stopPropagation())};return window.addEventListener("wheel",x,{capture:!0,passive:!1}),()=>{window.removeEventListener("wheel",x,!0)}},[ae,a]);const We=s.useCallback(async()=>{var A;await le();const x=(A=Se.current)==null?void 0:A.querySelector("textarea");x instanceof HTMLTextAreaElement&&x.blur(),Q==null||Q()},[le,Q]),Ze=s.useCallback(()=>{var A;ge();const x=(A=Se.current)==null?void 0:A.querySelector("textarea");x instanceof HTMLTextAreaElement&&x.blur(),Q==null||Q()},[ge,Q]),mt=s.useCallback(async()=>{var A;await pe(),await le();const x=document.activeElement;x instanceof HTMLElement&&((A=be.current)!=null&&A.contains(x))&&x.blur(),Q==null||Q()},[le,pe,Q]);s.useEffect(()=>{ut(o.container.querySelector(`[${te}="true"]`))},[o.container]),s.useEffect(()=>{ae||(E(!1),B(!1))},[E,B,ae]),s.useEffect(()=>()=>{E(!1),B(!1)},[E,B]);const Zt=Yi({currentTarget:i,uiMode:a,toolMinimized:c,onSendToGenie:o.onSendToGenie,getGenieBridgeAvailable:o.getGenieBridgeAvailable}),Le=$i({tool:f,currentTarget:i,uiMode:a,toolMinimized:c,onExportSelectionToDesignTool:I,canExportSelectionToDesignTool:M,getExportSelectionToDesignToolBlockReason:D}),Rt=g==="text-annotation",{currentTask:V,currentTaskRunning:fe,currentTaskTerminal:Qt,pageTaskRunning:Qe,pageTaskSessionReady:Jt,hasReusableConversation:Ge,effectiveVisualState:Je}=Jo({currentTarget:i,visualState:u,getElementGenieTaskState:o.getElementGenieTaskState,getVisibleElementGenieTaskStates:o.getVisibleElementGenieTaskStates,getHasReusableGenieConversation:T,getGenieBridgeConnected:S});(V==null?void 0:V.sessionUrl)??(V!=null&&V.sessionId&&`${V.sessionId}`);const ht=oa(((Ve=o.getElementStyleSummaryLines)==null?void 0:Ve.call(o,i))??[]),Fe=y||je,et=(()=>{const x=k==null?void 0:k(i);if(!(x==="当前元素没有可发送给 Genie 的编辑"&&Fe))return x})(),tt=Ki({visualState:Je,sending:Be,pageTaskRunning:Qe,pageTaskSessionReady:Jt,currentTaskRunning:fe,onSendCurrentElementPromptToGenie:b,getGenieBridgeConnected:S,getSendCurrentElementPromptToGenieBlockReason:()=>et,hasReusableConversation:Ge});s.useEffect(()=>{Be&&fe&&Ge&&gt(!1)},[fe,Ge,Be]);const Ne=s.useCallback(async()=>{gt(!0);try{await qi({currentTarget:i,onConfirmText:pe,onConfirmNote:le,onDismissSelection:Q,onSendCurrentElementPromptToGenie:b})}catch{}finally{gt(!1)}},[i,le,pe,Q,b]),nt=s.useCallback(x=>{if(!x.nativeEvent.isComposing){if(x.key==="Enter"){if(ue())return;if(x.metaKey||x.ctrlKey){x.preventDefault(),x.stopPropagation(),Ne();return}x.preventDefault(),x.stopPropagation(),We();return}x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Ze())}},[Ze,Ne,We]);if(!ie||!i||!ye||c||a!=="bubble-card")return n.jsx("div",{ref:be,style:{...lo,visibility:"hidden"}});const $e=i,en=C&&z.trim().length>0,Ce=n.jsxs("div",{ref:be,"data-we-selection-lock-root":"true",style:{...lo,left:ye.left,top:ye.top,visibility:ae?"visible":"hidden",...ue()?{width:"calc(100vw - 16px)",maxWidth:"calc(100vw - 16px)",borderRadius:16}:{}},onPointerDownCapture:()=>B(!0),onFocusCapture:()=>B(!0),onPointerEnter:()=>E(!0),onPointerLeave:()=>E(!1),children:[n.jsx("style",{children:`
.we-runtime-prompt-card__textarea textarea,
.we-runtime-prompt-card__textarea textarea:disabled {
color: ${h.textPrimary} !important;
-webkit-text-fill-color: ${h.textPrimary} !important;
}
.we-runtime-prompt-card__textarea textarea::placeholder {
color: ${h.textMuted} !important;
-webkit-text-fill-color: ${h.textMuted} !important;
}
.we-runtime-prompt-card__textarea .ant-input-clear-icon {
color: ${h.textSecondary} !important;
opacity: 1 !important;
background: ${h.surfaceInteractive};
border-radius: 999px;
}
.we-runtime-prompt-card__textarea .ant-input-clear-icon:hover {
color: ${h.textPrimary} !important;
background: ${h.surfaceElevated};
}
.we-runtime-prompt-card__textarea .ant-input-clear-icon svg {
fill: currentColor;
}
`}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[Zt?n.jsx(Ie,{title:"添加到 Genie 对话",icon:n.jsx(Ut,{}),tone:"dark",disabled:!i||fe,onClick:()=>{Ui({currentTarget:$e,onSendToGenie:o.onSendToGenie})}}):null,tt.visible?n.jsx(Ie,{title:tt.title,icon:n.jsx(Nt,{}),tone:"accent",loading:tt.loading,disabled:tt.disabled,onClick:()=>{Ne()}}):null,d&&m&&!Rt?n.jsx(Ie,{title:"样式编辑",icon:n.jsx(Dr,{}),tone:"dark",onClick:()=>L("panel-note")}):null,Le.visible&&!Rt?n.jsx(Ie,{title:Le.title,icon:n.jsx(zr,{}),tone:"dark",disabled:Le.disabled,onClick:()=>{Vi({tool:f,currentTarget:$e,onExportSelectionToDesignTool:I})}}):null,n.jsx(Ie,{title:"清空编辑",icon:n.jsx(xn,{}),tone:"dark",disabled:!i||fe,onClick:()=>{$()}}),n.jsx("div",{style:{flex:1}}),n.jsx(Ie,{title:"关闭",icon:n.jsx(Cn,{}),tone:"dark",onClick:()=>{var x;if(Qt&&i){(x=o.dismissElementGenieTaskState)==null||x.call(o,i);return}mt()}})]}),n.jsxs("div",{ref:Se,onFocusCapture:x=>{x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||window.requestAnimationFrame(()=>{He(3)})},onPointerDownCapture:()=>{window.requestAnimationFrame(()=>{He(3)})},style:{display:"flex",flexDirection:"column",gap:8},children:[en?n.jsx("div",{ref:se,children:n.jsx(Z,{value:J,allowClear:!0,placeholder:Wo,size:"small",style:{borderRadius:12,minHeight:32,background:h.surfaceMuted,borderColor:h.borderStrong,boxShadow:"none",color:h.textPrimary},onChange:x=>{ct(x.target.value)},onPressEnter:x=>{if(ue()){x.preventDefault(),x.stopPropagation();return}x.preventDefault(),x.stopPropagation(),pe()},onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),qe())},onBlur:()=>{je&&pe()}})}):null,n.jsx(Z.TextArea,{className:"we-runtime-prompt-card__textarea",value:Me,disabled:!Oe,allowClear:!0,autoSize:{minRows:1,maxRows:4},placeholder:Go,styles:{textarea:{color:h.textPrimary,background:"transparent",padding:"10px 12px",fontSize:12.5,lineHeight:1.55,caretColor:h.textPrimary}},style:{borderRadius:12,background:h.surfaceMuted,borderColor:h.borderStrong,boxShadow:"none"},onChange:x=>{w(x.target.value)},onPasteCapture:ze,onKeyDown:nt,onBlur:x=>{var q;const A=x.relatedTarget;A instanceof Node&&((q=Se.current)!=null&&q.contains(A))||y&&le()}}),n.jsx(er,{images:ve,onRemoveImage:x=>{Ee(x)}}),ht.length>0?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"8px 10px",borderRadius:12,background:"rgba(255, 255, 255, 0.04)",border:`1px solid ${h.border}`},children:[n.jsx("span",{style:{fontSize:11,fontWeight:600,lineHeight:1.4,color:h.textSecondary},children:"样式编辑"}),ht.map(x=>n.jsx("span",{style:{fontSize:11,lineHeight:1.45,color:h.textMuted,wordBreak:"break-word"},children:x},x))]}):null,V?n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 4px 0",marginTop:-2},children:[V.status==="completed"?n.jsx(Bo,{style:{color:"#22c55e",fontSize:13,marginTop:3}}):V.status==="error"?n.jsx(Ao,{style:{color:"#ef4444",fontSize:13,marginTop:3}}):n.jsx("div",{style:{marginTop:2},children:n.jsx(Ut,{})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0,overflow:"hidden"},children:[n.jsx("span",{style:{fontSize:12,fontWeight:500,color:V.status==="error"?"#ef4444":h.textPrimary},children:V.status==="pending"?"Genie 准备中":V.status==="created"?"Genie 正在修改":V.status==="completed"?"Genie 修改完成":"Genie 修改失败"}),V.message?n.jsxs("span",{style:{fontSize:11,lineHeight:1.5,color:h.textMuted,wordBreak:"break-word",marginTop:1},children:[V.message,V.sessionId?` · Session ${V.sessionId}`:""]}):null]})]}):null]})]}),Pt=n.jsx(Wi,{currentTarget:i,promptVisible:ae,promptCardTop:(ye==null?void 0:ye.top)??0,onDismiss:()=>{mt()}});return dt?Ar.createPortal(n.jsxs(n.Fragment,{children:[Pt,Ce]}),dt):n.jsxs(n.Fragment,{children:[Pt,Ce]})});function Pn(t){return t==="dark"?{activeColor:"#00d68f",inactiveColor:"#71717a",activeBackground:"rgba(0, 143, 93, 0.10)",activeInsetShadow:"inset 0 0 8px rgba(0, 143, 93, 0.10)",sleepingHoverBackground:"rgba(39, 39, 42, 0.50)",sleepingHoverShadow:"inset 0 0 8px rgba(255, 255, 255, 0.03)"}:{activeColor:"#008f5d",inactiveColor:"#a1a1aa",activeBackground:"rgba(0, 143, 93, 0.05)",activeInsetShadow:"inset 0 0 8px rgba(0, 143, 93, 0.05)",sleepingHoverBackground:"#f4f4f5",sleepingHoverShadow:"inset 0 0 8px rgba(15, 23, 42, 0.03)"}}function Ct(t,e,r){return Math.min(r,Math.max(e,t))}function ra(t){const{state:e,themeMode:r,hovered:o,mousePos:i,dragVelocity:l,size:a}=t,[g,f]=s.useState(!1),c=e!=="sleeping",d=e==="working",m=e==="dragging",{activeColor:u,inactiveColor:b}=Pn(r);s.useEffect(()=>{if(!c){f(!1);return}let L=!1;const _=window.setInterval(()=>{L||Math.random()<=.3||(f(!0),window.setTimeout(()=>{L||f(!1)},150),Math.random()>.5&&window.setTimeout(()=>{L||(f(!0),window.setTimeout(()=>{L||f(!1)},150))},250))},3e3);return()=>{L=!0,window.clearInterval(_)}},[c]);const S=c?m?7:d?6:g?.5:o?7.5:6:2,T=c?m?8:g?12:9:11;let k=c&&o&&!m?i.x*2.5:0,M=c&&o&&!m?i.y*2.5:0;m&&(k=Ct(l.x/120,-6,6),M=Ct(l.y/120,-4,4));const I=T+M,D=m?Ct(-l.x/14,-60,60):0,E=c?u:b,B=Math.max(20,Math.round(a*.56));return n.jsxs(ee.svg,{width:B,height:B,viewBox:"0 0 24 24","aria-hidden":"true","data-genie-face-state":e,style:{position:"relative",zIndex:1,overflow:"visible",display:"block",pointerEvents:"none"},animate:c?{y:[0,-2.5,0,2.5,0],rotate:[0,-3,0,3,0]}:{y:0,rotate:0},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:[n.jsx(ee.rect,{initial:!1,animate:m?{x:4+k,y:I-3,width:6,height:8,rx:3,rotate:D*.2,fill:u}:d?{x:4+k,y:I-2,width:6,height:6,rx:3,rotate:0,fill:u}:{x:(c?5:4)+k,y:I,width:c?o?4.5:4:5,height:S,rx:c?2:1,rotate:0,fill:E},transition:{type:"spring",stiffness:400,damping:25},style:{transformOrigin:"center"}}),n.jsx(ee.rect,{initial:!1,animate:m?{x:14+k,y:I-3,width:6,height:8,rx:3,rotate:D*.2,fill:u}:d?{x:14+k,y:I-2,width:6,height:6,rx:3,rotate:0,fill:u}:{x:15+k,y:I,width:c?o?4.5:4:5,height:S,rx:c?2:1,rotate:0,fill:E},transition:{type:"spring",stiffness:400,damping:25},style:{transformOrigin:"center"}}),n.jsx(Ke,{children:c?n.jsxs(ee.g,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.4,delay:.1}},children:[n.jsxs(ee.g,{animate:m?{rotate:D}:d?{rotate:[-2,2,-2]}:{rotate:[-4,6,-4]},transition:m?{type:"spring",stiffness:200,damping:10}:d?{duration:.1,repeat:1/0}:{duration:3.5,repeat:1/0,ease:"easeInOut"},style:{transformOrigin:"11px -6px"},children:[n.jsx(ee.path,{initial:{d:"M 11 -6 C 15 -10 21 -8 24 -2"},animate:m?{d:"M 11 -6 Q 7 -16 4 -24"}:d?{d:"M 11 -6 Q 8 -16 5 -26"}:{d:"M 11 -6 C 11 -16 15 -24 22 -26"},exit:{d:"M 11 -6 C 15 -10 21 -8 24 -2"},transition:{duration:.3,ease:"easeInOut"},stroke:u,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),n.jsx(ee.circle,{initial:{cx:24,cy:-2},animate:m?{cx:4,cy:-24}:d?{cx:5,cy:-26}:{cx:22,cy:-26},exit:{cx:24,cy:-2},transition:{duration:.3,ease:"easeInOut"},r:"1.5",fill:u}),n.jsx(Ke,{children:d?n.jsx(ee.circle,{initial:{cx:5,cy:-26,r:1,opacity:.8},animate:{r:8,opacity:0},exit:{opacity:0},transition:{duration:.6,repeat:1/0,ease:"easeOut"},fill:"none",stroke:u,strokeWidth:"1.5"}):null})]}),n.jsxs(ee.g,{animate:m?{rotate:D}:d?{rotate:[-2,2,-2]}:{rotate:[-3,5,-3]},transition:m?{type:"spring",stiffness:200,damping:10}:d?{duration:.1,repeat:1/0,delay:.05}:{duration:3.5,repeat:1/0,ease:"easeInOut",delay:.2},style:{transformOrigin:"13px -5px"},children:[n.jsx(ee.path,{initial:{d:"M 13 -5 C 17 -8 23 -5 26 2"},animate:m?{d:"M 13 -5 Q 17 -15 20 -23"}:d?{d:"M 13 -5 Q 16 -15 19 -25"}:{d:"M 13 -5 C 13 -12 18 -18 26 -19"},exit:{d:"M 13 -5 C 17 -8 23 -5 26 2"},transition:{duration:.3,ease:"easeInOut"},stroke:u,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),n.jsx(ee.circle,{initial:{cx:26,cy:2},animate:m?{cx:20,cy:-23}:d?{cx:19,cy:-25}:{cx:26,cy:-19},exit:{cx:26,cy:2},transition:{duration:.3,ease:"easeInOut"},r:"1.5",fill:u}),n.jsx(Ke,{children:d?n.jsx(ee.circle,{initial:{cx:19,cy:-25,r:1,opacity:.8},animate:{r:8,opacity:0},exit:{opacity:0},transition:{duration:.6,repeat:1/0,ease:"easeOut",delay:.2},fill:"none",stroke:u,strokeWidth:"1.5"}):null})]})]},"hair-tennae"):null}),n.jsx(Ke,{children:c&&!g&&!d&&!m?n.jsxs(n.Fragment,{children:[n.jsx(ee.circle,{initial:{opacity:0,scale:0},animate:{opacity:.5,scale:1},exit:{opacity:0,scale:0},cx:"3",cy:"14",r:"2",fill:u}),n.jsx(ee.circle,{initial:{opacity:0,scale:0},animate:{opacity:.5,scale:1},exit:{opacity:0,scale:0},cx:"21",cy:"14",r:"2",fill:u})]}):null})]})}function ia(t){const{inactiveColor:e}=Pn(t.themeMode);return n.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"visible"},children:[0,1,2].map(r=>n.jsx(ee.div,{style:{position:"absolute",top:0,right:0,fontSize:10,fontWeight:700,color:e,lineHeight:1},initial:{opacity:0,y:0,x:0,scale:.5},animate:{opacity:[0,1,0],y:-10-r*6,x:5+r*4,scale:[.5,1,1.2]},transition:{duration:3,repeat:1/0,delay:r*1,ease:"easeOut"},children:"z"},r))})}function aa(t){const{state:e,size:r=36,disabled:o=!1,loading:i=!1,title:l=e==="awake"?"Genie 已苏醒":"唤醒 Genie",themeMode:a="light",dragVelocity:g={x:0,y:0},onClick:f}=t,[c,d]=s.useState(!1),[m,u]=s.useState({x:0,y:0}),b=a==="dark",S=e!=="sleeping",T=e==="working",k=Pn(a),M=s.useCallback(E=>{if(!S||o||e==="dragging")return;const B=E.currentTarget.getBoundingClientRect(),L=Ct((E.clientX-B.left)/B.width*2-1,-1,1),_=Ct((E.clientY-B.top)/B.height*2-1,-1,1);u({x:L,y:_})},[o,S,e]),I=S?k.activeBackground:c?k.sleepingHoverBackground:"transparent",D=S?k.activeInsetShadow:c?k.sleepingHoverShadow:"none";return n.jsxs("button",{type:"button","aria-label":l,title:l,disabled:o,"data-we-no-drag":"true","data-genie-state":e,"data-theme":a,onClick:f,onMouseEnter:()=>d(!0),onMouseLeave:()=>{d(!1),u({x:0,y:0})},onMouseMove:M,style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:r,height:r,padding:0,border:"none",borderRadius:999,background:I,boxShadow:D,color:S?k.activeColor:k.inactiveColor,cursor:o?"default":"pointer",transition:"transform 220ms ease, box-shadow 240ms ease, background-color 240ms ease",overflow:"visible",outline:"none",pointerEvents:"auto",touchAction:"manipulation",WebkitTapHighlightColor:"transparent",userSelect:"none"},children:[n.jsx(Ke,{children:S?n.jsxs(n.Fragment,{children:[n.jsx(ee.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.5},style:{position:"absolute",inset:0,borderRadius:999,background:"rgba(0, 143, 93, 0.20)",filter:"blur(12px)",pointerEvents:"none"}},"genie-face-glow"),T?n.jsx(ee.div,{"data-genie-working-ring":"true",initial:{opacity:.8,scale:1},animate:{opacity:0,scale:1.6},exit:{opacity:0},transition:{duration:1.5,repeat:1/0,ease:"easeOut"},style:{position:"absolute",inset:0,borderRadius:999,border:`1px solid ${b?"rgba(0, 214, 143, 0.40)":"rgba(0, 143, 93, 0.35)"}`,pointerEvents:"none"}},"genie-working-ring"):null]}):null}),i?n.jsx(jn,{spin:!0,style:{position:"relative",zIndex:1,fontSize:Math.max(16,Math.round(r*.42)),color:k.activeColor}}):n.jsxs(n.Fragment,{children:[n.jsx(ra,{state:e,themeMode:a,hovered:c,mousePos:m,dragVelocity:g,size:r}),n.jsx(Ke,{children:S?null:n.jsx(ia,{themeMode:a})})]})]})}const ke={capture:!0,passive:!1},po=.12,la=220,go={capture:!0},sa=["button","input","textarea","select","option","label","a[href]",'[role="button"]','[role="switch"]','[role="menuitem"]','[data-we-no-drag="true"]',".ant-btn",".ant-switch",".ant-select",".ant-input",".ant-input-affix-wrapper"].join(", ");function Ot(t){t.cancelable&&t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()}function Tn(t,e,r){if(!Number.isFinite(t))return e;const o=Math.min(e,r),i=Math.max(e,r);return Math.min(i,Math.max(o,t))}function ca(t,e,r,o){const i=Number.isFinite(r)?Math.max(0,r):0,l=Math.max(i,o.width-i-e.width),a=Math.max(i,o.height-i-e.height);return{left:Tn(t.left,i,l),top:Tn(t.top,i,a)}}function fo(t){return{left:Math.round(t.left),top:Math.round(t.top)}}function da(t){return 1-(1-Tn(t,0,1))**3}function mo(t,e){return Math.round(t.left)===Math.round(e.left)&&Math.round(t.top)===Math.round(e.top)}function ua(t,e,r){if(!r||!(t instanceof Element)||t===e)return!1;const o=t.closest(sa);return o?typeof e.contains=="function"?e.contains(o):!0:!1}function ho(t){const{handleEl:e,targetEl:r,onPositionChange:o,clampMargin:i}=t,l=Math.max(0,t.moveThresholdPx??3),a=l*l,g=Math.max(80,t.settleDurationMs??la);let f=null,c=!1,d=null,m=null,u=!1;function b(y){var w;u!==y&&(u=y,(w=t.onDragStateChange)==null||w.call(t,y))}function S(y){var w;(w=t.onDragMetricsChange)==null||w.call(t,y)}function T(y){const w=document.documentElement,$=document.body;if(y){d||(d={documentCursor:w.style.cursor,bodyCursor:$.style.cursor}),w.style.cursor="grabbing",$.style.cursor="grabbing";return}d&&(w.style.cursor=d.documentCursor,$.style.cursor=d.bodyCursor,d=null)}function k(){window.removeEventListener("pointermove",qe,ke),window.removeEventListener("pointerup",pe,ke),window.removeEventListener("pointercancel",ve,ke),window.removeEventListener("keydown",Ee,ke),window.removeEventListener("blur",ze,ke),document.removeEventListener("visibilitychange",Oe)}function M(){!f||f.rafId===null||(window.cancelAnimationFrame(f.rafId),f.rafId=null)}function I(y){try{e.releasePointerCapture(y)}catch{}}function D(){return{width:window.innerWidth,height:window.innerHeight}}function E(y){return{width:y.targetWidth,height:y.targetHeight}}function B(y,w){return ca(w,E(y),i,D())}function L(y){const w=fo(y);m&&mo(m,w)||(m=w,o(w))}function _(y=!0){f&&(M(),k(),I(f.pointerId),e.dataset.dragging="false",T(!1),b(!1),y&&S({velocityX:0,velocityY:0}),f=null)}function F(){!f||f.rafId!==null||(f.rafId=window.requestAnimationFrame(ct))}function j(y,w){const $=f;$&&($.targetPosition=B($,{left:y-$.offsetX,top:w-$.offsetY}),F())}function C(y){if(y.phase="settling",y.settleStartedAt=performance.now(),y.settleFrom={...y.currentPosition},y.settleTo=B(y,{left:y.currentPosition.left+y.velocityX*po,top:y.currentPosition.top+y.velocityY*po}),mo(y.settleFrom,y.settleTo)){L(y.settleTo),_();return}F()}function z(){const y=f;y&&(M(),L(y.startPosition),_())}function J(){const y=w=>{Ot(w)};e.addEventListener("click",y,{capture:!0,once:!0}),window.setTimeout(()=>{e.removeEventListener("click",y,{capture:!0})},300)}function je(y){const w=f;if(!(!w||w.pointerId!==y||w.activated)){w.activated=!0,w.phase="dragging",e.dataset.dragging="true",b(!0),T(!0);try{e.setPointerCapture(y)}catch{}F()}}function ct(y){const w=f;if(w){if(w.rafId=null,w.phase==="dragging"){w.currentPosition={...w.targetPosition},L(w.currentPosition);return}if(w.phase==="settling"&&w.settleStartedAt!==null&&w.settleFrom&&w.settleTo){const $=(y-w.settleStartedAt)/g,ge=da($);w.currentPosition={left:w.settleFrom.left+(w.settleTo.left-w.settleFrom.left)*ge,top:w.settleFrom.top+(w.settleTo.top-w.settleFrom.top)*ge},L(w.currentPosition),$<1?F():(L(w.settleTo),_())}}}function qe(y){const w=f;if(!w||y.pointerId!==w.pointerId)return;if(!w.activated){const be=y.clientX-w.startClientX,se=y.clientY-w.startClientY;if(be*be+se*se<a)return;je(y.pointerId)}if(!w.activated)return;Ot(y);const $=performance.now(),ge=Math.max(8,$-w.lastMoveTime),le=(y.clientX-w.lastClientX)/ge*1e3,Q=(y.clientY-w.lastClientY)/ge*1e3;w.velocityX=w.velocityX*.65+le*.35,w.velocityY=w.velocityY*.65+Q*.35,w.lastClientX=y.clientX,w.lastClientY=y.clientY,w.lastMoveTime=$,S({velocityX:w.velocityX,velocityY:w.velocityY}),j(y.clientX,y.clientY)}function pe(y){const w=f;if(!(!w||y.pointerId!==w.pointerId)){if(!w.activated){_();return}Ot(y),J(),k(),I(y.pointerId),e.dataset.dragging="false",T(!1),b(!1),C(w)}}function ve(y){const w=f;!w||y.pointerId!==w.pointerId||(w.activated?(Ot(y),z()):_())}function Ee(y){y.key!=="Escape"||!f||(f.activated?(y.preventDefault(),y.stopImmediatePropagation(),y.stopPropagation(),z()):_())}function ze(){f&&(f.activated?z():_())}function Oe(){!f||document.visibilityState!=="hidden"||(f.activated?z():_())}function Me(y){if(c||!r.isConnected||f||y.button!==0||!y.isPrimary||ua(y.target,e,!!t.ignoreInteractiveChildren))return;const w=r.getBoundingClientRect(),$=fo({left:w.left,top:w.top}),ge=performance.now();f={pointerId:y.pointerId,startPosition:$,currentPosition:$,targetPosition:$,offsetX:y.clientX-w.left,offsetY:y.clientY-w.top,targetWidth:w.width,targetHeight:w.height,startClientX:y.clientX,startClientY:y.clientY,lastClientX:y.clientX,lastClientY:y.clientY,lastMoveTime:ge,velocityX:0,velocityY:0,activated:!1,phase:a>0?"pending":"dragging",rafId:null,settleStartedAt:null,settleFrom:null,settleTo:null},S({velocityX:0,velocityY:0}),e.dataset.dragging="false",a===0&&je(y.pointerId),window.addEventListener("pointermove",qe,ke),window.addEventListener("pointerup",pe,ke),window.addEventListener("pointercancel",ve,ke),window.addEventListener("keydown",Ee,ke),window.addEventListener("blur",ze,ke),document.addEventListener("visibilitychange",Oe)}return e.dataset.dragging="false",e.addEventListener("pointerdown",Me,go),()=>{c=!0,e.removeEventListener("pointerdown",Me,go),_()}}function bo(t,e,r){if(!Number.isFinite(t))return e;const o=Math.min(e,r),i=Math.max(e,r);return Math.min(i,Math.max(o,t))}function tr(t){const{position:e,size:r,viewport:o}=t,i=Number.isFinite(t.margin)?Math.max(0,t.margin):0,l=Math.max(i,o.width-i-r.width),a=Math.max(i,o.height-i-r.height);return{left:Math.round(bo(e.left,i,l)),top:Math.round(bo(e.top,i,a))}}function pa(t){const{actionRect:e,floatingPosition:r,viewport:o,panelWidth:i,panelRight:l,panelBottom:a,compactSize:g,compactWidth:f,compactHeight:c,margin:d,headerPaddingX:m,headerPaddingY:u,controlSize:b}=t,S=Math.max(0,f??g),T=Math.max(0,c),k=(r==null?void 0:r.left)??o.width-l-i,M=(r==null?void 0:r.top)??o.height-a-T,I=e?{left:e.left+(e.width-S)/2,top:e.top+(e.height-T)/2}:{left:k+i-m-S,top:M+u+(b-T)/2};return tr({position:I,size:{width:S,height:T},viewport:o,margin:d})}const ga=[{value:"block",label:"块级"},{value:"flex",label:"弹性"},{value:"grid",label:"网格"},{value:"inline-block",label:"内联块"},{value:"none",label:"隐藏"}],fa=[{value:"static",label:"默认"},{value:"relative",label:"相对定位"},{value:"absolute",label:"绝对定位"},{value:"fixed",label:"固定定位"},{value:"sticky",label:"粘性定位"}],ma=[{value:"row",label:"横向"},{value:"column",label:"纵向"},{value:"row-reverse",label:"横向反转"},{value:"column-reverse",label:"纵向反转"}],ha=[{value:"nowrap",label:"不换行"},{value:"wrap",label:"换行"},{value:"wrap-reverse",label:"反向换行"}],ba=[{value:"flex-start",label:"起始"},{value:"center",label:"居中"},{value:"flex-end",label:"末尾"},{value:"space-between",label:"两端对齐"},{value:"space-around",label:"环绕"},{value:"space-evenly",label:"均分"}],xa=[{value:"stretch",label:"拉伸"},{value:"flex-start",label:"起始"},{value:"center",label:"居中"},{value:"flex-end",label:"末尾"},{value:"baseline",label:"基线"}],ya=[{value:"left",label:"左"},{value:"center",label:"中"},{value:"right",label:"右"},{value:"justify",label:"两端"}],wa=[{value:"none",label:"无"},{value:"solid",label:"实线"},{value:"dashed",label:"虚线"},{value:"dotted",label:"点线"},{value:"double",label:"双线"}],va=[{value:"300",label:"300"},{value:"400",label:"400"},{value:"500",label:"500"},{value:"600",label:"600"},{value:"700",label:"700"},{value:"800",label:"800"}],Sa=h.textPrimary,nr=h.textSecondary,xo=h.textMuted,yo=h.textMuted,ne={display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",columnGap:6,rowGap:8},Ca={display:"flex",flexDirection:"column",gap:4},Ta={display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:10},or={fontSize:10,fontWeight:600,color:nr,lineHeight:1.2},_e={display:"flex",flexDirection:"column",gap:6,paddingTop:2},rr={display:"grid",gridTemplateColumns:"32px minmax(0, 1fr) auto auto",gap:4,alignItems:"center"},wo={display:"flex",flexDirection:"column",gap:6},vo={display:"inline-flex",alignItems:"center",gap:6,flexShrink:0},ka={width:"100%"},ja={width:"100%",minWidth:0},Ea={flex:"0 0 60%",width:"60%",minWidth:0},Ra={flex:"0 0 60%",width:"60%",minWidth:0},Pa={width:"40%",minWidth:0,flex:"0 0 40%"},Ia={width:"40%",minWidth:0,flex:"0 0 40%"};function _a(t){const{target:e,transactionManager:r,tokensService:o,disabled:i,refreshKey:l,onRefreshRequest:a}=t,[g,f]=s.useState(["spacing","layout","typography"]),c=s.useMemo(()=>e?Fa(e):null,[e,l]);if(!e||!c)return n.jsx(eo,{image:eo.PRESENTED_IMAGE_SIMPLE,description:"请选择一个元素后开始编辑。",style:{marginTop:8,padding:"12px 0 4px"}});const d={target:e,transactionManager:r,tokensService:o,disabled:i,onRefreshRequest:a};return n.jsx("div",{className:"we-runtime-prop-panel__body",children:n.jsx(Or,{className:"we-runtime-prop-panel__collapse",size:"small",bordered:!1,activeKey:g,onChange:m=>{const u=Array.isArray(m)?m.map(String):[String(m)];f(u)},items:[{key:"spacing",label:"间距",children:n.jsx(Ba,{...d,snapshot:c})},{key:"layout",label:"布局",children:n.jsx(Aa,{...d,snapshot:c})},{key:"size",label:"尺寸",children:n.jsx(Ma,{...d,snapshot:c})},{key:"background",label:"背景",children:n.jsx(Oa,{...d,snapshot:c})},{key:"typography",label:"文字",children:n.jsx(Da,{...d,snapshot:c})},{key:"border",label:"边框",children:n.jsx(Ha,{...d,snapshot:c})},{key:"position",label:"定位",children:n.jsx(La,{...d,snapshot:c})},{key:"effects",label:"阴影",children:n.jsx(Wa,{...d,snapshot:c})},{key:"appearance",label:"透明度",children:n.jsx(za,{...d,snapshot:c})}]})})}function Ma(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,[a,g]=s.useState(e.width),[f,c]=s.useState(e.height),[d,m]=s.useState(e.minWidth),[u,b]=s.useState(e.minHeight),[S,T]=s.useState(e.maxWidth),[k,M]=s.useState(e.maxHeight),[I,D]=s.useState(Gt(e.width)),[E,B]=s.useState(Gt(e.height)),[L,_]=s.useState(()=>Co(e)),F=s.useRef(r),j=s.useMemo(()=>Co(e),[e.maxHeight,e.maxWidth,e.minHeight,e.minWidth]),C=s.useCallback((z,J)=>{P(o,r,z,N(J),l)},[l,r,o]);return s.useEffect(()=>{g(e.width),c(e.height),m(e.minWidth),b(e.minHeight),T(e.maxWidth),M(e.maxHeight),D(Gt(e.width)),B(Gt(e.height))},[e.height,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.width]),s.useEffect(()=>{if(F.current!==r){F.current=r,_(j);return}j&&_(!0)},[j,r]),n.jsxs("div",{style:_e,children:[n.jsxs("div",{style:Ta,children:[n.jsx(U,{label:"宽度",children:n.jsxs("div",{style:wo,children:[n.jsx(Kt,{value:a,disabled:i||I!=="fixed",placeholder:"自动 / 320px / 100%",onChange:g,onCommit:z=>C("width",z)}),n.jsx(Vt,{size:"small",block:!0,value:I,disabled:i,options:[{value:"fixed",label:"固定"},{value:"fit",label:"适配"},{value:"fill",label:"填充"}],onChange:z=>{const J=String(z);D(J),C("width",J==="fixed"?a:J==="fit"?"fit-content":J==="fill"?"100%":a)}})]})}),n.jsx(U,{label:"高度",children:n.jsxs("div",{style:wo,children:[n.jsx(Kt,{value:f,disabled:i||E!=="fixed",placeholder:"自动 / 240px",onChange:c,onCommit:z=>C("height",z)}),n.jsx(Vt,{size:"small",block:!0,value:E,disabled:i,options:[{value:"fixed",label:"固定"},{value:"fit",label:"适配"},{value:"fill",label:"填充"}],onChange:z=>{const J=String(z);B(J),C("height",J==="fixed"?f:J==="fit"?"fit-content":J==="fill"?"100%":f)}})]})})]}),n.jsx(Xt,{title:"尺寸约束",action:n.jsx(Ga,{expanded:L,disabled:i,onClick:()=>_(z=>!z)}),children:L?n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"最小宽度",value:d,disabled:i,placeholder:"0px",onChange:m,onCommit:z=>C("min-width",z)}),n.jsx(O,{label:"最小高度",value:u,disabled:i,placeholder:"0px",onChange:b,onCommit:z=>C("min-height",z)})]}),n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"最大宽度",value:S,disabled:i,placeholder:"无 / 1280px",onChange:T,onCommit:z=>C("max-width",z)}),n.jsx(O,{label:"最大高度",value:k,disabled:i,placeholder:"无 / 720px",onChange:M,onCommit:z=>C("max-height",z)})]})]}):null})]})}function Ba(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,[a,g]=s.useState({marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}),[f,c]=s.useState({margin:!1,padding:!1}),d=s.useCallback((u,b)=>{P(o,r,u,N(b),l)},[l,r,o]),m=s.useCallback((u,b)=>{const S=N(b),T=o.beginMultiStyle(r,u);T?(T.set({[u[0]]:S,[u[1]]:S}),T.commit({merge:!0})):(P(o,r,u[0],S,l),P(o,r,u[1],S,l)),l==null||l()},[l,r,o]);return s.useEffect(()=>{g({marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft})},[e.marginBottom,e.marginLeft,e.marginRight,e.marginTop,e.paddingBottom,e.paddingLeft,e.paddingRight,e.paddingTop]),n.jsxs("div",{style:_e,children:[n.jsx(Xt,{title:"外边距",action:n.jsx(So,{expanded:f.margin,disabled:i,onClick:()=>c(u=>({...u,margin:!u.margin}))}),children:f.margin?n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"上",value:a.marginTop,disabled:i,onChange:u=>g(b=>({...b,marginTop:u})),onCommit:u=>d("margin-top",u)}),n.jsx(O,{label:"右",value:a.marginRight,disabled:i,onChange:u=>g(b=>({...b,marginRight:u})),onCommit:u=>d("margin-right",u)}),n.jsx(O,{label:"下",value:a.marginBottom,disabled:i,onChange:u=>g(b=>({...b,marginBottom:u})),onCommit:u=>d("margin-bottom",u)}),n.jsx(O,{label:"左",value:a.marginLeft,disabled:i,onChange:u=>g(b=>({...b,marginLeft:u})),onCommit:u=>d("margin-left",u)})]}):n.jsxs("div",{style:ne,children:[n.jsx(Ht,{label:"水平",value:a.marginLeft===a.marginRight?a.marginLeft:"",mixed:a.marginLeft!==a.marginRight,disabled:i,onChange:u=>g(b=>({...b,marginLeft:u,marginRight:u})),onCommit:u=>m(["margin-left","margin-right"],u)}),n.jsx(Ht,{label:"垂直",value:a.marginTop===a.marginBottom?a.marginTop:"",mixed:a.marginTop!==a.marginBottom,disabled:i,onChange:u=>g(b=>({...b,marginTop:u,marginBottom:u})),onCommit:u=>m(["margin-top","margin-bottom"],u)})]})}),n.jsx(Xt,{title:"内边距",action:n.jsx(So,{expanded:f.padding,disabled:i,onClick:()=>c(u=>({...u,padding:!u.padding}))}),children:f.padding?n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"上",value:a.paddingTop,disabled:i,onChange:u=>g(b=>({...b,paddingTop:u})),onCommit:u=>d("padding-top",u)}),n.jsx(O,{label:"右",value:a.paddingRight,disabled:i,onChange:u=>g(b=>({...b,paddingRight:u})),onCommit:u=>d("padding-right",u)}),n.jsx(O,{label:"下",value:a.paddingBottom,disabled:i,onChange:u=>g(b=>({...b,paddingBottom:u})),onCommit:u=>d("padding-bottom",u)}),n.jsx(O,{label:"左",value:a.paddingLeft,disabled:i,onChange:u=>g(b=>({...b,paddingLeft:u})),onCommit:u=>d("padding-left",u)})]}):n.jsxs("div",{style:ne,children:[n.jsx(Ht,{label:"水平",value:a.paddingLeft===a.paddingRight?a.paddingLeft:"",mixed:a.paddingLeft!==a.paddingRight,disabled:i,onChange:u=>g(b=>({...b,paddingLeft:u,paddingRight:u})),onCommit:u=>m(["padding-left","padding-right"],u)}),n.jsx(Ht,{label:"垂直",value:a.paddingTop===a.paddingBottom?a.paddingTop:"",mixed:a.paddingTop!==a.paddingBottom,disabled:i,onChange:u=>g(b=>({...b,paddingTop:u,paddingBottom:u})),onCommit:u=>m(["padding-top","padding-bottom"],u)})]})})]})}function Aa(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,[a,g]=s.useState(e.display||"block"),[f,c]=s.useState(e.flexDirection||"row"),[d,m]=s.useState(e.flexWrap||"nowrap"),[u,b]=s.useState(e.justifyContent||"flex-start"),[S,T]=s.useState(e.alignItems||"stretch"),[k,M]=s.useState(e.gap),[I,D]=s.useState(e.rowGap),[E,B]=s.useState(e.columnGap),[L,_]=s.useState(e.gridTemplateColumns),[F,j]=s.useState(e.gridTemplateRows);return s.useEffect(()=>{g(e.display||"block"),c(e.flexDirection||"row"),m(e.flexWrap||"nowrap"),b(e.justifyContent||"flex-start"),T(e.alignItems||"stretch"),M(e.gap),D(e.rowGap),B(e.columnGap),_(e.gridTemplateColumns),j(e.gridTemplateRows)},[e.alignItems,e.columnGap,e.display,e.flexDirection,e.flexWrap,e.gap,e.gridTemplateColumns,e.gridTemplateRows,e.justifyContent,e.rowGap]),n.jsxs("div",{style:_e,children:[n.jsx(U,{label:"显示",children:n.jsx(we,{value:a||"block",options:ga,disabled:i,onChange:C=>{g(C),P(o,r,"display",C,l)}})}),a==="flex"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:ne,children:[n.jsx(U,{label:"方向",children:n.jsx(we,{value:f||"row",options:ma,disabled:i,onChange:C=>{c(C),P(o,r,"flex-direction",C,l)}})}),n.jsx(U,{label:"换行",children:n.jsx(we,{value:d||"nowrap",options:ha,disabled:i,onChange:C=>{m(C),P(o,r,"flex-wrap",C,l)}})})]}),n.jsxs("div",{style:ne,children:[n.jsx(U,{label:"主轴对齐",children:n.jsx(we,{value:u||"flex-start",options:ba,disabled:i,onChange:C=>{b(C),P(o,r,"justify-content",C,l)}})}),n.jsx(U,{label:"交叉轴对齐",children:n.jsx(we,{value:S||"stretch",options:xa,disabled:i,onChange:C=>{T(C),P(o,r,"align-items",C,l)}})})]})]}):null,a==="grid"?n.jsxs("div",{style:ne,children:[n.jsx(U,{label:"列模板",children:n.jsx(Z,{value:L,disabled:i,placeholder:"repeat(3, minmax(0, 1fr))",onChange:C=>_(C.target.value),onBlur:()=>P(o,r,"grid-template-columns",L,l),onPressEnter:()=>P(o,r,"grid-template-columns",L,l)})}),n.jsx(U,{label:"行模板",children:n.jsx(Z,{value:F,disabled:i,placeholder:"auto auto",onChange:C=>j(C.target.value),onBlur:()=>P(o,r,"grid-template-rows",F,l),onPressEnter:()=>P(o,r,"grid-template-rows",F,l)})})]}):null,a==="flex"||a==="grid"?n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"间距",value:k,disabled:i,onChange:M,onCommit:C=>P(o,r,"gap",N(C),l)}),n.jsx(O,{label:"行间距",value:I,disabled:i,onChange:D,onCommit:C=>P(o,r,"row-gap",N(C),l)}),n.jsx(O,{label:"列间距",value:E,disabled:i,onChange:B,onCommit:C=>P(o,r,"column-gap",N(C),l)})]}):null]})}function La(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,[a,g]=s.useState(e.position||"static"),[f,c]=s.useState(e.top),[d,m]=s.useState(e.right),[u,b]=s.useState(e.bottom),[S,T]=s.useState(e.left),[k,M]=s.useState(e.zIndex),[I,D]=s.useState(e.transform);return s.useEffect(()=>{g(e.position||"static"),c(e.top),m(e.right),b(e.bottom),T(e.left),M(e.zIndex),D(e.transform)},[e.bottom,e.left,e.position,e.right,e.top,e.transform,e.zIndex]),n.jsxs("div",{style:_e,children:[n.jsx(U,{label:"定位",children:n.jsx(we,{size:"small",value:a||"static",options:fa,disabled:i,onChange:E=>{g(E),P(o,r,"position",E,l)}})}),n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"上",value:f,disabled:i||a==="static",placeholder:"自动",onChange:c,onCommit:E=>P(o,r,"top",N(E),l)}),n.jsx(O,{label:"右",value:d,disabled:i||a==="static",placeholder:"自动",onChange:m,onCommit:E=>P(o,r,"right",N(E),l)}),n.jsx(O,{label:"下",value:u,disabled:i||a==="static",placeholder:"自动",onChange:b,onCommit:E=>P(o,r,"bottom",N(E),l)}),n.jsx(O,{label:"左",value:S,disabled:i||a==="static",placeholder:"自动",onChange:T,onCommit:E=>P(o,r,"left",N(E),l)})]}),n.jsxs("div",{style:ne,children:[n.jsx(U,{label:"层级",children:n.jsx(Z,{size:"small",value:k,disabled:i,placeholder:"0",onChange:E=>M(E.target.value),onBlur:()=>P(o,r,"z-index",k.trim(),l),onPressEnter:()=>P(o,r,"z-index",k.trim(),l)})}),n.jsx(U,{label:"变换",children:n.jsx(Z,{size:"small",value:I,disabled:i,placeholder:"translateX(8px) scale(1)",onChange:E=>D(E.target.value),onBlur:()=>P(o,r,"transform",I.trim(),l),onPressEnter:()=>P(o,r,"transform",I.trim(),l)})})]})]})}function Da(t){const{snapshot:e,target:r,transactionManager:o,tokensService:i,disabled:l,onRefreshRequest:a}=t,[g,f]=s.useState(e.fontFamily),[c,d]=s.useState(e.fontSize),[m,u]=s.useState(e.fontWeight||"400"),[b,S]=s.useState(e.lineHeight),[T,k]=s.useState(e.letterSpacing),[M,I]=s.useState(e.textAlign||"left"),[D,E]=s.useState(e.textDecorationLine||"none"),[B,L]=s.useState(e.color);return s.useEffect(()=>{f(e.fontFamily),d(e.fontSize),u(e.fontWeight||"400"),S(e.lineHeight),k(e.letterSpacing),I(e.textAlign||"left"),E(e.textDecorationLine||"none"),L(e.color)},[e.color,e.fontFamily,e.fontSize,e.fontWeight,e.letterSpacing,e.lineHeight,e.textAlign,e.textDecorationLine]),n.jsxs("div",{style:_e,children:[n.jsx(U,{label:"字体家族",children:n.jsx(Z,{value:g,disabled:l,placeholder:"Inter, sans-serif",onChange:_=>f(_.target.value),onBlur:()=>P(o,r,"font-family",g.trim(),a),onPressEnter:()=>P(o,r,"font-family",g.trim(),a)})}),n.jsxs("div",{style:ne,children:[n.jsx(U,{label:"字重",children:n.jsx(we,{value:m||"400",options:va,disabled:l,onChange:_=>{u(_),P(o,r,"font-weight",_,a)}})}),n.jsx(O,{label:"字号",value:c,disabled:l,onChange:d,onCommit:_=>P(o,r,"font-size",N(_),a)})]}),n.jsx(In,{label:"文字颜色",value:B,disabled:l,target:r,tokensService:i,transactionManager:o,property:"color",onRefreshRequest:a,onValueChange:L}),n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"行高",value:b,disabled:l,placeholder:"1.5 / 24px",onChange:S,onCommit:_=>P(o,r,"line-height",_.trim(),a)}),n.jsx(O,{label:"字间距",value:T,disabled:l,onChange:k,onCommit:_=>P(o,r,"letter-spacing",N(_),a)})]}),n.jsx(U,{label:"对齐",children:n.jsx(Vt,{size:"small",block:!0,value:M||"left",disabled:l,options:ya,onChange:_=>{const F=String(_);I(F),P(o,r,"text-align",F,a)}})}),n.jsx(U,{label:"文本装饰",children:n.jsx(Vt,{size:"small",block:!0,value:D||"none",disabled:l,options:[{value:"none",label:"无"},{value:"underline",label:"下划线"},{value:"line-through",label:"删除线"},{value:"overline",label:"上划线"}],onChange:_=>{const F=String(_);E(F),P(o,r,"text-decoration-line",F,a)}})})]})}function za(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,[a,g]=s.useState(jo(e.opacity));return s.useEffect(()=>{g(jo(e.opacity))},[e.opacity]),n.jsx("div",{style:_e,children:n.jsx(U,{label:"透明度",children:n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 72px",gap:10,alignItems:"center"},children:[n.jsx(Hr,{min:0,max:100,value:a,disabled:i,onChange:f=>g(hn(f)),onChangeComplete:f=>P(o,r,"opacity",String((hn(f)/100).toFixed(2)).replace(/\.?0+$/,""),l)}),n.jsx(Wr,{min:0,max:100,addonAfter:"%",value:a,disabled:i,onChange:f=>g(hn(f)),onBlur:()=>P(o,r,"opacity",String((a/100).toFixed(2)).replace(/\.?0+$/,""),l)})]})})})}function Oa(t){const{snapshot:e,target:r,transactionManager:o,tokensService:i,disabled:l,onRefreshRequest:a}=t,g=e.backgroundImage==="none"?"":e.backgroundImage,f=st(g)?g:e.backgroundColor,[c,d]=s.useState(f);return s.useEffect(()=>{const m=e.backgroundImage==="none"?"":e.backgroundImage;d(st(m)?m:e.backgroundColor)},[e.backgroundColor,e.backgroundImage]),n.jsx("div",{style:_e,children:n.jsx(U,{label:"背景填充",children:n.jsxs("div",{style:rr,children:[n.jsx(Lo,{mode:["single","gradient"],value:c?Ua(c):void 0,allowClear:!0,disabled:l,showText:!1,onChange:(m,u)=>{d(u),Wt(o,r,u,a)},onClear:()=>{d(""),Wt(o,r,"",a)}}),n.jsx(Z,{value:c,disabled:l,placeholder:"#008F5D / linear-gradient(...)",onChange:m=>d(m.target.value),onBlur:()=>{const m=c.trim();d(m),Wt(o,r,m,a)},onPressEnter:()=>{const m=c.trim();d(m),Wt(o,r,m,a)}}),i&&!st(c)?n.jsx(ir,{target:r,property:"background-color",disabled:l,currentValue:c,tokensService:i,transactionManager:o,onApplied:a,onValueChange:d}):null]})})})}function Ha(t){const{snapshot:e,target:r,transactionManager:o,tokensService:i,disabled:l,onRefreshRequest:a}=t,[g,f]=s.useState(e.borderStyle||"none"),[c,d]=s.useState(Ro(e)),[m,u]=s.useState(e.borderWidth),[b,S]=s.useState({top:e.borderTopWidth,right:e.borderRightWidth,bottom:e.borderBottomWidth,left:e.borderLeftWidth}),[T,k]=s.useState(e.borderColor),[M,I]=s.useState(Eo(e)),[D,E]=s.useState(e.borderRadius),[B,L]=s.useState({tl:e.borderTopLeftRadius,tr:e.borderTopRightRadius,br:e.borderBottomRightRadius,bl:e.borderBottomLeftRadius});s.useEffect(()=>{f(e.borderStyle||"none"),d(Ro(e)),u(e.borderWidth),S({top:e.borderTopWidth,right:e.borderRightWidth,bottom:e.borderBottomWidth,left:e.borderLeftWidth}),k(e.borderColor),I(Eo(e)),E(e.borderRadius),L({tl:e.borderTopLeftRadius,tr:e.borderTopRightRadius,br:e.borderBottomRightRadius,bl:e.borderBottomLeftRadius})},[e.borderBottomLeftRadius,e.borderBottomRightRadius,e.borderBottomWidth,e.borderColor,e.borderLeftWidth,e.borderRadius,e.borderRightWidth,e.borderStyle,e.borderTopLeftRadius,e.borderTopRightRadius,e.borderTopWidth,e.borderWidth]);const _=s.useCallback(j=>{const C=N(j),z=o.beginMultiStyle(r,["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"]);z?(z.set({"border-top-left-radius":C,"border-top-right-radius":C,"border-bottom-right-radius":C,"border-bottom-left-radius":C}),z.commit({merge:!0})):P(o,r,"border-radius",C,a),a==null||a()},[a,r,o]),F=s.useCallback(j=>{const C=N(j),z=o.beginMultiStyle(r,["border-top-width","border-right-width","border-bottom-width","border-left-width"]);z?(z.set({"border-top-width":C,"border-right-width":C,"border-bottom-width":C,"border-left-width":C}),z.commit({merge:!0})):P(o,r,"border-width",C,a),a==null||a()},[a,r,o]);return n.jsxs("div",{style:_e,children:[n.jsx(U,{label:"边框类型",children:n.jsx(we,{value:g||"none",options:wa,disabled:l,onChange:j=>{f(j),P(o,r,"border-style",j,a)}})}),n.jsx(U,{label:"边框宽度",action:n.jsxs("span",{style:vo,children:[n.jsx("span",{style:{fontSize:11,color:xo},children:"联动"}),n.jsx(at,{size:"small",checked:c,onChange:d})]}),children:c?n.jsx(Z,{value:m,disabled:l,placeholder:"1px",onChange:j=>u(j.target.value),onBlur:()=>F(m),onPressEnter:()=>F(m)}):n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"上",value:b.top,disabled:l,onChange:j=>S(C=>({...C,top:j})),onCommit:j=>P(o,r,"border-top-width",N(j),a)}),n.jsx(O,{label:"右",value:b.right,disabled:l,onChange:j=>S(C=>({...C,right:j})),onCommit:j=>P(o,r,"border-right-width",N(j),a)}),n.jsx(O,{label:"下",value:b.bottom,disabled:l,onChange:j=>S(C=>({...C,bottom:j})),onCommit:j=>P(o,r,"border-bottom-width",N(j),a)}),n.jsx(O,{label:"左",value:b.left,disabled:l,onChange:j=>S(C=>({...C,left:j})),onCommit:j=>P(o,r,"border-left-width",N(j),a)})]})}),n.jsx(In,{label:"边框颜色",value:T,disabled:l,target:r,tokensService:i,transactionManager:o,property:"border-color",onRefreshRequest:a,onValueChange:k}),n.jsx(U,{label:"圆角",action:n.jsxs("span",{style:vo,children:[n.jsx("span",{style:{fontSize:11,color:xo},children:"联动"}),n.jsx(at,{size:"small",checked:M,onChange:I})]}),children:M?n.jsx(Z,{value:D,disabled:l,placeholder:"12px",onChange:j=>E(j.target.value),onBlur:()=>_(D),onPressEnter:()=>_(D)}):n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"左上",value:B.tl,disabled:l,onChange:j=>L(C=>({...C,tl:j})),onCommit:j=>P(o,r,"border-top-left-radius",N(j),a)}),n.jsx(O,{label:"右上",value:B.tr,disabled:l,onChange:j=>L(C=>({...C,tr:j})),onCommit:j=>P(o,r,"border-top-right-radius",N(j),a)}),n.jsx(O,{label:"右下",value:B.br,disabled:l,onChange:j=>L(C=>({...C,br:j})),onCommit:j=>P(o,r,"border-bottom-right-radius",N(j),a)}),n.jsx(O,{label:"左下",value:B.bl,disabled:l,onChange:j=>L(C=>({...C,bl:j})),onCommit:j=>P(o,r,"border-bottom-left-radius",N(j),a)})]})})]})}function Wa(t){const{snapshot:e,target:r,transactionManager:o,disabled:i,onRefreshRequest:l}=t,a=s.useMemo(()=>kn(e.boxShadow),[e.boxShadow]),[g,f]=s.useState(a.color),[c,d]=s.useState(a.x),[m,u]=s.useState(a.y),[b,S]=s.useState(a.blur),[T,k]=s.useState(a.spread),[M,I]=s.useState(e.boxShadow==="none"?"":e.boxShadow);s.useEffect(()=>{const E=kn(e.boxShadow);f(E.color),d(E.x),u(E.y),S(E.blur),k(E.spread),I(e.boxShadow==="none"?"":e.boxShadow)},[e.boxShadow]);const D=s.useCallback(()=>{const E=lr({color:g,x:c,y:m,blur:b,spread:T});I(E==="none"?"":E),P(o,r,"box-shadow",E,l)},[l,b,g,T,c,m,r,o]);return n.jsxs("div",{style:_e,children:[n.jsx(In,{label:"阴影颜色",value:g,disabled:i,target:r,transactionManager:o,property:"box-shadow-color",tokensService:void 0,onRefreshRequest:l,onValueChange:f}),n.jsxs("div",{style:ne,children:[n.jsx(O,{label:"横向",value:c,disabled:i,onChange:d,onCommit:()=>D()}),n.jsx(O,{label:"纵向",value:m,disabled:i,onChange:u,onCommit:()=>D()}),n.jsx(O,{label:"模糊",value:b,disabled:i,onChange:S,onCommit:()=>D()}),n.jsx(O,{label:"扩散",value:T,disabled:i,onChange:k,onCommit:()=>D()})]}),n.jsx(Xt,{title:"高级阴影",children:n.jsx(Z.TextArea,{autoSize:{minRows:2,maxRows:5},value:M,disabled:i,placeholder:"0 8px 24px rgba(15, 23, 42, 0.16)",onChange:E=>I(E.target.value),onBlur:()=>P(o,r,"box-shadow",M.trim()||"none",l)})})]})}function U(t){return n.jsxs("div",{style:Ca,children:[n.jsxs("div",{style:{...or,display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[n.jsx("span",{children:t.label}),t.action]}),t.children]})}function Xt(t){return n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[n.jsxs("div",{style:{...or,fontSize:9,letterSpacing:"0.08em",textTransform:"uppercase",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[n.jsx("span",{children:t.title}),t.action]}),t.children]})}function So(t){const{expanded:e,disabled:r,onClick:o}=t,i=e?"聚合编辑":"逐项编辑";return n.jsx(Mo,{title:i,children:n.jsx(re,{type:"text",size:"small",disabled:r,"aria-label":i,icon:e?n.jsx(Gr,{}):n.jsx(Fr,{}),onClick:o})})}function Ga(t){const{expanded:e,disabled:r,onClick:o}=t,i=e?"隐藏最小值和最大值":"显示最小值和最大值";return n.jsx(re,{type:"text",size:"small",disabled:r,"aria-label":i,onClick:o,style:{paddingInline:4,color:nr},children:n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[n.jsx("span",{children:"Min Max"}),e?n.jsx(Nr,{style:{fontSize:10}}):n.jsx($r,{style:{fontSize:10}})]})})}function O(t){return n.jsx(U,{label:t.label,children:n.jsx(Kt,{value:t.value,disabled:t.disabled,placeholder:t.placeholder??"0px",onChange:t.onChange,onCommit:t.onCommit})})}function Ht(t){return n.jsx(U,{label:t.label,children:n.jsx(Kt,{value:t.value,disabled:t.disabled,placeholder:t.mixed?"混合":"0px",onChange:t.onChange,onCommit:e=>{t.mixed&&!e.trim()||t.onCommit(e)}})})}function Kt(t){var f;const e=s.useMemo(()=>Ya(t.value),[t.value]);if(e.kind==="raw")return n.jsx(Z,{size:"small",style:ja,value:t.value,disabled:t.disabled,placeholder:t.placeholder,onChange:c=>t.onChange(c.target.value),onBlur:()=>t.onCommit(t.value),onPressEnter:()=>t.onCommit(t.value)});const r=[{value:"px",label:"px"},{value:"%",label:"%"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"auto",label:"自动"},{value:"none",label:"无"}],o=e.unit==="auto"||e.unit==="none",i=((f=r.find(c=>c.value===e.unit))==null?void 0:f.label)??e.unit,l=o?i:t.placeholder,a=o?Ra:Ea,g=o?Ia:Pa;return n.jsxs(De.Compact,{block:!0,className:"we-runtime-prop-panel__unit-input",style:ka,children:[n.jsx(Z,{className:"we-runtime-prop-panel__unit-input-amount",size:"small",style:a,value:o?"":e.amount,disabled:t.disabled||o,inputMode:"decimal",placeholder:l,onChange:c=>t.onChange(Po(c.target.value,e.unit)),onBlur:()=>t.onCommit(t.value),onPressEnter:()=>t.onCommit(t.value)}),n.jsx(we,{className:"we-runtime-prop-panel__unit-input-unit",size:"small",disabled:t.disabled,value:e.unit,style:g,popupMatchSelectWidth:76,classNames:{popup:{root:"we-runtime-prop-panel__unit-select-popup"}},options:r,onChange:c=>{const d=Po(e.amount,c);t.onChange(d),t.onCommit(d)}})]})}function In(t){const{label:e,value:r,property:o,target:i,transactionManager:l,tokensService:a,disabled:g,onRefreshRequest:f,onValueChange:c}=t,d=(a==null?void 0:a.parseCssVar(r.trim()))??null,m=d?(a==null?void 0:a.resolveToken(i,d.name).computedValue)??"":r,u=s.useCallback(b=>{if(o==="box-shadow-color"){const S=R(i,"box-shadow"),T=kn(S),k=lr({...T,color:b});c(b),P(l,i,"box-shadow",k,f);return}c(b),P(l,i,o,b,f)},[f,c,o,i,l]);return n.jsx(U,{label:e,children:n.jsxs("div",{style:rr,children:[n.jsx(Lo,{value:Va(m)?m:"#ffffff",disabled:g,showText:!1,onChange:(b,S)=>{const T=S||b.toCssString();u(T)}}),n.jsx(Z,{value:r,disabled:g,placeholder:"#008F5D / var(--color-primary)",onChange:b=>c(b.target.value),onBlur:()=>u(r.trim()),onPressEnter:()=>u(r.trim())}),a?n.jsx(ir,{target:i,property:o,disabled:g,currentValue:r,tokensService:a,transactionManager:l,onApplied:f,onValueChange:c}):null,d&&a?n.jsx(re,{size:"small",disabled:g,onClick:()=>{const b=a.resolveToken(i,d.name).computedValue.trim();c(b),P(l,i,o,b,f)},children:"解绑"}):null]})})}function ir(t){const{target:e,property:r,currentValue:o,disabled:i,tokensService:l,transactionManager:a,onApplied:g,onValueChange:f}=t,[c,d]=s.useState(!1),[m,u]=s.useState(""),b=s.useMemo(()=>l.getContextTokens(e).tokens.filter(T=>T.computedValue.trim()!==""),[e,l]),S=s.useMemo(()=>{const T=m.trim().toLowerCase();return T?b.filter(k=>{const M=k.token.name.toLowerCase(),I=k.computedValue.toLowerCase();return M.includes(T)||I.includes(T)}):b},[m,b]);return n.jsx(Do,{trigger:["click"],open:c,onOpenChange:d,content:n.jsxs("div",{style:{width:280,display:"flex",flexDirection:"column",gap:8},children:[n.jsx(Z,{size:"small",value:m,placeholder:"搜索设计令牌",onChange:T=>u(T.target.value)}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:280,overflowY:"auto"},children:S.length>0?S.map(T=>n.jsx(re,{size:"small",style:{justifyContent:"space-between",height:"auto",paddingBlock:6},onClick:()=>{const k=T.token.name;l.applyTokenToStyle(a,e,r,k,{merge:!0}),f(l.formatCssVar(k)),g==null||g(),d(!1),u("")},children:n.jsxs(De,{direction:"vertical",size:0,style:{alignItems:"flex-start"},children:[n.jsx("span",{style:{fontSize:11,fontWeight:600,color:Sa},children:T.token.name}),n.jsx("span",{style:{fontSize:10,color:yo},children:T.computedValue})]})},T.token.name)):n.jsx("div",{style:{fontSize:11,color:yo},children:"没有匹配到设计令牌。"})}),o?n.jsxs(re,{size:"small",type:"text",onClick:()=>{f(o),u("")},children:["当前值: ",o]}):null]}),children:n.jsx(re,{size:"small",icon:n.jsx(zo,{}),disabled:i})})}function Fa(t){return{width:R(t,"width"),height:R(t,"height"),minWidth:R(t,"min-width"),minHeight:R(t,"min-height"),maxWidth:R(t,"max-width"),maxHeight:R(t,"max-height"),marginTop:R(t,"margin-top"),marginRight:R(t,"margin-right"),marginBottom:R(t,"margin-bottom"),marginLeft:R(t,"margin-left"),paddingTop:R(t,"padding-top"),paddingRight:R(t,"padding-right"),paddingBottom:R(t,"padding-bottom"),paddingLeft:R(t,"padding-left"),display:R(t,"display"),flexDirection:R(t,"flex-direction"),flexWrap:R(t,"flex-wrap"),justifyContent:R(t,"justify-content"),alignItems:R(t,"align-items"),gap:R(t,"gap"),rowGap:R(t,"row-gap"),columnGap:R(t,"column-gap"),gridTemplateColumns:R(t,"grid-template-columns"),gridTemplateRows:R(t,"grid-template-rows"),position:R(t,"position"),top:R(t,"top"),right:R(t,"right"),bottom:R(t,"bottom"),left:R(t,"left"),zIndex:R(t,"z-index"),transform:R(t,"transform"),fontFamily:R(t,"font-family"),fontSize:R(t,"font-size"),fontWeight:R(t,"font-weight"),lineHeight:R(t,"line-height"),letterSpacing:R(t,"letter-spacing"),textAlign:R(t,"text-align"),textDecorationLine:R(t,"text-decoration-line")||R(t,"text-decoration"),color:R(t,"color"),backgroundColor:R(t,"background-color"),backgroundImage:R(t,"background-image"),borderStyle:R(t,"border-style"),borderWidth:R(t,"border-width"),borderTopWidth:R(t,"border-top-width"),borderRightWidth:R(t,"border-right-width"),borderBottomWidth:R(t,"border-bottom-width"),borderLeftWidth:R(t,"border-left-width"),borderColor:R(t,"border-color"),borderRadius:R(t,"border-radius"),borderTopLeftRadius:R(t,"border-top-left-radius"),borderTopRightRadius:R(t,"border-top-right-radius"),borderBottomRightRadius:R(t,"border-bottom-right-radius"),borderBottomLeftRadius:R(t,"border-bottom-left-radius"),opacity:R(t,"opacity"),overflow:R(t,"overflow"),boxShadow:R(t,"box-shadow")}}function R(t,e){const r=Na(t,e);return r||$a(t,e)}function Na(t,e){try{return t.style.getPropertyValue(e).trim()}catch{return""}}function $a(t,e){try{return window.getComputedStyle(t).getPropertyValue(e).trim()}catch{return""}}function P(t,e,r,o,i){t.applyStyle(e,r,o,{merge:!0}),i==null||i()}function Wt(t,e,r,o){const i=r.trim(),l=st(i)?"":i||"",a=st(i)?i:"none",g=t.beginMultiStyle(e,["background-color","background-image"]);g?(g.set({"background-color":l,"background-image":a}),g.commit({merge:!0})):(t.applyStyle(e,"background-color",l,{merge:!0}),t.applyStyle(e,"background-image",a,{merge:!0})),o==null||o()}function Gt(t){const e=t.trim().toLowerCase();return e==="100%"?"fill":!e||e==="auto"||e.includes("fit-content")?"fit":"fixed"}function Co(t){return!To(t.minWidth)||!To(t.minHeight)||!ko(t.maxWidth)||!ko(t.maxHeight)}function To(t){const e=ar(t);return e===""||e==="0"||e==="0px"||e==="auto"}function ko(t){const e=ar(t);return e===""||e==="none"||e==="auto"}function ar(t){return t.trim().toLowerCase()}function jo(t){const e=Number.parseFloat(t);return Number.isFinite(e)?Math.max(0,Math.min(100,Math.round(e*100))):100}function hn(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=Number.parseFloat(t);if(Number.isFinite(e))return e}return 0}function Eo(t){return t.borderTopLeftRadius===t.borderTopRightRadius&&t.borderTopLeftRadius===t.borderBottomRightRadius&&t.borderTopLeftRadius===t.borderBottomLeftRadius}function Ro(t){return t.borderTopWidth===t.borderRightWidth&&t.borderTopWidth===t.borderBottomWidth&&t.borderTopWidth===t.borderLeftWidth}function kn(t){const e=t.trim();if(!e||e==="none")return{color:"rgba(15, 23, 42, 0.18)",x:"0px",y:"8px",blur:"24px",spread:"0px"};const r=e.split(/,(?![^(]*\))/)[0].replace(/\binset\b/g,"").trim(),o=r.match(/(rgba?\([^)]+\)|hsla?\([^)]+\)|#[0-9a-fA-F]{3,8}|transparent|currentColor|black|white)/i),i=(o==null?void 0:o[0])??"rgba(15, 23, 42, 0.18)",a=(o?r.replace(o[0],"").trim():r).match(/-?(?:\d+|\d*\.\d+)(?:px|rem|em|%)?/g)??[];return{color:i,x:a[0]??"0px",y:a[1]??"8px",blur:a[2]??"24px",spread:a[3]??"0px"}}function lr(t){const e=[N(t.x)||"0px",N(t.y)||"0px",N(t.blur)||"0px",N(t.spread)||"0px",t.color.trim()||"rgba(15, 23, 42, 0.18)"];return e.every(r=>r==="0px"||r==="rgba(15, 23, 42, 0.18)")?"0px 0px 0px 0px rgba(15, 23, 42, 0.18)":e.join(" ")}function Va(t){const e=t.trim();return!e||e.startsWith("var(")?!1:typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("color",e):!0}function st(t){const e=t.trim().toLowerCase();return e.includes("linear-gradient(")||e.includes("radial-gradient(")||e.includes("conic-gradient(")}function Ya(t){const e=t.trim();if(!e)return{kind:"unit",amount:"",unit:"px"};if(e==="auto"||e==="none")return{kind:"unit",amount:"",unit:e};const r=e.match(/^(-?(?:\d+|\d*\.\d+))(px|%|vw|vh|em|rem)$/i);return r?{kind:"unit",amount:r[1],unit:r[2].toLowerCase()}:/^-?(?:\d+|\d*\.\d+)$/.test(e)?{kind:"unit",amount:e,unit:"px"}:{kind:"raw"}}function Po(t,e){if(e==="auto"||e==="none")return e;const r=t.trim();return r?`${r}${e}`:""}function Ua(t){if(!st(t))return t||"#ffffff";const e=t.match(/\((.*)\)/);if(!e)return"#ffffff";const i=e[1].split(/,(?![^(]*\))/).map(l=>l.trim()).filter(Boolean).filter(l=>/#|rgb|hsl/i.test(l)).map((l,a,g)=>{const f=l.split(/\s+/),c=f[0],d=f.find(b=>b.endsWith("%")),m=g.length===1?100:Math.round(a/(g.length-1)*100),u=d?Number.parseFloat(d):m;return c?{color:c,percent:u}:null}).filter(l=>!!l);return i.length>0?i:"#ffffff"}function N(t){const e=t.trim();return e?/^-?(?:\d+|\d*\.\d+)$/.test(e)?`${e}px`:/^-?\d+\.$/.test(e)?`${e.slice(0,-1)}px`:e:""}const Tt={fontSize:11,color:h.textMuted,lineHeight:1.4},Io={appearance:"none",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:6,width:"100%",minHeight:88,padding:"12px 14px",borderRadius:12,border:`1px solid ${h.border}`,background:h.surfaceMuted,textAlign:"left",cursor:"pointer",font:"inherit"},Xa=s.forwardRef(function(e,r){const{label:o,value:i,capturing:l,onActivate:a,onCapture:g,onCancelCapture:f,onClear:c}=e;return n.jsxs("button",{ref:r,type:"button",style:{...Io,border:l?`1px solid ${h.accentRing}`:Io.border,boxShadow:l?`0 0 0 3px ${h.accentSoft}`:"none"},onClick:a,onKeyDown:d=>{if(d.key==="Escape"){d.preventDefault(),f();return}const m=yn(d.key);m&&(d.preventDefault(),d.stopPropagation(),g(m))},children:[n.jsx("span",{style:{fontSize:12,fontWeight:600,color:h.textSecondary},children:o}),n.jsx("span",{style:{fontSize:18,fontWeight:600,color:h.textPrimary},children:l?"按下修饰键…":Jr(i)}),n.jsx("span",{style:Tt,children:l?"仅支持 Shift / Alt / Ctrl / Command按 Esc 取消。":"点击后录入一个修饰键。"}),i?n.jsx("span",{style:{...Tt,color:h.accent},onClick:d=>{d.stopPropagation(),c()},children:"清空"}):null]})});function Ft(t,e){const r=St();if(r){r.message({type:t,content:e});return}bn.open({type:t,content:e})}const cl=s.forwardRef(function(e,r){var Vn,Yn,Un,Xn,Kn,qn,Zn;const{options:o,currentTarget:i,uiMode:l,toolMinimized:a,uiSettings:g,interactionProfile:f,genieVisualState:c,onGenieVisualStateChange:d,onUiSettingsChange:m,onHoverSelectionSuppressedChange:u,onSelectionInteractionLockChange:b,onUiModeChange:S,onToolMinimizedChange:T,onTargetChange:k,onRefreshNoteState:M,canEditText:I,draftText:D,textDirty:E,onTextDraftChange:B,onCancelText:L,onConfirmText:_,images:F,onRemoveImage:j,onNotePasteCapture:C,canEditNote:z,draftNote:J,noteDirty:je,onDraftChange:ct,onClearCurrentElementEdits:qe,onConfirmNote:pe,onDismissSelection:ve}=e,Ee=s.useRef(null),ze=s.useRef(null),Oe=s.useRef(null),Me=s.useRef(null),y=s.useRef(null),w=s.useRef(null),$=s.useRef(null),ge=s.useRef(null),le=s.useRef(null),Q=s.useRef([]),be=s.useRef(null),se=s.useRef(null),Se=s.useRef(i),dt=s.useRef("design"),ut=s.useRef(null),ce=s.useRef(o.initialPosition??null),pt=s.useRef(l),[Be,gt]=s.useState(0),[qt,jt]=s.useState(0),[Ae,He]=s.useState(Math.max(0,((Vn=o.getModifiedElementCount)==null?void 0:Vn.call(o))??0)),[ie,Et]=s.useState(!1),[ft,ye]=s.useState(!1),[ae,We]=s.useState(!1),[Ze,mt]=s.useState(!1),[Zt,Le]=s.useState(!1),[Rt,V]=s.useState(!1),[fe,Qt]=s.useState(null),[Qe,Jt]=s.useState(o.initialPosition??null),[Ge,Je]=s.useState(!1),[ht,Fe]=s.useState({velocityX:0,velocityY:0}),[et,tt]=s.useState(()=>({width:window.innerWidth,height:window.innerHeight})),[Ne,nt]=s.useState(null),[$e,en]=s.useState(!1),[Ce,Pt]=s.useState(((Yn=o.getAnnotationShortcutSettings)==null?void 0:Yn.call(o))??{...oo}),[Ve,x]=s.useState(null),[A,q]=s.useState(0),[oe,de]=s.useState(null),[Re,Ye]=s.useState(!1),[bt,tn]=s.useState(!1);Se.current=i;const{currentTask:W,currentTaskRunning:Ue,currentTaskSessionReady:cr,currentTaskTerminal:dr,pageTaskRunning:It,pageTaskSessionReady:ur,hasReusableConversation:nn,effectiveVisualState:on}=Jo({currentTarget:i,visualState:c,getElementGenieTaskState:o.getElementGenieTaskState,getVisibleElementGenieTaskStates:o.getVisibleElementGenieTaskStates,getHasReusableGenieConversation:o.getHasReusableGenieConversation,getGenieBridgeConnected:o.getGenieBridgeConnected}),_n=!!(i&&((Un=o.getCanAbortSendPromptToGenie)!=null&&Un.call(o,i))),Mn=!!(ft&&W&&oe&&W.elementKey===oe);s.useEffect(()=>{ft&&Ue&&nn&&(ye(!1),de(null))},[Ue,ft,nn]);const _t=s.useCallback(()=>{var p;se.current!==null&&(window.cancelAnimationFrame(se.current),se.current=null);try{(p=be.current)==null||p.disconnect()}catch{}be.current=null},[]),Xe=s.useCallback(()=>{q(p=>p+1)},[]),Bn=s.useCallback(()=>{se.current===null&&(se.current=window.requestAnimationFrame(()=>{se.current=null,Xe()}))},[Xe]),An=s.useCallback(p=>{if(_t(),!p||!p.isConnected||typeof MutationObserver>"u")return;const v=new MutationObserver(()=>{Se.current===p&&Bn()});try{v.observe(p,{attributes:!0,attributeFilter:["style"]}),be.current=v}catch{try{v.disconnect()}catch{}}},[_t,Bn]),Mt=s.useCallback((p,v)=>{const H=Ee.current,G=H==null?void 0:H.getBoundingClientRect(),K=(v==null?void 0:v.width)??(G==null?void 0:G.width)??(a?pn:Yt),he=(v==null?void 0:v.height)??(G==null?void 0:G.height)??(a?$t:l==="panel-note"?680:72);return tr({position:p,size:{width:K,height:he},viewport:et,margin:Dt})},[a,l,et]),Ln=s.useCallback(p=>{ut.current=p?Mt(p,{width:pn,height:$t}):null,Qt(ut.current)},[Mt]),ot=s.useCallback(p=>{var v;ce.current=p?Mt(p):null,Jt(ce.current),(v=o.onPositionChange)==null||v.call(o,ce.current)},[Mt,o]),Te=s.useCallback(()=>{var p;He(Math.max(0,((p=o.getModifiedElementCount)==null?void 0:p.call(o))??0))},[o]),Dn=s.useCallback(async p=>{if(p){Et(!0);try{await p()}finally{Et(!1),Te()}}},[Te]),rn=s.useCallback(async()=>{if(o.onSendPromptToGenie){Le(!1),V(!1),ye(!0),de((W==null?void 0:W.elementKey)??null),We(!1);try{await o.onSendPromptToGenie(i)}catch{}finally{ye(!1),We(!1),Le(!1),V(!1),de(null),Te()}}},[W==null?void 0:W.elementKey,i,o,Te]),zn=s.useCallback(async()=>{if(o.onAbortSendPromptToGenie){V(!1),We(!0);try{await o.onAbortSendPromptToGenie(i)}catch{}finally{We(!1)}}},[i,o]),xt=s.useCallback(()=>{nt(null),T(!1)},[T]),an=s.useCallback(()=>{nt(null),T(!0)},[T]);s.useEffect(()=>{const p=v=>{if(v.key!=="\\")return;const H=/Mac|iPhone|iPad|iPod/i.test(navigator.platform);(H?v.metaKey:v.ctrlKey)&&(v.shiftKey||v.altKey||H&&v.ctrlKey||!H&&v.metaKey||(v.preventDefault(),v.stopPropagation(),a?xt():an()))};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[a,xt,an]);const rt=s.useCallback(()=>{var p;en(!1),x(null),(p=o.onAnnotationShortcutDialogOpenChange)==null||p.call(o,!1)},[o]),yt=s.useMemo(()=>{const[p,v]=Ce.shortcuts;return p&&v&&p===v?"两个快捷键不能配置为同一个修饰键。":""},[Ce.shortcuts]),me=!a&&f!=="text-annotation"&&g.styleDesignEnabled&&l==="panel-note"&&!!i,On=on==="awake",pr=g.darkMode?"dark":"light";s.useEffect(()=>{(f==="text-annotation"||!g.styleDesignEnabled)&&l==="panel-note"&&S("bubble-card")},[f,S,l,g.styleDesignEnabled]);const gr=s.useCallback(async()=>{if(!(Ze||It)){if(On){d("sleeping");return}if(!o.onWakeGenie){Ft("warning","当前环境未配置 Genie 唤醒能力。");return}mt(!0);try{if(await o.onWakeGenie()!==!0){Ft("warning","服务未启动,无法唤醒 Genie");return}d("awake")}catch{}finally{mt(!1)}}},[On,Ze,d,o,It]),Bt=s.useCallback(p=>{Pt(v=>cn(p(v)))},[]),fr=s.useCallback(()=>{var H,G;if(yt)return;const p=cn(Ce),v=cn(((H=o.getAnnotationShortcutSettings)==null?void 0:H.call(o))??oo);ei(p,v)||(G=o.onAnnotationShortcutSettingsChange)==null||G.call(o,p),rt()},[rt,o,Ce,yt]);s.useEffect(()=>{const p=Ee.current;if(!p)return;Je(!1),Fe({velocityX:0,velocityY:0});const v=K=>{var Qn,Jn;if(a||!me){nt(null),Ln(K);return}const he=((Qn=ce.current)==null?void 0:Qn.top)??((Jn=Ee.current)==null?void 0:Jn.getBoundingClientRect().top)??K.top;ot({left:K.left,top:he})};if(a){const K=w.current;return K?ho({handleEl:K,targetEl:p,clampMargin:Dt,onPositionChange:v,moveThresholdPx:ue()?8:3,onDragStateChange:he=>{Je(he),he||Fe({velocityX:0,velocityY:0})}}):void 0}const H=[Oe.current,Me.current,y.current].filter(K=>!!K);if(H.length===0)return;const G=H.map(K=>ho({handleEl:K,targetEl:p,clampMargin:Dt,onPositionChange:v,moveThresholdPx:ue()?8:3,ignoreInteractiveChildren:!0,onDragStateChange:he=>{Je(he),he||Fe({velocityX:0,velocityY:0})},onDragMetricsChange:he=>{Fe(he)}}));return()=>{Je(!1),Fe({velocityX:0,velocityY:0}),G.forEach(K=>K())}},[ot,Ln,me,a]),s.useEffect(()=>{pt.current!=="panel-note"&&l==="panel-note"&&ot(null),pt.current=l},[ot,l]),s.useEffect(()=>{const p=()=>{tt({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[]),s.useEffect(()=>{const p=v=>{const H=ze.current;if(!H||l!=="panel-note")return;const G=H.getBoundingClientRect(),K=v.clientX>=G.left&&v.clientX<=G.right,he=v.clientY>=G.top&&v.clientY<=G.bottom;!K||!he||H.scrollHeight<=H.clientHeight||(H.scrollTop+=v.deltaY,v.cancelable&&v.preventDefault(),v.stopPropagation())};return window.addEventListener("wheel",p,{capture:!0,passive:!1}),()=>{window.removeEventListener("wheel",p,{capture:!0})}},[l]),s.useEffect(()=>(An(i),()=>{_t()}),[An,i,_t]),s.useEffect(()=>{Xe()},[i,Xe]),s.useEffect(()=>()=>{var p;(p=o.onAnnotationShortcutDialogOpenChange)==null||p.call(o,!1)},[o]);const Hn=s.useCallback(()=>{var v;const p=(v=ge.current)==null?void 0:v.querySelector("input");if(!(p instanceof HTMLInputElement)||p.disabled)return!1;p.focus({preventScroll:!0});try{p.setSelectionRange(p.value.length,p.value.length)}catch{}return!0},[]),Wn=s.useCallback(()=>{var v;const p=(v=le.current)==null?void 0:v.querySelector("textarea");if(!(p instanceof HTMLTextAreaElement)||p.disabled)return!1;p.focus({preventScroll:!0});try{p.setSelectionRange(p.value.length,p.value.length)}catch{}return!0},[]);s.useEffect(()=>{if(a||l!=="panel-note")return;const p=window.requestAnimationFrame(()=>{Wn()||I&&Hn()});return()=>{window.cancelAnimationFrame(p)}},[I,i,Wn,Hn,a,l]);const Gn=s.useCallback(async()=>{var v;await pe();const p=(v=le.current)==null?void 0:v.querySelector("textarea");p instanceof HTMLTextAreaElement&&p.blur(),ve==null||ve()},[pe,ve]);s.useEffect(()=>{a&&u(!1)},[u,a]),s.useEffect(()=>{a&&b(!1)},[b,a]),s.useEffect(()=>{a&&(Le(!1),V(!1),Ye(!1))},[a]),s.useEffect(()=>()=>{u(!1),b(!1)},[u,b]),s.useEffect(()=>{Te()},[Te]),s.useEffect(()=>{a&&$e&&rt()},[rt,$e,a]),s.useLayoutEffect(()=>{if(a)return;const p=()=>{var H;const v=(H=$.current)==null?void 0:H.getBoundingClientRect();v&&nt(G=>{const K={left:v.left,top:v.top,width:v.width,height:v.height};return G&&G.left===K.left&&G.top===K.top&&G.width===K.width&&G.height===K.height?G:K})};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[ie,i,Ae,Qe,qt,$e,fe,a,l,Be]),s.useEffect(()=>{if(Ve===null)return;const p=Q.current[Ve];if(!p)return;const v=window.requestAnimationFrame(()=>{p.focus({preventScroll:!0})});return()=>{window.cancelAnimationFrame(v)}},[Ve]),s.useImperativeHandle(r,()=>({setTarget(p){k(p)},setTab(p){dt.current=p},getTab(){return dt.current},refresh(){M(),Xe(),Te()},setHistory(p,v){gt(Math.max(0,Math.floor(p))),jt(Math.max(0,Math.floor(v))),Te()},getPosition(){return me?ce.current:ut.current},setPosition(p){ot(p)},enterAnnotationInput(p="bubble-card"){a&&xt(),S(p),M()}}),[ot,M,k,S,Xe,xt,me,Te,a]);const Fn=(Xn=o.getCopyPromptBlockReason)==null?void 0:Xn.call(o),mr=!o.onCopyPrompt||!!Fn,Y=Xi({toolMinimized:a,visualState:on,waking:Ze,sending:Mn,interrupting:ae,hasReusableConversation:nn,pageTaskRunning:It,pageTaskSessionReady:ur,currentTaskRunning:Ue,currentTaskSessionReady:cr,canInterrupt:_n,onSendPromptToGenie:o.onSendPromptToGenie,getGenieBridgeConnected:o.getGenieBridgeConnected,getSendPromptToGenieBlockReason:()=>{var p;return(p=o.getSendPromptToGenieBlockReason)==null?void 0:p.call(o,i)}}),hr=_n,xe=Y.robotState==="awake"||Y.robotState==="working",br=Ge&&xe?"dragging":Y.robotState==="waking"?on:Y.robotState,At=(W==null?void 0:W.sessionUrl)??(W!=null&&W.sessionId?`/session/${W.sessionId}`:""),xr=s.useCallback(()=>{At&&window.open(At,"_blank","noopener,noreferrer")},[At]),yr=s.useCallback(()=>{!i||!o.dismissElementGenieTaskState||o.dismissElementGenieTaskState(i)},[i,o]),wr=W?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"12px 14px",borderRadius:18,border:W.status==="error"?"1px solid rgba(239, 68, 68, 0.24)":W.status==="completed"?"1px solid rgba(34, 197, 94, 0.24)":"1px solid rgba(0, 143, 93, 0.22)",background:W.status==="error"?"rgba(127, 29, 29, 0.14)":W.status==="completed"?"rgba(20, 83, 45, 0.14)":"rgba(0, 143, 93, 0.08)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.03)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[W.status==="completed"?n.jsx(Bo,{style:{color:"#22c55e"}}):W.status==="error"?n.jsx(Ao,{style:{color:"#ef4444"}}):n.jsx(Ut,{}),n.jsx("span",{style:{fontSize:12,fontWeight:700,color:h.textPrimary},children:W.status==="pending"?"Genie 准备中":W.status==="created"?"Genie 正在修改":W.status==="completed"?"Genie 修改完成":"Genie 修改失败"})]}),n.jsxs("span",{style:{fontSize:12,lineHeight:1.6,color:h.textSecondary},children:[W.message,W.sessionId?` · Session ${W.sessionId}`:""]}),n.jsxs(De,{size:8,wrap:!0,children:[Ue?n.jsx(re,{size:"small",danger:!0,icon:n.jsx(sn,{}),disabled:!hr||ae,loading:ae,onClick:()=>{zn()},children:"中断"}):null,W.status==="error"?n.jsx(re,{size:"small",icon:n.jsx(Vr,{}),disabled:Y.sendDisabled||ie,onClick:()=>{rn()},children:"重试"}):null,At?n.jsx(re,{size:"small",icon:n.jsx(zo,{}),onClick:xr,children:"打开会话"}):null,dr?n.jsx(re,{size:"small",icon:n.jsx(Cn,{}),onClick:yr,children:"关闭提示"}):null]})]}):null,Nn=s.useMemo(()=>pa({actionRect:Ne,floatingPosition:fe,viewport:et,panelWidth:Yt,panelRight:lt,panelBottom:Lt,compactSize:it,compactWidth:a?it:pn,compactHeight:a?it:$t,margin:Dt,headerPaddingX:ai,headerPaddingY:un,controlSize:li}),[Ne,fe,a,et]),ln=ue()&&!a&&l==="bubble-card"&&!!i,vr=a?{...fe||Ne?{left:Nn.left,top:Nn.top,right:"auto",bottom:"auto"}:{right:lt,bottom:Lt,top:"auto"},position:"absolute",zIndex:gn.zIndex,width:it,height:it,maxWidth:it,borderRadius:999,pointerEvents:"auto",overflow:"visible",border:"none",background:"transparent",boxShadow:"none"}:me?{...gn,maxHeight:l==="panel-note"?"calc(100vh - 48px)":void 0,...ln?{pointerEvents:"none",opacity:0}:{},...Qe?{left:Qe.left,top:Qe.top,right:"auto",bottom:"auto"}:{right:lt,bottom:Lt,top:"auto"}}:{...gn,width:"fit-content",height:"auto",maxWidth:"calc(100vw - 32px)",border:"none",background:"transparent",boxShadow:"none",pointerEvents:ln?"none":"auto",overflow:"visible",opacity:ln?0:1,...fe?{left:fe.left,top:fe.top,right:"auto",bottom:"auto"}:{right:lt,bottom:Lt,top:"auto"}},Sr=o.showCopyPromptAction!==!1&&!xe?n.jsx(Pe,{title:Fn??"复制 Prompt",icon:n.jsx(to,{}),awake:xe,disabled:ie||mr,onClick:()=>{Dn(o.onCopyPrompt)}}):null,$n=ie||Y.sendDisabled,Cr=ie||Y.interruptDisabled,Tr=Y.sendVisible?Y.sendRequiresConfirm?$n?n.jsx(Pe,{title:Y.sendTitle,icon:n.jsx(Nt,{}),awake:xe,loading:Y.sendLoading,disabled:!0}):n.jsx(no,{title:"让 Genie 修改",description:"确认后 Genie 会根据你的编辑修改当前页面。",arrow:{pointAtCenter:!0},open:Zt,onOpenChange:p=>{Ue||Le(p)},okText:"开始修改",cancelText:"取消",okButtonProps:{loading:Mn},onConfirm:()=>rn(),children:n.jsx("span",{style:{display:"inline-flex"},children:n.jsx(Pe,{title:Y.sendTitle,icon:n.jsx(Nt,{}),awake:xe,loading:Y.sendLoading})})}):n.jsx(Pe,{title:Y.sendTitle,icon:n.jsx(Nt,{}),awake:xe,loading:Y.sendLoading,disabled:$n,onClick:()=>{rn()}}):null,kr=Y.interruptVisible?Cr?n.jsx(Pe,{title:Y.interruptTitle,icon:n.jsx(sn,{}),awake:xe,loading:Y.interruptLoading,disabled:!0}):n.jsx(no,{title:"停止 Genie 修改",description:"确认后 Genie 会停止当前修改。",arrow:{pointAtCenter:!0},open:Rt,onOpenChange:p=>{ae||V(p)},okText:"确认停止",cancelText:"取消",okButtonProps:{danger:!0,loading:Y.interruptLoading},onConfirm:()=>zn(),children:n.jsx("span",{style:{display:"inline-flex"},children:n.jsx(Pe,{title:Y.interruptTitle,icon:n.jsx(sn,{}),awake:xe,loading:Y.interruptLoading})})}):null,jr=ie||It||Ue||Ae<=0||!o.onClearEdits,Er=n.jsx(Pe,{title:"清空全部编辑",icon:n.jsx(xn,{}),awake:xe,disabled:jr,onClick:()=>{Dn(()=>{var p;return(p=o.onClearEdits)==null?void 0:p.call(o)})}}),Rr=[{key:"genie-agent",label:"执行 agent",control:n.jsx(we,{allowClear:!0,placeholder:"默认",value:g.genieAgent??void 0,options:[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"opencode",label:"OpenCode"}],onChange:p=>{m({...g,genieAgent:p??null})},style:{width:124}})},...f==="text-annotation"?[]:[{key:"design-tool",label:"微调工具",control:n.jsx(we,{allowClear:!0,placeholder:"未设置",value:g.designAdjustmentTool??void 0,options:[{value:"figma",label:"Figma"},{value:"axure",label:"Axure"},{value:"pencil",label:"Pencil"}],onChange:p=>{m({...g,designAdjustmentTool:p??null})},style:{width:124}})},{key:"style-design",label:"样式编辑",control:n.jsx(at,{checked:g.styleDesignEnabled,onChange:p=>{m({...g,styleDesignEnabled:p})}})}],{key:"install-skill",label:"AI 处理 skills",control:n.jsxs(re,{type:"text",size:"small",style:{padding:"0 4px",color:h.textSecondary,fontSize:13,width:56,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4},onClick:async()=>{const p=["请帮忙安装自动处理技能。","","技能源文件路径skills/genie-editor-cli-workflow/","","请根据你的常规技能安装规则,将 skills/genie-editor-cli-workflow/ 目录下的所有文件(包括 SKILL.md 和 references/ 文件夹)安装到当前项目中。"].join(`
`);try{await navigator.clipboard.writeText(p),Ft("success","已复制安装提示词")}catch{Ft("error","复制失败")}Ye(!1)},children:[n.jsx("span",{children:"安装"}),n.jsx(to,{style:{fontSize:13}})]})},{key:"keyboard-shortcuts",label:"快捷键",control:n.jsxs(re,{type:"text",size:"small",style:{padding:"0 4px",color:h.textSecondary,fontSize:13,width:56,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4},onClick:()=>{tn(!0),Ye(!1)},children:[n.jsx("span",{children:"查看"}),n.jsx("span",{style:{fontSize:13,fontFamily:"inherit"},children:"⌘"})]})},{key:"dark-mode",label:"暗黑模式",control:n.jsx(at,{checked:g.darkMode,onChange:p=>{m({...g,darkMode:p})}})}].filter(p=>ue()?p.key==="genie-agent"||p.key==="dark-mode":!0),Pr=n.jsx(De,{direction:"vertical",size:12,onPointerDownCapture:p=>p.stopPropagation(),style:{width:238},children:Rr.map(p=>n.jsxs(Yr,{align:"center",justify:"space-between",gap:12,children:[n.jsx("span",{style:{fontSize:13,color:h.textPrimary,whiteSpace:"nowrap",flex:"0 0 auto"},children:p.label}),n.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto"},children:p.control})]},p.key))}),Ir=n.jsx(Do,{trigger:"click",placement:"bottomRight",open:ie?!1:Re,onOpenChange:p=>{ie||Ye(p)},arrow:!1,content:Pr,children:n.jsx("span",{style:{display:"inline-flex"},children:n.jsx(Pe,{title:"设置",icon:n.jsx(Kr,{}),awake:xe,disabled:ie})})}),_r=n.jsx(Qi,{awake:xe,dragHandleRef:Oe,fullWidth:me,style:{alignSelf:me?"stretch":"flex-start",width:me?"calc(100% - 16px)":"fit-content",maxWidth:me?"calc(100% - 16px)":"calc(100% - 8px)",margin:me?"6px 8px 8px":"0"},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:me?"space-between":"flex-start",gap:8,width:me?"100%":"auto",minWidth:0},children:[n.jsxs(De,{size:4,children:[n.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:n.jsx(aa,{state:br,size:si,title:Y.robotTitle,disabled:Y.robotDisabled,loading:Y.robotLoading,themeMode:pr,dragVelocity:{x:ht.velocityX,y:ht.velocityY},onClick:()=>{gr()}})}),Tr,kr]}),n.jsxs(De,{size:4,children:[n.jsx("div",{style:{width:1,height:18,marginInline:6,background:h.divider,borderRadius:999,flex:"0 0 auto"}}),Sr,Er,Ir,n.jsx("div",{ref:$,style:{display:"inline-flex"},children:n.jsx(Pe,{title:"关闭工具",icon:n.jsx(Cn,{}),awake:xe,onClick:an})})]})]})}),Mr=n.jsxs("button",{className:"we-runtime-prop-panel__minimized-trigger we-runtime-prop-panel__drag-handle",ref:w,type:"button","aria-label":"开启编辑",title:"开启编辑",onClick:xt,style:{position:"absolute",inset:0,width:"100%",height:"100%",overflow:"visible",border:"none",background:"transparent",color:h.textPrimary,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,touchAction:"none",pointerEvents:a?"auto":"none",opacity:a?1:0,transform:a?"scale(1)":"scale(0.9)",transition:"opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 220ms ease"},children:[n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",inset:0,borderRadius:999,background:h.toolbarShellBorder,boxShadow:h.shadowCompact}}),n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",inset:1,borderRadius:999,background:h.surface,boxShadow:h.toolbarShellInset}}),n.jsx("span",{style:{position:"relative",zIndex:1,width:32,height:32,display:"inline-flex",alignItems:"center",justifyContent:"center",color:h.textSecondary,transition:"background-color 220ms ease, color 220ms ease, transform 220ms ease"},children:n.jsx(Ut,{})}),Ae>0?n.jsx("span",{style:{position:"absolute",top:-6,right:-6,minWidth:18,height:18,paddingInline:5,borderRadius:999,background:h.accent,color:"#FFFFFF",fontSize:10,fontWeight:700,lineHeight:"18px",boxShadow:`0 6px 14px ${di}`,pointerEvents:"none",zIndex:2},children:Ae>99?"99+":Ae}):null]});return n.jsxs("div",{ref:Ee,"data-we-selection-lock-root":"true",style:{...vr,transition:Ge?"none":"left 220ms cubic-bezier(0.2, 0.8, 0.2, 1), top 220ms cubic-bezier(0.2, 0.8, 0.2, 1), width 220ms cubic-bezier(0.2, 0.8, 0.2, 1), height 220ms cubic-bezier(0.2, 0.8, 0.2, 1), max-height 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-radius 220ms ease, border-color 220ms ease, background-color 220ms ease",willChange:Ge?"left, top":void 0},onPointerDownCapture:()=>{b(!0)},onFocusCapture:()=>{b(!0)},onPointerEnter:()=>{a||u(!0)},onPointerLeave:()=>u(!1),children:[n.jsx("style",{children:hi}),me?n.jsxs("div",{ref:ze,style:mi,"aria-hidden":!1,children:[n.jsxs("div",{ref:Me,className:"we-runtime-prop-panel__drag-handle",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:`${Math.max(4,un-2)}px 0 ${Math.max(4,un-3)}px`,borderBottom:`1px solid ${h.divider}`,marginBottom:8},children:[n.jsxs(De,{size:8,wrap:!0,style:{rowGap:6},children:[n.jsx(Ie,{title:Be>0?`撤销 (${Be})`:"撤销",icon:n.jsx(Ur,{}),tone:"dark",disabled:ie||Be<=0||!o.onUndo,onClick:()=>{var p;return(p=o.onUndo)==null?void 0:p.call(o)}}),n.jsx(Ie,{title:"清空当前编辑",icon:n.jsx(xn,{}),tone:"dark",disabled:!i||Ue,onClick:()=>{qe()}})]}),n.jsx(De,{size:8,wrap:!0,style:{rowGap:6},children:n.jsx(Ie,{title:"简易模式",icon:n.jsx(Xr,{}),tone:"dark",onClick:()=>S("bubble-card")})})]}),n.jsx("div",{ref:y,className:"we-runtime-prop-panel__drag-handle","aria-hidden":"true",style:{display:"flex",alignItems:"center",width:"100%",height:14,marginBottom:4,cursor:"grab"}}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0 6px"},onPointerDownCapture:p=>p.stopPropagation(),children:[wr,I?n.jsx("div",{ref:ge,children:n.jsx(Z,{value:D,allowClear:!0,placeholder:Wo,style:{borderRadius:8,background:h.surfaceMuted,borderColor:h.border,color:h.textPrimary,boxShadow:"none"},onChange:p=>{B(p.target.value)},onPressEnter:p=>{p.preventDefault(),_()},onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),L())},onBlur:()=>{E&&_()}})}):null,n.jsxs("div",{ref:le,children:[n.jsx(Z.TextArea,{value:J,disabled:!i||!z,allowClear:!0,rows:2,style:{borderRadius:8,background:h.surfaceMuted,borderColor:h.border,color:h.textPrimary,boxShadow:"none"},placeholder:Go,onChange:p=>{ct(p.target.value)},onPasteCapture:C,onPressEnter:p=>{p.preventDefault(),Gn()},onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),Gn())},onBlur:p=>{var H;const v=p.relatedTarget;v instanceof Node&&((H=le.current)!=null&&H.contains(v))||je&&pe()}}),F.length>0?n.jsx("div",{style:{marginTop:8},children:n.jsx(er,{images:F,onRemoveImage:p=>{j(p)}})}):null]})]}),n.jsx(_a,{target:i,transactionManager:o.transactionManager,tokensService:o.tokensService,disabled:ie,refreshKey:A,onRefreshRequest:()=>{Xe(),Te()}})]}):null,a?Mr:_r,n.jsx(kt,{title:"语音快捷键",open:$e,centered:!0,getContainer:!1,maskClosable:!0,onCancel:rt,footer:[n.jsx(re,{onClick:rt,children:"取消"},"cancel"),n.jsx(re,{type:"primary",disabled:!!yt,onClick:fr,children:"保存"},"save")],children:n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"12px 0"},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:13,fontWeight:600,color:h.textPrimary},children:"启用语音快捷键"}),n.jsx("div",{style:Tt,children:"开启后才会响应长按修饰键和鼠标中键。"})]}),n.jsx(at,{checked:Ce.enabled,onChange:p=>{Bt(v=>({...v,enabled:p}))}})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"12px 0",borderTop:`1px solid ${h.border}`,borderBottom:`1px solid ${h.border}`},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:13,fontWeight:600,color:h.textPrimary},children:"启用鼠标中键监听"}),n.jsx("div",{style:Tt,children:"鼠标中键单击会直接进入标注气泡卡片。"})]}),n.jsx(at,{checked:Ce.middleClickEnabled,onChange:p=>{Bt(v=>({...v,middleClickEnabled:p}))}})]}),n.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[0,1].map(p=>n.jsx(Xa,{ref:v=>{Q.current[p]=v},label:`快捷键 ${p+1}`,value:Ce.shortcuts[p]??null,capturing:Ve===p,onActivate:()=>x(p),onCapture:v=>{Bt(H=>{const G=[...H.shortcuts];return G[p]=v,{...H,shortcuts:G}}),x(null)},onCancelCapture:()=>x(null),onClear:()=>{Bt(v=>{const H=[...v.shortcuts];return H[p]=null,{...v,shortcuts:H}})}},p))}),n.jsxs("div",{style:Tt,children:["仅支持 Shift / Alt / Ctrl / Command长按 ",Zr,"ms 触发。"]}),yt?n.jsx("div",{style:{fontSize:12,color:h.textDanger},children:yt}):null]})}),n.jsx(kt,{title:"快捷键",open:bt,centered:!0,getContainer:!1,maskClosable:!0,onCancel:()=>tn(!1),footer:[n.jsx(re,{type:"primary",onClick:()=>tn(!1),children:"知道了"},"close")],children:n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[{keys:[`${(Kn=navigator.platform)!=null&&Kn.includes("Mac")?"⌘":"Ctrl"} + \\`],label:"开启 / 关闭工具",desc:"在任意状态下切换编辑工具的展开与收起,等同于工具栏的关闭和展开按钮"},{keys:["Enter","Esc"],label:"保存并关闭气泡卡片",desc:"在气泡卡片的输入框中按下,保存当前标注内容并关闭卡片"},{keys:[`${(qn=navigator.platform)!=null&&qn.includes("Mac")?"⌘":"Ctrl"} + Enter`],label:"快捷执行并关闭",desc:"保存当前标注并立即发送给 Genie 执行,同时关闭气泡卡片"},{keys:[`${(Zn=navigator.platform)!=null&&Zn.includes("Mac")?"⌘":"Ctrl"} + V`],label:"粘贴图片或文案",desc:"Genie 开启时,在气泡卡片或待选框中可直接粘贴图片和文案"}].map(p=>n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16,padding:"14px 0",borderBottom:`1px solid ${h.border}`},children:[n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:13,fontWeight:600,color:h.textPrimary},children:p.label}),n.jsx("div",{style:{fontSize:12,color:h.textMuted,marginTop:2},children:p.desc})]}),n.jsx("div",{style:{display:"flex",gap:4,flexShrink:0,alignItems:"center",paddingTop:2},children:p.keys.map(v=>n.jsx("kbd",{style:{display:"inline-block",padding:"2px 8px",fontSize:12,fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:500,lineHeight:"20px",color:h.textPrimary,background:h.surfaceMuted,border:`1px solid ${h.border}`,borderRadius:6,whiteSpace:"nowrap"},children:v},v))})]},p.label))})})]})}),sr=s.forwardRef((t,e)=>{const[r,o]=s.useState(t.defaultValue??""),[i,l]=s.useState(""),a=s.useRef(null);s.useImperativeHandle(e,()=>({getValue:()=>r,setError:c=>{l(c)},focus:c=>{const d=a.current;d&&(d.focus(),c&&d.select())}}),[r]);const g=c=>{o(c.target.value),i&&l("")},f=t.multiline?s.createElement(Z.TextArea,{ref:c=>{var d;a.current=((d=c==null?void 0:c.resizableTextArea)==null?void 0:d.textArea)??null},value:r,rows:t.rows??8,readOnly:t.readOnly,placeholder:t.placeholder,onChange:g}):s.createElement(Z,{ref:c=>{a.current=(c==null?void 0:c.input)??null},value:r,readOnly:t.readOnly,placeholder:t.placeholder,onChange:g});return s.createElement("div",{style:{display:"grid",gap:10}},t.content?s.createElement("div",{style:{whiteSpace:"pre-line"}},t.content):null,t.label?s.createElement("div",{style:{fontSize:12,fontWeight:600,color:"rgba(0,0,0,0.88)"}},t.label):null,f,i?s.createElement("div",{style:{fontSize:12,color:"#ff4d4f"}},i):null)});sr.displayName="PromptBridgeContent";function dl(){const t=_o.useApp();s.useEffect(()=>(ro({confirm:({title:e,content:r,okText:o,cancelText:i,okType:l,getContainer:a,onOk:g,onCancel:f})=>{t.modal.confirm({title:e,content:r,okText:o,cancelText:i,okType:l,centered:!0,closable:!0,maskClosable:!0,getContainer:a,onOk:g,onCancel:f})},alert:({title:e,content:r,okText:o,okType:i,getContainer:l,onOk:a})=>{t.modal.confirm({title:e,content:r,okText:o,okType:i,centered:!0,closable:!0,maskClosable:!0,getContainer:l,cancelButtonProps:{style:{display:"none"}},onOk:a})},prompt:({title:e,content:r,label:o,defaultValue:i,placeholder:l,okText:a,cancelText:g,readOnly:f,multiline:c,rows:d,selectOnOpen:m,validate:u,getContainer:b,onOk:S,onCancel:T})=>{const k=s.createRef(),M=t.modal.confirm({title:e,content:s.createElement(sr,{ref:k,content:r,label:o,defaultValue:i,placeholder:l,readOnly:f,multiline:c,rows:d}),okText:a,cancelText:g,centered:!0,closable:!0,maskClosable:!0,getContainer:b,cancelButtonProps:g?void 0:{style:{display:"none"}},onOk:()=>{var D,E,B;const I=((D=k.current)==null?void 0:D.getValue())??i??"";if(!f){const L=(u==null?void 0:u(I))??null;if(L)return(E=k.current)==null||E.setError(L),(B=k.current)==null||B.focus(!!m),Promise.reject()}S(I)},onCancel:T});return window.setTimeout(()=>{var I;(I=k.current)==null||I.focus(!!m)},0),M},message:({type:e,content:r})=>{t.message.open({type:e,content:r,duration:2})}}),()=>{ro(null)}),[t])}export{oo as D,aa as G,sl as P,nl as W,ol as a,te as b,ll as c,cl as d,il as e,el as f,rl as g,tl as h,ue as i,Mi as j,Ft as n,al as p,cn as s,dl as u};