Files
GenericAgent/frontends/desktop/dist/assets/ServicesPage-DrjRw530.js
T

5 lines
39 KiB
JavaScript

import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-tfiFK9EG.js";import{T as He,a as Ve,b as ce}from"./index-DwVcZP0M.js";import{_ as he,t as Fe,c as Pe,I as Ie,a as $e,u as Be,b as q,d as z,M as fe,e as xe,i as be,f as Y,E as ye,T as ee,g as Ae,h as de}from"./main-Knf6L_en.js";import{B as _,c as Q,I as Ke}from"./index-Bpi3BHKj.js";import{S as G}from"./index-D_sWIqse.js";import{I as ve}from"./IconFile-CgfQSwGI.js";import"./WindowsTitlebar-CrkUa1UM.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(x=>{R.style[x]=r[x]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompositionUpdate(t)},this.resizeTextarea=()=>{var t;const{height:n}=this.getStates(),{rows:a,autosize:o}=this.getProps(),r=this._adapter.getRef(),l=Ye(r);if(!l)return;const[c,g]=o!==null&&typeof o=="object"?[(t=o==null?void 0:o.minRows)!==null&&t!==void 0?t:a,o==null?void 0:o.maxRows]:[a],m=Ze(l,r.value||r.placeholder||"x",c,g);if(n!==m){this._adapter.notifyHeightUpdate(m),r.style.height=`${m}px`;return}}}destroy(){}handleValueChange(e){this._adapter.setValue(e)}handleChange(e,t){const{composition:n}=this._adapter.getProps();let a=e;if(n&&this.compositionEnter){this._adapter.setValue(a);return}this.compositionEnter||(a=this.getNextValue(a)),this._changeValue(a,t)}handleVisibleMinLength(e){const{minLength:t,getValueLength:n}=this._adapter.getProps(),{minLength:a}=this._adapter.getStates();if(he(t)&&t>=0&&K(n)&&oe(e)){const o=n(e);if(o<t){const r=e.length+(t-o);r!==a&&this._adapter.setMinLength(r)}else a!==t&&this._adapter.setMinLength(t)}}handleVisibleMaxLength(e){const{maxLength:t,getValueLength:n}=this._adapter.getProps();if(he(t)&&t>=0&&oe(e)){if(K(n)){if(n(e)>t)return console.warn("[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit"),this.handleTruncateValue(e,t)}else if(e.length>t)return console.warn("[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit"),e.slice(0,t);return e}}handleTruncateValue(e,t){const{getValueLength:n}=this._adapter.getProps();return Fe({value:e,maxLength:t,getValueLength:n})}handleFocus(e){const{value:t}=this.getStates();this._adapter.toggleFocusing(!0),this._adapter.notifyFocus(t,e)}handleBlur(e){const{value:t}=this.getStates(),{maxLength:n}=this.getProps();let a=t;n&&(a=this.handleVisibleMaxLength(t),a!==t&&(this._isControlledComponent()||this._adapter.setValue(a),this._adapter.notifyChange(a,e))),this._adapter.toggleFocusing(!1),this._adapter.notifyBlur(a,e)}handleKeyDown(e){const{disabledEnterStartNewLine:t}=this.getProps();t&&e.key==="Enter"&&!e.shiftKey&&e.preventDefault(),this._adapter.notifyKeyDown(e),e.keyCode===13&&this._adapter.notifyPressEnter(e)}handleMouseEnter(e){this._adapter.toggleHovering(!0)}handleMouseLeave(e){this._adapter.toggleHovering(!1)}isAllowClear(){const{value:e,isFocus:t,isHover:n}=this._adapter.getStates(),{showClear:a,disabled:o,readonly:r}=this._adapter.getProps();return e&&a&&!o&&(t||n)&&!r}handleClear(e){const{isFocus:t}=this.getStates();this._isControlledComponent("value")?this._adapter.setState({isFocus:!1}):this._adapter.setState({value:"",isFocus:!1}),t&&this._adapter.notifyBlur("",e),this._adapter.notifyChange("",e),this._adapter.notifyClear(e),this.stopPropagation(e)}handleClick(e){const{disabled:t,readonly:n}=this._adapter.getProps(),{isFocus:a}=this._adapter.getStates();t||n||a||this._adapter.isEventTarget(e)&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handleCounterClick(e){const{disabled:t,readonly:n}=this._adapter.getProps(),{isFocus:a}=this._adapter.getStates();t||n||a||(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}}var Qe=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(s);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(s,n[a])&&(t[n[a]]=s[n[a]]);return t};const y=Pe.PREFIX;class ae extends Te{constructor(e){super(e),this.handleNativeResize=n=>{var a,o;if(this.props.autosize)return;const r=n&&n[0],l=r&&r.contentRect;if(!l)return;const c=l.width,g=l.height;if(!this.nativeResizeObservedOnce){this.nativeResizeObservedOnce=!0,this.lastNativeSize={width:c,height:g};return}const m=this.lastNativeSize;m&&m.width===c&&m.height===g||(this.lastNativeSize={width:c,height:g},(o=(a=this.props).onResize)===null||o===void 0||o.call(a,{height:g,width:c}))},this.handleClear=n=>{this.foundation.handleClear(n)},this.handleClick=n=>{this.foundation.handleClick(n)},this.handleCounterClick=n=>{this.foundation.handleCounterClick(n)},this.setRef=n=>{this.libRef.current=n;const{forwardRef:a}=this.props;typeof a=="function"?a(n):a&&typeof a=="object"&&(a.current=n)},this.handleTextAreaScroll=n=>{const{showLineNumber:a}=this.props;a&&this.lineNumberRef.current&&requestAnimationFrame(()=>{const o=this.lineNumberRef.current;o&&(o.scrollTop=n.target.scrollTop)})},this.getTextareaLineHeightPx=n=>{const a=window.getComputedStyle(n),o=a.lineHeight,r=parseFloat(a.fontSize)||14;if(!o||o==="normal")return r*1.5;const l=parseFloat(o);return Number.isFinite(l)&&l>0?l:r*1.5},this.calculateWrappedLines=(n,a)=>{if(!n)return 1;const o=window.getComputedStyle(a),l=document.createElement("canvas").getContext("2d");if(!l)return 1;const c=o.fontSize,g=o.fontFamily;l.font=`${c} ${g}`;const m=parseFloat(o.paddingLeft)||0,w=parseFloat(o.paddingRight)||0,x=a.clientWidth-m-w;if(x<=0)return 1;const C=l.measureText(n).width,k=Math.ceil(C/x);return Math.max(1,k)};const t="value"in e?e.value:e.defaultValue;this.state={value:t,isFocus:!1,isHover:!1,height:0,minLength:e.minLength,cachedValue:e.value,textareaWidth:0,textareaHeight:0},this.focusing=!1,this.foundation=new ne(this.adapter),this.lineNumberResizeObserver=null,this.libRef=v.createRef(),this.lineNumberRef=v.createRef(),this.throttledResizeTextarea=re(this.foundation.resizeTextarea,10),this.throttledNotifyNativeResize=re(this.handleNativeResize,10),this.nativeResizeObservedOnce=!1,this.lastNativeSize=null}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:e=>this.setState({value:e},()=>{this.props.autosize&&this.foundation.resizeTextarea()}),getRef:()=>this.libRef.current,toggleFocusing:e=>this.setState({isFocus:e}),toggleHovering:e=>this.setState({isHover:e}),notifyChange:(e,t)=>{this.props.onChange(e,t)},notifyClear:e=>this.props.onClear(e),notifyBlur:(e,t)=>this.props.onBlur(t),notifyFocus:(e,t)=>this.props.onFocus(t),notifyKeyDown:e=>{this.props.onKeyDown(e)},notifyHeightUpdate:e=>{this.setState({height:e}),this.props.onResize({height:e})},notifyPressEnter:e=>{this.props.onEnterPress&&this.props.onEnterPress(e)},notifyCompositionStart:e=>this.props.onCompositionStart(e),notifyCompositionEnd:e=>this.props.onCompositionEnd(e),notifyCompositionUpdate:e=>this.props.onCompositionUpdate(e),setMinLength:e=>this.setState({minLength:e}),focusInput:()=>{const e=this.libRef&&this.libRef.current;e&&e.focus()},isEventTarget:e=>e&&e.target===e.currentTarget})}static getDerivedStateFromProps(e,t){const n={};return e.value!==t.cachedValue&&(n.value=e.value,n.cachedValue=e.value),n}componentDidMount(){if(this.props.showLineNumber&&this.libRef.current&&typeof globalThis.ResizeObserver<"u"){const e=this.libRef.current;this.setState({textareaWidth:e.clientWidth,textareaHeight:e.clientHeight}),this.lineNumberResizeObserver=new globalThis.ResizeObserver(t=>{for(const n of t){const a=n.contentRect.width,o=n.contentRect.height;this.setState({textareaWidth:a,textareaHeight:o})}}),this.lineNumberResizeObserver.observe(e)}}componentWillUnmount(){var e,t,n,a;this.throttledResizeTextarea&&((t=(e=this.throttledResizeTextarea)===null||e===void 0?void 0:e.cancel)===null||t===void 0||t.call(e),this.throttledResizeTextarea=null),this.throttledNotifyNativeResize&&((a=(n=this.throttledNotifyNativeResize)===null||n===void 0?void 0:n.cancel)===null||a===void 0||a.call(n),this.throttledNotifyNativeResize=null),this.lineNumberResizeObserver&&(this.lineNumberResizeObserver.disconnect(),this.lineNumberResizeObserver=null)}componentDidUpdate(e,t){if((this.props.value!==e.value||this.props.placeholder!==e.placeholder)&&this.props.autosize&&this.foundation.resizeTextarea(),this.props.showLineNumber!==e.showLineNumber)if(this.props.showLineNumber&&this.libRef.current&&typeof globalThis.ResizeObserver<"u"){const n=this.libRef.current;this.setState({textareaWidth:n.clientWidth,textareaHeight:n.clientHeight}),this.lineNumberResizeObserver||(this.lineNumberResizeObserver=new globalThis.ResizeObserver(a=>{for(const o of a){const r=o.contentRect.width,l=o.contentRect.height;this.setState({textareaWidth:r,textareaHeight:l})}})),this.lineNumberResizeObserver.observe(n)}else this.lineNumberResizeObserver&&(this.lineNumberResizeObserver.disconnect(),this.lineNumberResizeObserver=null)}renderClearBtn(){const{showClear:e}=this.props,t=this.foundation.isAllowClear(),n=D(`${y}-clearbtn`,{[`${y}-clearbtn-hidden`]:!t});return e?v.createElement("div",{className:n,onClick:this.handleClear},v.createElement(Ie,null)):null}renderCounter(){let e,t,n,a;const{showCounter:o,maxCount:r,getValueLength:l}=this.props;if(o||r){const{value:c}=this.state;t=c?K(l)?l(c):c.length:0,n=r||null,a=D(`${y}-textarea-counter`,{[`${y}-textarea-counter-exceed`]:t>n}),e=v.createElement("div",{className:a,onClick:this.handleCounterClick},t,n?"/":null,n)}else e=null;return e}renderLineNumbers(){const{showLineNumber:e,lineNumberStart:t=1,lineNumberClassName:n,lineNumberStyle:a}=this.props;if(!e)return null;const{value:o,textareaWidth:r,textareaHeight:l}=this.state,c=this.libRef.current,g=o?o.split(`
`):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,x=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:x},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:x,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:h,lineNumberStart:d,lineNumberClassName:b,lineNumberStyle:M,composition:U}=e,$=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:B,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:h,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:$e(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe($,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:B??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),h?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join(`
`)).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[s]);return i.jsxs("div",{className:`ga-log-tail ${t??""}`,children:[i.jsx("button",{type:"button",className:`ga-log-tail-copy ${o?"copied":""}`,onClick:c,title:"Copy",children:o?"✓":"⎘"}),i.jsx("div",{ref:n,className:"ga-log-tail-scroll",onScroll:l,children:s===null?i.jsx("p",{className:"ga-log-tail-empty",children:"…"}):s.length===0?i.jsx("p",{className:"ga-log-tail-empty",children:e}):i.jsx("pre",{className:"ga-log-tail-pre",children:s.map((g,m)=>i.jsxs("span",{className:g.startsWith("=====")?"ga-log-separator":void 0,children:[g,`
`]},m))})})]})}function Ce(s,e){Be.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(x=>x.fetchMykey),a=z(x=>x.saveMykey),o=z(x=>x.mykeyContent),r=z(x=>x.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const x=await a(l);m(!1),x?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:x=>c(x),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb6500'/%3e%3c/g%3e%3cmask%20id='mask1_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask1_338_13245)'%3e%3cpath%20d='M37.057%2028.448a2%202%200%200%200-.58%201.215%206.2%206.2%200%200%201-1.918%203.454.484.484%200%201%200%20.738.616%206.2%206.2%200%200%201%203.725-1.91%202.02%202.02%200%201%200-1.96-3.376z'%20fill='%230082ef'/%3e%3c/g%3e%3cpath%20d='M31.366%2022.75a2.02%202.02%200%200%200%201.215%203.435%206.2%206.2%200%200%201%203.454%201.918.483.483%200%200%200%20.829-.27.48.48%200%200%200-.212-.468%206.2%206.2%200%200%201-1.911-3.726%202.02%202.02%200%200%200-3.375-.889'%20fill='%232dbc00'/%3e%3cmask%20id='mask2_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask2_338_13245)'%3e%3cpath%20d='m30.374%2025.907-.037.037a6.2%206.2%200%200%201-3.78%201.978%202.007%202.007%200%200%200-.895%203.374%202.02%202.02%200%200%200%203.435-1.216%206.2%206.2%200%200%201%201.923-3.453.484.484%200%200%200-.646-.72'%20fill='%23fc0'/%3e%3c/g%3e%3cmask%20id='mask3_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask3_338_13245)'%3e%3cpath%20d='M18.17%208.471c-3.624.4-6.908%201.948-9.266%204.367-.938.956-1.7%202.032-2.262%203.182a11.08%2011.08%200%200%200%20.78%2011.188c.64.968%201.693%202.178%202.654%203.037l-.435%203.423-.048.145c-.012.042-.012.09-.018.133l-.012.108.012.11a1.1%201.1%200%200%200%201.657.852h.018l.067-.049%201.04-.52%203.102-1.56a16%2016%200%200%200%204.537.623c1.897.004%203.78-.323%205.564-.968a2.014%202.014%200%200%201-1.373-2.11%2013.7%2013.7%200%200%201-5.721.568l-.309-.042a14%2014%200%200%201-2.056-.43%201.4%201.4%200%200%200-1.1.116l-.085.042-2.552%201.5-.109.066c-.06.036-.09.048-.12.048a.176.176%200%200%201-.164-.181l.097-.393.115-.43.181-.707.212-.787a1.07%201.07%200%200%200-.387-1.19%2011.2%2011.2%200%200%201-2.577-2.686%208.73%208.73%200%200%201-.629-8.818c.46-.92%201.065-1.773%201.815-2.54%201.935-1.997%204.657-3.267%207.669-3.593a14.3%2014.3%200%200%201%203.132%200c2.994.344%205.704%201.633%207.627%203.617a10%2010%200%200%201%201.796%202.551%208.7%208.7%200%200%201%20.901%203.84c0%20.14-.012.279-.018.412a2.015%202.015%200%200%201%202.48.29l.09.109a11%2011%200%200%200-1.1-5.733%2012.3%2012.3%200%200%200-2.238-3.182%2015.18%2015.18%200%200%200-9.229-4.397%2017%2017%200%200%200-3.739-.01'%20fill='%230082ef'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_338_13245'%3e%3cpath%20fill='%23fff'%20d='M0%200h46v46H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",it="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='64%2064%20896%20896'%20fill='%233089F2'%3e%3cpath%20d='M573.7%20252.5C422.5%20197.4%20201.3%2096.7%20201.3%2096.7c-15.7-4.1-17.9%2011.1-17.9%2011.1-5%2061.1%2033.6%20160.5%2053.6%20182.8%2019.9%2022.3%20319.1%20113.7%20319.1%20113.7S326%20357.9%20270.5%20341.9c-55.6-16-37.9%2017.8-37.9%2017.8%2011.4%2061.7%2064.9%20131.8%20107.2%20138.4%2042.2%206.6%20220.1%204%20220.1%204s-35.5%204.1-93.2%2011.9c-42.7%205.8-97%2012.5-111.1%2017.8-33.1%2012.5%2024%2062.6%2024%2062.6%2084.7%2076.8%20129.7%2050.5%20129.7%2050.5%2033.3-10.7%2061.4-18.5%2085.2-24.2L565%20743.1h84.6L603%20928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8%20496.1%20829%20433.8l.6-1h-.1c5-10.8%208.6-19.7%2010-25.8%2017-71.3-114.5-99.4-265.8-154.5z'%20/%3e%3c/svg%3e",ot="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTelegram%3c/title%3e%3cpath%20d='M11.944%200A12%2012%200%200%200%200%2012a12%2012%200%200%200%2012%2012%2012%2012%200%200%200%2012-12A12%2012%200%200%200%2012%200a12%2012%200%200%200-.056%200zm4.962%207.224c.1-.002.321.023.465.14a.506.506%200%200%201%20.171.325c.016.093.036.306.02.472-.18%201.898-.962%206.502-1.36%208.627-.168.9-.499%201.201-.82%201.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184%203.247-2.977%203.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793%201.14-5.061%203.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663%203.498-1.524%205.83-2.529%206.998-3.014%203.332-1.386%204.025-1.627%204.476-1.635z'/%3e%3c/svg%3e",rt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDiscord%3c/title%3e%3cpath%20d='M20.317%204.3698a19.7913%2019.7913%200%2000-4.8851-1.5152.0741.0741%200%2000-.0785.0371c-.211.3753-.4447.8648-.6083%201.2495-1.8447-.2762-3.68-.2762-5.4868%200-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077%200%2000-.0785-.037%2019.7363%2019.7363%200%2000-4.8852%201.515.0699.0699%200%2000-.0321.0277C.5334%209.0458-.319%2013.5799.0992%2018.0578a.0824.0824%200%2000.0312.0561c2.0528%201.5076%204.0413%202.4228%205.9929%203.0294a.0777.0777%200%2000.0842-.0276c.4616-.6304.8731-1.2952%201.226-1.9942a.076.076%200%2000-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077%200%2001-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743%200%2001.0776-.0105c3.9278%201.7933%208.18%201.7933%2012.0614%200a.0739.0739%200%2001.0785.0095c.1202.099.246.1981.3728.2924a.077.077%200%2001-.0066.1276%2012.2986%2012.2986%200%2001-1.873.8914.0766.0766%200%2000-.0407.1067c.3604.698.7719%201.3628%201.225%201.9932a.076.076%200%2000.0842.0286c1.961-.6067%203.9495-1.5219%206.0023-3.0294a.077.077%200%2000.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061%200%2000-.0312-.0286zM8.02%2015.3312c-1.1825%200-2.1569-1.0857-2.1569-2.419%200-1.3332.9555-2.4189%202.157-2.4189%201.2108%200%202.1757%201.0952%202.1568%202.419%200%201.3332-.9555%202.4189-2.1569%202.4189zm7.9748%200c-1.1825%200-2.1569-1.0857-2.1569-2.419%200-1.3332.9554-2.4189%202.1569-2.4189%201.2108%200%202.1757%201.0952%202.1568%202.419%200%201.3332-.946%202.4189-2.1568%202.4189Z'/%3e%3c/svg%3e",lt="/assets/feishu-9hxxyz3-.svg",te={"frontends/qqapp.py":{label:"ch.qq",icon:st},"frontends/wechatapp.py":{label:"ch.wechat",icon:nt},"frontends/wecomapp.py":{label:"ch.wecom",icon:at},"frontends/dingtalkapp.py":{label:"ch.dingtalk",icon:it},"frontends/tgapp.py":{label:"ch.telegram",icon:ot},"frontends/dcapp.py":{label:"ch.discord",icon:rt},"frontends/fsapp.py":{label:"ch.lark",icon:lt}},ct=Object.fromEntries(Object.entries(te).map(([s,e])=>[s,e.label])),me=new Set(Object.keys(ct));function Ne(s){return me.has(s.id)||me.has(s.name)}function ht(){const{t:s}=q(),e=xe(),t=z(p=>p.services),n=z(p=>p.loading),a=z(p=>p.startService),o=z(p=>p.stopService),[r,l]=u.useState(new Set),[c,g]=u.useState(null),[m,w]=u.useState(!1),[x,E]=u.useState(!1),C=t.filter(Ne),k=u.useCallback(async()=>{E(!0);try{await be()}catch{W(s("err.bridge"))}finally{E(!1)}},[s]),T=u.useCallback(async p=>{l(N=>new Set([...N,p.id]));try{p.running?await o(p.id)?P(s("sys.channelStopped")):W(s("err.channelStop")):await a(p.id)?P(s("sys.channelStarted")):W(s("err.channelStart"))}finally{l(N=>{const O=new Set(N);return O.delete(p.id),O})}},[a,o,s]),H=e!=="ready";return H&&C.length===0?i.jsxs("div",{className:"ga-services-loading ga-services-loading--col",children:[i.jsx(Q,{style:{color:"var(--semi-color-warning)",fontSize:24}}),i.jsx("span",{children:s("bridge.notRunning")}),Y()?i.jsx(_,{"data-testid":"bridge-restart",loading:x,onClick:k,theme:"light",type:"primary",children:s("bridge.restart")}):i.jsx("code",{className:"ga-bridge-hint",children:s("bridge.notRunningHint")})]}):n&&C.length===0?i.jsxs("div",{className:"ga-services-loading",children:[i.jsx(G,{size:"large"}),i.jsx("span",{children:s("ch.loading")})]}):!H&&C.length===0?i.jsx(ye,{description:s("ch.empty")}):i.jsxs("div",{className:"ga-channel-list",children:[H&&i.jsxs("div",{className:"ga-offline-banner",children:[i.jsx(Q,{size:"small"}),i.jsx("span",{children:s("bridge.staleData")}),Y()&&i.jsx(_,{"data-testid":"bridge-restart",size:"small",loading:x,onClick:k,theme:"light",children:s("bridge.restart")})]}),C.map(p=>{const N=te[p.id]||te[p.name],O=(N==null?void 0:N.label)||"",L=O?s(O):p.name,I=N==null?void 0:N.icon,h=r.has(p.id);return i.jsxs("div",{className:"ga-channel-card",children:[i.jsxs("div",{className:"ga-channel-card-info",children:[I&&i.jsx("img",{src:I,alt:"",className:"ga-channel-icon"}),i.jsx("span",{className:"ga-channel-card-name",children:L}),i.jsx(ee,{size:"small",color:p.running?"green":"grey",type:"ghost",children:p.running?s("st.online"):s("st.offline")}),p.lastError&&i.jsx(ee,{size:"small",color:"red",type:"ghost",children:p.lastError})]}),i.jsxs("div",{className:"ga-channel-card-actions",children:[i.jsx(_,{size:"small",icon:p.running?i.jsx(Se,{}):i.jsx(we,{}),loading:h,disabled:H,onClick:()=>T(p),type:p.running?"danger":"primary",theme:"light",children:p.running?s("act.stop"):s("act.start")}),i.jsx(_,{size:"small",icon:i.jsx(ve,{}),theme:"borderless",onClick:()=>g(p.id),children:s("act.logs")}),i.jsx(_,{size:"small",icon:i.jsx(De,{}),theme:"borderless",onClick:()=>w(!0),children:s("act.configure")})]})]},p.id)}),i.jsx(ze,{serviceId:c,onClose:()=>g(null)}),i.jsx(tt,{visible:m,onClose:()=>w(!1)})]})}const dt={__bridge__:{labelKey:"proc.bridge",summaryKey:"proc.bridgeSummary",tipKey:"proc.bridgeTip"},"frontends/conductor.py":{labelKey:"proc.conductor",summaryKey:"proc.conductorSummary",tipKey:"proc.conductorTip"},"reflect/scheduler.py":{labelKey:"proc.scheduler",summaryKey:"proc.schedulerSummary",tipKey:"proc.schedulerTip"}};function ut(){const{t:s}=q(),e=xe(),t=z(h=>h.services),n=z(h=>h.loading),a=z(h=>h.startService),o=z(h=>h.stopService),r=z(h=>h.exitBridge),l=z(h=>h.restartService),[c,g]=u.useState(new Set),[m,w]=u.useState(null),[x,E]=u.useState(!1),C=t.filter(h=>!Ne(h)),k=u.useCallback(async()=>{E(!0);try{await be()}catch{W(s("err.bridge"))}finally{E(!1)}},[s]),T=u.useCallback(async(h,d)=>{g(b=>new Set([...b,h]));try{await d()||W(s("err.channelStop"))}finally{g(b=>{const M=new Set(b);return M.delete(h),M})}},[s]),H=u.useCallback(h=>T(h.id,async()=>{const d=await a(h.id);return d&&P(s("sys.channelStarted")),d}),[a,s,T]),p=u.useCallback(h=>T(h.id,async()=>{if(!h.managed){const b=await r();return b&&P(s("sys.bridgeDisconnecting")),b}const d=await o(h.id);return d&&P(s("sys.channelStopped")),d}),[r,o,s,T]),N=u.useCallback(h=>T(h.id,async()=>{const d=await l(h.id);return d&&P(s("sys.channelStarted")),d}),[l,s,T]),O=h=>{const{status:d,errorKey:b,warningKey:M,lastError:U,lastWarning:$}=h,Z={running:{color:"green",text:s("st.running")},offline:{color:"grey",text:s("st.stopped")},error:{color:"red",text:s("st.abnormal")},warning:{color:"amber",text:s("st.warning")}},B=Z[d]??Z.offline,F=b?s(b):M?s(M):U||$||"",A=d==="error"||d==="running"&&M;return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx(ee,{size:"small",color:B.color,type:"light",children:B.text}),A&&F&&i.jsx("span",{title:U||$||"",style:{fontSize:11,color:d==="error"?"var(--semi-color-danger)":"var(--semi-color-warning)",maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.length>50?F.slice(0,50)+"…":F})]})},L=e!=="ready",I=[{title:s("svc.colName"),dataIndex:"name",key:"name",render:(h,d)=>{const b=dt[d.id],M=s(b?b.labelKey:"proc.runtimeComponent"),U=s(b?b.summaryKey:"proc.runtimeComponentSummary"),$=s(b?b.tipKey:"proc.runtimeComponentTip");return i.jsx(Me,{content:$,position:"topLeft",children:i.jsxs("span",{className:"ga-service-identity",children:[i.jsx("span",{className:"ga-service-identity-name",children:M}),i.jsx("span",{className:"ga-service-identity-summary",children:U})]})})}},{title:s("svc.colStatus"),dataIndex:"status",key:"status",width:220,render:(h,d)=>O(d)},{title:s("svc.colPid"),dataIndex:"pid",key:"pid",width:80,render:(h,d)=>i.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:d.pid??"—"})},{title:s("svc.colMemory"),dataIndex:"memMb",key:"memMb",width:100,render:(h,d)=>i.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:d.memMb!=null?d.memMb.toFixed(1):"—"})},{title:s("svc.colCpu"),dataIndex:"cpuPct",key:"cpuPct",width:90,render:(h,d)=>i.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:d.cpuPct!=null?d.cpuPct.toFixed(1):"—"})},{title:s("svc.colActions"),key:"actions",width:200,render:(h,d)=>{const b=c.has(d.id);return i.jsxs("div",{className:"ga-status-actions",children:[d.running?i.jsxs(i.Fragment,{children:[d.managed&&i.jsx(_,{size:"small",icon:i.jsx(Ae,{}),theme:"borderless",loading:b,disabled:L,onClick:()=>N(d),children:s("act.restart")}),i.jsx(_,{size:"small",icon:d.managed?i.jsx(Se,{}):i.jsx(Ke,{}),theme:"borderless",type:"danger",loading:b,disabled:L,onClick:()=>p(d),children:d.managed?s("act.stop"):s("act.disconnect")})]}):d.managed&&i.jsx(_,{size:"small",icon:i.jsx(we,{}),theme:"borderless",type:"primary",loading:b,disabled:L,onClick:()=>H(d),children:s("act.start")}),i.jsx(_,{size:"small",icon:i.jsx(ve,{}),theme:"borderless",onClick:()=>w(d.id),children:s("act.logs")})]})}}];return L&&C.length===0?i.jsxs("div",{className:"ga-services-loading ga-services-loading--col",children:[i.jsx(Q,{style:{color:"var(--semi-color-warning)",fontSize:24}}),i.jsx("span",{children:s("bridge.notRunning")}),Y()?i.jsx(_,{"data-testid":"bridge-restart",loading:x,onClick:k,theme:"light",type:"primary",children:s("bridge.restart")}):i.jsx("code",{className:"ga-bridge-hint",children:s("bridge.notRunningHint")})]}):n&&C.length===0?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{size:"large"})}):!L&&C.length===0?i.jsx(ye,{description:s("svc.empty")}):i.jsxs("div",{className:"ga-status-panel",children:[L&&i.jsxs("div",{className:"ga-offline-banner",children:[i.jsx(Q,{size:"small"}),i.jsx("span",{children:s("bridge.staleData")}),Y()&&i.jsx(_,{"data-testid":"bridge-restart",size:"small",loading:x,onClick:k,theme:"light",children:s("bridge.restart")})]}),i.jsx(He,{columns:I,dataSource:C,rowKey:"id",pagination:!1,size:"small",bordered:!1}),i.jsx(ze,{serviceId:m,onClose:()=>w(null)})]})}function vt(){const{t:s}=q(),e=z(a=>a.fetchServices),t=de(a=>a.servicesTab),n=de(a=>a.setServicesTab);return u.useEffect(()=>{e()},[e]),i.jsx("div",{className:"ga-services-page",children:i.jsxs(Ve,{type:"line",activeKey:t,onChange:n,children:[i.jsx(ce,{tab:s("nav.channels"),itemKey:"channels",children:i.jsx(ht,{})}),i.jsx(ce,{tab:s("nav.status"),itemKey:"status",children:i.jsx(ut,{})})]})})}export{vt as ServicesPage};