@gavinc-cn/touchstone-dsh 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/lib/board.js +84 -11
- package/backend/lib/chat.js +37 -0
- package/backend/lib/feishu.js +10 -1
- package/backend/lib/feishu_cfg.js +36 -2
- package/backend/lib/feishu_inbound.js +409 -6
- package/backend/lib/feishu_provision.js +37 -6
- package/backend/lib/lock.js +32 -11
- package/backend/lib/proc.js +91 -8
- package/backend/lib/runner.js +32 -6
- package/backend/lib/seed_hint.js +40 -0
- package/backend/lib/serverstate.js +5 -15
- package/backend/routes/board.js +9 -1
- package/backend/routes/feishu_app.js +41 -7
- package/backend/routes/index.js +3 -2
- package/backend/routes/projects.js +81 -2
- package/backend/routes/sessions.js +61 -4
- package/backend/server.js +18 -11
- package/board.py +66 -12
- package/chat.py +33 -0
- package/dsh-plugin/lib/client.bundle.js +111 -2
- package/dsh-plugin/lib/index.js +46 -5
- package/dsh-plugin/src/client.js +111 -2
- package/feishu.py +417 -3
- package/package.json +1 -1
- package/server.py +155 -11
- package/webui/dist-plugin/assets/index-3QsYQi7y.css +1 -0
- package/webui/dist-plugin/assets/index-B8AMtW7y.js +486 -0
- package/webui/dist-plugin/index.html +2 -2
- package/webui/dist-plugin/assets/index-ChP3sg6y.css +0 -1
- package/webui/dist-plugin/assets/index-UrMyeAXF.js +0 -484
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
var Jm=e=>{throw TypeError(e)};var Zm=(e,t,n)=>t.has(e)||Jm("Cannot "+n);var gn=(e,t,n)=>(Zm(e,t,"read from private field"),n?n.call(e):t.get(e)),eh=(e,t,n)=>t.has(e)?Jm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Eu=(e,t,n,s)=>(Zm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);function f1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Tx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $x={exports:{}},Yc={},Ix={exports:{}},Ye={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Za=Symbol.for("react.element"),p1=Symbol.for("react.portal"),m1=Symbol.for("react.fragment"),h1=Symbol.for("react.strict_mode"),g1=Symbol.for("react.profiler"),x1=Symbol.for("react.provider"),v1=Symbol.for("react.context"),y1=Symbol.for("react.forward_ref"),w1=Symbol.for("react.suspense"),j1=Symbol.for("react.memo"),b1=Symbol.for("react.lazy"),th=Symbol.iterator;function k1(e){return e===null||typeof e!="object"?null:(e=th&&e[th]||e["@@iterator"],typeof e=="function"?e:null)}var Ax={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ox=Object.assign,Lx={};function Wl(e,t,n){this.props=e,this.context=t,this.refs=Lx,this.updater=n||Ax}Wl.prototype.isReactComponent={};Wl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Wl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dx(){}Dx.prototype=Wl.prototype;function rp(e,t,n){this.props=e,this.context=t,this.refs=Lx,this.updater=n||Ax}var op=rp.prototype=new Dx;op.constructor=rp;Ox(op,Wl.prototype);op.isPureReactComponent=!0;var nh=Array.isArray,zx=Object.prototype.hasOwnProperty,lp={current:null},Fx={key:!0,ref:!0,__self:!0,__source:!0};function Bx(e,t,n){var s,o={},l=null,a=null;if(t!=null)for(s in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)zx.call(t,s)&&!Fx.hasOwnProperty(s)&&(o[s]=t[s]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var c=Array(i),d=0;d<i;d++)c[d]=arguments[d+2];o.children=c}if(e&&e.defaultProps)for(s in i=e.defaultProps,i)o[s]===void 0&&(o[s]=i[s]);return{$$typeof:Za,type:e,key:l,ref:a,props:o,_owner:lp.current}}function _1(e,t){return{$$typeof:Za,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ap(e){return typeof e=="object"&&e!==null&&e.$$typeof===Za}function S1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var sh=/\/+/g;function Ru(e,t){return typeof e=="object"&&e!==null&&e.key!=null?S1(""+e.key):t.toString(36)}function Ki(e,t,n,s,o){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Za:case p1:a=!0}}if(a)return a=e,o=o(a),e=s===""?"."+Ru(a,0):s,nh(o)?(n="",e!=null&&(n=e.replace(sh,"$&/")+"/"),Ki(o,t,n,"",function(d){return d})):o!=null&&(ap(o)&&(o=_1(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(sh,"$&/")+"/")+e)),t.push(o)),1;if(a=0,s=s===""?".":s+":",nh(e))for(var i=0;i<e.length;i++){l=e[i];var c=s+Ru(l,i);a+=Ki(l,t,n,c,o)}else if(c=k1(e),typeof c=="function")for(e=c.call(e),i=0;!(l=e.next()).done;)l=l.value,c=s+Ru(l,i++),a+=Ki(l,t,n,c,o);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function di(e,t,n){if(e==null)return e;var s=[],o=0;return Ki(e,s,"","",function(l){return t.call(n,l,o++)}),s}function N1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pn={current:null},Yi={transition:null},C1={ReactCurrentDispatcher:Pn,ReactCurrentBatchConfig:Yi,ReactCurrentOwner:lp};function Hx(){throw Error("act(...) is not supported in production builds of React.")}Ye.Children={map:di,forEach:function(e,t,n){di(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return di(e,function(){t++}),t},toArray:function(e){return di(e,function(t){return t})||[]},only:function(e){if(!ap(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ye.Component=Wl;Ye.Fragment=m1;Ye.Profiler=g1;Ye.PureComponent=rp;Ye.StrictMode=h1;Ye.Suspense=w1;Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C1;Ye.act=Hx;Ye.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Ox({},e.props),o=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=lp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(c in t)zx.call(t,c)&&!Fx.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&i!==void 0?i[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){i=Array(c);for(var d=0;d<c;d++)i[d]=arguments[d+2];s.children=i}return{$$typeof:Za,type:e.type,key:o,ref:l,props:s,_owner:a}};Ye.createContext=function(e){return e={$$typeof:v1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:x1,_context:e},e.Consumer=e};Ye.createElement=Bx;Ye.createFactory=function(e){var t=Bx.bind(null,e);return t.type=e,t};Ye.createRef=function(){return{current:null}};Ye.forwardRef=function(e){return{$$typeof:y1,render:e}};Ye.isValidElement=ap;Ye.lazy=function(e){return{$$typeof:b1,_payload:{_status:-1,_result:e},_init:N1}};Ye.memo=function(e,t){return{$$typeof:j1,type:e,compare:t===void 0?null:t}};Ye.startTransition=function(e){var t=Yi.transition;Yi.transition={};try{e()}finally{Yi.transition=t}};Ye.unstable_act=Hx;Ye.useCallback=function(e,t){return Pn.current.useCallback(e,t)};Ye.useContext=function(e){return Pn.current.useContext(e)};Ye.useDebugValue=function(){};Ye.useDeferredValue=function(e){return Pn.current.useDeferredValue(e)};Ye.useEffect=function(e,t){return Pn.current.useEffect(e,t)};Ye.useId=function(){return Pn.current.useId()};Ye.useImperativeHandle=function(e,t,n){return Pn.current.useImperativeHandle(e,t,n)};Ye.useInsertionEffect=function(e,t){return Pn.current.useInsertionEffect(e,t)};Ye.useLayoutEffect=function(e,t){return Pn.current.useLayoutEffect(e,t)};Ye.useMemo=function(e,t){return Pn.current.useMemo(e,t)};Ye.useReducer=function(e,t,n){return Pn.current.useReducer(e,t,n)};Ye.useRef=function(e){return Pn.current.useRef(e)};Ye.useState=function(e){return Pn.current.useState(e)};Ye.useSyncExternalStore=function(e,t,n){return Pn.current.useSyncExternalStore(e,t,n)};Ye.useTransition=function(){return Pn.current.useTransition()};Ye.version="18.3.1";Ix.exports=Ye;var u=Ix.exports;const Ux=Tx(u),Wo=f1({__proto__:null,default:Ux},[u]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var E1=u,R1=Symbol.for("react.element"),P1=Symbol.for("react.fragment"),M1=Object.prototype.hasOwnProperty,T1=E1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$1={key:!0,ref:!0,__self:!0,__source:!0};function Vx(e,t,n){var s,o={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(s in t)M1.call(t,s)&&!$1.hasOwnProperty(s)&&(o[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)o[s]===void 0&&(o[s]=t[s]);return{$$typeof:R1,type:e,key:l,ref:a,props:o,_owner:T1.current}}Yc.Fragment=P1;Yc.jsx=Vx;Yc.jsxs=Vx;$x.exports=Yc;var r=$x.exports,Wx={exports:{}},Zn={},qx={exports:{}},Gx={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(z,Y){var B=z.length;z.push(Y);e:for(;0<B;){var me=B-1>>>1,Z=z[me];if(0<o(Z,Y))z[me]=Y,z[B]=Z,B=me;else break e}}function n(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var Y=z[0],B=z.pop();if(B!==Y){z[0]=B;e:for(var me=0,Z=z.length,Te=Z>>>1;me<Te;){var ke=2*(me+1)-1,_e=z[ke],Ce=ke+1,$e=z[Ce];if(0>o(_e,B))Ce<Z&&0>o($e,_e)?(z[me]=$e,z[Ce]=B,me=Ce):(z[me]=_e,z[ke]=B,me=ke);else if(Ce<Z&&0>o($e,B))z[me]=$e,z[Ce]=B,me=Ce;else break e}}return Y}function o(z,Y){var B=z.sortIndex-Y.sortIndex;return B!==0?B:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,i=a.now();e.unstable_now=function(){return a.now()-i}}var c=[],d=[],f=1,m=null,p=3,h=!1,x=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var Y=n(d);Y!==null;){if(Y.callback===null)s(d);else if(Y.startTime<=z)s(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function b(z){if(y=!1,w(z),!x)if(n(c)!==null)x=!0,ee(S);else{var Y=n(d);Y!==null&&G(b,Y.startTime-z)}}function S(z,Y){x=!1,y&&(y=!1,v(C),C=-1),h=!0;var B=p;try{for(w(Y),m=n(c);m!==null&&(!(m.expirationTime>Y)||z&&!D());){var me=m.callback;if(typeof me=="function"){m.callback=null,p=m.priorityLevel;var Z=me(m.expirationTime<=Y);Y=e.unstable_now(),typeof Z=="function"?m.callback=Z:m===n(c)&&s(c),w(Y)}else s(c);m=n(c)}if(m!==null)var Te=!0;else{var ke=n(d);ke!==null&&G(b,ke.startTime-Y),Te=!1}return Te}finally{m=null,p=B,h=!1}}var N=!1,_=null,C=-1,O=5,P=-1;function D(){return!(e.unstable_now()-P<O)}function K(){if(_!==null){var z=e.unstable_now();P=z;var Y=!0;try{Y=_(!0,z)}finally{Y?L():(N=!1,_=null)}}else N=!1}var L;if(typeof g=="function")L=function(){g(K)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,q=I.port2;I.port1.onmessage=K,L=function(){q.postMessage(null)}}else L=function(){j(K,0)};function ee(z){_=z,N||(N=!0,L())}function G(z,Y){C=j(function(){z(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,ee(S))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(z){switch(p){case 1:case 2:case 3:var Y=3;break;default:Y=p}var B=p;p=Y;try{return z()}finally{p=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=p;p=z;try{return Y()}finally{p=B}},e.unstable_scheduleCallback=function(z,Y,B){var me=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?me+B:me):B=me,z){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=B+Z,z={id:f++,callback:Y,priorityLevel:z,startTime:B,expirationTime:Z,sortIndex:-1},B>me?(z.sortIndex=B,t(d,z),n(c)===null&&z===n(d)&&(y?(v(C),C=-1):y=!0,G(b,B-me))):(z.sortIndex=Z,t(c,z),x||h||(x=!0,ee(S))),z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(z){var Y=p;return function(){var B=p;p=Y;try{return z.apply(this,arguments)}finally{p=B}}}})(Gx);qx.exports=Gx;var I1=qx.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var A1=u,Jn=I1;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Kx=new Set,Ra={};function qo(e,t){Tl(e,t),Tl(e+"Capture",t)}function Tl(e,t){for(Ra[e]=t,e=0;e<t.length;e++)Kx.add(t[e])}var pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nd=Object.prototype.hasOwnProperty,O1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rh={},oh={};function L1(e){return Nd.call(oh,e)?!0:Nd.call(rh,e)?!1:O1.test(e)?oh[e]=!0:(rh[e]=!0,!1)}function D1(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z1(e,t,n,s){if(t===null||typeof t>"u"||D1(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mn(e,t,n,s,o,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new Mn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new Mn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new Mn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new Mn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){hn[e]=new Mn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new Mn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new Mn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new Mn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new Mn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function cp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ip,cp);hn[t]=new Mn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ip,cp);hn[t]=new Mn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ip,cp);hn[t]=new Mn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new Mn(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new Mn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new Mn(e,1,!1,e.toLowerCase(),null,!0,!0)});function up(e,t,n,s){var o=hn.hasOwnProperty(t)?hn[t]:null;(o!==null?o.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(z1(t,n,o,s)&&(n=null),s||o===null?L1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,s=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var jr=A1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fi=Symbol.for("react.element"),al=Symbol.for("react.portal"),il=Symbol.for("react.fragment"),dp=Symbol.for("react.strict_mode"),Cd=Symbol.for("react.profiler"),Yx=Symbol.for("react.provider"),Qx=Symbol.for("react.context"),fp=Symbol.for("react.forward_ref"),Ed=Symbol.for("react.suspense"),Rd=Symbol.for("react.suspense_list"),pp=Symbol.for("react.memo"),$r=Symbol.for("react.lazy"),Xx=Symbol.for("react.offscreen"),lh=Symbol.iterator;function ta(e){return e===null||typeof e!="object"?null:(e=lh&&e[lh]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,Pu;function ma(e){if(Pu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Pu=t&&t[1]||""}return`
|
|
34
|
-
`+Pu+e}var Mu=!1;function Tu(e,t){if(!e||Mu)return"";Mu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var s=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){s=d}e.call(t.prototype)}else{try{throw Error()}catch(d){s=d}e()}}catch(d){if(d&&s&&typeof d.stack=="string"){for(var o=d.stack.split(`
|
|
35
|
-
`),l=s.stack.split(`
|
|
36
|
-
`),a=o.length-1,i=l.length-1;1<=a&&0<=i&&o[a]!==l[i];)i--;for(;1<=a&&0<=i;a--,i--)if(o[a]!==l[i]){if(a!==1||i!==1)do if(a--,i--,0>i||o[a]!==l[i]){var c=`
|
|
37
|
-
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=i);break}}}finally{Mu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ma(e):""}function F1(e){switch(e.tag){case 5:return ma(e.type);case 16:return ma("Lazy");case 13:return ma("Suspense");case 19:return ma("SuspenseList");case 0:case 2:case 15:return e=Tu(e.type,!1),e;case 11:return e=Tu(e.type.render,!1),e;case 1:return e=Tu(e.type,!0),e;default:return""}}function Pd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case il:return"Fragment";case al:return"Portal";case Cd:return"Profiler";case dp:return"StrictMode";case Ed:return"Suspense";case Rd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qx:return(e.displayName||"Context")+".Consumer";case Yx:return(e._context.displayName||"Context")+".Provider";case fp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pp:return t=e.displayName||null,t!==null?t:Pd(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return Pd(e(t))}catch{}}return null}function B1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pd(t);case 8:return t===dp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function to(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function H1(e){var t=Jx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){s=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(a){s=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pi(e){e._valueTracker||(e._valueTracker=H1(e))}function Zx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Jx(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function pc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Md(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ah(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=to(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ev(e,t){t=t.checked,t!=null&&up(e,"checked",t,!1)}function Td(e,t){ev(e,t);var n=to(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$d(e,t.type,n):t.hasOwnProperty("defaultValue")&&$d(e,t.type,to(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ih(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $d(e,t,n){(t!=="number"||pc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ha=Array.isArray;function bl(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&s&&(e[n].defaultSelected=!0)}else{for(n=""+to(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Id(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ch(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(ha(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:to(n)}}function tv(e,t){var n=to(t.value),s=to(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function uh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ad(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mi,sv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(mi=mi||document.createElement("div"),mi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},U1=["Webkit","ms","Moz","O"];Object.keys(wa).forEach(function(e){U1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wa[t]=wa[e]})});function rv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wa.hasOwnProperty(e)&&wa[e]?(""+t).trim():t+"px"}function ov(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,o=rv(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,o):e[n]=o}}var V1=St({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Od(e,t){if(t){if(V1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Ld(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Dd=null;function mp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zd=null,kl=null,_l=null;function dh(e){if(e=ni(e)){if(typeof zd!="function")throw Error(re(280));var t=e.stateNode;t&&(t=eu(t),zd(e.stateNode,e.type,t))}}function lv(e){kl?_l?_l.push(e):_l=[e]:kl=e}function av(){if(kl){var e=kl,t=_l;if(_l=kl=null,dh(e),t)for(e=0;e<t.length;e++)dh(t[e])}}function iv(e,t){return e(t)}function cv(){}var $u=!1;function uv(e,t,n){if($u)return e(t,n);$u=!0;try{return iv(e,t,n)}finally{$u=!1,(kl!==null||_l!==null)&&(cv(),av())}}function Ma(e,t){var n=e.stateNode;if(n===null)return null;var s=eu(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var Fd=!1;if(pr)try{var na={};Object.defineProperty(na,"passive",{get:function(){Fd=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{Fd=!1}function W1(e,t,n,s,o,l,a,i,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(f){this.onError(f)}}var ja=!1,mc=null,hc=!1,Bd=null,q1={onError:function(e){ja=!0,mc=e}};function G1(e,t,n,s,o,l,a,i,c){ja=!1,mc=null,W1.apply(q1,arguments)}function K1(e,t,n,s,o,l,a,i,c){if(G1.apply(this,arguments),ja){if(ja){var d=mc;ja=!1,mc=null}else throw Error(re(198));hc||(hc=!0,Bd=d)}}function Go(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dv(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fh(e){if(Go(e)!==e)throw Error(re(188))}function Y1(e){var t=e.alternate;if(!t){if(t=Go(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(o===null)break;var l=o.alternate;if(l===null){if(s=o.return,s!==null){n=s;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return fh(o),e;if(l===s)return fh(o),t;l=l.sibling}throw Error(re(188))}if(n.return!==s.return)n=o,s=l;else{for(var a=!1,i=o.child;i;){if(i===n){a=!0,n=o,s=l;break}if(i===s){a=!0,s=o,n=l;break}i=i.sibling}if(!a){for(i=l.child;i;){if(i===n){a=!0,n=l,s=o;break}if(i===s){a=!0,s=l,n=o;break}i=i.sibling}if(!a)throw Error(re(189))}}if(n.alternate!==s)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function fv(e){return e=Y1(e),e!==null?pv(e):null}function pv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pv(e);if(t!==null)return t;e=e.sibling}return null}var mv=Jn.unstable_scheduleCallback,ph=Jn.unstable_cancelCallback,Q1=Jn.unstable_shouldYield,X1=Jn.unstable_requestPaint,Ot=Jn.unstable_now,J1=Jn.unstable_getCurrentPriorityLevel,hp=Jn.unstable_ImmediatePriority,hv=Jn.unstable_UserBlockingPriority,gc=Jn.unstable_NormalPriority,Z1=Jn.unstable_LowPriority,gv=Jn.unstable_IdlePriority,Qc=null,Ws=null;function eb(e){if(Ws&&typeof Ws.onCommitFiberRoot=="function")try{Ws.onCommitFiberRoot(Qc,e,void 0,(e.current.flags&128)===128)}catch{}}var Ss=Math.clz32?Math.clz32:sb,tb=Math.log,nb=Math.LN2;function sb(e){return e>>>=0,e===0?32:31-(tb(e)/nb|0)|0}var hi=64,gi=4194304;function ga(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function xc(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,o=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var i=a&~o;i!==0?s=ga(i):(l&=a,l!==0&&(s=ga(l)))}else a=n&~o,a!==0?s=ga(a):l!==0&&(s=ga(l));if(s===0)return 0;if(t!==0&&t!==s&&!(t&o)&&(o=s&-s,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Ss(t),o=1<<n,s|=e[n],t&=~o;return s}function rb(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ob(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-Ss(l),i=1<<a,c=o[a];c===-1?(!(i&n)||i&s)&&(o[a]=rb(i,t)):c<=t&&(e.expiredLanes|=i),l&=~i}}function Hd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xv(){var e=hi;return hi<<=1,!(hi&4194240)&&(hi=64),e}function Iu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ei(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ss(t),e[t]=n}function lb(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Ss(n),l=1<<o;t[o]=0,s[o]=-1,e[o]=-1,n&=~l}}function gp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ss(n),o=1<<s;o&t|e[s]&t&&(e[s]|=t),n&=~o}}var at=0;function vv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yv,xp,wv,jv,bv,Ud=!1,xi=[],Hr=null,Ur=null,Vr=null,Ta=new Map,$a=new Map,Ar=[],ab="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function mh(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":Ta.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$a.delete(t.pointerId)}}function sa(e,t,n,s,o,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:l,targetContainers:[o]},t!==null&&(t=ni(t),t!==null&&xp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ib(e,t,n,s,o){switch(t){case"focusin":return Hr=sa(Hr,e,t,n,s,o),!0;case"dragenter":return Ur=sa(Ur,e,t,n,s,o),!0;case"mouseover":return Vr=sa(Vr,e,t,n,s,o),!0;case"pointerover":var l=o.pointerId;return Ta.set(l,sa(Ta.get(l)||null,e,t,n,s,o)),!0;case"gotpointercapture":return l=o.pointerId,$a.set(l,sa($a.get(l)||null,e,t,n,s,o)),!0}return!1}function kv(e){var t=Eo(e.target);if(t!==null){var n=Go(t);if(n!==null){if(t=n.tag,t===13){if(t=dv(n),t!==null){e.blockedOn=t,bv(e.priority,function(){wv(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Dd=s,n.target.dispatchEvent(s),Dd=null}else return t=ni(n),t!==null&&xp(t),e.blockedOn=n,!1;t.shift()}return!0}function hh(e,t,n){Qi(e)&&n.delete(t)}function cb(){Ud=!1,Hr!==null&&Qi(Hr)&&(Hr=null),Ur!==null&&Qi(Ur)&&(Ur=null),Vr!==null&&Qi(Vr)&&(Vr=null),Ta.forEach(hh),$a.forEach(hh)}function ra(e,t){e.blockedOn===t&&(e.blockedOn=null,Ud||(Ud=!0,Jn.unstable_scheduleCallback(Jn.unstable_NormalPriority,cb)))}function Ia(e){function t(o){return ra(o,e)}if(0<xi.length){ra(xi[0],e);for(var n=1;n<xi.length;n++){var s=xi[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Hr!==null&&ra(Hr,e),Ur!==null&&ra(Ur,e),Vr!==null&&ra(Vr,e),Ta.forEach(t),$a.forEach(t),n=0;n<Ar.length;n++)s=Ar[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ar.length&&(n=Ar[0],n.blockedOn===null);)kv(n),n.blockedOn===null&&Ar.shift()}var Sl=jr.ReactCurrentBatchConfig,vc=!0;function ub(e,t,n,s){var o=at,l=Sl.transition;Sl.transition=null;try{at=1,vp(e,t,n,s)}finally{at=o,Sl.transition=l}}function db(e,t,n,s){var o=at,l=Sl.transition;Sl.transition=null;try{at=4,vp(e,t,n,s)}finally{at=o,Sl.transition=l}}function vp(e,t,n,s){if(vc){var o=Vd(e,t,n,s);if(o===null)Vu(e,t,s,yc,n),mh(e,s);else if(ib(o,e,t,n,s))s.stopPropagation();else if(mh(e,s),t&4&&-1<ab.indexOf(e)){for(;o!==null;){var l=ni(o);if(l!==null&&yv(l),l=Vd(e,t,n,s),l===null&&Vu(e,t,s,yc,n),l===o)break;o=l}o!==null&&s.stopPropagation()}else Vu(e,t,s,null,n)}}var yc=null;function Vd(e,t,n,s){if(yc=null,e=mp(s),e=Eo(e),e!==null)if(t=Go(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dv(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return yc=e,null}function _v(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(J1()){case hp:return 1;case hv:return 4;case gc:case Z1:return 16;case gv:return 536870912;default:return 16}default:return 16}}var Dr=null,yp=null,Xi=null;function Sv(){if(Xi)return Xi;var e,t=yp,n=t.length,s,o="value"in Dr?Dr.value:Dr.textContent,l=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===o[l-s];s++);return Xi=o.slice(e,1<s?1-s:void 0)}function Ji(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vi(){return!0}function gh(){return!1}function es(e){function t(n,s,o,l,a){this._reactName=n,this._targetInst=o,this.type=s,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(n=e[i],this[i]=n?n(l):l[i]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?vi:gh,this.isPropagationStopped=gh,this}return St(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vi)},persist:function(){},isPersistent:vi}),t}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wp=es(ql),ti=St({},ql,{view:0,detail:0}),fb=es(ti),Au,Ou,oa,Xc=St({},ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==oa&&(oa&&e.type==="mousemove"?(Au=e.screenX-oa.screenX,Ou=e.screenY-oa.screenY):Ou=Au=0,oa=e),Au)},movementY:function(e){return"movementY"in e?e.movementY:Ou}}),xh=es(Xc),pb=St({},Xc,{dataTransfer:0}),mb=es(pb),hb=St({},ti,{relatedTarget:0}),Lu=es(hb),gb=St({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),xb=es(gb),vb=St({},ql,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yb=es(vb),wb=St({},ql,{data:0}),vh=es(wb),jb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},kb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _b(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kb[e])?!!t[e]:!1}function jp(){return _b}var Sb=St({},ti,{key:function(e){if(e.key){var t=jb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ji(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jp,charCode:function(e){return e.type==="keypress"?Ji(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ji(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nb=es(Sb),Cb=St({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yh=es(Cb),Eb=St({},ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jp}),Rb=es(Eb),Pb=St({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mb=es(Pb),Tb=St({},Xc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),$b=es(Tb),Ib=[9,13,27,32],bp=pr&&"CompositionEvent"in window,ba=null;pr&&"documentMode"in document&&(ba=document.documentMode);var Ab=pr&&"TextEvent"in window&&!ba,Nv=pr&&(!bp||ba&&8<ba&&11>=ba),wh=" ",jh=!1;function Cv(e,t){switch(e){case"keyup":return Ib.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ev(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cl=!1;function Ob(e,t){switch(e){case"compositionend":return Ev(t);case"keypress":return t.which!==32?null:(jh=!0,wh);case"textInput":return e=t.data,e===wh&&jh?null:e;default:return null}}function Lb(e,t){if(cl)return e==="compositionend"||!bp&&Cv(e,t)?(e=Sv(),Xi=yp=Dr=null,cl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nv&&t.locale!=="ko"?null:t.data;default:return null}}var Db={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Db[e.type]:t==="textarea"}function Rv(e,t,n,s){lv(s),t=wc(t,"onChange"),0<t.length&&(n=new wp("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ka=null,Aa=null;function zb(e){Fv(e,0)}function Jc(e){var t=fl(e);if(Zx(t))return e}function Fb(e,t){if(e==="change")return t}var Pv=!1;if(pr){var Du;if(pr){var zu="oninput"in document;if(!zu){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),zu=typeof kh.oninput=="function"}Du=zu}else Du=!1;Pv=Du&&(!document.documentMode||9<document.documentMode)}function _h(){ka&&(ka.detachEvent("onpropertychange",Mv),Aa=ka=null)}function Mv(e){if(e.propertyName==="value"&&Jc(Aa)){var t=[];Rv(t,Aa,e,mp(e)),uv(zb,t)}}function Bb(e,t,n){e==="focusin"?(_h(),ka=t,Aa=n,ka.attachEvent("onpropertychange",Mv)):e==="focusout"&&_h()}function Hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jc(Aa)}function Ub(e,t){if(e==="click")return Jc(t)}function Vb(e,t){if(e==="input"||e==="change")return Jc(t)}function Wb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cs=typeof Object.is=="function"?Object.is:Wb;function Oa(e,t){if(Cs(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var o=n[s];if(!Nd.call(t,o)||!Cs(e[o],t[o]))return!1}return!0}function Sh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nh(e,t){var n=Sh(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sh(n)}}function Tv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $v(){for(var e=window,t=pc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pc(e.document)}return t}function kp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function qb(e){var t=$v(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tv(n.ownerDocument.documentElement,n)){if(s!==null&&kp(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,l=Math.min(s.start,o);s=s.end===void 0?l:Math.min(s.end,o),!e.extend&&l>s&&(o=s,s=l,l=o),o=Nh(n,l);var a=Nh(n,s);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>s?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gb=pr&&"documentMode"in document&&11>=document.documentMode,ul=null,Wd=null,_a=null,qd=!1;function Ch(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qd||ul==null||ul!==pc(s)||(s=ul,"selectionStart"in s&&kp(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),_a&&Oa(_a,s)||(_a=s,s=wc(Wd,"onSelect"),0<s.length&&(t=new wp("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ul)))}function yi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var dl={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionend:yi("Transition","TransitionEnd")},Fu={},Iv={};pr&&(Iv=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function Zc(e){if(Fu[e])return Fu[e];if(!dl[e])return e;var t=dl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Iv)return Fu[e]=t[n];return e}var Av=Zc("animationend"),Ov=Zc("animationiteration"),Lv=Zc("animationstart"),Dv=Zc("transitionend"),zv=new Map,Eh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function oo(e,t){zv.set(e,t),qo(t,[e])}for(var Bu=0;Bu<Eh.length;Bu++){var Hu=Eh[Bu],Kb=Hu.toLowerCase(),Yb=Hu[0].toUpperCase()+Hu.slice(1);oo(Kb,"on"+Yb)}oo(Av,"onAnimationEnd");oo(Ov,"onAnimationIteration");oo(Lv,"onAnimationStart");oo("dblclick","onDoubleClick");oo("focusin","onFocus");oo("focusout","onBlur");oo(Dv,"onTransitionEnd");Tl("onMouseEnter",["mouseout","mouseover"]);Tl("onMouseLeave",["mouseout","mouseover"]);Tl("onPointerEnter",["pointerout","pointerover"]);Tl("onPointerLeave",["pointerout","pointerover"]);qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Qb=new Set("cancel close invalid load scroll toggle".split(" ").concat(xa));function Rh(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,K1(s,t,void 0,e),e.currentTarget=null}function Fv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],o=s.event;s=s.listeners;e:{var l=void 0;if(t)for(var a=s.length-1;0<=a;a--){var i=s[a],c=i.instance,d=i.currentTarget;if(i=i.listener,c!==l&&o.isPropagationStopped())break e;Rh(o,i,d),l=c}else for(a=0;a<s.length;a++){if(i=s[a],c=i.instance,d=i.currentTarget,i=i.listener,c!==l&&o.isPropagationStopped())break e;Rh(o,i,d),l=c}}}if(hc)throw e=Bd,hc=!1,Bd=null,e}function gt(e,t){var n=t[Xd];n===void 0&&(n=t[Xd]=new Set);var s=e+"__bubble";n.has(s)||(Bv(t,e,2,!1),n.add(s))}function Uu(e,t,n){var s=0;t&&(s|=4),Bv(n,e,s,t)}var wi="_reactListening"+Math.random().toString(36).slice(2);function La(e){if(!e[wi]){e[wi]=!0,Kx.forEach(function(n){n!=="selectionchange"&&(Qb.has(n)||Uu(n,!1,e),Uu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wi]||(t[wi]=!0,Uu("selectionchange",!1,t))}}function Bv(e,t,n,s){switch(_v(t)){case 1:var o=ub;break;case 4:o=db;break;default:o=vp}n=o.bind(null,t,n,e),o=void 0,!Fd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Vu(e,t,n,s,o){var l=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var i=s.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;i!==null;){if(a=Eo(i),a===null)return;if(c=a.tag,c===5||c===6){s=l=a;continue e}i=i.parentNode}}s=s.return}uv(function(){var d=l,f=mp(n),m=[];e:{var p=zv.get(e);if(p!==void 0){var h=wp,x=e;switch(e){case"keypress":if(Ji(n)===0)break e;case"keydown":case"keyup":h=Nb;break;case"focusin":x="focus",h=Lu;break;case"focusout":x="blur",h=Lu;break;case"beforeblur":case"afterblur":h=Lu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=xh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=mb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Rb;break;case Av:case Ov:case Lv:h=xb;break;case Dv:h=Mb;break;case"scroll":h=fb;break;case"wheel":h=$b;break;case"copy":case"cut":case"paste":h=yb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=yh}var y=(t&4)!==0,j=!y&&e==="scroll",v=y?p!==null?p+"Capture":null:p;y=[];for(var g=d,w;g!==null;){w=g;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,v!==null&&(b=Ma(g,v),b!=null&&y.push(Da(g,b,w)))),j)break;g=g.return}0<y.length&&(p=new h(p,x,null,n,f),m.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Dd&&(x=n.relatedTarget||n.fromElement)&&(Eo(x)||x[mr]))break e;if((h||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=d,x=x?Eo(x):null,x!==null&&(j=Go(x),x!==j||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=d),h!==x)){if(y=xh,b="onMouseLeave",v="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(y=yh,b="onPointerLeave",v="onPointerEnter",g="pointer"),j=h==null?p:fl(h),w=x==null?p:fl(x),p=new y(b,g+"leave",h,n,f),p.target=j,p.relatedTarget=w,b=null,Eo(f)===d&&(y=new y(v,g+"enter",x,n,f),y.target=w,y.relatedTarget=j,b=y),j=b,h&&x)t:{for(y=h,v=x,g=0,w=y;w;w=tl(w))g++;for(w=0,b=v;b;b=tl(b))w++;for(;0<g-w;)y=tl(y),g--;for(;0<w-g;)v=tl(v),w--;for(;g--;){if(y===v||v!==null&&y===v.alternate)break t;y=tl(y),v=tl(v)}y=null}else y=null;h!==null&&Ph(m,p,h,y,!1),x!==null&&j!==null&&Ph(m,j,x,y,!0)}}e:{if(p=d?fl(d):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=Fb;else if(bh(p))if(Pv)S=Vb;else{S=Hb;var N=Bb}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=Ub);if(S&&(S=S(e,d))){Rv(m,S,n,f);break e}N&&N(e,p,d),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&$d(p,"number",p.value)}switch(N=d?fl(d):window,e){case"focusin":(bh(N)||N.contentEditable==="true")&&(ul=N,Wd=d,_a=null);break;case"focusout":_a=Wd=ul=null;break;case"mousedown":qd=!0;break;case"contextmenu":case"mouseup":case"dragend":qd=!1,Ch(m,n,f);break;case"selectionchange":if(Gb)break;case"keydown":case"keyup":Ch(m,n,f)}var _;if(bp)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else cl?Cv(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Nv&&n.locale!=="ko"&&(cl||C!=="onCompositionStart"?C==="onCompositionEnd"&&cl&&(_=Sv()):(Dr=f,yp="value"in Dr?Dr.value:Dr.textContent,cl=!0)),N=wc(d,C),0<N.length&&(C=new vh(C,e,null,n,f),m.push({event:C,listeners:N}),_?C.data=_:(_=Ev(n),_!==null&&(C.data=_)))),(_=Ab?Ob(e,n):Lb(e,n))&&(d=wc(d,"onBeforeInput"),0<d.length&&(f=new vh("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:d}),f.data=_))}Fv(m,t)})}function Da(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wc(e,t){for(var n=t+"Capture",s=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=Ma(e,n),l!=null&&s.unshift(Da(e,l,o)),l=Ma(e,t),l!=null&&s.push(Da(e,l,o))),e=e.return}return s}function tl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ph(e,t,n,s,o){for(var l=t._reactName,a=[];n!==null&&n!==s;){var i=n,c=i.alternate,d=i.stateNode;if(c!==null&&c===s)break;i.tag===5&&d!==null&&(i=d,o?(c=Ma(n,l),c!=null&&a.unshift(Da(n,c,i))):o||(c=Ma(n,l),c!=null&&a.push(Da(n,c,i)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Xb=/\r\n?/g,Jb=/\u0000|\uFFFD/g;function Mh(e){return(typeof e=="string"?e:""+e).replace(Xb,`
|
|
38
|
-
`).replace(Jb,"")}function ji(e,t,n){if(t=Mh(t),Mh(e)!==t&&n)throw Error(re(425))}function jc(){}var Gd=null,Kd=null;function Yd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qd=typeof setTimeout=="function"?setTimeout:void 0,Zb=typeof clearTimeout=="function"?clearTimeout:void 0,Th=typeof Promise=="function"?Promise:void 0,ek=typeof queueMicrotask=="function"?queueMicrotask:typeof Th<"u"?function(e){return Th.resolve(null).then(e).catch(tk)}:Qd;function tk(e){setTimeout(function(){throw e})}function Wu(e,t){var n=t,s=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(s===0){e.removeChild(o),Ia(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=o}while(n);Ia(t)}function Wr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $h(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Gl=Math.random().toString(36).slice(2),Bs="__reactFiber$"+Gl,za="__reactProps$"+Gl,mr="__reactContainer$"+Gl,Xd="__reactEvents$"+Gl,nk="__reactListeners$"+Gl,sk="__reactHandles$"+Gl;function Eo(e){var t=e[Bs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mr]||n[Bs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$h(e);e!==null;){if(n=e[Bs])return n;e=$h(e)}return t}e=n,n=e.parentNode}return null}function ni(e){return e=e[Bs]||e[mr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function fl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function eu(e){return e[za]||null}var Jd=[],pl=-1;function lo(e){return{current:e}}function xt(e){0>pl||(e.current=Jd[pl],Jd[pl]=null,pl--)}function pt(e,t){pl++,Jd[pl]=e.current,e.current=t}var no={},_n=lo(no),Fn=lo(!1),Ao=no;function $l(e,t){var n=e.type.contextTypes;if(!n)return no;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Bn(e){return e=e.childContextTypes,e!=null}function bc(){xt(Fn),xt(_n)}function Ih(e,t,n){if(_n.current!==no)throw Error(re(168));pt(_n,t),pt(Fn,n)}function Hv(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var o in s)if(!(o in t))throw Error(re(108,B1(e)||"Unknown",o));return St({},n,s)}function kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||no,Ao=_n.current,pt(_n,e),pt(Fn,Fn.current),!0}function Ah(e,t,n){var s=e.stateNode;if(!s)throw Error(re(169));n?(e=Hv(e,t,Ao),s.__reactInternalMemoizedMergedChildContext=e,xt(Fn),xt(_n),pt(_n,e)):xt(Fn),pt(Fn,n)}var sr=null,tu=!1,qu=!1;function Uv(e){sr===null?sr=[e]:sr.push(e)}function rk(e){tu=!0,Uv(e)}function ao(){if(!qu&&sr!==null){qu=!0;var e=0,t=at;try{var n=sr;for(at=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}sr=null,tu=!1}catch(o){throw sr!==null&&(sr=sr.slice(e+1)),mv(hp,ao),o}finally{at=t,qu=!1}}return null}var ml=[],hl=0,_c=null,Sc=0,as=[],is=0,Oo=null,rr=1,or="";function So(e,t){ml[hl++]=Sc,ml[hl++]=_c,_c=e,Sc=t}function Vv(e,t,n){as[is++]=rr,as[is++]=or,as[is++]=Oo,Oo=e;var s=rr;e=or;var o=32-Ss(s)-1;s&=~(1<<o),n+=1;var l=32-Ss(t)+o;if(30<l){var a=o-o%5;l=(s&(1<<a)-1).toString(32),s>>=a,o-=a,rr=1<<32-Ss(t)+o|n<<o|s,or=l+e}else rr=1<<l|n<<o|s,or=e}function _p(e){e.return!==null&&(So(e,1),Vv(e,1,0))}function Sp(e){for(;e===_c;)_c=ml[--hl],ml[hl]=null,Sc=ml[--hl],ml[hl]=null;for(;e===Oo;)Oo=as[--is],as[is]=null,or=as[--is],as[is]=null,rr=as[--is],as[is]=null}var Qn=null,Kn=null,yt=!1,_s=null;function Wv(e,t){var n=us(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qn=e,Kn=Wr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Oo!==null?{id:rr,overflow:or}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=us(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qn=e,Kn=null,!0):!1;default:return!1}}function Zd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ef(e){if(yt){var t=Kn;if(t){var n=t;if(!Oh(e,t)){if(Zd(e))throw Error(re(418));t=Wr(n.nextSibling);var s=Qn;t&&Oh(e,t)?Wv(s,n):(e.flags=e.flags&-4097|2,yt=!1,Qn=e)}}else{if(Zd(e))throw Error(re(418));e.flags=e.flags&-4097|2,yt=!1,Qn=e}}}function Lh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function bi(e){if(e!==Qn)return!1;if(!yt)return Lh(e),yt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yd(e.type,e.memoizedProps)),t&&(t=Kn)){if(Zd(e))throw qv(),Error(re(418));for(;t;)Wv(e,t),t=Wr(t.nextSibling)}if(Lh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=Wr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Qn?Wr(e.stateNode.nextSibling):null;return!0}function qv(){for(var e=Kn;e;)e=Wr(e.nextSibling)}function Il(){Kn=Qn=null,yt=!1}function Np(e){_s===null?_s=[e]:_s.push(e)}var ok=jr.ReactCurrentBatchConfig;function la(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(re(309));var s=n.stateNode}if(!s)throw Error(re(147,e));var o=s,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var i=o.refs;a===null?delete i[l]:i[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(re(284));if(!n._owner)throw Error(re(290,e))}return e}function ki(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dh(e){var t=e._init;return t(e._payload)}function Gv(e){function t(v,g){if(e){var w=v.deletions;w===null?(v.deletions=[g],v.flags|=16):w.push(g)}}function n(v,g){if(!e)return null;for(;g!==null;)t(v,g),g=g.sibling;return null}function s(v,g){for(v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function o(v,g){return v=Yr(v,g),v.index=0,v.sibling=null,v}function l(v,g,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<g?(v.flags|=2,g):w):(v.flags|=2,g)):(v.flags|=1048576,g)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function i(v,g,w,b){return g===null||g.tag!==6?(g=Zu(w,v.mode,b),g.return=v,g):(g=o(g,w),g.return=v,g)}function c(v,g,w,b){var S=w.type;return S===il?f(v,g,w.props.children,b,w.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===$r&&Dh(S)===g.type)?(b=o(g,w.props),b.ref=la(v,g,w),b.return=v,b):(b=oc(w.type,w.key,w.props,null,v.mode,b),b.ref=la(v,g,w),b.return=v,b)}function d(v,g,w,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=ed(w,v.mode,b),g.return=v,g):(g=o(g,w.children||[]),g.return=v,g)}function f(v,g,w,b,S){return g===null||g.tag!==7?(g=To(w,v.mode,b,S),g.return=v,g):(g=o(g,w),g.return=v,g)}function m(v,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Zu(""+g,v.mode,w),g.return=v,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case fi:return w=oc(g.type,g.key,g.props,null,v.mode,w),w.ref=la(v,null,g),w.return=v,w;case al:return g=ed(g,v.mode,w),g.return=v,g;case $r:var b=g._init;return m(v,b(g._payload),w)}if(ha(g)||ta(g))return g=To(g,v.mode,w,null),g.return=v,g;ki(v,g)}return null}function p(v,g,w,b){var S=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:i(v,g,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case fi:return w.key===S?c(v,g,w,b):null;case al:return w.key===S?d(v,g,w,b):null;case $r:return S=w._init,p(v,g,S(w._payload),b)}if(ha(w)||ta(w))return S!==null?null:f(v,g,w,b,null);ki(v,w)}return null}function h(v,g,w,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(w)||null,i(g,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case fi:return v=v.get(b.key===null?w:b.key)||null,c(g,v,b,S);case al:return v=v.get(b.key===null?w:b.key)||null,d(g,v,b,S);case $r:var N=b._init;return h(v,g,w,N(b._payload),S)}if(ha(b)||ta(b))return v=v.get(w)||null,f(g,v,b,S,null);ki(g,b)}return null}function x(v,g,w,b){for(var S=null,N=null,_=g,C=g=0,O=null;_!==null&&C<w.length;C++){_.index>C?(O=_,_=null):O=_.sibling;var P=p(v,_,w[C],b);if(P===null){_===null&&(_=O);break}e&&_&&P.alternate===null&&t(v,_),g=l(P,g,C),N===null?S=P:N.sibling=P,N=P,_=O}if(C===w.length)return n(v,_),yt&&So(v,C),S;if(_===null){for(;C<w.length;C++)_=m(v,w[C],b),_!==null&&(g=l(_,g,C),N===null?S=_:N.sibling=_,N=_);return yt&&So(v,C),S}for(_=s(v,_);C<w.length;C++)O=h(_,v,C,w[C],b),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?C:O.key),g=l(O,g,C),N===null?S=O:N.sibling=O,N=O);return e&&_.forEach(function(D){return t(v,D)}),yt&&So(v,C),S}function y(v,g,w,b){var S=ta(w);if(typeof S!="function")throw Error(re(150));if(w=S.call(w),w==null)throw Error(re(151));for(var N=S=null,_=g,C=g=0,O=null,P=w.next();_!==null&&!P.done;C++,P=w.next()){_.index>C?(O=_,_=null):O=_.sibling;var D=p(v,_,P.value,b);if(D===null){_===null&&(_=O);break}e&&_&&D.alternate===null&&t(v,_),g=l(D,g,C),N===null?S=D:N.sibling=D,N=D,_=O}if(P.done)return n(v,_),yt&&So(v,C),S;if(_===null){for(;!P.done;C++,P=w.next())P=m(v,P.value,b),P!==null&&(g=l(P,g,C),N===null?S=P:N.sibling=P,N=P);return yt&&So(v,C),S}for(_=s(v,_);!P.done;C++,P=w.next())P=h(_,v,C,P.value,b),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?C:P.key),g=l(P,g,C),N===null?S=P:N.sibling=P,N=P);return e&&_.forEach(function(K){return t(v,K)}),yt&&So(v,C),S}function j(v,g,w,b){if(typeof w=="object"&&w!==null&&w.type===il&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case fi:e:{for(var S=w.key,N=g;N!==null;){if(N.key===S){if(S=w.type,S===il){if(N.tag===7){n(v,N.sibling),g=o(N,w.props.children),g.return=v,v=g;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===$r&&Dh(S)===N.type){n(v,N.sibling),g=o(N,w.props),g.ref=la(v,N,w),g.return=v,v=g;break e}n(v,N);break}else t(v,N);N=N.sibling}w.type===il?(g=To(w.props.children,v.mode,b,w.key),g.return=v,v=g):(b=oc(w.type,w.key,w.props,null,v.mode,b),b.ref=la(v,g,w),b.return=v,v=b)}return a(v);case al:e:{for(N=w.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(v,g.sibling),g=o(g,w.children||[]),g.return=v,v=g;break e}else{n(v,g);break}else t(v,g);g=g.sibling}g=ed(w,v.mode,b),g.return=v,v=g}return a(v);case $r:return N=w._init,j(v,g,N(w._payload),b)}if(ha(w))return x(v,g,w,b);if(ta(w))return y(v,g,w,b);ki(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(v,g.sibling),g=o(g,w),g.return=v,v=g):(n(v,g),g=Zu(w,v.mode,b),g.return=v,v=g),a(v)):n(v,g)}return j}var Al=Gv(!0),Kv=Gv(!1),Nc=lo(null),Cc=null,gl=null,Cp=null;function Ep(){Cp=gl=Cc=null}function Rp(e){var t=Nc.current;xt(Nc),e._currentValue=t}function tf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Nl(e,t){Cc=e,Cp=gl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zn=!0),e.firstContext=null)}function ms(e){var t=e._currentValue;if(Cp!==e)if(e={context:e,memoizedValue:t,next:null},gl===null){if(Cc===null)throw Error(re(308));gl=e,Cc.dependencies={lanes:0,firstContext:e}}else gl=gl.next=e;return t}var Ro=null;function Pp(e){Ro===null?Ro=[e]:Ro.push(e)}function Yv(e,t,n,s){var o=t.interleaved;return o===null?(n.next=n,Pp(t)):(n.next=o.next,o.next=n),t.interleaved=n,hr(e,s)}function hr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ir=!1;function Mp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Ze&2){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,hr(e,n)}return o=s.interleaved,o===null?(t.next=t,Pp(s)):(t.next=o.next,o.next=t),s.interleaved=t,hr(e,n)}function Zi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,gp(e,n)}}function zh(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?o=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:l,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ec(e,t,n,s){var o=e.updateQueue;Ir=!1;var l=o.firstBaseUpdate,a=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var c=i,d=c.next;c.next=null,a===null?l=d:a.next=d,a=c;var f=e.alternate;f!==null&&(f=f.updateQueue,i=f.lastBaseUpdate,i!==a&&(i===null?f.firstBaseUpdate=d:i.next=d,f.lastBaseUpdate=c))}if(l!==null){var m=o.baseState;a=0,f=d=c=null,i=l;do{var p=i.lane,h=i.eventTime;if((s&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,y=i;switch(p=t,h=n,y.tag){case 1:if(x=y.payload,typeof x=="function"){m=x.call(h,m,p);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,p=typeof x=="function"?x.call(h,m,p):x,p==null)break e;m=St({},m,p);break e;case 2:Ir=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[i]:p.push(i))}else h={eventTime:h,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},f===null?(d=f=h,c=m):f=f.next=h,a|=p;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;p=i,i=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(f===null&&(c=m),o.baseState=c,o.firstBaseUpdate=d,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);Do|=a,e.lanes=a,e.memoizedState=m}}function Fh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],o=s.callback;if(o!==null){if(s.callback=null,s=n,typeof o!="function")throw Error(re(191,o));o.call(s)}}}var si={},qs=lo(si),Fa=lo(si),Ba=lo(si);function Po(e){if(e===si)throw Error(re(174));return e}function Tp(e,t){switch(pt(Ba,t),pt(Fa,e),pt(qs,si),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ad(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ad(t,e)}xt(qs),pt(qs,t)}function Ol(){xt(qs),xt(Fa),xt(Ba)}function Xv(e){Po(Ba.current);var t=Po(qs.current),n=Ad(t,e.type);t!==n&&(pt(Fa,e),pt(qs,n))}function $p(e){Fa.current===e&&(xt(qs),xt(Fa))}var bt=lo(0);function Rc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Gu=[];function Ip(){for(var e=0;e<Gu.length;e++)Gu[e]._workInProgressVersionPrimary=null;Gu.length=0}var ec=jr.ReactCurrentDispatcher,Ku=jr.ReactCurrentBatchConfig,Lo=0,_t=null,Jt=null,on=null,Pc=!1,Sa=!1,Ha=0,lk=0;function xn(){throw Error(re(321))}function Ap(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cs(e[n],t[n]))return!1;return!0}function Op(e,t,n,s,o,l){if(Lo=l,_t=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ec.current=e===null||e.memoizedState===null?uk:dk,e=n(s,o),Sa){l=0;do{if(Sa=!1,Ha=0,25<=l)throw Error(re(301));l+=1,on=Jt=null,t.updateQueue=null,ec.current=fk,e=n(s,o)}while(Sa)}if(ec.current=Mc,t=Jt!==null&&Jt.next!==null,Lo=0,on=Jt=_t=null,Pc=!1,t)throw Error(re(300));return e}function Lp(){var e=Ha!==0;return Ha=0,e}function Fs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?_t.memoizedState=on=e:on=on.next=e,on}function hs(){if(Jt===null){var e=_t.alternate;e=e!==null?e.memoizedState:null}else e=Jt.next;var t=on===null?_t.memoizedState:on.next;if(t!==null)on=t,Jt=e;else{if(e===null)throw Error(re(310));Jt=e,e={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},on===null?_t.memoizedState=on=e:on=on.next=e}return on}function Ua(e,t){return typeof t=="function"?t(e):t}function Yu(e){var t=hs(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var s=Jt,o=s.baseQueue,l=n.pending;if(l!==null){if(o!==null){var a=o.next;o.next=l.next,l.next=a}s.baseQueue=o=l,n.pending=null}if(o!==null){l=o.next,s=s.baseState;var i=a=null,c=null,d=l;do{var f=d.lane;if((Lo&f)===f)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var m={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(i=c=m,a=s):c=c.next=m,_t.lanes|=f,Do|=f}d=d.next}while(d!==null&&d!==l);c===null?a=s:c.next=i,Cs(s,t.memoizedState)||(zn=!0),t.memoizedState=s,t.baseState=a,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){o=e;do l=o.lane,_t.lanes|=l,Do|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Qu(e){var t=hs(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var s=n.dispatch,o=n.pending,l=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do l=e(l,a.action),a=a.next;while(a!==o);Cs(l,t.memoizedState)||(zn=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,s]}function Jv(){}function Zv(e,t){var n=_t,s=hs(),o=t(),l=!Cs(s.memoizedState,o);if(l&&(s.memoizedState=o,zn=!0),s=s.queue,Dp(ny.bind(null,n,s,e),[e]),s.getSnapshot!==t||l||on!==null&&on.memoizedState.tag&1){if(n.flags|=2048,Va(9,ty.bind(null,n,s,o,t),void 0,null),cn===null)throw Error(re(349));Lo&30||ey(n,t,o)}return o}function ey(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ty(e,t,n,s){t.value=n,t.getSnapshot=s,sy(t)&&ry(e)}function ny(e,t,n){return n(function(){sy(t)&&ry(e)})}function sy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cs(e,n)}catch{return!0}}function ry(e){var t=hr(e,1);t!==null&&Ns(t,e,1,-1)}function Bh(e){var t=Fs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:e},t.queue=e,e=e.dispatch=ck.bind(null,_t,e),[t.memoizedState,e]}function Va(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function oy(){return hs().memoizedState}function tc(e,t,n,s){var o=Fs();_t.flags|=e,o.memoizedState=Va(1|t,n,void 0,s===void 0?null:s)}function nu(e,t,n,s){var o=hs();s=s===void 0?null:s;var l=void 0;if(Jt!==null){var a=Jt.memoizedState;if(l=a.destroy,s!==null&&Ap(s,a.deps)){o.memoizedState=Va(t,n,l,s);return}}_t.flags|=e,o.memoizedState=Va(1|t,n,l,s)}function Hh(e,t){return tc(8390656,8,e,t)}function Dp(e,t){return nu(2048,8,e,t)}function ly(e,t){return nu(4,2,e,t)}function ay(e,t){return nu(4,4,e,t)}function iy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cy(e,t,n){return n=n!=null?n.concat([e]):null,nu(4,4,iy.bind(null,t,e),n)}function zp(){}function uy(e,t){var n=hs();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Ap(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function dy(e,t){var n=hs();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Ap(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function fy(e,t,n){return Lo&21?(Cs(n,t)||(n=xv(),_t.lanes|=n,Do|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,zn=!0),e.memoizedState=n)}function ak(e,t){var n=at;at=n!==0&&4>n?n:4,e(!0);var s=Ku.transition;Ku.transition={};try{e(!1),t()}finally{at=n,Ku.transition=s}}function py(){return hs().memoizedState}function ik(e,t,n){var s=Kr(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},my(e))hy(t,n);else if(n=Yv(e,t,n,s),n!==null){var o=Rn();Ns(n,e,s,o),gy(n,t,s)}}function ck(e,t,n){var s=Kr(e),o={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(my(e))hy(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,i=l(a,n);if(o.hasEagerState=!0,o.eagerState=i,Cs(i,a)){var c=t.interleaved;c===null?(o.next=o,Pp(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Yv(e,t,o,s),n!==null&&(o=Rn(),Ns(n,e,s,o),gy(n,t,s))}}function my(e){var t=e.alternate;return e===_t||t!==null&&t===_t}function hy(e,t){Sa=Pc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gy(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,gp(e,n)}}var Mc={readContext:ms,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},uk={readContext:ms,useCallback:function(e,t){return Fs().memoizedState=[e,t===void 0?null:t],e},useContext:ms,useEffect:Hh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tc(4194308,4,iy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tc(4194308,4,e,t)},useInsertionEffect:function(e,t){return tc(4,2,e,t)},useMemo:function(e,t){var n=Fs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Fs();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=ik.bind(null,_t,e),[s.memoizedState,e]},useRef:function(e){var t=Fs();return e={current:e},t.memoizedState=e},useState:Bh,useDebugValue:zp,useDeferredValue:function(e){return Fs().memoizedState=e},useTransition:function(){var e=Bh(!1),t=e[0];return e=ak.bind(null,e[1]),Fs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=_t,o=Fs();if(yt){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),cn===null)throw Error(re(349));Lo&30||ey(s,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Hh(ny.bind(null,s,l,e),[e]),s.flags|=2048,Va(9,ty.bind(null,s,l,n,t),void 0,null),n},useId:function(){var e=Fs(),t=cn.identifierPrefix;if(yt){var n=or,s=rr;n=(s&~(1<<32-Ss(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ha++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=lk++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dk={readContext:ms,useCallback:uy,useContext:ms,useEffect:Dp,useImperativeHandle:cy,useInsertionEffect:ly,useLayoutEffect:ay,useMemo:dy,useReducer:Yu,useRef:oy,useState:function(){return Yu(Ua)},useDebugValue:zp,useDeferredValue:function(e){var t=hs();return fy(t,Jt.memoizedState,e)},useTransition:function(){var e=Yu(Ua)[0],t=hs().memoizedState;return[e,t]},useMutableSource:Jv,useSyncExternalStore:Zv,useId:py,unstable_isNewReconciler:!1},fk={readContext:ms,useCallback:uy,useContext:ms,useEffect:Dp,useImperativeHandle:cy,useInsertionEffect:ly,useLayoutEffect:ay,useMemo:dy,useReducer:Qu,useRef:oy,useState:function(){return Qu(Ua)},useDebugValue:zp,useDeferredValue:function(e){var t=hs();return Jt===null?t.memoizedState=e:fy(t,Jt.memoizedState,e)},useTransition:function(){var e=Qu(Ua)[0],t=hs().memoizedState;return[e,t]},useMutableSource:Jv,useSyncExternalStore:Zv,useId:py,unstable_isNewReconciler:!1};function bs(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var su={isMounted:function(e){return(e=e._reactInternals)?Go(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Rn(),o=Kr(e),l=cr(s,o);l.payload=t,n!=null&&(l.callback=n),t=qr(e,l,o),t!==null&&(Ns(t,e,o,s),Zi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Rn(),o=Kr(e),l=cr(s,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=qr(e,l,o),t!==null&&(Ns(t,e,o,s),Zi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rn(),s=Kr(e),o=cr(n,s);o.tag=2,t!=null&&(o.callback=t),t=qr(e,o,s),t!==null&&(Ns(t,e,s,n),Zi(t,e,s))}};function Uh(e,t,n,s,o,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,l,a):t.prototype&&t.prototype.isPureReactComponent?!Oa(n,s)||!Oa(o,l):!0}function xy(e,t,n){var s=!1,o=no,l=t.contextType;return typeof l=="object"&&l!==null?l=ms(l):(o=Bn(t)?Ao:_n.current,s=t.contextTypes,l=(s=s!=null)?$l(e,o):no),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=su,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function Vh(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&su.enqueueReplaceState(t,t.state,null)}function sf(e,t,n,s){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Mp(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=ms(l):(l=Bn(t)?Ao:_n.current,o.context=$l(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(nf(e,t,l,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&su.enqueueReplaceState(o,o.state,null),Ec(e,n,o,s),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ll(e,t){try{var n="",s=t;do n+=F1(s),s=s.return;while(s);var o=n}catch(l){o=`
|
|
39
|
-
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function Xu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var pk=typeof WeakMap=="function"?WeakMap:Map;function vy(e,t,n){n=cr(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){$c||($c=!0,hf=s),rf(e,t)},n}function yy(e,t,n){n=cr(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var o=t.value;n.payload=function(){return s(o)},n.callback=function(){rf(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){rf(e,t),typeof s!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Wh(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new pk;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(n)||(o.add(n),e=Ck.bind(null,e,t,n),t.then(e,e))}function qh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Gh(e,t,n,s,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=cr(-1,1),t.tag=2,qr(n,t,1))),n.lanes|=1),e)}var mk=jr.ReactCurrentOwner,zn=!1;function Nn(e,t,n,s){t.child=e===null?Kv(t,null,n,s):Al(t,e.child,n,s)}function Kh(e,t,n,s,o){n=n.render;var l=t.ref;return Nl(t,o),s=Op(e,t,n,s,l,o),n=Lp(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gr(e,t,o)):(yt&&n&&_p(t),t.flags|=1,Nn(e,t,s,o),t.child)}function Yh(e,t,n,s,o){if(e===null){var l=n.type;return typeof l=="function"&&!Gp(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,wy(e,t,l,s,o)):(e=oc(n.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&o)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:Oa,n(a,s)&&e.ref===t.ref)return gr(e,t,o)}return t.flags|=1,e=Yr(l,s),e.ref=t.ref,e.return=t,t.child=e}function wy(e,t,n,s,o){if(e!==null){var l=e.memoizedProps;if(Oa(l,s)&&e.ref===t.ref)if(zn=!1,t.pendingProps=s=l,(e.lanes&o)!==0)e.flags&131072&&(zn=!0);else return t.lanes=e.lanes,gr(e,t,o)}return of(e,t,n,s,o)}function jy(e,t,n){var s=t.pendingProps,o=s.children,l=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},pt(vl,qn),qn|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,pt(vl,qn),qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=l!==null?l.baseLanes:n,pt(vl,qn),qn|=s}else l!==null?(s=l.baseLanes|n,t.memoizedState=null):s=n,pt(vl,qn),qn|=s;return Nn(e,t,o,n),t.child}function by(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function of(e,t,n,s,o){var l=Bn(n)?Ao:_n.current;return l=$l(t,l),Nl(t,o),n=Op(e,t,n,s,l,o),s=Lp(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gr(e,t,o)):(yt&&s&&_p(t),t.flags|=1,Nn(e,t,n,o),t.child)}function Qh(e,t,n,s,o){if(Bn(n)){var l=!0;kc(t)}else l=!1;if(Nl(t,o),t.stateNode===null)nc(e,t),xy(t,n,s),sf(t,n,s,o),s=!0;else if(e===null){var a=t.stateNode,i=t.memoizedProps;a.props=i;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=ms(d):(d=Bn(n)?Ao:_n.current,d=$l(t,d));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";m||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==s||c!==d)&&Vh(t,a,s,d),Ir=!1;var p=t.memoizedState;a.state=p,Ec(t,s,a,o),c=t.memoizedState,i!==s||p!==c||Fn.current||Ir?(typeof f=="function"&&(nf(t,n,f,s),c=t.memoizedState),(i=Ir||Uh(t,n,i,s,p,c,d))?(m||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),a.props=s,a.state=c,a.context=d,s=i):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,Qv(e,t),i=t.memoizedProps,d=t.type===t.elementType?i:bs(t.type,i),a.props=d,m=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=ms(c):(c=Bn(n)?Ao:_n.current,c=$l(t,c));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==m||p!==c)&&Vh(t,a,s,c),Ir=!1,p=t.memoizedState,a.state=p,Ec(t,s,a,o);var x=t.memoizedState;i!==m||p!==x||Fn.current||Ir?(typeof h=="function"&&(nf(t,n,h,s),x=t.memoizedState),(d=Ir||Uh(t,n,d,s,p,x,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,x,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,x,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),a.props=s,a.state=x,a.context=c,s=d):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return lf(e,t,n,s,l,o)}function lf(e,t,n,s,o,l){by(e,t);var a=(t.flags&128)!==0;if(!s&&!a)return o&&Ah(t,n,!1),gr(e,t,l);s=t.stateNode,mk.current=t;var i=a&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&a?(t.child=Al(t,e.child,null,l),t.child=Al(t,null,i,l)):Nn(e,t,i,l),t.memoizedState=s.state,o&&Ah(t,n,!0),t.child}function ky(e){var t=e.stateNode;t.pendingContext?Ih(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ih(e,t.context,!1),Tp(e,t.containerInfo)}function Xh(e,t,n,s,o){return Il(),Np(o),t.flags|=256,Nn(e,t,n,s),t.child}var af={dehydrated:null,treeContext:null,retryLane:0};function cf(e){return{baseLanes:e,cachePool:null,transitions:null}}function _y(e,t,n){var s=t.pendingProps,o=bt.current,l=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),pt(bt,o&1),e===null)return ef(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=s.children,e=s.fallback,l?(s=t.mode,l=t.child,a={mode:"hidden",children:a},!(s&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=lu(a,s,0,null),e=To(e,s,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=cf(n),t.memoizedState=af,e):Fp(t,a));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return hk(e,t,a,s,i,o,n);if(l){l=s.fallback,a=t.mode,o=e.child,i=o.sibling;var c={mode:"hidden",children:s.children};return!(a&1)&&t.child!==o?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Yr(o,c),s.subtreeFlags=o.subtreeFlags&14680064),i!==null?l=Yr(i,l):(l=To(l,a,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,s=l,l=t.child,a=e.child.memoizedState,a=a===null?cf(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=af,s}return l=e.child,e=l.sibling,s=Yr(l,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Fp(e,t){return t=lu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function _i(e,t,n,s){return s!==null&&Np(s),Al(t,e.child,null,n),e=Fp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hk(e,t,n,s,o,l,a){if(n)return t.flags&256?(t.flags&=-257,s=Xu(Error(re(422))),_i(e,t,a,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=s.fallback,o=t.mode,s=lu({mode:"visible",children:s.children},o,0,null),l=To(l,o,a,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,t.mode&1&&Al(t,e.child,null,a),t.child.memoizedState=cf(a),t.memoizedState=af,l);if(!(t.mode&1))return _i(e,t,a,null);if(o.data==="$!"){if(s=o.nextSibling&&o.nextSibling.dataset,s)var i=s.dgst;return s=i,l=Error(re(419)),s=Xu(l,s,void 0),_i(e,t,a,s)}if(i=(a&e.childLanes)!==0,zn||i){if(s=cn,s!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(s.suspendedLanes|a)?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,hr(e,o),Ns(s,e,o,-1))}return qp(),s=Xu(Error(re(421))),_i(e,t,a,s)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ek.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,Kn=Wr(o.nextSibling),Qn=t,yt=!0,_s=null,e!==null&&(as[is++]=rr,as[is++]=or,as[is++]=Oo,rr=e.id,or=e.overflow,Oo=t),t=Fp(t,s.children),t.flags|=4096,t)}function Jh(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),tf(e.return,t,n)}function Ju(e,t,n,s,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=n,l.tailMode=o)}function Sy(e,t,n){var s=t.pendingProps,o=s.revealOrder,l=s.tail;if(Nn(e,t,s.children,n),s=bt.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jh(e,n,t);else if(e.tag===19)Jh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(pt(bt,s),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Rc(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ju(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Rc(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ju(t,!0,n,null,l);break;case"together":Ju(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Do|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gk(e,t,n){switch(t.tag){case 3:ky(t),Il();break;case 5:Xv(t);break;case 1:Bn(t.type)&&kc(t);break;case 4:Tp(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,o=t.memoizedProps.value;pt(Nc,s._currentValue),s._currentValue=o;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(pt(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?_y(e,t,n):(pt(bt,bt.current&1),e=gr(e,t,n),e!==null?e.sibling:null);pt(bt,bt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Sy(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),pt(bt,bt.current),s)break;return null;case 22:case 23:return t.lanes=0,jy(e,t,n)}return gr(e,t,n)}var Ny,uf,Cy,Ey;Ny=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};uf=function(){};Cy=function(e,t,n,s){var o=e.memoizedProps;if(o!==s){e=t.stateNode,Po(qs.current);var l=null;switch(n){case"input":o=Md(e,o),s=Md(e,s),l=[];break;case"select":o=St({},o,{value:void 0}),s=St({},s,{value:void 0}),l=[];break;case"textarea":o=Id(e,o),s=Id(e,s),l=[];break;default:typeof o.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=jc)}Od(n,s);var a;n=null;for(d in o)if(!s.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var i=o[d];for(a in i)i.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Ra.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in s){var c=s[d];if(i=o!=null?o[d]:void 0,s.hasOwnProperty(d)&&c!==i&&(c!=null||i!=null))if(d==="style")if(i){for(a in i)!i.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&i[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(l||(l=[]),l.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,i=i?i.__html:void 0,c!=null&&i!==c&&(l=l||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Ra.hasOwnProperty(d)?(c!=null&&d==="onScroll"&>("scroll",e),l||i===c||(l=[])):(l=l||[]).push(d,c))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};Ey=function(e,t,n,s){n!==s&&(t.flags|=4)};function aa(e,t){if(!yt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function vn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags&14680064,s|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function xk(e,t,n){var s=t.pendingProps;switch(Sp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(t),null;case 1:return Bn(t.type)&&bc(),vn(t),null;case 3:return s=t.stateNode,Ol(),xt(Fn),xt(_n),Ip(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(bi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_s!==null&&(vf(_s),_s=null))),uf(e,t),vn(t),null;case 5:$p(t);var o=Po(Ba.current);if(n=t.type,e!==null&&t.stateNode!=null)Cy(e,t,n,s,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(re(166));return vn(t),null}if(e=Po(qs.current),bi(t)){s=t.stateNode,n=t.type;var l=t.memoizedProps;switch(s[Bs]=t,s[za]=l,e=(t.mode&1)!==0,n){case"dialog":gt("cancel",s),gt("close",s);break;case"iframe":case"object":case"embed":gt("load",s);break;case"video":case"audio":for(o=0;o<xa.length;o++)gt(xa[o],s);break;case"source":gt("error",s);break;case"img":case"image":case"link":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"input":ah(s,l),gt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!l.multiple},gt("invalid",s);break;case"textarea":ch(s,l),gt("invalid",s)}Od(n,l),o=null;for(var a in l)if(l.hasOwnProperty(a)){var i=l[a];a==="children"?typeof i=="string"?s.textContent!==i&&(l.suppressHydrationWarning!==!0&&ji(s.textContent,i,e),o=["children",i]):typeof i=="number"&&s.textContent!==""+i&&(l.suppressHydrationWarning!==!0&&ji(s.textContent,i,e),o=["children",""+i]):Ra.hasOwnProperty(a)&&i!=null&&a==="onScroll"&>("scroll",s)}switch(n){case"input":pi(s),ih(s,l,!0);break;case"textarea":pi(s),uh(s);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(s.onclick=jc)}s=o,t.updateQueue=s,s!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nv(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=a.createElement(n,{is:s.is}):(e=a.createElement(n),n==="select"&&(a=e,s.multiple?a.multiple=!0:s.size&&(a.size=s.size))):e=a.createElementNS(e,n),e[Bs]=t,e[za]=s,Ny(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ld(n,s),n){case"dialog":gt("cancel",e),gt("close",e),o=s;break;case"iframe":case"object":case"embed":gt("load",e),o=s;break;case"video":case"audio":for(o=0;o<xa.length;o++)gt(xa[o],e);o=s;break;case"source":gt("error",e),o=s;break;case"img":case"image":case"link":gt("error",e),gt("load",e),o=s;break;case"details":gt("toggle",e),o=s;break;case"input":ah(e,s),o=Md(e,s),gt("invalid",e);break;case"option":o=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},o=St({},s,{value:void 0}),gt("invalid",e);break;case"textarea":ch(e,s),o=Id(e,s),gt("invalid",e);break;default:o=s}Od(n,o),i=o;for(l in i)if(i.hasOwnProperty(l)){var c=i[l];l==="style"?ov(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&sv(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Pa(e,c):typeof c=="number"&&Pa(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ra.hasOwnProperty(l)?c!=null&&l==="onScroll"&>("scroll",e):c!=null&&up(e,l,c,a))}switch(n){case"input":pi(e),ih(e,s,!1);break;case"textarea":pi(e),uh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+to(s.value));break;case"select":e.multiple=!!s.multiple,l=s.value,l!=null?bl(e,!!s.multiple,l,!1):s.defaultValue!=null&&bl(e,!!s.multiple,s.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=jc)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vn(t),null;case 6:if(e&&t.stateNode!=null)Ey(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(re(166));if(n=Po(Ba.current),Po(qs.current),bi(t)){if(s=t.stateNode,n=t.memoizedProps,s[Bs]=t,(l=s.nodeValue!==n)&&(e=Qn,e!==null))switch(e.tag){case 3:ji(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ji(s.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Bs]=t,t.stateNode=s}return vn(t),null;case 13:if(xt(bt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(yt&&Kn!==null&&t.mode&1&&!(t.flags&128))qv(),Il(),t.flags|=98560,l=!1;else if(l=bi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!l)throw Error(re(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(re(317));l[Bs]=t}else Il(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vn(t),l=!1}else _s!==null&&(vf(_s),_s=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||bt.current&1?Zt===0&&(Zt=3):qp())),t.updateQueue!==null&&(t.flags|=4),vn(t),null);case 4:return Ol(),uf(e,t),e===null&&La(t.stateNode.containerInfo),vn(t),null;case 10:return Rp(t.type._context),vn(t),null;case 17:return Bn(t.type)&&bc(),vn(t),null;case 19:if(xt(bt),l=t.memoizedState,l===null)return vn(t),null;if(s=(t.flags&128)!==0,a=l.rendering,a===null)if(s)aa(l,!1);else{if(Zt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Rc(e),a!==null){for(t.flags|=128,aa(l,!1),s=a.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)l=n,e=s,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return pt(bt,bt.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ot()>Dl&&(t.flags|=128,s=!0,aa(l,!1),t.lanes=4194304)}else{if(!s)if(e=Rc(a),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),aa(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!yt)return vn(t),null}else 2*Ot()-l.renderingStartTime>Dl&&n!==1073741824&&(t.flags|=128,s=!0,aa(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ot(),t.sibling=null,n=bt.current,pt(bt,s?n&1|2:n&1),t):(vn(t),null);case 22:case 23:return Wp(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?qn&1073741824&&(vn(t),t.subtreeFlags&6&&(t.flags|=8192)):vn(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function vk(e,t){switch(Sp(t),t.tag){case 1:return Bn(t.type)&&bc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ol(),xt(Fn),xt(_n),Ip(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $p(t),null;case 13:if(xt(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(bt),null;case 4:return Ol(),null;case 10:return Rp(t.type._context),null;case 22:case 23:return Wp(),null;case 24:return null;default:return null}}var Si=!1,wn=!1,yk=typeof WeakSet=="function"?WeakSet:Set,we=null;function xl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Rt(e,t,s)}else n.current=null}function df(e,t,n){try{n()}catch(s){Rt(e,t,s)}}var Zh=!1;function wk(e,t){if(Gd=vc,e=$v(),kp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,l=s.focusNode;s=s.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,i=-1,c=-1,d=0,f=0,m=e,p=null;t:for(;;){for(var h;m!==n||o!==0&&m.nodeType!==3||(i=a+o),m!==l||s!==0&&m.nodeType!==3||(c=a+s),m.nodeType===3&&(a+=m.nodeValue.length),(h=m.firstChild)!==null;)p=m,m=h;for(;;){if(m===e)break t;if(p===n&&++d===o&&(i=a),p===l&&++f===s&&(c=a),(h=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=h}n=i===-1||c===-1?null:{start:i,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Kd={focusedElem:e,selectionRange:n},vc=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,j=x.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:bs(t.type,y),j);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(b){Rt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return x=Zh,Zh=!1,x}function Na(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&df(t,n,l)}o=o.next}while(o!==s)}}function ru(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function ff(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ry(e){var t=e.alternate;t!==null&&(e.alternate=null,Ry(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bs],delete t[za],delete t[Xd],delete t[nk],delete t[sk])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Py(e){return e.tag===5||e.tag===3||e.tag===4}function eg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Py(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pf(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jc));else if(s!==4&&(e=e.child,e!==null))for(pf(e,t,n),e=e.sibling;e!==null;)pf(e,t,n),e=e.sibling}function mf(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(mf(e,t,n),e=e.sibling;e!==null;)mf(e,t,n),e=e.sibling}var pn=null,ks=!1;function Rr(e,t,n){for(n=n.child;n!==null;)My(e,t,n),n=n.sibling}function My(e,t,n){if(Ws&&typeof Ws.onCommitFiberUnmount=="function")try{Ws.onCommitFiberUnmount(Qc,n)}catch{}switch(n.tag){case 5:wn||xl(n,t);case 6:var s=pn,o=ks;pn=null,Rr(e,t,n),pn=s,ks=o,pn!==null&&(ks?(e=pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(ks?(e=pn,n=n.stateNode,e.nodeType===8?Wu(e.parentNode,n):e.nodeType===1&&Wu(e,n),Ia(e)):Wu(pn,n.stateNode));break;case 4:s=pn,o=ks,pn=n.stateNode.containerInfo,ks=!0,Rr(e,t,n),pn=s,ks=o;break;case 0:case 11:case 14:case 15:if(!wn&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){o=s=s.next;do{var l=o,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&df(n,t,a),o=o.next}while(o!==s)}Rr(e,t,n);break;case 1:if(!wn&&(xl(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(i){Rt(n,t,i)}Rr(e,t,n);break;case 21:Rr(e,t,n);break;case 22:n.mode&1?(wn=(s=wn)||n.memoizedState!==null,Rr(e,t,n),wn=s):Rr(e,t,n);break;default:Rr(e,t,n)}}function tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yk),t.forEach(function(s){var o=Rk.bind(null,e,s);n.has(s)||(n.add(s),s.then(o,o))})}}function ws(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];try{var l=e,a=t,i=a;e:for(;i!==null;){switch(i.tag){case 5:pn=i.stateNode,ks=!1;break e;case 3:pn=i.stateNode.containerInfo,ks=!0;break e;case 4:pn=i.stateNode.containerInfo,ks=!0;break e}i=i.return}if(pn===null)throw Error(re(160));My(l,a,o),pn=null,ks=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Rt(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ty(t,e),t=t.sibling}function Ty(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ws(t,e),Is(e),s&4){try{Na(3,e,e.return),ru(3,e)}catch(y){Rt(e,e.return,y)}try{Na(5,e,e.return)}catch(y){Rt(e,e.return,y)}}break;case 1:ws(t,e),Is(e),s&512&&n!==null&&xl(n,n.return);break;case 5:if(ws(t,e),Is(e),s&512&&n!==null&&xl(n,n.return),e.flags&32){var o=e.stateNode;try{Pa(o,"")}catch(y){Rt(e,e.return,y)}}if(s&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,i=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{i==="input"&&l.type==="radio"&&l.name!=null&&ev(o,l),Ld(i,a);var d=Ld(i,l);for(a=0;a<c.length;a+=2){var f=c[a],m=c[a+1];f==="style"?ov(o,m):f==="dangerouslySetInnerHTML"?sv(o,m):f==="children"?Pa(o,m):up(o,f,m,d)}switch(i){case"input":Td(o,l);break;case"textarea":tv(o,l);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var h=l.value;h!=null?bl(o,!!l.multiple,h,!1):p!==!!l.multiple&&(l.defaultValue!=null?bl(o,!!l.multiple,l.defaultValue,!0):bl(o,!!l.multiple,l.multiple?[]:"",!1))}o[za]=l}catch(y){Rt(e,e.return,y)}}break;case 6:if(ws(t,e),Is(e),s&4){if(e.stateNode===null)throw Error(re(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(y){Rt(e,e.return,y)}}break;case 3:if(ws(t,e),Is(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ia(t.containerInfo)}catch(y){Rt(e,e.return,y)}break;case 4:ws(t,e),Is(e);break;case 13:ws(t,e),Is(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Up=Ot())),s&4&&tg(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(wn=(d=wn)||f,ws(t,e),wn=d):ws(t,e),Is(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&e.mode&1)for(we=e,f=e.child;f!==null;){for(m=we=f;we!==null;){switch(p=we,h=p.child,p.tag){case 0:case 11:case 14:case 15:Na(4,p,p.return);break;case 1:xl(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){s=p,n=p.return;try{t=s,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(y){Rt(s,n,y)}}break;case 5:xl(p,p.return);break;case 22:if(p.memoizedState!==null){sg(m);continue}}h!==null?(h.return=p,we=h):sg(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{o=m.stateNode,d?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(i=m.stateNode,c=m.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,i.style.display=rv("display",a))}catch(y){Rt(e,e.return,y)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(y){Rt(e,e.return,y)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:ws(t,e),Is(e),s&4&&tg(e);break;case 21:break;default:ws(t,e),Is(e)}}function Is(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Py(n)){var s=n;break e}n=n.return}throw Error(re(160))}switch(s.tag){case 5:var o=s.stateNode;s.flags&32&&(Pa(o,""),s.flags&=-33);var l=eg(e);mf(e,l,o);break;case 3:case 4:var a=s.stateNode.containerInfo,i=eg(e);pf(e,i,a);break;default:throw Error(re(161))}}catch(c){Rt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jk(e,t,n){we=e,$y(e)}function $y(e,t,n){for(var s=(e.mode&1)!==0;we!==null;){var o=we,l=o.child;if(o.tag===22&&s){var a=o.memoizedState!==null||Si;if(!a){var i=o.alternate,c=i!==null&&i.memoizedState!==null||wn;i=Si;var d=wn;if(Si=a,(wn=c)&&!d)for(we=o;we!==null;)a=we,c=a.child,a.tag===22&&a.memoizedState!==null?rg(o):c!==null?(c.return=a,we=c):rg(o);for(;l!==null;)we=l,$y(l),l=l.sibling;we=o,Si=i,wn=d}ng(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,we=l):ng(e)}}function ng(e){for(;we!==null;){var t=we;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wn||ru(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!wn)if(n===null)s.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:bs(t.type,n.memoizedProps);s.componentDidUpdate(o,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Fh(t,l,s);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Fh(t,a,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Ia(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}wn||t.flags&512&&ff(t)}catch(p){Rt(t,t.return,p)}}if(t===e){we=null;break}if(n=t.sibling,n!==null){n.return=t.return,we=n;break}we=t.return}}function sg(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var n=t.sibling;if(n!==null){n.return=t.return,we=n;break}we=t.return}}function rg(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ru(4,t)}catch(c){Rt(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var o=t.return;try{s.componentDidMount()}catch(c){Rt(t,o,c)}}var l=t.return;try{ff(t)}catch(c){Rt(t,l,c)}break;case 5:var a=t.return;try{ff(t)}catch(c){Rt(t,a,c)}}}catch(c){Rt(t,t.return,c)}if(t===e){we=null;break}var i=t.sibling;if(i!==null){i.return=t.return,we=i;break}we=t.return}}var bk=Math.ceil,Tc=jr.ReactCurrentDispatcher,Bp=jr.ReactCurrentOwner,fs=jr.ReactCurrentBatchConfig,Ze=0,cn=null,Ht=null,mn=0,qn=0,vl=lo(0),Zt=0,Wa=null,Do=0,ou=0,Hp=0,Ca=null,Dn=null,Up=0,Dl=1/0,tr=null,$c=!1,hf=null,Gr=null,Ni=!1,zr=null,Ic=0,Ea=0,gf=null,sc=-1,rc=0;function Rn(){return Ze&6?Ot():sc!==-1?sc:sc=Ot()}function Kr(e){return e.mode&1?Ze&2&&mn!==0?mn&-mn:ok.transition!==null?(rc===0&&(rc=xv()),rc):(e=at,e!==0||(e=window.event,e=e===void 0?16:_v(e.type)),e):1}function Ns(e,t,n,s){if(50<Ea)throw Ea=0,gf=null,Error(re(185));ei(e,n,s),(!(Ze&2)||e!==cn)&&(e===cn&&(!(Ze&2)&&(ou|=n),Zt===4&&Or(e,mn)),Hn(e,s),n===1&&Ze===0&&!(t.mode&1)&&(Dl=Ot()+500,tu&&ao()))}function Hn(e,t){var n=e.callbackNode;ob(e,t);var s=xc(e,e===cn?mn:0);if(s===0)n!==null&&ph(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&ph(n),t===1)e.tag===0?rk(og.bind(null,e)):Uv(og.bind(null,e)),ek(function(){!(Ze&6)&&ao()}),n=null;else{switch(vv(s)){case 1:n=hp;break;case 4:n=hv;break;case 16:n=gc;break;case 536870912:n=gv;break;default:n=gc}n=By(n,Iy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Iy(e,t){if(sc=-1,rc=0,Ze&6)throw Error(re(327));var n=e.callbackNode;if(Cl()&&e.callbackNode!==n)return null;var s=xc(e,e===cn?mn:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Ac(e,s);else{t=s;var o=Ze;Ze|=2;var l=Oy();(cn!==e||mn!==t)&&(tr=null,Dl=Ot()+500,Mo(e,t));do try{Sk();break}catch(i){Ay(e,i)}while(!0);Ep(),Tc.current=l,Ze=o,Ht!==null?t=0:(cn=null,mn=0,t=Zt)}if(t!==0){if(t===2&&(o=Hd(e),o!==0&&(s=o,t=xf(e,o))),t===1)throw n=Wa,Mo(e,0),Or(e,s),Hn(e,Ot()),n;if(t===6)Or(e,s);else{if(o=e.current.alternate,!(s&30)&&!kk(o)&&(t=Ac(e,s),t===2&&(l=Hd(e),l!==0&&(s=l,t=xf(e,l))),t===1))throw n=Wa,Mo(e,0),Or(e,s),Hn(e,Ot()),n;switch(e.finishedWork=o,e.finishedLanes=s,t){case 0:case 1:throw Error(re(345));case 2:No(e,Dn,tr);break;case 3:if(Or(e,s),(s&130023424)===s&&(t=Up+500-Ot(),10<t)){if(xc(e,0)!==0)break;if(o=e.suspendedLanes,(o&s)!==s){Rn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Qd(No.bind(null,e,Dn,tr),t);break}No(e,Dn,tr);break;case 4:if(Or(e,s),(s&4194240)===s)break;for(t=e.eventTimes,o=-1;0<s;){var a=31-Ss(s);l=1<<a,a=t[a],a>o&&(o=a),s&=~l}if(s=o,s=Ot()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*bk(s/1960))-s,10<s){e.timeoutHandle=Qd(No.bind(null,e,Dn,tr),s);break}No(e,Dn,tr);break;case 5:No(e,Dn,tr);break;default:throw Error(re(329))}}}return Hn(e,Ot()),e.callbackNode===n?Iy.bind(null,e):null}function xf(e,t){var n=Ca;return e.current.memoizedState.isDehydrated&&(Mo(e,t).flags|=256),e=Ac(e,t),e!==2&&(t=Dn,Dn=n,t!==null&&vf(t)),e}function vf(e){Dn===null?Dn=e:Dn.push.apply(Dn,e)}function kk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var o=n[s],l=o.getSnapshot;o=o.value;try{if(!Cs(l(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Or(e,t){for(t&=~Hp,t&=~ou,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ss(t),s=1<<n;e[n]=-1,t&=~s}}function og(e){if(Ze&6)throw Error(re(327));Cl();var t=xc(e,0);if(!(t&1))return Hn(e,Ot()),null;var n=Ac(e,t);if(e.tag!==0&&n===2){var s=Hd(e);s!==0&&(t=s,n=xf(e,s))}if(n===1)throw n=Wa,Mo(e,0),Or(e,t),Hn(e,Ot()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,No(e,Dn,tr),Hn(e,Ot()),null}function Vp(e,t){var n=Ze;Ze|=1;try{return e(t)}finally{Ze=n,Ze===0&&(Dl=Ot()+500,tu&&ao())}}function zo(e){zr!==null&&zr.tag===0&&!(Ze&6)&&Cl();var t=Ze;Ze|=1;var n=fs.transition,s=at;try{if(fs.transition=null,at=1,e)return e()}finally{at=s,fs.transition=n,Ze=t,!(Ze&6)&&ao()}}function Wp(){qn=vl.current,xt(vl)}function Mo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Zb(n)),Ht!==null)for(n=Ht.return;n!==null;){var s=n;switch(Sp(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&bc();break;case 3:Ol(),xt(Fn),xt(_n),Ip();break;case 5:$p(s);break;case 4:Ol();break;case 13:xt(bt);break;case 19:xt(bt);break;case 10:Rp(s.type._context);break;case 22:case 23:Wp()}n=n.return}if(cn=e,Ht=e=Yr(e.current,null),mn=qn=t,Zt=0,Wa=null,Hp=ou=Do=0,Dn=Ca=null,Ro!==null){for(t=0;t<Ro.length;t++)if(n=Ro[t],s=n.interleaved,s!==null){n.interleaved=null;var o=s.next,l=n.pending;if(l!==null){var a=l.next;l.next=o,s.next=a}n.pending=s}Ro=null}return e}function Ay(e,t){do{var n=Ht;try{if(Ep(),ec.current=Mc,Pc){for(var s=_t.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}Pc=!1}if(Lo=0,on=Jt=_t=null,Sa=!1,Ha=0,Bp.current=null,n===null||n.return===null){Zt=1,Wa=t,Ht=null;break}e:{var l=e,a=n.return,i=n,c=t;if(t=mn,i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,f=i,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=qh(a);if(h!==null){h.flags&=-257,Gh(h,a,i,l,t),h.mode&1&&Wh(l,d,t),t=h,c=d;var x=t.updateQueue;if(x===null){var y=new Set;y.add(c),t.updateQueue=y}else x.add(c);break e}else{if(!(t&1)){Wh(l,d,t),qp();break e}c=Error(re(426))}}else if(yt&&i.mode&1){var j=qh(a);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Gh(j,a,i,l,t),Np(Ll(c,i));break e}}l=c=Ll(c,i),Zt!==4&&(Zt=2),Ca===null?Ca=[l]:Ca.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=vy(l,c,t);zh(l,v);break e;case 1:i=c;var g=l.type,w=l.stateNode;if(!(l.flags&128)&&(typeof g.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Gr===null||!Gr.has(w)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=yy(l,i,t);zh(l,b);break e}}l=l.return}while(l!==null)}Dy(n)}catch(S){t=S,Ht===n&&n!==null&&(Ht=n=n.return);continue}break}while(!0)}function Oy(){var e=Tc.current;return Tc.current=Mc,e===null?Mc:e}function qp(){(Zt===0||Zt===3||Zt===2)&&(Zt=4),cn===null||!(Do&268435455)&&!(ou&268435455)||Or(cn,mn)}function Ac(e,t){var n=Ze;Ze|=2;var s=Oy();(cn!==e||mn!==t)&&(tr=null,Mo(e,t));do try{_k();break}catch(o){Ay(e,o)}while(!0);if(Ep(),Ze=n,Tc.current=s,Ht!==null)throw Error(re(261));return cn=null,mn=0,Zt}function _k(){for(;Ht!==null;)Ly(Ht)}function Sk(){for(;Ht!==null&&!Q1();)Ly(Ht)}function Ly(e){var t=Fy(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?Dy(e):Ht=t,Bp.current=null}function Dy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=vk(n,t),n!==null){n.flags&=32767,Ht=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Zt=6,Ht=null;return}}else if(n=xk(n,t,qn),n!==null){Ht=n;return}if(t=t.sibling,t!==null){Ht=t;return}Ht=t=e}while(t!==null);Zt===0&&(Zt=5)}function No(e,t,n){var s=at,o=fs.transition;try{fs.transition=null,at=1,Nk(e,t,n,s)}finally{fs.transition=o,at=s}return null}function Nk(e,t,n,s){do Cl();while(zr!==null);if(Ze&6)throw Error(re(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(re(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(lb(e,l),e===cn&&(Ht=cn=null,mn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ni||(Ni=!0,By(gc,function(){return Cl(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=fs.transition,fs.transition=null;var a=at;at=1;var i=Ze;Ze|=4,Bp.current=null,wk(e,n),Ty(n,e),qb(Kd),vc=!!Gd,Kd=Gd=null,e.current=n,jk(n),X1(),Ze=i,at=a,fs.transition=l}else e.current=n;if(Ni&&(Ni=!1,zr=e,Ic=o),l=e.pendingLanes,l===0&&(Gr=null),eb(n.stateNode),Hn(e,Ot()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],s(o.value,{componentStack:o.stack,digest:o.digest});if($c)throw $c=!1,e=hf,hf=null,e;return Ic&1&&e.tag!==0&&Cl(),l=e.pendingLanes,l&1?e===gf?Ea++:(Ea=0,gf=e):Ea=0,ao(),null}function Cl(){if(zr!==null){var e=vv(Ic),t=fs.transition,n=at;try{if(fs.transition=null,at=16>e?16:e,zr===null)var s=!1;else{if(e=zr,zr=null,Ic=0,Ze&6)throw Error(re(331));var o=Ze;for(Ze|=4,we=e.current;we!==null;){var l=we,a=l.child;if(we.flags&16){var i=l.deletions;if(i!==null){for(var c=0;c<i.length;c++){var d=i[c];for(we=d;we!==null;){var f=we;switch(f.tag){case 0:case 11:case 15:Na(8,f,l)}var m=f.child;if(m!==null)m.return=f,we=m;else for(;we!==null;){f=we;var p=f.sibling,h=f.return;if(Ry(f),f===d){we=null;break}if(p!==null){p.return=h,we=p;break}we=h}}}var x=l.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var j=y.sibling;y.sibling=null,y=j}while(y!==null)}}we=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,we=a;else e:for(;we!==null;){if(l=we,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Na(9,l,l.return)}var v=l.sibling;if(v!==null){v.return=l.return,we=v;break e}we=l.return}}var g=e.current;for(we=g;we!==null;){a=we;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,we=w;else e:for(a=g;we!==null;){if(i=we,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:ru(9,i)}}catch(S){Rt(i,i.return,S)}if(i===a){we=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,we=b;break e}we=i.return}}if(Ze=o,ao(),Ws&&typeof Ws.onPostCommitFiberRoot=="function")try{Ws.onPostCommitFiberRoot(Qc,e)}catch{}s=!0}return s}finally{at=n,fs.transition=t}}return!1}function lg(e,t,n){t=Ll(n,t),t=vy(e,t,1),e=qr(e,t,1),t=Rn(),e!==null&&(ei(e,1,t),Hn(e,t))}function Rt(e,t,n){if(e.tag===3)lg(e,e,n);else for(;t!==null;){if(t.tag===3){lg(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Gr===null||!Gr.has(s))){e=Ll(n,e),e=yy(t,e,1),t=qr(t,e,1),e=Rn(),t!==null&&(ei(t,1,e),Hn(t,e));break}}t=t.return}}function Ck(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Rn(),e.pingedLanes|=e.suspendedLanes&n,cn===e&&(mn&n)===n&&(Zt===4||Zt===3&&(mn&130023424)===mn&&500>Ot()-Up?Mo(e,0):Hp|=n),Hn(e,t)}function zy(e,t){t===0&&(e.mode&1?(t=gi,gi<<=1,!(gi&130023424)&&(gi=4194304)):t=1);var n=Rn();e=hr(e,t),e!==null&&(ei(e,t,n),Hn(e,n))}function Ek(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zy(e,n)}function Rk(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(re(314))}s!==null&&s.delete(t),zy(e,n)}var Fy;Fy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fn.current)zn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zn=!1,gk(e,t,n);zn=!!(e.flags&131072)}else zn=!1,yt&&t.flags&1048576&&Vv(t,Sc,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;nc(e,t),e=t.pendingProps;var o=$l(t,_n.current);Nl(t,n),o=Op(null,t,s,e,o,n);var l=Lp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Bn(s)?(l=!0,kc(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Mp(t),o.updater=su,t.stateNode=o,o._reactInternals=t,sf(t,s,e,n),t=lf(null,t,s,!0,l,n)):(t.tag=0,yt&&l&&_p(t),Nn(null,t,o,n),t=t.child),t;case 16:s=t.elementType;e:{switch(nc(e,t),e=t.pendingProps,o=s._init,s=o(s._payload),t.type=s,o=t.tag=Mk(s),e=bs(s,e),o){case 0:t=of(null,t,s,e,n);break e;case 1:t=Qh(null,t,s,e,n);break e;case 11:t=Kh(null,t,s,e,n);break e;case 14:t=Yh(null,t,s,bs(s.type,e),n);break e}throw Error(re(306,s,""))}return t;case 0:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:bs(s,o),of(e,t,s,o,n);case 1:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:bs(s,o),Qh(e,t,s,o,n);case 3:e:{if(ky(t),e===null)throw Error(re(387));s=t.pendingProps,l=t.memoizedState,o=l.element,Qv(e,t),Ec(t,s,null,n);var a=t.memoizedState;if(s=a.element,l.isDehydrated)if(l={element:s,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=Ll(Error(re(423)),t),t=Xh(e,t,s,n,o);break e}else if(s!==o){o=Ll(Error(re(424)),t),t=Xh(e,t,s,n,o);break e}else for(Kn=Wr(t.stateNode.containerInfo.firstChild),Qn=t,yt=!0,_s=null,n=Kv(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Il(),s===o){t=gr(e,t,n);break e}Nn(e,t,s,n)}t=t.child}return t;case 5:return Xv(t),e===null&&ef(t),s=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,a=o.children,Yd(s,o)?a=null:l!==null&&Yd(s,l)&&(t.flags|=32),by(e,t),Nn(e,t,a,n),t.child;case 6:return e===null&&ef(t),null;case 13:return _y(e,t,n);case 4:return Tp(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Al(t,null,s,n):Nn(e,t,s,n),t.child;case 11:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:bs(s,o),Kh(e,t,s,o,n);case 7:return Nn(e,t,t.pendingProps,n),t.child;case 8:return Nn(e,t,t.pendingProps.children,n),t.child;case 12:return Nn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,o=t.pendingProps,l=t.memoizedProps,a=o.value,pt(Nc,s._currentValue),s._currentValue=a,l!==null)if(Cs(l.value,a)){if(l.children===o.children&&!Fn.current){t=gr(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var i=l.dependencies;if(i!==null){a=l.child;for(var c=i.firstContext;c!==null;){if(c.context===s){if(l.tag===1){c=cr(-1,n&-n),c.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),tf(l.return,n,t),i.lanes|=n;break}c=c.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(re(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),tf(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}Nn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps.children,Nl(t,n),o=ms(o),s=s(o),t.flags|=1,Nn(e,t,s,n),t.child;case 14:return s=t.type,o=bs(s,t.pendingProps),o=bs(s.type,o),Yh(e,t,s,o,n);case 15:return wy(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:bs(s,o),nc(e,t),t.tag=1,Bn(s)?(e=!0,kc(t)):e=!1,Nl(t,n),xy(t,s,o),sf(t,s,o,n),lf(null,t,s,!0,e,n);case 19:return Sy(e,t,n);case 22:return jy(e,t,n)}throw Error(re(156,t.tag))};function By(e,t){return mv(e,t)}function Pk(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function us(e,t,n,s){return new Pk(e,t,n,s)}function Gp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mk(e){if(typeof e=="function")return Gp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fp)return 11;if(e===pp)return 14}return 2}function Yr(e,t){var n=e.alternate;return n===null?(n=us(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oc(e,t,n,s,o,l){var a=2;if(s=e,typeof e=="function")Gp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case il:return To(n.children,o,l,t);case dp:a=8,o|=8;break;case Cd:return e=us(12,n,t,o|2),e.elementType=Cd,e.lanes=l,e;case Ed:return e=us(13,n,t,o),e.elementType=Ed,e.lanes=l,e;case Rd:return e=us(19,n,t,o),e.elementType=Rd,e.lanes=l,e;case Xx:return lu(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yx:a=10;break e;case Qx:a=9;break e;case fp:a=11;break e;case pp:a=14;break e;case $r:a=16,s=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=us(a,n,t,o),t.elementType=e,t.type=s,t.lanes=l,t}function To(e,t,n,s){return e=us(7,e,s,t),e.lanes=n,e}function lu(e,t,n,s){return e=us(22,e,s,t),e.elementType=Xx,e.lanes=n,e.stateNode={isHidden:!1},e}function Zu(e,t,n){return e=us(6,e,null,t),e.lanes=n,e}function ed(e,t,n){return t=us(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tk(e,t,n,s,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Iu(0),this.expirationTimes=Iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Iu(0),this.identifierPrefix=s,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Kp(e,t,n,s,o,l,a,i,c){return e=new Tk(e,t,n,i,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=us(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mp(l),e}function $k(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:al,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Hy(e){if(!e)return no;e=e._reactInternals;e:{if(Go(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Bn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var n=e.type;if(Bn(n))return Hv(e,n,t)}return t}function Uy(e,t,n,s,o,l,a,i,c){return e=Kp(n,s,!0,e,o,l,a,i,c),e.context=Hy(null),n=e.current,s=Rn(),o=Kr(n),l=cr(s,o),l.callback=t??null,qr(n,l,o),e.current.lanes=o,ei(e,o,s),Hn(e,s),e}function au(e,t,n,s){var o=t.current,l=Rn(),a=Kr(o);return n=Hy(n),t.context===null?t.context=n:t.pendingContext=n,t=cr(l,a),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=qr(o,t,a),e!==null&&(Ns(e,o,a,l),Zi(e,o,a)),a}function Oc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ag(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yp(e,t){ag(e,t),(e=e.alternate)&&ag(e,t)}function Ik(){return null}var Vy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qp(e){this._internalRoot=e}iu.prototype.render=Qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));au(e,t,null,null)};iu.prototype.unmount=Qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zo(function(){au(null,e,null,null)}),t[mr]=null}};function iu(e){this._internalRoot=e}iu.prototype.unstable_scheduleHydration=function(e){if(e){var t=jv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ar.length&&t!==0&&t<Ar[n].priority;n++);Ar.splice(n,0,e),n===0&&kv(e)}};function Xp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ig(){}function Ak(e,t,n,s,o){if(o){if(typeof s=="function"){var l=s;s=function(){var d=Oc(a);l.call(d)}}var a=Uy(t,s,e,0,null,!1,!1,"",ig);return e._reactRootContainer=a,e[mr]=a.current,La(e.nodeType===8?e.parentNode:e),zo(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof s=="function"){var i=s;s=function(){var d=Oc(c);i.call(d)}}var c=Kp(e,0,!1,null,null,!1,!1,"",ig);return e._reactRootContainer=c,e[mr]=c.current,La(e.nodeType===8?e.parentNode:e),zo(function(){au(t,c,n,s)}),c}function uu(e,t,n,s,o){var l=n._reactRootContainer;if(l){var a=l;if(typeof o=="function"){var i=o;o=function(){var c=Oc(a);i.call(c)}}au(t,a,e,o)}else a=Ak(n,t,e,o,s);return Oc(a)}yv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ga(t.pendingLanes);n!==0&&(gp(t,n|1),Hn(t,Ot()),!(Ze&6)&&(Dl=Ot()+500,ao()))}break;case 13:zo(function(){var s=hr(e,1);if(s!==null){var o=Rn();Ns(s,e,1,o)}}),Yp(e,1)}};xp=function(e){if(e.tag===13){var t=hr(e,134217728);if(t!==null){var n=Rn();Ns(t,e,134217728,n)}Yp(e,134217728)}};wv=function(e){if(e.tag===13){var t=Kr(e),n=hr(e,t);if(n!==null){var s=Rn();Ns(n,e,t,s)}Yp(e,t)}};jv=function(){return at};bv=function(e,t){var n=at;try{return at=e,t()}finally{at=n}};zd=function(e,t,n){switch(t){case"input":if(Td(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var o=eu(s);if(!o)throw Error(re(90));Zx(s),Td(s,o)}}}break;case"textarea":tv(e,n);break;case"select":t=n.value,t!=null&&bl(e,!!n.multiple,t,!1)}};iv=Vp;cv=zo;var Ok={usingClientEntryPoint:!1,Events:[ni,fl,eu,lv,av,Vp]},ia={findFiberByHostInstance:Eo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Lk={bundleType:ia.bundleType,version:ia.version,rendererPackageName:ia.rendererPackageName,rendererConfig:ia.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fv(e),e===null?null:e.stateNode},findFiberByHostInstance:ia.findFiberByHostInstance||Ik,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ci=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ci.isDisabled&&Ci.supportsFiber)try{Qc=Ci.inject(Lk),Ws=Ci}catch{}}Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ok;Zn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xp(t))throw Error(re(200));return $k(e,t,null,n)};Zn.createRoot=function(e,t){if(!Xp(e))throw Error(re(299));var n=!1,s="",o=Vy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Kp(e,1,!1,null,null,n,!1,s,o),e[mr]=t.current,La(e.nodeType===8?e.parentNode:e),new Qp(t)};Zn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=fv(t),e=e===null?null:e.stateNode,e};Zn.flushSync=function(e){return zo(e)};Zn.hydrate=function(e,t,n){if(!cu(t))throw Error(re(200));return uu(null,e,t,!0,n)};Zn.hydrateRoot=function(e,t,n){if(!Xp(e))throw Error(re(405));var s=n!=null&&n.hydratedSources||null,o=!1,l="",a=Vy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Uy(t,null,e,1,n??null,o,!1,l,a),e[mr]=t.current,La(e),s)for(e=0;e<s.length;e++)n=s[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new iu(t)};Zn.render=function(e,t,n){if(!cu(t))throw Error(re(200));return uu(null,e,t,!1,n)};Zn.unmountComponentAtNode=function(e){if(!cu(e))throw Error(re(40));return e._reactRootContainer?(zo(function(){uu(null,null,e,!1,function(){e._reactRootContainer=null,e[mr]=null})}),!0):!1};Zn.unstable_batchedUpdates=Vp;Zn.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!cu(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return uu(e,t,n,!1,s)};Zn.version="18.3.1-next-f1338f8080-20240426";function Wy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wy)}catch(e){console.error(e)}}Wy(),Wx.exports=Zn;var Ko=Wx.exports,qy,cg=Ko;qy=cg.createRoot,cg.hydrateRoot;/**
|
|
41
|
-
* @remix-run/router v1.23.4
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},qa.apply(null,arguments)}var Fr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Fr||(Fr={}));const ug="popstate";function Dk(e){e===void 0&&(e={});function t(s,o){let{pathname:l,search:a,hash:i}=s.location;return yf("",{pathname:l,search:a,hash:i},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){return typeof o=="string"?o:Ky(o)}return Fk(t,n,null,e)}function qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function zk(){return Math.random().toString(36).substr(2,8)}function dg(e,t){return{usr:e.state,key:e.key,idx:t}}function yf(e,t,n,s){return n===void 0&&(n=null),qa({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Kl(t):t,{state:n,key:t&&t.key||s||zk()})}function Ky(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Kl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Fk(e,t,n,s){s===void 0&&(s={});let{window:o=document.defaultView,v5Compat:l=!1}=s,a=o.history,i=Fr.Pop,c=null,d=f();d==null&&(d=0,a.replaceState(qa({},a.state,{idx:d}),""));function f(){return(a.state||{idx:null}).idx}function m(){i=Fr.Pop;let j=f(),v=j==null?null:j-d;d=j,c&&c({action:i,location:y.location,delta:v})}function p(j,v){i=Fr.Push;let g=yf(y.location,j,v);d=f()+1;let w=dg(g,d),b=y.createHref(g);try{a.pushState(w,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(b)}l&&c&&c({action:i,location:y.location,delta:1})}function h(j,v){i=Fr.Replace;let g=yf(y.location,j,v);d=f();let w=dg(g,d),b=y.createHref(g);a.replaceState(w,"",b),l&&c&&c({action:i,location:y.location,delta:0})}function x(j){let v=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof j=="string"?j:Ky(j);return g=g.replace(/ $/,"%20"),qt(v,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,v)}let y={get action(){return i},get location(){return e(o,a)},listen(j){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(ug,m),c=j,()=>{o.removeEventListener(ug,m),c=null}},createHref(j){return t(o,j)},createURL:x,encodeLocation(j){let v=x(j);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(j){return a.go(j)}};return y}var fg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(fg||(fg={}));function Bk(e,t,n){return n===void 0&&(n="/"),Hk(e,t,n)}function Hk(e,t,n,s){let o=typeof t=="string"?Kl(t):t,l=Xy(o.pathname||"/",n);if(l==null)return null;let a=Yy(e);Uk(a);let i=null,c=t_(l);for(let d=0;i==null&&d<a.length;++d)i=Jk(a[d],c);return i}function Yy(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let o=(l,a,i)=>{let c={relativePath:i===void 0?l.path||"":i,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};c.relativePath.startsWith("/")&&(qt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let d=$o([s,c.relativePath]),f=n.concat(c);l.children&&l.children.length>0&&(qt(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Yy(l.children,t,f,d)),!(l.path==null&&!l.index)&&t.push({path:d,score:Qk(d,l.index),routesMeta:f})};return e.forEach((l,a)=>{var i;if(l.path===""||!((i=l.path)!=null&&i.includes("?")))o(l,a);else for(let c of Qy(l.path))o(l,a,c)}),t}function Qy(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let a=Qy(s.join("/")),i=[];return i.push(...a.map(c=>c===""?l:[l,c].join("/"))),o&&i.push(...a),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function Uk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Xk(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Vk=/^:[\w-]+$/,Wk=3,qk=2,Gk=1,Kk=10,Yk=-2,pg=e=>e==="*";function Qk(e,t){let n=e.split("/"),s=n.length;return n.some(pg)&&(s+=Yk),t&&(s+=qk),n.filter(o=>!pg(o)).reduce((o,l)=>o+(Vk.test(l)?Wk:l===""?Gk:Kk),s)}function Xk(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function Jk(e,t,n){let{routesMeta:s}=e,o={},l="/",a=[];for(let i=0;i<s.length;++i){let c=s[i],d=i===s.length-1,f=l==="/"?t:t.slice(l.length)||"/",m=Zk({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),p=c.route;if(!m)return null;Object.assign(o,m.params),a.push({params:o,pathname:$o([l,m.pathname]),pathnameBase:r_($o([l,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(l=$o([l,m.pathnameBase]))}return a}function Zk(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=e_(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],a=l.replace(/(.)\/+$/,"$1"),i=o.slice(1);return{params:s.reduce((d,f,m)=>{let{paramName:p,isOptional:h}=f;if(p==="*"){let y=i[m]||"";a=l.slice(0,l.length-y.length).replace(/(.)\/+$/,"$1")}const x=i[m];return h&&!x?d[p]=void 0:d[p]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function e_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Gy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,i,c)=>(s.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function t_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xy(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function n_(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?Kl(e):e,l;return n?(n=e0(n),n.startsWith("/")?l=mg(n.substring(1),"/"):l=mg(n,t)):l=t,{pathname:l,search:o_(s),hash:l_(o)}}function mg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function td(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function s_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jy(e,t){let n=s_(e);return t?n.map((s,o)=>o===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Zy(e,t,n,s){s===void 0&&(s=!1);let o;typeof e=="string"?o=Kl(e):(o=qa({},e),qt(!o.pathname||!o.pathname.includes("?"),td("?","pathname","search",o)),qt(!o.pathname||!o.pathname.includes("#"),td("#","pathname","hash",o)),qt(!o.search||!o.search.includes("#"),td("#","search","hash",o)));let l=e===""||o.pathname==="",a=l?"/":o.pathname,i;if(a==null)i=n;else{let m=t.length-1;if(!s&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),m-=1;o.pathname=p.join("/")}i=m>=0?t[m]:"/"}let c=n_(o,i),d=a&&a!=="/"&&a.endsWith("/"),f=(l||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const e0=e=>e.replace(/\/\/+/g,"/"),$o=e=>e0(e.join("/")),r_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),o_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,l_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function a_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const t0=["post","put","patch","delete"];new Set(t0);const i_=["get",...t0];new Set(i_);/**
|
|
50
|
-
* React Router v6.30.6
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ga.apply(null,arguments)}const Jp=u.createContext(null),c_=u.createContext(null),ri=u.createContext(null),du=u.createContext(null),io=u.createContext({outlet:null,matches:[],isDataRoute:!1}),n0=u.createContext(null);function oi(){return u.useContext(du)!=null}function li(){return oi()||qt(!1),u.useContext(du).location}function s0(e){u.useContext(ri).static||u.useLayoutEffect(e)}function Yl(){let{isDataRoute:e}=u.useContext(io);return e?k_():u_()}function u_(){oi()||qt(!1);let e=u.useContext(Jp),{basename:t,future:n,navigator:s}=u.useContext(ri),{matches:o}=u.useContext(io),{pathname:l}=li(),a=JSON.stringify(Jy(o,n.v7_relativeSplatPath)),i=u.useRef(!1);return s0(()=>{i.current=!0}),u.useCallback(function(d,f){if(f===void 0&&(f={}),!i.current)return;if(typeof d=="number"){s.go(d);return}let m=Zy(d,JSON.parse(a),l,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:$o([t,m.pathname])),(f.replace?s.replace:s.push)(m,f.state,f)},[t,s,a,l,e])}function d_(){let{matches:e}=u.useContext(io),t=e[e.length-1];return t?t.params:{}}function f_(e,t){return p_(e,t)}function p_(e,t,n,s){oi()||qt(!1);let{navigator:o}=u.useContext(ri),{matches:l}=u.useContext(io),a=l[l.length-1],i=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=li(),f;if(t){var m;let j=typeof t=="string"?Kl(t):t;c==="/"||(m=j.pathname)!=null&&m.startsWith(c)||qt(!1),f=j}else f=d;let p=f.pathname||"/",h=p;if(c!=="/"){let j=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(j.length).join("/")}let x=Bk(e,{pathname:h}),y=v_(x&&x.map(j=>Object.assign({},j,{params:Object.assign({},i,j.params),pathname:$o([c,o.encodeLocation?o.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:$o([c,o.encodeLocation?o.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),l,n,s);return t&&y?u.createElement(du.Provider,{value:{location:Ga({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Fr.Pop}},y):y}function m_(){let e=b_(),t=a_(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:o},n):null,null)}const h_=u.createElement(m_,null);class g_ extends u.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?u.createElement(io.Provider,{value:this.props.routeContext},u.createElement(n0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function x_(e){let{routeContext:t,match:n,children:s}=e,o=u.useContext(Jp);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(io.Provider,{value:t},s)}function v_(e,t,n,s){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=s)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=(o=n)==null?void 0:o.errors;if(i!=null){let f=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);f>=0||qt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,d=-1;if(n&&s&&s.v7_partialHydration)for(let f=0;f<a.length;f++){let m=a[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=f),m.route.id){let{loaderData:p,errors:h}=n,x=m.route.loader&&p[m.route.id]===void 0&&(!h||h[m.route.id]===void 0);if(m.route.lazy||x){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((f,m,p)=>{let h,x=!1,y=null,j=null;n&&(h=i&&m.route.id?i[m.route.id]:void 0,y=m.route.errorElement||h_,c&&(d<0&&p===0?(__("route-fallback"),x=!0,j=null):d===p&&(x=!0,j=m.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,p+1)),g=()=>{let w;return h?w=y:x?w=j:m.route.Component?w=u.createElement(m.route.Component,null):m.route.element?w=m.route.element:w=f,u.createElement(x_,{match:m,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:w})};return n&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?u.createElement(g_,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:g(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):g()},null)}var r0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(r0||{}),o0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(o0||{});function y_(e){let t=u.useContext(Jp);return t||qt(!1),t}function w_(e){let t=u.useContext(c_);return t||qt(!1),t}function j_(e){let t=u.useContext(io);return t||qt(!1),t}function l0(e){let t=j_(),n=t.matches[t.matches.length-1];return n.route.id||qt(!1),n.route.id}function b_(){var e;let t=u.useContext(n0),n=w_(),s=l0();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function k_(){let{router:e}=y_(r0.UseNavigateStable),t=l0(o0.UseNavigateStable),n=u.useRef(!1);return s0(()=>{n.current=!0}),u.useCallback(function(o,l){l===void 0&&(l={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ga({fromRouteId:t},l)))},[e,t])}const hg={};function __(e,t,n){hg[e]||(hg[e]=!0)}function S_(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zl(e){let{to:t,replace:n,state:s,relative:o}=e;oi()||qt(!1);let{future:l,static:a}=u.useContext(ri),{matches:i}=u.useContext(io),{pathname:c}=li(),d=Yl(),f=Zy(t,Jy(i,l.v7_relativeSplatPath),c,o==="path"),m=JSON.stringify(f);return u.useEffect(()=>d(JSON.parse(m),{replace:n,state:s,relative:o}),[d,m,o,n,s]),null}function Ds(e){qt(!1)}function N_(e){let{basename:t="/",children:n=null,location:s,navigationType:o=Fr.Pop,navigator:l,static:a=!1,future:i}=e;oi()&&qt(!1);let c=t.replace(/^\/*/,"/"),d=u.useMemo(()=>({basename:c,navigator:l,static:a,future:Ga({v7_relativeSplatPath:!1},i)}),[c,i,l,a]);typeof s=="string"&&(s=Kl(s));let{pathname:f="/",search:m="",hash:p="",state:h=null,key:x="default"}=s,y=u.useMemo(()=>{let j=Xy(f,c);return j==null?null:{location:{pathname:j,search:m,hash:p,state:h,key:x},navigationType:o}},[c,f,m,p,h,x,o]);return y==null?null:u.createElement(ri.Provider,{value:d},u.createElement(du.Provider,{children:n,value:y}))}function C_(e){let{children:t,location:n}=e;return f_(wf(t),n)}new Promise(()=>{});function wf(e,t){t===void 0&&(t=[]);let n=[];return u.Children.forEach(e,(s,o)=>{if(!u.isValidElement(s))return;let l=[...t,o];if(s.type===u.Fragment){n.push.apply(n,wf(s.props.children,l));return}s.type!==Ds&&qt(!1),!s.props.index||!s.props.children||qt(!1);let a={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(a.children=wf(s.props.children,l)),n.push(a)}),n}/**
|
|
59
|
-
* React Router DOM v6.30.6
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function jf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(o=>[n,o]):[[n,s]])},[]))}function E_(e,t){let n=jf(e);return t&&t.forEach((s,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}const R_="6";try{window.__reactRouterVersion=R_}catch{}const P_="startTransition",gg=Wo[P_];function M_(e){let{basename:t,children:n,future:s,window:o}=e,l=u.useRef();l.current==null&&(l.current=Dk({window:o,v5Compat:!0}));let a=l.current,[i,c]=u.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},f=u.useCallback(m=>{d&&gg?gg(()=>c(m)):c(m)},[c,d]);return u.useLayoutEffect(()=>a.listen(f),[a,f]),u.useEffect(()=>S_(s),[s]),u.createElement(N_,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:a,future:s})}var xg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xg||(xg={}));var vg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(vg||(vg={}));function T_(e){let t=u.useRef(jf(e)),n=u.useRef(!1),s=li(),o=u.useMemo(()=>E_(s.search,n.current?null:t.current),[s.search]),l=Yl(),a=u.useCallback((i,c)=>{const d=jf(typeof i=="function"?i(o):i);n.current=!0,l("?"+d,c)},[l,o]);return[o,a]}const $_={},yg=e=>{let t;const n=new Set,s=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,h))}},o=()=>t,c={setState:s,getState:o,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{($_?"plugin":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,o,c);return c},I_=e=>e?yg(e):yg;var a0={exports:{}},i0={},c0={exports:{}},u0={};/**
|
|
68
|
-
* @license React
|
|
69
|
-
* use-sync-external-store-shim.production.js
|
|
70
|
-
*
|
|
71
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the MIT license found in the
|
|
74
|
-
* LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/var Fl=u;function A_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var O_=typeof Object.is=="function"?Object.is:A_,L_=Fl.useState,D_=Fl.useEffect,z_=Fl.useLayoutEffect,F_=Fl.useDebugValue;function B_(e,t){var n=t(),s=L_({inst:{value:n,getSnapshot:t}}),o=s[0].inst,l=s[1];return z_(function(){o.value=n,o.getSnapshot=t,nd(o)&&l({inst:o})},[e,n,t]),D_(function(){return nd(o)&&l({inst:o}),e(function(){nd(o)&&l({inst:o})})},[e]),F_(n),n}function nd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!O_(e,n)}catch{return!0}}function H_(e,t){return t()}var U_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?H_:B_;u0.useSyncExternalStore=Fl.useSyncExternalStore!==void 0?Fl.useSyncExternalStore:U_;c0.exports=u0;var V_=c0.exports;/**
|
|
76
|
-
* @license React
|
|
77
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
78
|
-
*
|
|
79
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the MIT license found in the
|
|
82
|
-
* LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/var fu=u,W_=V_;function q_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G_=typeof Object.is=="function"?Object.is:q_,K_=W_.useSyncExternalStore,Y_=fu.useRef,Q_=fu.useEffect,X_=fu.useMemo,J_=fu.useDebugValue;i0.useSyncExternalStoreWithSelector=function(e,t,n,s,o){var l=Y_(null);if(l.current===null){var a={hasValue:!1,value:null};l.current=a}else a=l.current;l=X_(function(){function c(h){if(!d){if(d=!0,f=h,h=s(h),o!==void 0&&a.hasValue){var x=a.value;if(o(x,h))return m=x}return m=h}if(x=m,G_(f,h))return x;var y=s(h);return o!==void 0&&o(x,y)?(f=h,x):(f=h,m=y)}var d=!1,f,m,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,s,o]);var i=K_(e,l[0],l[1]);return Q_(function(){a.hasValue=!0,a.value=i},[i]),J_(i),i};a0.exports=i0;var Z_=a0.exports;const eS=Tx(Z_),d0={},{useDebugValue:tS}=Ux,{useSyncExternalStoreWithSelector:nS}=eS;let wg=!1;const sS=e=>e;function rS(e,t=sS,n){(d0?"plugin":void 0)!=="production"&&n&&!wg&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),wg=!0);const s=nS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tS(s),s}const jg=e=>{(d0?"plugin":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?I_(e):e,n=(s,o)=>rS(t,s,o);return Object.assign(n,t),n},Zp=e=>e?jg(e):jg,ds="/touchstone/".replace(/\/+$/,"");async function Ei(e,t,n){const s={method:e,credentials:"same-origin",headers:{}};n!==void 0&&(s.headers["Content-Type"]="application/json",s.body=JSON.stringify(n));const o=await fetch(ds+t,s);if(o.status===401)throw window.location.pathname!==ds+"/login"&&!window.__ts_redirecting&&(window.__ts_redirecting=!0,window.location.href=ds+"/login"),new Error("unauthorized");let l=null;const a=await o.text();if(a)try{l=JSON.parse(a)}catch{l=a}if(!o.ok){const i=l&&(l.error||l.message)||`HTTP ${o.status}`;throw new Error(i)}return l}const J={get:e=>Ei("GET",e),post:(e,t)=>Ei("POST",e,t),patch:(e,t)=>Ei("PATCH",e,t),del:(e,t)=>Ei("DELETE",e,t)},El={me:()=>J.get("/api/auth/me"),login:(e,t)=>J.post("/api/auth/login",{username:e,password:t}),register:(e,t)=>J.post("/api/auth/register",{username:e,password:t}),logout:()=>J.post("/api/auth/logout"),changePassword:(e,t)=>J.post("/api/auth/change_password",{old_password:e,new_password:t})},Ln={feishuGet:()=>J.get("/api/me/feishu"),feishuBindcode:()=>J.post("/api/me/feishu-bindcode"),feishuUnbind:()=>J.del("/api/me/feishu"),feishuCfgGet:()=>J.get("/api/me/feishu-cfg"),feishuCfgSet:e=>J.patch("/api/me/feishu-cfg",e),feishuOutbox:()=>J.get("/api/me/feishu/outbox"),feishuSlashGet:()=>J.get("/api/me/feishu/slash-commands"),feishuSlashSet:e=>J.post("/api/me/feishu/slash-commands",{action:e}),feishuProvisionGet:()=>J.get("/api/me/feishu/provision"),feishuProvisionSet:(e,t={})=>J.post("/api/me/feishu/provision",{action:e,...t}),feishuDoctor:(e=!1)=>J.post("/api/me/feishu/doctor",{send_probe:!!e})},kt={list:()=>J.get("/api/projects"),get:e=>J.get(`/api/projects/${e}`),create:e=>J.post("/api/projects",e),update:(e,t)=>J.patch(`/api/projects/${e}`,t),remove:(e,t)=>J.del(`/api/projects/${e}`,t),archive:e=>J.post(`/api/projects/${e}/archive`),unarchive:e=>J.post(`/api/projects/${e}/unarchive`),fsBrowse:e=>J.get(`/api/fs/browse?path=${encodeURIComponent(e||"")}`),fsMkdir:(e,t)=>J.post("/api/fs/mkdir",{path:e,name:t}),dupCheck:e=>{const t=new URLSearchParams(e).toString();return J.get(`/api/projects/dup_check?${t}`)},agents:()=>J.get("/api/agents/scan"),agentModels:e=>J.get(`/api/agents/models?agent_path=${encodeURIComponent(e||"")}`),agentSkills:(e,t)=>J.get(`/api/agents/skills?agent_path=${encodeURIComponent(e||"")}&project_dir=${encodeURIComponent(t||"")}`),feishuHookGet:e=>J.get(`/api/projects/${e}/feishu-hook`),feishuHookSet:(e,t)=>J.patch(`/api/projects/${e}/feishu-hook`,t),feishuHookApplyAll:e=>J.post("/api/me/feishu-hook/apply",e),filePreview:(e,t)=>J.get(`/api/projects/${e}/file?path=${encodeURIComponent(t)}`),fileRawUrl:(e,t)=>`${ds}/api/projects/${e}/file?path=${encodeURIComponent(t)}&raw=1`},yl={get:e=>J.get(`/api/prefs?project_id=${e||0}`),set:(e,t,n)=>J.post("/api/prefs",{project_id:e||0,key:t,value:n})},Ue={list:e=>J.get(`/api/projects/${e}/tasks`),create:(e,t)=>J.post(`/api/projects/${e}/tasks`,t),get:e=>J.get(`/api/tasks/${e}`),update:(e,t)=>J.patch(`/api/tasks/${e}`,t),stop:e=>J.post(`/api/tasks/${e}/stop`),restart:e=>J.post(`/api/tasks/${e}/restart`),continue:(e,t)=>J.post(`/api/tasks/${e}/continue`,t),remove:e=>J.del(`/api/tasks/${e}`),rounds:e=>J.get(`/api/tasks/${e}/rounds`),dialogue:e=>J.get(`/api/tasks/${e}/dialogue`),log:(e,t,n=300)=>J.get(`/api/tasks/${e}/log?round=${t}&tail=${n}`),loadCase:e=>J.get(`/api/tasks/${e}/load/case`),loadCaseMeta:e=>J.get(`/api/tasks/${e}/load/case?meta=1`),loadRuns:e=>J.get(`/api/tasks/${e}/load/runs`),loadRerun:e=>J.post(`/api/tasks/${e}/load/rerun`),loadDiagnose:e=>J.post(`/api/tasks/${e}/load/diagnose`),loadMetrics:(e,t=0,n=2e4,s="")=>J.get(`/api/tasks/${e}/load/metrics?after=${t}&limit=${n}`+(s?`&run=${encodeURIComponent(s)}`:"")),loadReport:(e,t="")=>J.get(`/api/tasks/${e}/load_report${t?`?run=${encodeURIComponent(t)}`:""}`),loadStream:(e,t="")=>new EventSource(`${ds}/api/tasks/${e}/load/stream${t?`?run=${encodeURIComponent(t)}`:""}`),loadCustomHtmlUrl:e=>`${ds}/api/tasks/${e}/load/custom_html`,sessionMessages:(e,t="main",n=0)=>J.get(`/api/tasks/${e}/session/messages?agent=${encodeURIComponent(t)}&after=${n}`),sessionStream:(e,t="main")=>new EventSource(`${ds}/api/tasks/${e}/session/stream?agent=${encodeURIComponent(t)}`),sessionChat:(e,t,n=!1)=>J.post(`/api/tasks/${e}/session/chat`,{message:t,inject:n}),sessionChatInject:(e,t)=>J.post(`/api/tasks/${e}/session/chat/inject`,{msg_id:t}),sessionRewind:(e,t)=>J.post(`/api/tasks/${e}/session/rewind`,{mid:t}),answerInteraction:(e,t)=>J.post(`/api/tasks/${e}/session/interaction/answer`,t),sessionChatStop:e=>J.post(`/api/tasks/${e}/session/chat/stop`),sessionProfile:(e,t)=>J.post(`/api/tasks/${e}/session/profile`,t),sessionMediaUrl:(e,t,n)=>`${ds}/api/tasks/${e}/session/media/${encodeURIComponent(n)}?agent=${encodeURIComponent(t)}`},bf={list:e=>J.get(`/api/projects/${e}/bugs`),get:(e,t)=>J.get(`/api/projects/${e}/bugs/${encodeURIComponent(t)}`),reject:(e,t,n)=>J.post(`/api/projects/${e}/bugs/${encodeURIComponent(t)}/reject`,{reason:n})},Br={users:()=>J.get("/api/admin/users"),createUser:e=>J.post("/api/admin/users",e),updateUser:(e,t)=>J.patch(`/api/admin/users/${e}`,t),deleteUser:e=>J.del(`/api/admin/users/${e}`),ragGet:()=>J.get("/api/admin/rag"),ragSet:e=>J.patch("/api/admin/rag",e),ragTest:e=>J.post("/api/admin/rag/test",e)},sd={list:(e,t)=>{const n=e==="project"?"project":"user";return J.get(`/api/builtin-assets?target=${n}`+(n==="project"&&t?`&project_id=${t}`:""))},install:(e,t,n)=>J.post(`/api/builtin-assets/${e}/install`,{target:t,project_id:n??null}),uninstall:(e,t,n)=>J.post(`/api/builtin-assets/${e}/uninstall`,{target:t,project_id:n??null})},bg={state:e=>J.get(`/api/state?project=${e}`),stream:e=>new EventSource(`${ds}/api/stream?project=${e}`)},Ee={get:e=>J.get(`/api/projects/${e}/board`),createCard:(e,t)=>J.post(`/api/projects/${e}/board/cards`,t),updateCard:(e,t,n)=>J.patch(`/api/projects/${e}/board/cards/${t}`,n),removeCard:(e,t)=>J.del(`/api/projects/${e}/board/cards/${t}`),moveCard:(e,t,n,s,o=null,l=!1)=>J.post(`/api/projects/${e}/board/cards/${t}/move`,{column:n,block_text:s,before_id:o,merge_ack:!!l}),startCard:(e,t,n,s,o)=>J.post(`/api/projects/${e}/board/cards/${t}/start`,{opinion:n,force:!!s,worktree:!!o}),worktreePreview:(e,t)=>J.get(`/api/projects/${e}/board/cards/${t}/worktree`),mergeWorktree:(e,t)=>J.post(`/api/projects/${e}/board/cards/${t}/worktree/merge`,{}),removeWorktree:(e,t)=>J.del(`/api/projects/${e}/board/cards/${t}/worktree`),stopCard:(e,t)=>J.post(`/api/projects/${e}/board/cards/${t}/stop`),markViewed:(e,t)=>J.post(`/api/projects/${e}/board/cards/${t}/viewed`),addComment:(e,t,n)=>J.post(`/api/projects/${e}/board/cards/${t}/comments`,{text:n}),sendComment:(e,t,n,s=!1)=>J.post(`/api/projects/${e}/board/cards/${t}/comments/${n}/send`,{inject:s}),removeComment:(e,t,n)=>J.del(`/api/projects/${e}/board/cards/${t}/comments/${n}`),listSessions:e=>J.get(`/api/projects/${e}/board/sessions`),compact:(e,t,n)=>J.post(`/api/projects/${e}/board/cards/${t}/compact`,n?{sid:n}:{}),forkCompact:(e,t,n)=>J.post(`/api/projects/${e}/board/cards/${t}/fork-compact`,n?{sid:n}:{}),forkSession:(e,t,n)=>J.post(`/api/projects/${e}/board/cards/${t}/fork`,n?{sid:n}:{}),answerInteraction:(e,t,n)=>J.post(`/api/projects/${e}/board/cards/${t}/interaction/answer`,n),deliverAnswer:(e,t)=>J.post(`/api/projects/${e}/board/cards/${t}/answer/deliver`),injectSessionMsg:(e,t,n)=>J.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/inject`,{msg_id:n}),rewindSession:(e,t,n)=>J.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/rewind`,{mid:n}),updateSettings:(e,t)=>J.patch(`/api/projects/${e}/board/settings`,t),jiraTest:(e,t)=>J.post(`/api/projects/${e}/board/jira/test`,t),jiraImport:e=>J.post(`/api/projects/${e}/board/jira/import`),sessionMessages:(e,t,n=0,s="main")=>J.get(`/api/projects/${e}/board/session/messages?sid=${encodeURIComponent(t)}&after=${n}&agent=${encodeURIComponent(s)}`),sessionMediaUrl:(e,t,n,s)=>`${ds}/api/projects/${e}/board/session/media/${encodeURIComponent(s)}?sid=${encodeURIComponent(t)}&agent=${encodeURIComponent(n)}`,reorderCard:(e,t,n)=>J.post(`/api/projects/${e}/board/reorder`,{card_id:t,before_id:n}),trashList:e=>J.get(`/api/projects/${e}/board/trash`),restoreCard:(e,t)=>J.post(`/api/projects/${e}/board/trash/${t}/restore`),purgeCard:(e,t)=>J.del(`/api/projects/${e}/board/trash/${t}`),emptyTrash:e=>J.post(`/api/projects/${e}/board/trash/empty`),setSessionProfile:(e,t,n)=>J.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/profile`,n),uploadMedia:(e,t)=>J.post(`/api/projects/${e}/board/media`,t),stream:e=>new EventSource(`${ds}/api/projects/${e}/board/stream`),sessionStream:(e,t)=>new EventSource(`${ds}/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/stream`)},Xn=Zp((e,t)=>({username:"",isAdmin:!1,mustChangePassword:!1,loaded:!1,load:async()=>{try{const n=await El.me();e({username:n.username,isAdmin:!!n.is_admin,mustChangePassword:!!n.must_change_password,loaded:!0})}catch{e({username:"",mustChangePassword:!1,loaded:!0})}},login:async(n,s)=>{await El.login(n,s),await t().load()},logout:async()=>{try{await El.logout()}catch{}e({username:"",isAdmin:!1,mustChangePassword:!1})}}));function pu({size:e=22}){return r.jsxs("svg",{className:"ts-logo",width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"tsLogoG",x1:"0",y1:"1",x2:"1",y2:"0",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--logo-1)"}}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--logo-2)"}})]})}),r.jsx("path",{fill:"url(#tsLogoG)",fillRule:"evenodd",d:`M8.6 3H15.4A5.6 5.6 0 0 1 21 8.6V15.4A5.6 5.6 0 0 1 15.4 21H8.6A5.6 5.6 0 0 1 3 15.4V8.6A5.6 5.6 0 0 1 8.6 3Z
|
|
84
|
-
M7.6 6.6H16.4V9.8H13.6V17.8H10.4V9.8H7.6Z`})]})}var oS=Object.defineProperty,em=(e,t)=>oS(e,"name",{value:t,configurable:!0});function kf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}em(kf,"setRef");function f0(...e){return t=>{let n=!1;const s=e.map(o=>{const l=kf(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():kf(e[o],null)}}}}em(f0,"composeRefs");function wt(...e){return u.useCallback(f0(...e),e)}em(wt,"useComposedRefs");var lS=Object.defineProperty,Rs=(e,t)=>lS(e,"name",{value:t,configurable:!0});function xr(e){const t=u.forwardRef((n,s)=>{let{children:o,...l}=n,a=null,i=!1;const c=[];_f(o)&&typeof Ri=="function"&&(o=Ri(o._payload)),u.Children.forEach(o,p=>{var h;if(g0(p)){i=!0;const x=p;let y="child"in x.props?x.props.child:x.props.children;_f(y)&&typeof Ri=="function"&&(y=Ri(y._payload)),a=cS(x,y),c.push((h=a==null?void 0:a.props)==null?void 0:h.children)}else c.push(p)}),a?a=u.cloneElement(a,void 0,c):!i&&u.Children.count(o)===1&&u.isValidElement(o)&&(a=o);const d=a?h0(a):void 0,f=wt(s,d);if(!a){if(o||o===0)throw new Error(i?fS(e):dS(e));return o}const m=m0(l,a.props??{});return a.type!==u.Fragment&&(m.ref=s?f:d),u.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}Rs(xr,"createSlot");var aS=xr("Slot"),p0=Symbol.for("radix.slottable");function iS(e){const t=Rs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=p0,t}Rs(iS,"createSlottable");var cS=Rs((e,t)=>{if("child"in e.props){const n=e.props.child;return u.isValidElement(n)?u.cloneElement(n,void 0,e.props.children(n.props.children)):null}return u.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m0(e,t){const n={...t};for(const s in t){const o=e[s],l=t[s];/^on[A-Z]/.test(s)?o&&l?n[s]=(...i)=>{const c=l(...i);return o(...i),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...l}:s==="className"&&(n[s]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}Rs(m0,"mergeProps");function h0(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Rs(h0,"getElementRef");function g0(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===p0}Rs(g0,"isSlottable");var uS=Symbol.for("react.lazy");function _f(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===uS&&"_payload"in e&&x0(e._payload)}Rs(_f,"isLazyComponent");function x0(e){return typeof e=="object"&&e!==null&&"then"in e}Rs(x0,"isPromiseLike");var dS=Rs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fS=Rs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ri=Wo[" use ".trim().toString()];function v0(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=v0(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function y0(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=v0(e))&&(s&&(s+=" "),s+=t);return s}const kg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_g=y0,w0=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return _g(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,a=Object.keys(o).map(d=>{const f=n==null?void 0:n[d],m=l==null?void 0:l[d];if(f===null)return null;const p=kg(f)||kg(m);return o[d][p]}),i=n&&Object.entries(n).reduce((d,f)=>{let[m,p]=f;return p===void 0||(d[m]=p),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,f)=>{let{class:m,className:p,...h}=f;return Object.entries(h).every(x=>{let[y,j]=x;return Array.isArray(j)?j.includes({...l,...i}[y]):{...l,...i}[y]===j})?[...d,m,p]:d},[]);return _g(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},pS=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},mS=(e,t)=>({classGroupId:e,validator:t}),j0=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lc="-",Sg=[],hS="arbitrary..",gS=e=>{const t=vS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return xS(a);const i=a.split(Lc),c=i[0]===""&&i.length>1?1:0;return b0(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=s[a],d=n[a];return c?d?pS(d,c):c:d||Sg}return n[a]||Sg}}},b0=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const d=b0(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(Lc):e.slice(t).join(Lc),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},xS=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?hS+s:void 0})(),vS=e=>{const{theme:t,classGroups:n}=e;return yS(n,t)},yS=(e,t)=>{const n=j0();for(const s in e){const o=e[s];tm(o,n,s,t)}return n},tm=(e,t,n,s)=>{const o=e.length;for(let l=0;l<o;l++){const a=e[l];wS(a,t,n,s)}},wS=(e,t,n,s)=>{if(typeof e=="string"){jS(e,t,n);return}if(typeof e=="function"){bS(e,t,n,s);return}kS(e,t,n,s)},jS=(e,t,n)=>{const s=e===""?t:k0(t,e);s.classGroupId=n},bS=(e,t,n,s)=>{if(_S(e)){tm(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(mS(n,e))},kS=(e,t,n,s)=>{const o=Object.entries(e),l=o.length;for(let a=0;a<l;a++){const[i,c]=o[a];tm(c,k0(t,i),n,s)}},k0=(e,t)=>{let n=e;const s=t.split(Lc),o=s.length;for(let l=0;l<o;l++){const a=s[l];let i=n.nextPart.get(a);i||(i=j0(),n.nextPart.set(a,i)),n=i}return n},_S=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(l,a)=>{n[l]=a,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=s[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},Sf="!",Ng=":",NS=[],Cg=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),CS=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const l=[];let a=0,i=0,c=0,d;const f=o.length;for(let y=0;y<f;y++){const j=o[y];if(a===0&&i===0){if(j===Ng){l.push(o.slice(c,y)),c=y+1;continue}if(j==="/"){d=y;continue}}j==="["?a++:j==="]"?a--:j==="("?i++:j===")"&&i--}const m=l.length===0?o:o.slice(c);let p=m,h=!1;m.endsWith(Sf)?(p=m.slice(0,-1),h=!0):m.startsWith(Sf)&&(p=m.slice(1),h=!0);const x=d&&d>c?d-c:void 0;return Cg(l,h,p,x)};if(t){const o=t+Ng,l=s;s=a=>a.startsWith(o)?l(a.slice(o.length)):Cg(NS,!1,a,void 0,!0)}if(n){const o=s;s=l=>n({className:l,parseClassName:o})}return s},ES=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],i=a[0]==="[",c=t.has(a);i||c?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(a)):o.push(a)}return o.length>0&&(o.sort(),s.push(...o)),s}},RS=e=>({cache:SS(e.cacheSize),parseClassName:CS(e),sortModifiers:ES(e),postfixLookupClassGroupIds:PS(e),...gS(e)}),PS=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let s=0;s<n.length;s++)t[n[s]]=!0;return t},MS=/\s+/,TS=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:a}=t,i=[],c=e.trim().split(MS);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:p,modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:j}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let v=!!j,g;if(v){const _=y.substring(0,j);g=s(_);const C=g&&a[g]?s(y):void 0;C&&C!==g&&(g=C,v=!1)}else g=s(y);if(!g){if(!v){d=m+(d.length>0?" "+d:d);continue}if(g=s(y),!g){d=m+(d.length>0?" "+d:d);continue}v=!1}const w=h.length===0?"":h.length===1?h[0]:l(h).join(":"),b=x?w+Sf:w,S=b+g;if(i.indexOf(S)>-1)continue;i.push(S);const N=o(g,v);for(let _=0;_<N.length;++_){const C=N[_];i.push(b+C)}d=m+(d.length>0?" "+d:d)}return d},$S=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=_0(n))&&(o&&(o+=" "),o+=s);return o},_0=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=_0(e[s]))&&(n&&(n+=" "),n+=t);return n},IS=(e,...t)=>{let n,s,o,l;const a=c=>{const d=t.reduce((f,m)=>m(f),e());return n=RS(d),s=n.cache.get,o=n.cache.set,l=i,i(c)},i=c=>{const d=s(c);if(d)return d;const f=TS(c,n);return o(c,f),f};return l=a,(...c)=>l($S(...c))},AS=[],Xt=e=>{const t=n=>n[e]||AS;return t.isThemeGetter=!0,t},S0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,N0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,OS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,FS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=e=>OS.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),As=e=>!!e&&Number.isInteger(Number(e)),rd=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Zs=e=>LS.test(e),C0=()=>!0,HS=e=>DS.test(e)&&!zS.test(e),nm=()=>!1,US=e=>FS.test(e),VS=e=>BS.test(e),WS=e=>!xe(e)&&!ye(e),qS=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),GS=e=>co(e,P0,nm),xe=e=>S0.test(e),jo=e=>co(e,M0,HS),Eg=e=>co(e,tN,qe),KS=e=>co(e,$0,C0),YS=e=>co(e,T0,nm),Rg=e=>co(e,E0,nm),QS=e=>co(e,R0,VS),Pi=e=>co(e,I0,US),ye=e=>N0.test(e),ca=e=>Yo(e,M0),XS=e=>Yo(e,T0),Pg=e=>Yo(e,E0),JS=e=>Yo(e,P0),ZS=e=>Yo(e,R0),Mi=e=>Yo(e,I0,!0),eN=e=>Yo(e,$0,!0),co=(e,t,n)=>{const s=S0.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Yo=(e,t,n=!1)=>{const s=N0.exec(e);return s?s[1]?t(s[1]):n:!1},E0=e=>e==="position"||e==="percentage",R0=e=>e==="image"||e==="url",P0=e=>e==="length"||e==="size"||e==="bg-size",M0=e=>e==="length",tN=e=>e==="number",T0=e=>e==="family-name",$0=e=>e==="number"||e==="weight",I0=e=>e==="shadow",nN=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),s=Xt("font-weight"),o=Xt("tracking"),l=Xt("leading"),a=Xt("breakpoint"),i=Xt("container"),c=Xt("spacing"),d=Xt("radius"),f=Xt("shadow"),m=Xt("inset-shadow"),p=Xt("text-shadow"),h=Xt("drop-shadow"),x=Xt("blur"),y=Xt("perspective"),j=Xt("aspect"),v=Xt("ease"),g=Xt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),ye,xe],N=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],C=()=>[ye,xe,c],O=()=>[Pr,"full","auto",...C()],P=()=>[As,"none","subgrid",ye,xe],D=()=>["auto",{span:["full",As,ye,xe]},As,ye,xe],K=()=>[As,"auto",ye,xe],L=()=>["auto","min","max","fr",ye,xe],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...C()],G=()=>[Pr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],z=()=>[Pr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],Y=()=>[Pr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],B=()=>[e,ye,xe],me=()=>[...b(),Pg,Rg,{position:[ye,xe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",JS,GS,{size:[ye,xe]}],ke=()=>[rd,ca,jo],_e=()=>["","none","full",d,ye,xe],Ce=()=>["",qe,ca,jo],$e=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[qe,rd,Pg,Rg],Se=()=>["","none",x,ye,xe],te=()=>["none",qe,ye,xe],E=()=>["none",qe,ye,xe],U=()=>[qe,ye,xe],A=()=>[Pr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[C0],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[WS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",qe],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pr,xe,ye,j]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,xe]}],"container-named":[qS],columns:[{columns:[qe,xe,ye,i]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[As,"auto",ye,xe]}],basis:[{basis:[Pr,"full","auto",i,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Pr,"auto","initial","none",xe]}],grow:[{grow:["",qe,ye,xe]}],shrink:[{shrink:["",qe,ye,xe]}],order:[{order:[As,"first","last","none",ye,xe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mbs:[{mbs:ee()}],mbe:[{mbe:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[i,"screen",...G()]}],"min-w":[{"min-w":[i,"screen","none",...G()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,ca,jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,eN,KS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rd,xe]}],"font-family":[{font:[XS,YS,t]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ye,xe]}],"line-clamp":[{"line-clamp":[qe,"none",ye,Eg]}],leading:[{leading:[l,...C()]}],"list-image":[{"list-image":["none",ye,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$e(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",ye,jo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[qe,"auto",ye,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[As,ye,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},As,ye,xe],radial:["",ye,xe],conic:[As,ye,xe]},ZS,QS]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:ke()}],"gradient-via-pos":[{via:ke()}],"gradient-to-pos":[{to:ke()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:_e()}],"rounded-s":[{"rounded-s":_e()}],"rounded-e":[{"rounded-e":_e()}],"rounded-t":[{"rounded-t":_e()}],"rounded-r":[{"rounded-r":_e()}],"rounded-b":[{"rounded-b":_e()}],"rounded-l":[{"rounded-l":_e()}],"rounded-ss":[{"rounded-ss":_e()}],"rounded-se":[{"rounded-se":_e()}],"rounded-ee":[{"rounded-ee":_e()}],"rounded-es":[{"rounded-es":_e()}],"rounded-tl":[{"rounded-tl":_e()}],"rounded-tr":[{"rounded-tr":_e()}],"rounded-br":[{"rounded-br":_e()}],"rounded-bl":[{"rounded-bl":_e()}],"border-w":[{border:Ce()}],"border-w-x":[{"border-x":Ce()}],"border-w-y":[{"border-y":Ce()}],"border-w-s":[{"border-s":Ce()}],"border-w-e":[{"border-e":Ce()}],"border-w-bs":[{"border-bs":Ce()}],"border-w-be":[{"border-be":Ce()}],"border-w-t":[{"border-t":Ce()}],"border-w-r":[{"border-r":Ce()}],"border-w-b":[{"border-b":Ce()}],"border-w-l":[{"border-l":Ce()}],"divide-x":[{"divide-x":Ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$e(),"hidden","none"]}],"divide-style":[{divide:[...$e(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...$e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,ye,xe]}],"outline-w":[{outline:["",qe,ca,jo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",f,Mi,Pi]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",m,Mi,Pi]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[qe,jo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Ce()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",p,Mi,Pi]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[qe,ye,xe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ye,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,xe]}],filter:[{filter:["","none",ye,xe]}],blur:[{blur:Se()}],brightness:[{brightness:[qe,ye,xe]}],contrast:[{contrast:[qe,ye,xe]}],"drop-shadow":[{"drop-shadow":["","none",h,Mi,Pi]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",qe,ye,xe]}],"hue-rotate":[{"hue-rotate":[qe,ye,xe]}],invert:[{invert:["",qe,ye,xe]}],saturate:[{saturate:[qe,ye,xe]}],sepia:[{sepia:["",qe,ye,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,xe]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[qe,ye,xe]}],"backdrop-contrast":[{"backdrop-contrast":[qe,ye,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,ye,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,ye,xe]}],"backdrop-invert":[{"backdrop-invert":["",qe,ye,xe]}],"backdrop-opacity":[{"backdrop-opacity":[qe,ye,xe]}],"backdrop-saturate":[{"backdrop-saturate":[qe,ye,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,ye,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",ye,xe]}],ease:[{ease:["linear","initial",v,ye,xe]}],delay:[{delay:[qe,ye,xe]}],animate:[{animate:["none",g,ye,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,ye,xe]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:E()}],"scale-x":[{"scale-x":E()}],"scale-y":[{"scale-y":E()}],"scale-z":[{"scale-z":E()}],"scale-3d":["scale-3d"],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[ye,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:A()}],"translate-x":[{"translate-x":A()}],"translate-y":[{"translate-y":A()}],"translate-z":[{"translate-z":A()}],"translate-none":["translate-none"],zoom:[{zoom:[As,ye,xe]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,xe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[qe,ca,jo,Eg]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sN=IS(nN);function Ge(...e){return sN(y0(e))}const rN=w0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function H({className:e,variant:t,size:n,asChild:s=!1,...o}){const l=s?aS:"button";return r.jsx(l,{"data-slot":"button",className:Ge(rN({variant:t,size:n,className:e})),...o})}function Ae({className:e,type:t,...n}){return r.jsx("input",{type:t,"data-slot":"input",className:Ge("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",e),...n})}var oN=Object.defineProperty,lN=(e,t)=>oN(e,"name",{value:t,configurable:!0}),aN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=aN.reduce((e,t)=>{const n=xr(`Primitive.${t}`),s=u.forwardRef((o,l)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...i,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function A0(e,t){e&&Ko.flushSync(()=>e.dispatchEvent(t))}lN(A0,"dispatchDiscreteCustomEvent");var iN=Object.defineProperty,cN=(e,t)=>iN(e,"name",{value:t,configurable:!0}),uN=u.forwardRef(cN(function(t,n){return r.jsx(ut.label,{...t,ref:n,onMouseDown:s=>{var l;s.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})},"Label")),dN=uN;const st=u.forwardRef(({className:e,...t},n)=>r.jsx(dN,{ref:n,"data-slot":"label",className:Ge("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t}));st.displayName="Label";function bn({className:e,...t}){return r.jsx("div",{"data-slot":"card",className:Ge("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Vn({className:e,...t}){return r.jsx("div",{"data-slot":"card-header",className:Ge("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Wn({className:e,...t}){return r.jsx("div",{"data-slot":"card-title",className:Ge("leading-none font-semibold",e),...t})}function O0({className:e,...t}){return r.jsx("div",{"data-slot":"card-description",className:Ge("text-muted-foreground text-sm",e),...t})}function kn({className:e,...t}){return r.jsx("div",{"data-slot":"card-content",className:Ge("px-6",e),...t})}function L0({className:e,...t}){return r.jsx("div",{"data-slot":"card-footer",className:Ge("flex items-center px-6",e),...t})}/**
|
|
85
|
-
* @license lucide-react v1.35.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const D0=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
90
|
-
* @license lucide-react v1.35.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const fN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
95
|
-
* @license lucide-react v1.35.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const pN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
100
|
-
* @license lucide-react v1.35.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const Mg=e=>{const t=pN(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
105
|
-
* @license lucide-react v1.35.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/var od={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
110
|
-
* @license lucide-react v1.35.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const mN=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},hN=u.createContext({}),gN=()=>u.useContext(hN),xN=u.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:o="",children:l,iconNode:a,...i},c)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:m=!1,color:p="currentColor",className:h=""}=gN()??{},x=s??m?Number(n??f)*24/Number(t??d):n??f;return u.createElement("svg",{ref:c,...od,width:t??d??od.width,height:t??d??od.height,stroke:e??p,strokeWidth:x,className:D0("lucide",h,o),...!l&&!mN(i)&&{"aria-hidden":"true"},...i},[...a.map(([y,j])=>u.createElement(y,j)),...Array.isArray(l)?l:[l]])});/**
|
|
115
|
-
* @license lucide-react v1.35.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const Ne=(e,t)=>{const n=u.forwardRef(({className:s,...o},l)=>u.createElement(xN,{ref:l,iconNode:t,className:D0(`lucide-${fN(Mg(e))}`,`lucide-${e}`,s),...o}));return n.displayName=Mg(e),n};/**
|
|
120
|
-
* @license lucide-react v1.35.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const vN=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],ld=Ne("archive-restore",vN);/**
|
|
125
|
-
* @license lucide-react v1.35.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const yN=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],ad=Ne("archive",yN);/**
|
|
130
|
-
* @license lucide-react v1.35.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const wN=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],jN=Ne("arrow-down-to-line",wN);/**
|
|
135
|
-
* @license lucide-react v1.35.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const bN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sm=Ne("arrow-left",bN);/**
|
|
140
|
-
* @license lucide-react v1.35.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const kN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Tg=Ne("arrow-right",kN);/**
|
|
145
|
-
* @license lucide-react v1.35.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const _N=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],SN=Ne("arrow-up",_N);/**
|
|
150
|
-
* @license lucide-react v1.35.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const NN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],CN=Ne("ban",NN);/**
|
|
155
|
-
* @license lucide-react v1.35.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const EN=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],RN=Ne("bell",EN);/**
|
|
160
|
-
* @license lucide-react v1.35.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const PN=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],z0=Ne("boxes",PN);/**
|
|
165
|
-
* @license lucide-react v1.35.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const MN=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],F0=Ne("brain",MN);/**
|
|
170
|
-
* @license lucide-react v1.35.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const TN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lr=Ne("check",TN);/**
|
|
175
|
-
* @license lucide-react v1.35.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const $N=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bl=Ne("chevron-down",$N);/**
|
|
180
|
-
* @license lucide-react v1.35.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const IN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Dc=Ne("chevron-up",IN);/**
|
|
185
|
-
* @license lucide-react v1.35.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const AN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ON=Ne("circle-x",AN);/**
|
|
190
|
-
* @license lucide-react v1.35.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const LN=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],DN=Ne("command",LN);/**
|
|
195
|
-
* @license lucide-react v1.35.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const zN=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],FN=Ne("copy-plus",zN);/**
|
|
200
|
-
* @license lucide-react v1.35.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const BN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],rm=Ne("copy",BN);/**
|
|
205
|
-
* @license lucide-react v1.35.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const HN=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],UN=Ne("download",HN);/**
|
|
210
|
-
* @license lucide-react v1.35.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const VN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],om=Ne("external-link",VN);/**
|
|
215
|
-
* @license lucide-react v1.35.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const WN=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],$g=Ne("eye-off",WN);/**
|
|
220
|
-
* @license lucide-react v1.35.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const qN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],GN=Ne("file-exclamation-point",qN);/**
|
|
225
|
-
* @license lucide-react v1.35.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const KN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],B0=Ne("file-text",KN);/**
|
|
230
|
-
* @license lucide-react v1.35.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const YN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Ig=Ne("folder-open",YN);/**
|
|
235
|
-
* @license lucide-react v1.35.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const QN=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],XN=Ne("folder-plus",QN);/**
|
|
240
|
-
* @license lucide-react v1.35.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const JN=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],ZN=Ne("git-fork",JN);/**
|
|
245
|
-
* @license lucide-react v1.35.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const eC=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],lm=Ne("key-round",eC);/**
|
|
250
|
-
* @license lucide-react v1.35.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const tC=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],H0=Ne("link-2",tC);/**
|
|
255
|
-
* @license lucide-react v1.35.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const nC=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],sC=Ne("list",nC);/**
|
|
260
|
-
* @license lucide-react v1.35.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const rC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],U0=Ne("loader-circle",rC);/**
|
|
265
|
-
* @license lucide-react v1.35.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const oC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],am=Ne("log-out",oC);/**
|
|
270
|
-
* @license lucide-react v1.35.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const lC=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],aC=Ne("maximize-2",lC);/**
|
|
275
|
-
* @license lucide-react v1.35.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const iC=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],cC=Ne("menu",iC);/**
|
|
280
|
-
* @license lucide-react v1.35.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const uC=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],dC=Ne("message-square",uC);/**
|
|
285
|
-
* @license lucide-react v1.35.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const fC=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],pC=Ne("messages-square",fC);/**
|
|
290
|
-
* @license lucide-react v1.35.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const mC=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],V0=Ne("palette",mC);/**
|
|
295
|
-
* @license lucide-react v1.35.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const hC=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],im=Ne("pencil",hC);/**
|
|
300
|
-
* @license lucide-react v1.35.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const gC=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],va=Ne("play",gC);/**
|
|
305
|
-
* @license lucide-react v1.35.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const xC=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],vC=Ne("plug-zap",xC);/**
|
|
310
|
-
* @license lucide-react v1.35.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const yC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ai=Ne("plus",yC);/**
|
|
315
|
-
* @license lucide-react v1.35.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const wC=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ka=Ne("refresh-cw",wC);/**
|
|
320
|
-
* @license lucide-react v1.35.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const jC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Nf=Ne("rotate-ccw",jC);/**
|
|
325
|
-
* @license lucide-react v1.35.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const bC=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],kC=Ne("save",bC);/**
|
|
330
|
-
* @license lucide-react v1.35.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const _C=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Cf=Ne("send",_C);/**
|
|
335
|
-
* @license lucide-react v1.35.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const SC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],W0=Ne("settings",SC);/**
|
|
340
|
-
* @license lucide-react v1.35.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const NC=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]],CC=Ne("shield-user",NC);/**
|
|
345
|
-
* @license lucide-react v1.35.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const EC=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],RC=Ne("shrink",EC);/**
|
|
350
|
-
* @license lucide-react v1.35.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const PC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],cm=Ne("square",PC);/**
|
|
355
|
-
* @license lucide-react v1.35.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const MC=[["path",{d:"M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"1ystz2"}],["path",{d:"M3 4v16",key:"1ph11n"}]],TC=Ne("step-forward",MC);/**
|
|
360
|
-
* @license lucide-react v1.35.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const $C=[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]],IC=Ne("stethoscope",$C);/**
|
|
365
|
-
* @license lucide-react v1.35.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const AC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gs=Ne("trash-2",AC);/**
|
|
370
|
-
* @license lucide-react v1.35.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const OC=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],um=Ne("triangle-alert",OC);/**
|
|
375
|
-
* @license lucide-react v1.35.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const LC=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],wl=Ne("undo-2",LC);/**
|
|
380
|
-
* @license lucide-react v1.35.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const DC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zC=Ne("users",DC);/**
|
|
385
|
-
* @license lucide-react v1.35.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const FC=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],BC=Ne("wand-sparkles",FC);/**
|
|
390
|
-
* @license lucide-react v1.35.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const HC=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],UC=Ne("webhook",HC);/**
|
|
395
|
-
* @license lucide-react v1.35.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const VC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],dm=Ne("wrench",VC);/**
|
|
400
|
-
* @license lucide-react v1.35.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const WC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vr=Ne("x",WC);/**
|
|
405
|
-
* @license lucide-react v1.35.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const qC=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],jl=Ne("zap",qC);function GC(){const e=Yl(),t=Xn(),[n,s]=u.useState("login"),[o,l]=u.useState(""),[a,i]=u.useState(""),[c,d]=u.useState(""),[f,m]=u.useState(""),[p,h]=u.useState(""),[x,y]=u.useState(""),[j,v]=u.useState(!1);function g(){s(n==="login"?"reg":"login"),y("")}async function w(){if(j)return;y("");const b=n==="reg";if(b&&f!==p){y("两次输入的密码不一致");return}v(!0);try{b?(await El.register(c,f),await t.load()):await t.login(o,a),e("/app")}catch(S){y(S.message||(b?"注册失败":"登录失败"))}finally{v(!1)}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(bn,{className:"w-[360px] shadow-xl",children:[r.jsxs(Vn,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(pu,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsx(Wn,{className:"font-serif text-lg",children:n==="login"?"Touchstone":"注册用户"}),r.jsx(O0,{className:"mt-1",children:"Free-style testing · Execution & monitoring"})]})]}),r.jsxs(kn,{className:"flex flex-col gap-4",children:[n==="login"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"login-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ae,{id:"login-username",value:o,onChange:b=>l(b.target.value.trim()),autoComplete:"username",placeholder:"请输入用户名",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"login-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ae,{id:"login-password",value:a,onChange:b=>i(b.target.value),type:"password",autoComplete:"current-password",placeholder:"请输入密码",onKeyUp:b=>{b.key==="Enter"&&w()}})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"reg-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ae,{id:"reg-username",value:c,onChange:b=>d(b.target.value.trim()),autoComplete:"username",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"reg-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ae,{id:"reg-password",value:f,onChange:b=>m(b.target.value),type:"password",autoComplete:"new-password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"reg-password2",className:"text-xs text-muted-foreground",children:"确认密码"}),r.jsx(Ae,{id:"reg-password2",value:p,onChange:b=>h(b.target.value),type:"password",autoComplete:"new-password",onKeyUp:b=>{b.key==="Enter"&&w()}})]})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:x}),r.jsxs(H,{size:"lg",className:"w-full",disabled:j,onClick:w,children:[j&&r.jsx(U0,{className:"size-4 animate-spin"}),n==="login"?"登 录":"注 册"]})]}),r.jsxs(L0,{className:"flex-col items-center gap-3 pt-0",children:[r.jsx("button",{type:"button",className:"text-sm text-[var(--run)] underline-offset-4 hover:underline",onClick:g,children:n==="login"?"没有账号?注册新用户":"已有账号?返回登录"}),n==="login"&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入账号密码登录;登录后可在右上角修改密码"})]})]})})}const On=Zp((e,t)=>({projects:[],currentProject:null,tasks:[],bugs:[],loading:{projects:!1,tasks:!1,bugs:!1},loadProjects:async()=>{e(n=>({loading:{...n.loading,projects:!0}}));try{e({projects:await kt.list()})}finally{e(n=>({loading:{...n.loading,projects:!1}}))}},selectProject:async n=>{const s=t().projects.find(o=>o.id===n)||null;e({currentProject:s}),s&&await Promise.all([t().loadTasks(),t().loadBugs()])},refreshProject:async()=>{const n=t().currentProject;if(!n)return;const s=await kt.get(n.id);e(o=>({currentProject:s,projects:o.projects.map(l=>l.id===s.id?s:l)}))},loadTasks:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,tasks:!0}}));try{e({tasks:await Ue.list(n.id)})}finally{e(s=>({loading:{...s.loading,tasks:!1}}))}}},loadBugs:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,bugs:!0}}));try{e({bugs:await bf.list(n.id)})}finally{e(s=>({loading:{...s.loading,bugs:!1}}))}}},createProject:async n=>{const s=await kt.create(n);return await t().loadProjects(),s},updateProject:async(n,s)=>{await kt.update(n,s),await t().refreshProject(),await t().loadProjects()},deleteProject:async(n,s)=>{var o;await kt.remove(n,s),((o=t().currentProject)==null?void 0:o.id)===n&&e({currentProject:null}),await t().loadProjects()},archiveProject:async(n,s)=>{var o;await kt[s?"archive":"unarchive"](n),await t().loadProjects(),((o=t().currentProject)==null?void 0:o.id)===n&&await t().refreshProject()}}));let bo=null,Ag=null;function M(e,t=2500){bo||(bo=document.createElement("div"),bo.className="ts-toast",document.body.appendChild(bo)),bo.textContent=e,bo.classList.add("show"),clearTimeout(Ag),Ag=setTimeout(()=>bo.classList.remove("show"),t)}const lc=400,ac=240,An=8,KC={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",nw:"nwse-resize",se:"nwse-resize",sw:"nesw-resize"};function YC(e,t){if(!e)return null;try{const n=JSON.parse(localStorage.getItem(e));if(n&&+n.w>=lc&&(!t||+n.h>=ac))return t?{w:+n.w,h:+n.h}:{w:+n.w}}catch{}return null}function ar(e,t=!0){const[n,s]=u.useState(()=>YC(e,t)),o=u.useRef(null),l=u.useRef(null),a=u.useCallback(h=>{const x=o.current;if(!x)return;const y=h.clientX-x.sx,j=h.clientY-x.sy;let v=x.left,g=x.top,w=x.w,b=x.h;if(x.dir==="mv"){const _=window.innerWidth,C=window.innerHeight;v=Math.max(An,Math.min(x.left+y,_-An-w)),g=Math.max(An,Math.min(x.top+j,C-An-b)),s({left:v,top:g,w,h:b});return}x.dir.includes("e")&&(w=x.w+y),x.dir.includes("s")&&(b=x.h+j),x.dir.includes("w")&&(w=x.w-y,v=x.left+y),x.dir.includes("n")&&(b=x.h-j,g=x.top+j);const S=window.innerWidth,N=window.innerHeight;w<lc&&(x.dir.includes("w")&&(v-=lc-w),w=lc),b<ac&&(x.dir.includes("n")&&(g-=ac-b),b=ac),v<An&&(x.dir.includes("w")&&(w-=An-v),v=An),g<An&&(x.dir.includes("n")&&(b-=An-g),g=An),v+w>S-An&&(w=S-An-v),g+b>N-An&&(b=N-An-g),s({left:v,top:g,w,h:b})},[]),i=u.useCallback(()=>{l.current&&(window.removeEventListener("mousemove",l.current),window.removeEventListener("mouseup",i),l.current=null),document.body.style.cursor="",e&&s(h=>{if(h)try{localStorage.setItem(e,JSON.stringify(t?{w:h.w,h:h.h}:{w:h.w}))}catch{}return h})},[e,t]),c=u.useCallback((h,x)=>{const y=h.currentTarget.closest(".modal");if(!y)return;y.style.animation="none",y.style.transition="none";const j=y.getBoundingClientRect();o.current={dir:x,sx:h.clientX,sy:h.clientY,left:j.left,top:j.top,w:j.width,h:j.height},s({left:j.left,top:j.top,w:j.width,h:j.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor=KC[x]||"default"},[a,i]),d=u.useCallback(h=>{if(h.button!==0)return;const x=h.currentTarget.closest(".modal");if(!x)return;x.style.animation="none",x.style.transition="none";const y=x.getBoundingClientRect();o.current={dir:"mv",sx:h.clientX,sy:h.clientY,left:y.left,top:y.top,w:y.width,h:y.height},s({left:y.left,top:y.top,w:y.width,h:y.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor="move",h.preventDefault()},[a,i]),f=u.useCallback(()=>{if(e)try{localStorage.removeItem(e)}catch{}s(null)},[e]),m=!!n,p=n?n.left!=null?{left:n.left+"px",top:n.top+"px",width:n.w+"px",height:n.h+"px",transform:"none"}:n.h?{left:`calc(50% - ${n.w/2}px)`,top:`calc(50% - ${n.h/2}px)`,width:n.w+"px",height:n.h+"px"}:{left:`calc(50% - ${n.w/2}px)`,width:n.w+"px"}:{};return{rzOn:m,rzStyle:p,rzStart:c,rzDragStart:d,rzReset:f}}const QC=/[^\s\u0000\u0001<>",。、;:!?()〔〕【】「」『』《》〈〉…—~·“”‘’]+/g,XC=/^[([{`'*“「『【(〔〈《]+/,JC=/(?::\d+(?::\d+)?|[)\]}`'*.,;:!?。,、;:!?…’”」』)】〕〉》])+$/,ZC=/[()[\]{}*?=,!#$%^|`]/,e2=/^[^/\\\s]*\.[A-Za-z][A-Za-z0-9]{0,9}$/,t2=new Set(["md","markdown","txt","rst","json","jsonl","ndjson","yaml","yml","toml","ini","cfg","conf","env","log","csv","tsv","xml","html","htm","css","scss","less","js","jsx","mjs","cjs","ts","tsx","vue","svelte","py","sh","bash","zsh","bat","cmd","ps1","sql","go","rs","java","kt","rb","php","c","h","cc","cpp","hpp","cs","swift","lua","pl","r","jl","lock","patch","diff","ipynb","pdf","zip","tar","gz","tgz","7z","png","jpg","jpeg","gif","webp","svg","ico","bmp","mp4","mov","mp3","xlsx","xls","docx","doc","pptx","ppt","db","sqlite","wasm","map"]);function n2(e){return e.slice(e.lastIndexOf(".")+1).toLowerCase()}function s2(e,t){if(!e||e.indexOf("://")>=0||ZC.test(e))return!1;const n=e.split(/[/\\]/).pop();return e2.test(n)?/[/\\]/.test(e)||/^[A-Za-z]:/.test(e)?!0:t&&t2.has(n2(n)):!1}function r2(e){return`<a class="md-path" data-path="${e}" title="点击预览:${e}">${e}</a>`}function Og(e,t){const n=!!(t&&t.bare);return String(e??"").replace(QC,s=>{const o=(s.match(XC)||[""])[0],l=s.slice(o.length),a=(l.match(JC)||[""])[0],i=l.slice(0,l.length-a.length);return s2(i,n)?o+r2(i)+a:s})}const Ti=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function Lg(e){const t=String(e||"").trim();return/^(\/|https?:\/\/|mailto:|tel:|data:image\/)/i.test(t)?t:""}function Mr(e,t){const n=!!(t&&t.pathLinks);let s=Ti(e);const o=[],l=[];return s=s.replace(/`([^`]+)`/g,(a,i)=>(o.push(i),"\0"+(o.length-1)+"\0")),n&&(s=s.replace(/!?\[[^\]]*\]\([^)\s]+(?:\s+"[^"]*")?\)/g,a=>(l.push(a),""+(l.length-1)+""))),s=s.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),n&&(s=Og(s)),l.length&&(s=s.replace(/\u0001(\d+)\u0001/g,(a,i)=>l[+i])),s=s.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=Lg(c);return d?`<img class="md-img" src="${d}" alt="${Ti(i)}" loading="lazy">`:Ti(a)}),s=s.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=Lg(c);return d?`<a href="${d}" target="_blank" rel="noreferrer">${i}</a>`:Ti(a)}),s=s.replace(/\u0000(\d+)\u0000/g,(a,i)=>"<code>"+(n?Og(o[+i],{bare:!0}):o[+i])+"</code>"),s}const Dg=e=>String(e).trim().replace(/^\||\|$/g,"").split("|").map(t=>t.trim());function Fo(e,t){const n=t||{},s=String(e||"").split(`
|
|
410
|
-
`);let o="",l=0;for(;l<s.length;){const a=s[l];if(/^```/.test(a)){const c=[];for(l++;l<s.length&&!/^```/.test(s[l]);)c.push(s[l]),l++;l++,o+="<pre><code>"+c.map(d=>Mr(d)).join(`
|
|
411
|
-
`)+"</code></pre>";continue}if(/^\|/.test(a)&&l+1<s.length&&/^\|[\s:|-]+\|$/.test(s[l+1])){const c=Dg(a);l+=2;const d=[];for(;l<s.length&&/^\|/.test(s[l]);)d.push(Dg(s[l])),l++;o+="<table><thead><tr>"+c.map(f=>"<th>"+Mr(f,n)+"</th>").join("")+"</tr></thead><tbody>"+d.map(f=>"<tr>"+f.map(m=>"<td>"+Mr(m,n)+"</td>").join("")+"</tr>").join("")+"</tbody></table>";continue}const i=a.match(/^(#{1,4})\s+(.*)$/);if(i){o+="<h"+i[1].length+">"+Mr(i[2],n)+"</h"+i[1].length+">",l++;continue}if(/^\s*(?:---|\*\*\*)\s*$/.test(a)){o+="<hr>",l++;continue}if(/^\s*[-*]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*[-*]\s+/.test(s[l]);)c.push(Mr(s[l].replace(/^\s*[-*]\s+/,""),n)),l++;o+="<ul>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ul>";continue}if(/^\s*\d{1,2}[.)]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*\d{1,2}[.)]\s+/.test(s[l]);)c.push(Mr(s[l].replace(/^\s*\d{1,2}[.)]\s+/,""),n)),l++;o+="<ol>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ol>";continue}if(/^\s*>\s?/.test(a)){const c=[];for(;l<s.length&&/^\s*>\s?/.test(s[l]);)c.push(s[l].replace(/^\s*>\s?/,"")),l++;o+="<blockquote>"+c.map(d=>"<p>"+Mr(d,n)+"</p>").join("")+"</blockquote>";continue}if(a.trim()===""){l++;continue}o+="<p>"+Mr(a,n)+"</p>",l++}return o}function ls(e){return e||"—"}const ur={queued:"排队中",running:"运行中",done:"已完成",stopped:"已停止",failed:"失败",interrupted:"中断"};function ir({start:e,reset:t}){const n=["n","s","e","w","ne","nw","se","sw"];return r.jsx(r.Fragment,{children:n.map(s=>r.jsx("i",{className:"rz rz-"+s,onMouseDown:o=>e(o,s),onDoubleClick:t,title:"拖动调整大小,双击复位"},s))})}const Ef={idle:"",queued_serial:"排队中",answer_pending:"已作答·待送达",interaction_pending:"等待作答",server_queued:"服务端排队中",foreign_busy:"等外部会话",starting:"启动中",running:"会话运行中"},q0={running:"run",starting:"run",interaction_pending:"queued",queued_serial:"queued",answer_pending:"queued",server_queued:"server",foreign_busy:"foreign"},o2={run:"bug-status run",queued:"bug-status retest",server:"bug-status retest",foreign:"bug-status retest"},l2={run:"sess-qstate run",queued:"sess-qstate queued",server:"sess-qstate server",foreign:"sess-qstate foreign"};function G0(e,t="board"){const n=q0[e];return n?(t==="sess"?l2:o2)[n]:t==="sess"?"sess-qstate":"bug-status pending"}function a2(e,t={}){const{found:n=!0,board:s=!1,canQueue:o=!1,chatRunning:l=!1,projectBusy:a=!1}=t;if(!n)return"会话不可用";if(e==="foreign_busy")return s?"外部会话运行中:Enter 排队,空闲后自动投递":"外部会话运行中:Enter 排队,空闲后自动发送";if(e==="interaction_pending")return s?"agent 等待你作答:回答上方提问,或 Enter 排队继续对话":"agent 等待你作答:回答上方提问";const i=!!q0[e]||a;return i&&o?s?"会话运行中:Enter 排队,排队行「立即注入」可插入当前轮":"任务运行中:Enter 排队,排队行「立即注入」可插入当前轮":i?s?"项目忙:Enter 排队,空闲后自动投递":"项目忙:Enter 排队,空闲后自动发送":l?"对话进行中:Enter 排队,等当前轮结束发送":"向该会话继续发消息…(Enter 发送,Shift+Enter 换行)"}const i2=/([!]?\[[^\]]*\]\()([^)\s]+)(\))/g,K0="m\\d{13}_[0-9a-f]{10}\\.[A-Za-z0-9]{1,10}",c2=new RegExp("^\\/.*\\/board_media\\/("+K0+")$"),u2=new RegExp("^\\/api\\/projects\\/\\d+\\/board\\/media\\/("+K0+")$"),Y0="/touchstone/".replace(/\/+$/,"");function fm(e,t=Y0){const n=typeof e=="string"?e:"";return u2.test(n)?t+n:n}function Rf(e,t,n=Y0){return!e||!t?e||"":String(e).replace(i2,(s,o,l,a)=>{const i=c2.exec(l);if(i)return o+n+"/api/projects/"+t+"/board/media/"+i[1]+a;const c=fm(l,n);return c===l?s:o+c+a})}const zg=4;async function pm(e){try{if(!(e.type||"").startsWith("image/"))return!1;const t=new Uint8Array(await e.slice(0,24).arrayBuffer());if(t.length<24||[137,80,78,71,13,10,26,10].some((l,a)=>t[a]!==l))return!1;const s=t[16]<<24|t[17]<<16|t[18]<<8|t[19],o=t[20]<<24|t[21]<<16|t[22]<<8|t[23];return s<=zg&&o<=zg}catch{return!1}}var d2=Object.defineProperty,f2=(e,t)=>d2(e,"name",{value:t,configurable:!0});function Pf(e,[t,n]){return Math.min(n,Math.max(t,e))}f2(Pf,"clamp");var p2=Object.defineProperty,Ql=(e,t)=>p2(e,"name",{value:t,configurable:!0}),Q0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Xe(e,t,{checkForDefaultPrevented:n=!0}={}){return Ql(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Ql(Xe,"composeEventHandlers");function m2(e){var t;if(!Q0)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Ql(m2,"getOwnerWindow");function Mf(e){if(!Q0)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ql(Mf,"getOwnerDocument");function X0(e,t=!1){const{activeElement:n}=Mf(e);if(!(n!=null&&n.nodeName))return null;if(J0(n)&&n.contentDocument)return X0(n.contentDocument.body,t);if(t){const s=n.getAttribute("aria-activedescendant");if(s){const o=Mf(n).getElementById(s);if(o)return o}}return n}Ql(X0,"getActiveElement");function J0(e){return e.tagName==="IFRAME"}Ql(J0,"isFrame");var h2=Object.defineProperty,cs=(e,t)=>h2(e,"name",{value:t,configurable:!0});function g2(e,t){const n=u.createContext(t);n.displayName=e+"Context";const s=cs(l=>{const{children:a,...i}=l,c=u.useMemo(()=>i,Object.values(i));return r.jsx(n.Provider,{value:c,children:a})},"Provider");s.displayName=e+"Provider";function o(l,a={}){const{optional:i=!1}=a,c=u.useContext(n);if(c)return c;if(t!==void 0)return t;if(!i)throw new Error(`\`${l}\` must be used within \`${e}\``)}return cs(o,"useContext"),[s,o]}cs(g2,"createContext");function uo(e,t=[]){let n=[];function s(l,a){const i=u.createContext(a);i.displayName=l+"Context";const c=n.length;n=[...n,a];const d=cs(m=>{var v;const{scope:p,children:h,...x}=m,y=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useMemo(()=>x,Object.values(x));return r.jsx(y.Provider,{value:j,children:h})},"Provider");d.displayName=l+"Provider";function f(m,p,h={}){var v;const{optional:x=!1}=h,y=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useContext(y);if(j)return j;if(a!==void 0)return a;if(!x)throw new Error(`\`${m}\` must be used within \`${l}\``)}return cs(f,"useContext"),[d,f]}cs(s,"createContext");const o=cs(()=>{const l=n.map(a=>u.createContext(a));return cs(function(i){const c=(i==null?void 0:i[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])},"useScope")},"createScope");return o.scopeName=e,[s,Z0(o,...t)]}cs(uo,"createContextScope");function Z0(...e){const t=e[0];if(e.length===1)return t;const n=cs(()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return cs(function(l){const a=s.reduce((i,{useScope:c,scopeName:d})=>{const m=c(l)[`__scope${d}`];return{...i,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}cs(Z0,"composeContextScopes");var x2=Object.defineProperty,an=(e,t)=>x2(e,"name",{value:t,configurable:!0});function mm(e){const t=e+"CollectionProvider",[n,s]=uo(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=an(y=>{const{scope:j,children:v}=y,g=u.useRef(null),w=u.useRef(new Map).current;return r.jsx(o,{scope:j,itemMap:w,collectionRef:g,children:v})},"CollectionProvider");a.displayName=t;const i=e+"CollectionSlot",c=xr(i),d=u.forwardRef((y,j)=>{const{scope:v,children:g}=y,w=l(i,v),b=wt(j,w.collectionRef);return r.jsx(c,{ref:b,children:g})});d.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=xr(f),h=u.forwardRef((y,j)=>{const{scope:v,children:g,...w}=y,b=u.useRef(null),S=wt(j,b),N=l(f,v);return u.useEffect(()=>(N.itemMap.set(b,{ref:b,...w}),()=>void N.itemMap.delete(b))),r.jsx(p,{[m]:"",ref:S,children:g})});h.displayName=f;function x(y){const j=l(e+"CollectionConsumer",y);return u.useCallback(()=>{const g=j.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${m}]`));return Array.from(j.itemMap.values()).sort((N,_)=>w.indexOf(N.ref.current)-w.indexOf(_.ref.current))},[j.collectionRef,j.itemMap])}return an(x,"useCollection"),[{Provider:a,Slot:d,ItemSlot:h},x,s]}an(mm,"createCollection");var Fg=new WeakMap,Ft,Gn,id=(Gn=class extends Map{constructor(n){super(n);eh(this,Ft);Eu(this,Ft,[...super.keys()]),Fg.set(this,!0)}set(n,s){return Fg.get(this)&&(this.has(n)?gn(this,Ft)[gn(this,Ft).indexOf(n)]=n:gn(this,Ft).push(n)),super.set(n,s),this}insert(n,s,o){const l=this.has(s),a=gn(this,Ft).length,i=hm(n);let c=i>=0?i:a+i;const d=c<0||c>=a?-1:c;if(d===this.size||l&&d===this.size-1||d===-1)return this.set(s,o),this;const f=this.size+(l?0:1);i<0&&c++;const m=[...gn(this,Ft)];let p,h=!1;for(let x=c;x<f;x++)if(c===x){let y=m[x];m[x]===s&&(y=m[x+1]),l&&this.delete(s),p=this.get(y),this.set(s,o)}else{!h&&m[x-1]===s&&(h=!0);const y=m[h?x:x-1],j=p;p=this.get(y),this.delete(y),this.set(y,j)}return this}with(n,s,o){const l=new Gn(this);return l.insert(n,s,o),l}before(n){const s=gn(this,Ft).indexOf(n)-1;if(!(s<0))return this.entryAt(s)}setBefore(n,s,o){const l=gn(this,Ft).indexOf(n);return l===-1?this:this.insert(l,s,o)}after(n){let s=gn(this,Ft).indexOf(n);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(n,s,o){const l=gn(this,Ft).indexOf(n);return l===-1?this:this.insert(l+1,s,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Eu(this,Ft,[]),super.clear()}delete(n){const s=super.delete(n);return s&&gn(this,Ft).splice(gn(this,Ft).indexOf(n),1),s}deleteAt(n){const s=this.keyAt(n);return s!==void 0?this.delete(s):!1}at(n){const s=ic(gn(this,Ft),n);if(s!==void 0)return this.get(s)}entryAt(n){const s=ic(gn(this,Ft),n);if(s!==void 0)return[s,this.get(s)]}indexOf(n){return gn(this,Ft).indexOf(n)}keyAt(n){return ic(gn(this,Ft),n)}from(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return l;o++}}findIndex(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return o;o++}return-1}filter(n,s){const o=[];let l=0;for(const a of this)Reflect.apply(n,s,[a,l,this])&&o.push(a),l++;return new Gn(o)}map(n,s){const o=[];let l=0;for(const a of this)o.push([a[0],Reflect.apply(n,s,[a,l,this])]),l++;return new Gn(o)}reduce(...n){const[s,o]=n;let l=0,a=o??this.at(0);for(const i of this)l===0&&n.length===1?a=i:a=Reflect.apply(s,this,[a,i,l,this]),l++;return a}reduceRight(...n){const[s,o]=n;let l=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const i=this.at(a);a===this.size-1&&n.length===1?l=i:l=Reflect.apply(s,this,[l,i,a,this])}return l}toSorted(n){const s=[...this.entries()].sort(n);return new Gn(s)}toReversed(){const n=new Gn;for(let s=this.size-1;s>=0;s--){const o=this.keyAt(s),l=this.get(o);n.set(o,l)}return n}toSpliced(...n){const s=[...this.entries()];return s.splice(...n),new Gn(s)}slice(n,s){const o=new Gn;let l=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),s!==void 0&&s>0&&(l=s-1);for(let a=n;a<=l;a++){const i=this.keyAt(a),c=this.get(i);o.set(i,c)}return o}every(n,s){let o=0;for(const l of this){if(!Reflect.apply(n,s,[l,o,this]))return!1;o++}return!0}some(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return!0;o++}return!1}},Ft=new WeakMap,an(Gn,"OrderedDict"),Gn);function ic(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=ew(e,t);return n===-1?void 0:e[n]}an(ic,"at");function ew(e,t){const n=e.length,s=hm(t),o=s>=0?s:n+s;return o<0||o>=n?-1:o}an(ew,"toSafeIndex");function hm(e){return e!==e||e===0?0:Math.trunc(e)}an(hm,"toSafeInteger");function v2(e){const t=e+"CollectionProvider",[n,s]=uo(t),[o,l]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new id,setItemMap:an(()=>{},"setItemMap")}),a=an(({state:w,...b})=>w?r.jsx(c,{...b,state:w}):r.jsx(i,{...b}),"CollectionProvider");a.displayName=t;const i=an(w=>{const b=j();return r.jsx(c,{...w,state:b})},"CollectionInit");i.displayName=t+"Init";const c=an(w=>{const{scope:b,children:S,state:N}=w,_=u.useRef(null),[C,O]=u.useState(null),P=wt(_,O),[D,K]=N;return u.useEffect(()=>{if(!C)return;const L=sw(()=>{});return L.observe(C,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[C]),r.jsx(o,{scope:b,itemMap:D,setItemMap:K,collectionRef:P,collectionRefObject:_,collectionElement:C,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const d=e+"CollectionSlot",f=xr(d),m=u.forwardRef((w,b)=>{const{scope:S,children:N}=w,_=l(d,S),C=wt(b,_.collectionRef);return r.jsx(f,{ref:C,children:N})});m.displayName=d;const p=e+"CollectionItemSlot",h="data-radix-collection-item",x=xr(p),y=u.forwardRef((w,b)=>{const{scope:S,children:N,..._}=w,C=u.useRef(null),[O,P]=u.useState(null),D=wt(b,C,P),K=l(p,S),{setItemMap:L}=K,I=u.useRef(_);tw(I.current,_)||(I.current=_);const q=I.current;return u.useEffect(()=>{const ee=q;return L(G=>O?G.has(O)?G.set(O,{...ee,element:O}).toSorted(Tf):(G.set(O,{...ee,element:O}),G.toSorted(Tf)):G),()=>{L(G=>!O||!G.has(O)?G:(G.delete(O),new id(G)))}},[O,q,L]),r.jsx(x,{[h]:"",ref:D,children:N})});y.displayName=p;function j(){return u.useState(new id)}an(j,"useInitCollection");function v(w){const{itemMap:b}=l(e+"CollectionConsumer",w);return b}return an(v,"useCollection"),[{Provider:a,Slot:m,ItemSlot:y},{createCollectionScope:s,useCollection:v,useInitCollection:j}]}an(v2,"createCollection");function tw(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}an(tw,"shallowEqual");function nw(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}an(nw,"isElementPreceding");function Tf(e,t){return!e[1].element||!t[1].element?0:nw(e[1].element,t[1].element)?-1:1}an(Tf,"sortByDocumentPosition");function sw(e){return new MutationObserver(n=>{for(const s of n)if(s.type==="childList"){e();return}})}an(sw,"getChildListObserver");var y2=Object.defineProperty,w2=(e,t)=>y2(e,"name",{value:t,configurable:!0}),j2=u.createContext(void 0);function mu(e){const t=u.useContext(j2);return e||t||"ltr"}w2(mu,"useDirection");var b2=Object.defineProperty,k2=(e,t)=>b2(e,"name",{value:t,configurable:!0});function Es(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}k2(Es,"useCallbackRef");var _2=Object.defineProperty,ln=(e,t)=>_2(e,"name",{value:t,configurable:!0}),$f="dismissableLayer.update",S2="dismissableLayer.pointerDownOutside",N2="dismissableLayer.focusOutside",Bg,rw=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ow=u.forwardRef(ln(function(t,n){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:d,...f}=t,m=u.useContext(rw),[p,h]=u.useState(null),x=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=u.useState({}),j=wt(n,h),v=Array.from(m.layers),[g]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),w=g?v.indexOf(g):-1,b=p?v.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,N=b>=w,_=u.useRef(!1),C=aw(K=>{a==null||a(K),c==null||c(K),K.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(K=>{if(!(K instanceof Node))return!1;const L=[...m.branches].some(I=>I.contains(K));return N&&!L},[m.branches,N])}),O=iw(K=>{if(o&&_.current)return;const L=K.target;[...m.branches].some(q=>q.contains(L))||(i==null||i(K),c==null||c(K),K.defaultPrevented||d==null||d())},x),P=p?b===v.length-1:!1,D=Es(K=>{K.key==="Escape"&&(l==null||l(K),!K.defaultPrevented&&d&&(K.preventDefault(),d()))});return u.useEffect(()=>{if(P)return x.addEventListener("keydown",D,{capture:!0}),()=>x.removeEventListener("keydown",D,{capture:!0})},[x,P,D]),u.useEffect(()=>{if(p)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Bg=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),If(),()=>{s&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=Bg))}},[p,x,s,m]),u.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),If())},[p,m]),u.useEffect(()=>{const K=ln(()=>y({}),"handleUpdate");return document.addEventListener($f,K),()=>document.removeEventListener($f,K)},[]),r.jsx(ut.div,{...f,ref:j,style:{pointerEvents:S?N?"auto":"none":void 0,...t.style},onFocusCapture:Xe(t.onFocusCapture,O.onFocusCapture),onBlurCapture:Xe(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Xe(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function lw(){const e=u.useContext(rw),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ln(lw,"useDismissableLayerSurface");var C2=ln(()=>!0,"IS_TRUE");function aw(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:a=C2}=t,i=Es(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),m=u.useRef(()=>{});return u.useEffect(()=>{function p(){d.current=!1,o.current=!1,f.current.clear()}ln(p,"resetOutsideInteraction");function h(){return Array.from(f.current.values()).some(Boolean)}ln(h,"isOutsideInteractionIntercepted");function x(w){if(!d.current)return;const b=w.target;b instanceof Node&&[...l].some(N=>N.contains(b))||f.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{d.current&&m.current()},0)}ln(x,"handleInteractionCapture");function y(w){d.current&&f.current.set(w.type,!1)}ln(y,"handleInteractionBubble");const j=ln(w=>{if(w.target&&!c.current){let b=function(){n.removeEventListener("click",m.current);const N=h();p(),N||gm(S2,i,S,{discrete:!0})};if(ln(b,"handleAndDispatchPointerDownOutsideEvent"),!a(w.target)){n.removeEventListener("click",m.current),p(),c.current=!1;return}const S={originalEvent:w};d.current=!0,o.current=s&&w.button===0,f.current.clear(),!s||w.button!==0?b():(n.removeEventListener("click",m.current),m.current=b,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),p();c.current=!1},"handlePointerDown"),v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of v)n.addEventListener(w,x,!0),n.addEventListener(w,y);const g=window.setTimeout(()=>{n.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(g),n.removeEventListener("pointerdown",j),n.removeEventListener("click",m.current);for(const w of v)n.removeEventListener(w,x,!0),n.removeEventListener(w,y)}},[n,i,s,o,l,a]),{onPointerDownCapture:ln(()=>c.current=!0,"onPointerDownCapture")}}ln(aw,"usePointerDownOutside");function iw(e,t=globalThis==null?void 0:globalThis.document){const n=Es(e),s=u.useRef(!1);return u.useEffect(()=>{const o=ln(l=>{l.target&&!s.current&&gm(N2,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:ln(()=>s.current=!0,"onFocusCapture"),onBlurCapture:ln(()=>s.current=!1,"onBlurCapture")}}ln(iw,"useFocusOutside");function If(){const e=new CustomEvent($f);document.dispatchEvent(e)}ln(If,"dispatchUpdate");function gm(e,t,n,{discrete:s}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),s?A0(o,l):o.dispatchEvent(l)}ln(gm,"handleAndDispatchCustomEvent");var E2=Object.defineProperty,xm=(e,t)=>E2(e,"name",{value:t,configurable:!0}),$i=0,Os=null;function R2(e){return hu(),e.children}xm(R2,"FocusGuards");function hu(){u.useEffect(()=>{Os||(Os={start:Af(),end:Af()});const{start:e,end:t}=Os;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),$i++,()=>{$i===1&&(Os==null||Os.start.remove(),Os==null||Os.end.remove(),Os=null),$i=Math.max(0,$i-1)}},[])}xm(hu,"useFocusGuards");function Af(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}xm(Af,"createFocusGuard");var P2=Object.defineProperty,En=(e,t)=>P2(e,"name",{value:t,configurable:!0}),cd="focusScope.autoFocusOnMount",ud="focusScope.autoFocusOnUnmount",Hg={bubbles:!1,cancelable:!0},cw=u.forwardRef(En(function(t,n){const{loop:s=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:a,...i}=t,[c,d]=u.useState(null),f=Es(l),m=Es(a),p=u.useRef(null),h=wt(n,d),x=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let j=function(b){if(x.paused||!c)return;const S=b.target;c.contains(S)?p.current=S:nr(p.current,{select:!0})},v=function(b){if(x.paused||!c)return;const S=b.relatedTarget;S!==null&&(c.contains(S)||nr(p.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&nr(c)};En(j,"handleFocusIn"),En(v,"handleFocusOut"),En(g,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",v);const w=new MutationObserver(g);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",v),w.disconnect()}}},[o,c,x.paused]),u.useEffect(()=>{if(c){Ug.add(x);const j=document.activeElement;if(!c.contains(j)){const g=new CustomEvent(cd,Hg);c.addEventListener(cd,f),c.dispatchEvent(g),g.defaultPrevented||(uw(hw(vm(c)),{select:!0}),document.activeElement===j&&nr(c))}return()=>{c.removeEventListener(cd,f),setTimeout(()=>{const g=new CustomEvent(ud,Hg);c.addEventListener(ud,m),c.dispatchEvent(g),g.defaultPrevented||nr(j??document.body,{select:!0}),c.removeEventListener(ud,m),Ug.remove(x)},0)}}},[c,f,m,x]);const y=u.useCallback(j=>{if(!s&&!o||x.paused)return;const v=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,g=document.activeElement;if(v&&g){const w=j.currentTarget,[b,S]=dw(w);b&&S?!j.shiftKey&&g===S?(j.preventDefault(),s&&nr(b,{select:!0})):j.shiftKey&&g===b&&(j.preventDefault(),s&&nr(S,{select:!0})):g===w&&j.preventDefault()}},[s,o,x.paused]);return r.jsx(ut.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})},"FocusScope"));function uw(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(nr(s,{select:t}),document.activeElement!==n)return}En(uw,"focusFirst");function dw(e){const t=vm(e),n=Of(t,e),s=Of(t.reverse(),e);return[n,s]}En(dw,"getTabbableEdges");function vm(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:En(s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}En(vm,"getTabbableCandidates");function Of(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(n?!s.checkVisibility({checkVisibilityCSS:!0}):fw(s,{upTo:t})))return s}En(Of,"findVisible");function fw(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}En(fw,"isHidden");function pw(e){return e instanceof HTMLInputElement&&"select"in e}En(pw,"isSelectableInput");function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pw(e)&&t&&e.select()}}En(nr,"focus");var Ug=mw();function mw(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Lf(e,t),e.unshift(t)},remove(t){var n;e=Lf(e,t),(n=e[0])==null||n.resume()}}}En(mw,"createFocusScopesStack");function Lf(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}En(Lf,"arrayRemove");function hw(e){return e.filter(t=>t.tagName!=="A")}En(hw,"removeLinks");var Lt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},M2=Object.defineProperty,T2=(e,t)=>M2(e,"name",{value:t,configurable:!0}),$2=Wo[" useId ".trim().toString()]||(()=>{}),I2=0;function Qr(e){const[t,n]=u.useState($2());return Lt(()=>{e||n(s=>s??String(I2++))},[e]),e||(t?`radix-${t}`:"")}T2(Qr,"useId");const A2=["top","right","bottom","left"],so=Math.min,dr=Math.max,zc=Math.round,Ii=Math.floor,fr=e=>({x:e,y:e}),O2={left:"right",right:"left",bottom:"top",top:"bottom"};function gw(e,t,n){return dr(e,so(t,n))}function yr(e,t){return typeof e=="function"?e(t):e}function ro(e){return e.split("-")[0]}function Xl(e){return e.split("-")[1]}function ym(e){return e==="x"?"y":"x"}function wm(e){return e==="y"?"height":"width"}function Us(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jm(e){return ym(Us(e))}function L2(e,t,n){n===void 0&&(n=!1);const s=Xl(e),o=jm(e),l=wm(o);let a=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Fc(a)),[a,Fc(a)]}function D2(e){const t=Fc(e);return[Df(e),t,Df(t)]}function Df(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Vg=["left","right"],Wg=["right","left"],z2=["top","bottom"],F2=["bottom","top"];function B2(e,t,n){switch(e){case"top":case"bottom":return n?t?Wg:Vg:t?Vg:Wg;case"left":case"right":return t?z2:F2;default:return[]}}function H2(e,t,n,s){const o=Xl(e);let l=B2(ro(e),n==="start",s);return o&&(l=l.map(a=>a+"-"+o),t&&(l=l.concat(l.map(Df)))),l}function Fc(e){const t=ro(e);return O2[t]+e.slice(t.length)}function U2(e){var t,n,s,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(o=e.left)!=null?o:0}}function xw(e){return typeof e!="number"?U2(e):{top:e,right:e,bottom:e,left:e}}function Bc(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function qg(e,t,n){let{reference:s,floating:o}=e;const l=Us(t),a=jm(t),i=wm(a),c=ro(t),d=l==="y",f=s.x+s.width/2-o.width/2,m=s.y+s.height/2-o.height/2,p=s[i]/2-o[i]/2;let h;switch(c){case"top":h={x:f,y:s.y-o.height};break;case"bottom":h={x:f,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:m};break;case"left":h={x:s.x-o.width,y:m};break;default:h={x:s.x,y:s.y}}const x=Xl(t);return x&&(h[a]+=p*(x==="end"?1:-1)*(n&&d?-1:1)),h}async function V2(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:l,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=yr(t,e),x=xw(h),j=i[p?m==="floating"?"reference":"floating":m],v=Bc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),g=m==="floating"?{x:s,y:o,width:a.floating.width,height:a.floating.height}:a.reference,w=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),b=await(l.isElement==null?void 0:l.isElement(w))&&await(l.getScale==null?void 0:l.getScale(w))||{x:1,y:1},S=Bc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:w,strategy:c}):g);return{top:(v.top-S.top+x.top)/b.y,bottom:(S.bottom-v.bottom+x.bottom)/b.y,left:(v.left-S.left+x.left)/b.x,right:(S.right-v.right+x.right)/b.x}}const W2=50,q2=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:V2},c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:m}=qg(d,s,c),p=s,h=0;const x={};for(let y=0;y<l.length;y++){const j=l[y];if(!j)continue;const{name:v,fn:g}=j,{x:w,y:b,data:S,reset:N}=await g({x:f,y:m,initialPlacement:s,placement:p,strategy:o,middlewareData:x,rects:d,platform:i,elements:{reference:e,floating:t}});f=w??f,m=b??m,x[v]={...x[v],...S},N&&h<W2&&(h++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:f,y:m}=qg(d,p,c)),y=-1)}return{x:f,y:m,placement:p,strategy:o,middlewareData:x}},G2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:l,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=yr(e,t)||{};if(d==null)return{};const m=xw(f),p={x:n,y:s},h=jm(o),x=wm(h),y=await a.getDimensions(d),j=h==="y",v=j?"top":"left",g=j?"bottom":"right",w=j?"clientHeight":"clientWidth",b=l.reference[x]+l.reference[h]-p[h]-l.floating[x],S=p[h]-l.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let _=N?N[w]:0;(!_||!await(a.isElement==null?void 0:a.isElement(N)))&&(_=i.floating[w]||l.floating[x]);const C=b/2-S/2,O=_/2-y[x]/2-1,P=so(m[v],O),D=so(m[g],O),K=_-y[x]-D,L=_/2-y[x]/2+C,I=gw(P,L,K),q=!c.arrow&&Xl(o)!=null&&L!==I&&l.reference[x]/2-(L<P?P:D)-y[x]/2<0,ee=q?L<P?L-P:L-K:0;return{[h]:p[h]+ee,data:{[h]:I,centerOffset:L-I-ee,...q&&{alignmentOffset:ee}},reset:q}}}),K2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:l,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...j}=yr(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const v=ro(o),g=Us(i),w=ro(i)===i,b=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(w||!y?[Fc(i)]:D2(i)),N=x!=="none";!p&&N&&S.push(...H2(i,y,x,b));const _=[i,...S],C=await c.detectOverflow(t,j),O=[];let P=((s=l.flip)==null?void 0:s.overflows)||[];if(f&&O.push(C[v]),m){const I=L2(o,a,b);O.push(C[I[0]],C[I[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every(I=>I<=0)){var D,K;const I=(((D=l.flip)==null?void 0:D.index)||0)+1,q=_[I];if(q&&(!(m==="alignment"?g!==Us(q):!1)||P.every(z=>Us(z.placement)===g?z.overflows[0]>0:!0)))return{data:{index:I,overflows:P},reset:{placement:q}};let ee=(K=P.filter(G=>G.overflows[0]<=0).sort((G,z)=>G.overflows[1]-z.overflows[1])[0])==null?void 0:K.placement;if(!ee)switch(h){case"bestFit":{var L;const G=(L=P.filter(z=>{if(N){const Y=Us(z.placement);return Y===g||Y==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(Y=>Y>0).reduce((Y,B)=>Y+B,0)]).sort((z,Y)=>z[1]-Y[1])[0])==null?void 0:L[0];G&&(ee=G);break}case"initialPlacement":ee=i;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function Gg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kg(e){return A2.some(t=>e[t]>=0)}const Y2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:o="referenceHidden",...l}=yr(e,t);switch(o){case"referenceHidden":{const a=await s.detectOverflow(t,{...l,elementContext:"reference"}),i=Gg(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Kg(i)}}}case"escaped":{const a=await s.detectOverflow(t,{...l,altBoundary:!0}),i=Gg(a,n.floating);return{data:{escapedOffsets:i,escaped:Kg(i)}}}default:return{}}}}},vw=new Set(["left","top"]);async function Q2(e,t){const{placement:n,platform:s,elements:o}=e,l=await(s.isRTL==null?void 0:s.isRTL(o.floating)),a=ro(n),i=Xl(n),c=Us(n)==="y",d=vw.has(a)?-1:1,f=l&&c?-1:1,m=yr(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof x=="number"&&(h=i==="end"?x*-1:x),c?{x:h*f,y:p*d}:{x:p*d,y:h*f}}const X2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:l,placement:a,middlewareData:i}=t,c=await Q2(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(s=i.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:l+c.y,data:{...c,placement:a}}}}},J2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o,platform:l}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:g=>{let{x:w,y:b}=g;return{x:w,y:b}}},...d}=yr(e,t),f={x:n,y:s},m=await l.detectOverflow(t,d),p=Us(o),h=ym(p);let x=f[h],y=f[p];const j=(g,w)=>gw(w+m[g==="y"?"top":"left"],w,w-m[g==="y"?"bottom":"right"]);a&&(x=j(h,x)),i&&(y=j(p,y));const v=c.fn({...t,[h]:x,[p]:y});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:a,[p]:i}}}}}},Z2=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,s;const{x:o,y:l,placement:a,rects:i,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=yr(e,t),p={x:o,y:l},h=Us(a),x=ym(h);let y=p[x],j=p[h];const v=yr(d,t),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(s=v.crossAxis)!=null?s:0};if(f){const S=x==="y"?"height":"width",N=i.reference[x]-i.floating[S]+g.mainAxis,_=i.reference[x]+i.reference[S]-g.mainAxis;y<N?y=N:y>_&&(y=_)}if(m){var w,b;const S=x==="y"?"width":"height",N=vw.has(ro(a)),_=i.reference[h]-i.floating[S]+(N&&((w=c.offset)==null?void 0:w[h])||0)+(N?0:g.crossAxis),C=i.reference[h]+i.reference[S]+(N?0:((b=c.offset)==null?void 0:b[h])||0)-(N?g.crossAxis:0);j<_?j=_:j>C&&(j=C)}return{[x]:y,[h]:j}}}},eE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:s,platform:o,elements:l}=t,{apply:a=()=>{},...i}=yr(e,t),c=await o.detectOverflow(t,i),d=ro(n),f=Xl(n),m=Us(n)==="y",{width:p,height:h}=s.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=d,x=f==="end"?"top":"bottom");const j=h-c.top-c.bottom,v=p-c.left-c.right,g=so(h-c[x],j),w=so(p-c[y],v),b=t.middlewareData.shift,S=!b;let N=g,_=w;b!=null&&b.enabled.x&&(_=v),b!=null&&b.enabled.y&&(N=j),S&&!f&&(m?_=p-2*dr(c.left,c.right):N=h-2*dr(c.top,c.bottom)),await a({...t,availableWidth:_,availableHeight:N});const C=await o.getDimensions(l.floating);return p!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function gu(){return typeof window<"u"}function Jl(e){return yw(e)?(e.nodeName||"").toLowerCase():"#document"}function Un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(yw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yw(e){return gu()?e instanceof Node||e instanceof Un(e).Node:!1}function Ks(e){return gu()?e instanceof Element||e instanceof Un(e).Element:!1}function fo(e){return gu()?e instanceof HTMLElement||e instanceof Un(e).HTMLElement:!1}function Yg(e){return!gu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Un(e).ShadowRoot}function xu(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&o!=="inline"&&o!=="contents"}function tE(e){return/^(table|td|th)$/.test(Jl(e))}function vu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nE=/transform|translate|scale|rotate|perspective|filter/,sE=/paint|layout|strict|content/,ko=e=>!!e&&e!=="none";let dd;function bm(e){const t=Ks(e)?Ys(e):e;return ko(t.transform)||ko(t.translate)||ko(t.scale)||ko(t.rotate)||ko(t.perspective)||!km()&&(ko(t.backdropFilter)||ko(t.filter))||nE.test(t.willChange||"")||sE.test(t.contain||"")}function rE(e){let t=Bo(e);for(;fo(t)&&!Ya(t);){if(bm(t))return t;if(vu(t))return null;t=Bo(t)}return null}function km(){return dd==null&&(dd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dd}function Ya(e){return/^(html|body|#document)$/.test(Jl(e))}function Ys(e){return Un(e).getComputedStyle(e)}function yu(e){return Ks(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bo(e){if(Jl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yg(e)&&e.host||br(e);return Yg(t)?t.host:t}function ww(e){const t=Bo(e);return Ya(t)?(e.ownerDocument||e).body:fo(t)&&xu(t)?t:ww(t)}function Qa(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ww(e),l=o===((s=e.ownerDocument)==null?void 0:s.body),a=Un(o);if(l){const i=zf(a);return t.concat(a,a.visualViewport||[],xu(o)?o:[],i&&n?Qa(i):[])}else return t.concat(o,Qa(o,[],n))}function zf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jw(e){const t=Ys(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=fo(e),l=o?e.offsetWidth:n,a=o?e.offsetHeight:s,i=zc(n)!==l||zc(s)!==a;return i&&(n=l,s=a),{width:n,height:s,$:i}}function _m(e){return Ks(e)?e:e.contextElement}function Rl(e){const t=_m(e);if(!fo(t))return fr(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:l}=jw(t);let a=(l?zc(n.width):n.width)/s,i=(l?zc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const oE=fr(0);function bw(e){const t=Un(e);return!km()||!t.visualViewport?oE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lE(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Un(e)}function Ho(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=_m(e);let a=fr(1);t&&(s?Ks(s)&&(a=Rl(s)):a=Rl(e));const i=lE(l,n,s)?bw(l):fr(0);let c=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,f=o.width/a.x,m=o.height/a.y;if(l&&s){const p=Un(l),h=Ks(s)?Un(s):s;let x=p,y=zf(x);for(;y&&h!==x;){const j=Rl(y),v=y.getBoundingClientRect(),g=Ys(y),w=v.left+(y.clientLeft+parseFloat(g.paddingLeft))*j.x,b=v.top+(y.clientTop+parseFloat(g.paddingTop))*j.y;c*=j.x,d*=j.y,f*=j.x,m*=j.y,c+=w,d+=b,x=Un(y),y=zf(x)}}return Bc({width:f,height:m,x:c,y:d})}function wu(e,t){const n=yu(e).scrollLeft;return t?t.left+n:Ho(br(e)).left+n}function kw(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-wu(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function aE(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const l=o==="fixed",a=br(s),i=t?vu(t.floating):!1;if(s===a||i&&l)return n;let c={scrollLeft:0,scrollTop:0},d=fr(1);const f=fr(0),m=fo(s);if((m||!l)&&((Jl(s)!=="body"||xu(a))&&(c=yu(s)),m)){const h=Ho(s);d=Rl(s),f.x=h.x+s.clientLeft,f.y=h.y+s.clientTop}const p=a&&!m&&!l?kw(a,c):fr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+p.x,y:n.y*d.y-c.scrollTop*d.y+f.y+p.y}}function iE(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function cE(e){const t=yu(e),n=e.ownerDocument.body,s=dr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=dr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-t.scrollLeft+wu(e);const a=-t.scrollTop;return Ys(n).direction==="rtl"&&(l+=dr(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:a}}const uE=25;function dE(e,t,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",o=Un(e),l=br(e),a=o.visualViewport;let i=l.clientWidth,c=l.clientHeight,d=0,f=0;if(a){const p=!km()||t==="fixed";s?p||(d=-a.offsetLeft,f=-a.offsetTop):(i=a.width,c=a.height,p&&(d=a.offsetLeft,f=a.offsetTop))}if(wu(l)<=0){const p=l.ownerDocument,h=p.body,x=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,j=Math.abs(l.clientWidth-h.clientWidth-y),v=getComputedStyle(l).scrollbarGutter==="stable both-edges"?j/2:j;v<=uE&&(i-=v)}return{width:i,height:c,x:d,y:f}}function fE(e,t){const n=Ho(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,l=Rl(e),a=e.clientWidth*l.x,i=e.clientHeight*l.y,c=o*l.x,d=s*l.y;return{width:a,height:i,x:c,y:d}}function Qg(e,t,n){let s;if(t==="viewport"||t==="layoutViewport")s=dE(e,n,t);else if(t==="document")s=cE(br(e));else if(Ks(t))s=fE(t,n);else{const o=bw(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Bc(s)}function pE(e,t){const n=t.get(e);if(n)return n;let s=Qa(e,[],!1).filter(i=>Ks(i)&&Jl(i)!=="body"),o=null;const l=Ys(e).position==="fixed";let a=l?Bo(e):e;for(;Ks(a)&&!Ya(a);){const i=Ys(a),c=bm(a),d=o?o.position:l?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&i.position==="static")?s=s.filter(m=>m!==a):o=i,a=Bo(a)}return t.set(e,s),s}function mE(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const a=[...n==="clippingAncestors"?vu(t)?[]:pE(t,this._c):[].concat(n),s],i=Qg(t,a[0],o);let c=i.top,d=i.right,f=i.bottom,m=i.left;for(let p=1;p<a.length;p++){const h=Qg(t,a[p],o);c=dr(h.top,c),d=so(h.right,d),f=so(h.bottom,f),m=dr(h.left,m)}return{width:d-m,height:f-c,x:m,y:c}}function hE(e){const{width:t,height:n}=jw(e);return{width:t,height:n}}function gE(e,t,n){const s=fo(t),o=br(t),l=n==="fixed",a=Ho(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const c=fr(0);if((s||!l)&&((Jl(t)!=="body"||xu(o))&&(i=yu(t)),s)){const p=Ho(t,!0,l,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}!s&&o&&(c.x=wu(o));const d=o&&!s&&!l?kw(o,i):fr(0),f=a.left+i.scrollLeft-c.x-d.x,m=a.top+i.scrollTop-c.y-d.y;return{x:f,y:m,width:a.width,height:a.height}}function fd(e){return Ys(e).position==="static"}function Xg(e,t){if(!fo(e)||Ys(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return br(e)===n&&(n=n.ownerDocument.body),n}function _w(e,t){const n=Un(e);if(vu(e))return n;if(!fo(e)){let o=Bo(e);for(;o&&!Ya(o);){if(Ks(o)&&!fd(o))return o;o=Bo(o)}return n}let s=Xg(e,t);for(;s&&tE(s)&&fd(s);)s=Xg(s,t);return s&&Ya(s)&&fd(s)&&!bm(s)?n:s||rE(e)||n}const xE=async function(e){const t=this.getOffsetParent||_w,n=this.getDimensions,s=await n(e.floating);return{reference:gE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function vE(e){return Ys(e).direction==="rtl"}const yE={convertOffsetParentRelativeRectToViewportRelativeRect:aE,getDocumentElement:br,getClippingRect:mE,getOffsetParent:_w,getElementRects:xE,getClientRects:iE,getDimensions:hE,getScale:Rl,isElement:Ks,isRTL:vE};function Sw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wE(e,t,n){let s=null,o;const l=br(e);function a(){var f;clearTimeout(o),(f=s)==null||f.disconnect(),s=null}function i(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),a();const p=e.getBoundingClientRect(),{left:h,top:x,width:y,height:j}=p;if(f||t(),!y||!j)return;const v=Ii(x),g=Ii(l.clientWidth-(h+y)),w=Ii(l.clientHeight-(x+j)),b=Ii(h),N={rootMargin:-v+"px "+-g+"px "+-w+"px "+-b+"px",threshold:dr(0,so(1,m))||1};let _=!0;function C(O){const P=O[0].intersectionRatio;if(!Sw(p,e.getBoundingClientRect()))return i();if(P!==m){if(!_)return i();P?i(!1,P):o=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{s=new IntersectionObserver(C,{...N,root:l.ownerDocument})}catch{s=new IntersectionObserver(C,N)}s.observe(e)}const c=Un(e),d=()=>i(n);return c.addEventListener("resize",d),i(!0),()=>{c.removeEventListener("resize",d),a()}}function jE(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=_m(e),f=o||l?[...d?Qa(d):[],...t?Qa(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),l&&v.addEventListener("resize",n)});const m=d&&i?wE(d,n,l):null;let p=-1,h=null;a&&(h=new ResizeObserver(v=>{let[g]=v;g&&g.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),d&&!c&&h.observe(d),t&&h.observe(t));let x,y=c?Ho(e):null;c&&j();function j(){const v=Ho(e);y&&!Sw(y,v)&&n(),y=v,x=requestAnimationFrame(j)}return n(),()=>{var v;f.forEach(g=>{o&&g.removeEventListener("scroll",n),l&&g.removeEventListener("resize",n)}),m==null||m(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(x)}}const bE=X2,kE=J2,_E=K2,SE=eE,NE=Y2,Jg=G2,CE=Z2,EE=(e,t,n)=>{const s=new Map,o=n??{},l={...yE,...o.platform,_c:s};return q2(e,t,{...o,platform:l})};var RE=typeof document<"u",PE=function(){},cc=RE?u.useLayoutEffect:PE;function Hc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Hc(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const l=o[s];if(!(l==="_owner"&&e.$$typeof)&&!Hc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Nw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zg(e,t){const n=Nw(e);return Math.round(t*n)/n}function pd(e){const t=u.useRef(e);return cc(()=>{t.current=e}),t}function ME(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:l,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(s);Hc(p,s)||h(s);const[x,y]=u.useState(null),[j,v]=u.useState(null),g=u.useCallback(z=>{z!==N.current&&(N.current=z,y(z))},[]),w=u.useCallback(z=>{z!==_.current&&(_.current=z,v(z))},[]),b=l||x,S=a||j,N=u.useRef(null),_=u.useRef(null),C=u.useRef(f),O=c!=null,P=pd(c),D=pd(o),K=pd(d),L=u.useCallback(()=>{if(!N.current||!_.current)return;const z={placement:t,strategy:n,middleware:p};D.current&&(z.platform=D.current),EE(N.current,_.current,z).then(Y=>{const B={...Y,isPositioned:K.current!==!1};I.current&&!Hc(C.current,B)&&(C.current=B,Ko.flushSync(()=>{m(B)}))})},[p,t,n,D,K]);cc(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[d]);const I=u.useRef(!1);cc(()=>(I.current=!0,()=>{I.current=!1}),[]),cc(()=>{if(b&&(N.current=b),S&&(_.current=S),b&&S){if(P.current)return P.current(b,S,L);L()}},[b,S,L,P,O]);const q=u.useMemo(()=>({reference:N,floating:_,setReference:g,setFloating:w}),[g,w]),ee=u.useMemo(()=>({reference:b,floating:S}),[b,S]),G=u.useMemo(()=>{const z={position:n,left:0,top:0};if(!ee.floating)return z;const Y=Zg(ee.floating,f.x),B=Zg(ee.floating,f.y);return i?{...z,transform:"translate("+Y+"px, "+B+"px)",...Nw(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:B}},[n,i,ee.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:q,elements:ee,floatingStyles:G}),[f,L,q,ee,G])}const TE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Jg({element:s.current,padding:o}).fn(n):{}:s?Jg({element:s,padding:o}).fn(n):{}}}},$E=(e,t)=>{const n=bE(e);return{name:n.name,fn:n.fn,options:[e,t]}},IE=(e,t)=>{const n=kE(e);return{name:n.name,fn:n.fn,options:[e,t]}},AE=(e,t)=>({fn:CE(e).fn,options:[e,t]}),OE=(e,t)=>{const n=_E(e);return{name:n.name,fn:n.fn,options:[e,t]}},LE=(e,t)=>{const n=SE(e);return{name:n.name,fn:n.fn,options:[e,t]}},DE=(e,t)=>{const n=NE(e);return{name:n.name,fn:n.fn,options:[e,t]}},zE=(e,t)=>{const n=TE(e);return{name:n.name,fn:n.fn,options:[e,t]}};var FE=Object.defineProperty,BE=(e,t)=>FE(e,"name",{value:t,configurable:!0});function Cw(e){const[t,n]=u.useState(void 0);return Lt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,i;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}BE(Cw,"useSize");var HE=Object.defineProperty,Xr=(e,t)=>HE(e,"name",{value:t,configurable:!0}),Ew="Popper",[Rw,Pw]=uo(Ew),[UE,Mw]=Rw(Ew),VE=Xr(e=>{const{__scopePopper:t,children:n}=e,[s,o]=u.useState(null),[l,a]=u.useState(void 0);return r.jsx(UE,{scope:t,anchor:s,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})},"Popper"),WE="PopperAnchor",qE=u.forwardRef(Xr(function(t,n){const{__scopePopper:s,virtualRef:o,...l}=t,a=Mw(WE,s),i=u.useRef(null),c=a.onAnchorChange,d=u.useCallback(y=>{i.current=y,y&&c(y)},[c]),f=wt(n,d),m=u.useRef(null);u.useEffect(()=>{if(!o)return;const y=m.current;m.current=o.current,y!==m.current&&c(m.current)});const p=a.placementState&&ju(a.placementState),h=p==null?void 0:p[0],x=p==null?void 0:p[1];return o?null:r.jsx(ut.div,{"data-radix-popper-side":h,"data-radix-popper-align":x,...l,ref:f})},"PopperAnchor")),Tw="PopperContent",[GE,WI]=Rw(Tw),KE=u.forwardRef(Xr(function(t,n){var fe,Se,te,E,U,A,se;const{__scopePopper:s,side:o="bottom",sideOffset:l=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:y,...j}=t,v=Mw(Tw,s),[g,w]=u.useState(null),b=wt(n,w),[S,N]=u.useState(null),_=Cw(S),C=(_==null?void 0:_.width)??0,O=(_==null?void 0:_.height)??0,P=o+(a!=="center"?"-"+a:""),D=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},K=Array.isArray(f)?f:[f],L=K.length>0,I={padding:D,boundary:K.filter($w),altBoundary:L},{refs:q,floatingStyles:ee,placement:G,isPositioned:z,middlewareData:Y}=ME({strategy:"fixed",placement:P,whileElementsMounted:Xr((...oe)=>jE(...oe,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[$E({mainAxis:l+O,alignmentAxis:i}),d&&IE({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?AE():void 0,...I}),d&&OE({...I}),LE({...I,apply:Xr(({elements:oe,rects:ze,availableWidth:Je,availableHeight:Fe})=>{const{width:et,height:Be}=ze.reference,Ke=oe.floating.style;Ke.setProperty("--radix-popper-available-width",`${Je}px`),Ke.setProperty("--radix-popper-available-height",`${Fe}px`),Ke.setProperty("--radix-popper-anchor-width",`${et}px`),Ke.setProperty("--radix-popper-anchor-height",`${Be}px`)},"apply")}),S&&zE({element:S,padding:c}),YE({arrowWidth:C,arrowHeight:O}),h&&DE({strategy:"referenceHidden",...I,boundary:L?I.boundary:void 0})]}),B=v.setPlacementState;Lt(()=>(B(G),()=>{B(void 0)}),[G,B]);const[me,Z]=ju(G),Te=Es(y);Lt(()=>{z&&(Te==null||Te())},[z,Te]);const ke=(fe=Y.arrow)==null?void 0:fe.x,_e=(Se=Y.arrow)==null?void 0:Se.y,Ce=((te=Y.arrow)==null?void 0:te.centerOffset)!==0,[$e,ue]=u.useState();return Lt(()=>{g&&ue(window.getComputedStyle(g).zIndex)},[g]),r.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:z?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[(E=Y.transformOrigin)==null?void 0:E.x,(U=Y.transformOrigin)==null?void 0:U.y].join(" "),...((A=Y.hide)==null?void 0:A.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(GE,{scope:s,placedSide:me,placedAlign:Z,onArrowChange:N,arrowX:ke,arrowY:_e,shouldHideArrow:Ce,children:r.jsx(ut.div,{"data-side":me,"data-align":Z,...j,ref:b,style:{...j.style,animation:z?(se=j.style)==null?void 0:se.animation:"none"}})})})},"PopperContent"));function $w(e){return e!==null}Xr($w,"isNotNull");var YE=Xr(e=>({name:"transformOrigin",options:e,fn(t){var j,v,g;const{placement:n,rects:s,middlewareData:o}=t,a=((j=o.arrow)==null?void 0:j.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=ju(n),m={start:"0%",center:"50%",end:"100%"}[f],p=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,h=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let x="",y="";return d==="bottom"?(x=a?m:`${p}px`,y=`${-c}px`):d==="top"?(x=a?m:`${p}px`,y=`${s.floating.height+c}px`):d==="right"?(x=`${-c}px`,y=a?m:`${h}px`):d==="left"&&(x=`${s.floating.width+c}px`,y=a?m:`${h}px`),{data:{x,y}}}}),"transformOrigin");function ju(e){const[t,n="center"]=e.split("-");return[t,n]}Xr(ju,"getSideAndAlignFromPlacement");var QE=VE,XE=qE,JE=KE,ZE=Object.defineProperty,eR=(e,t)=>ZE(e,"name",{value:t,configurable:!0}),Iw=u.forwardRef(eR(function(t,n){var c;const{container:s,...o}=t,[l,a]=u.useState(!1);Lt(()=>a(!0),[]);const i=s||l&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Ko.createPortal(r.jsx(ut.div,{...o,ref:n}),i):null},"Portal")),tR=Object.defineProperty,wr=(e,t)=>tR(e,"name",{value:t,configurable:!0});function Aw(e,t){return u.useReducer((n,s)=>t[n][s]??n,e)}wr(Aw,"useStateMachine");var ii=wr(e=>{const{present:t,children:n}=e,s=Ow(t),o=typeof n=="function"?n({present:s.isPresent}):u.Children.only(n),l=Lw(s.ref,Dw(o));return typeof n=="function"||s.isPresent?u.cloneElement(o,{ref:l}):null},"Presence");function Ow(e){const[t,n]=u.useState(),s=u.useRef(null),o=u.useRef(e),l=u.useRef("none"),a=u.useRef(void 0),i=e?"mounted":"unmounted",[c,d]=Aw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{c==="mounted"?(l.current=a.current??ll(s.current),a.current=void 0):l.current="none"},[c]),Lt(()=>{const f=s.current,m=o.current;if(m!==e){const h=l.current,x=ll(f);e?(a.current=x,d("MOUNT")):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(m&&h!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Lt(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=wr(x=>{const j=ll(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&j&&(d("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},"handleAnimationEnd"),h=wr(x=>{x.target===t&&(l.current=ll(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u.useCallback(f=>{if(f){const m=getComputedStyle(f);s.current=m,a.current=ll(m)}else s.current=null;n(f)},[])}}wr(Ow,"usePresence");function Ff(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}wr(Ff,"setRef");function Lw(...e){const t=u.useRef(e);return t.current=e,u.useCallback(n=>{const s=t.current;let o=!1;const l=s.map(a=>{const i=Ff(a,n);return!o&&typeof i=="function"&&(o=!0),i});if(o)return()=>{for(let a=0;a<l.length;a++){const i=l[a];typeof i=="function"?i():Ff(s[a],null)}}},[])}wr(Lw,"useStableComposedRefs");function ll(e){return(e==null?void 0:e.animationName)||"none"}wr(ll,"getAnimationName");function Dw(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}wr(Dw,"getElementRef");var nR=Object.defineProperty,sR=(e,t)=>nR(e,"name",{value:t,configurable:!0}),ex=Wo[" useEffectEvent ".trim().toString()],tx=Wo[" useInsertionEffect ".trim().toString()];function zw(e){if(typeof ex=="function")return ex(e);const t=u.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof tx=="function"?tx(()=>{t.current=e}):Lt(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}sR(zw,"useEffectEvent");var rR=Object.defineProperty,ci=(e,t)=>rR(e,"name",{value:t,configurable:!0}),oR=Wo[" useInsertionEffect ".trim().toString()]||Lt;function Hl({prop:e,defaultProp:t,onChange:n=ci(()=>{},"onChange"),caller:s}){const[o,l,a]=Fw({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o,d=u.useCallback(f=>{var m;if(i){const p=Bw(f)?f(e):f;p!==e&&((m=a.current)==null||m.call(a,p))}else l(f)},[i,e,l,a]);return[c,d]}ci(Hl,"useControllableState");function Fw({defaultProp:e,onChange:t}){const[n,s]=u.useState(e),o=u.useRef(n),l=u.useRef(t);return oR(()=>{l.current=t},[t]),u.useEffect(()=>{var a;o.current!==n&&((a=l.current)==null||a.call(l,n),o.current=n)},[n,o]),[n,s,l]}ci(Fw,"useUncontrolledState");function Bw(e){return typeof e=="function"}ci(Bw,"isFunction");var nx=Symbol("RADIX:SYNC_STATE");function lR(e,t,n,s){const{prop:o,defaultProp:l,onChange:a,caller:i}=t,c=o!==void 0,d=zw(a),f=[{...n,state:l}];s&&f.push(s);const[m,p]=u.useReducer((j,v)=>{if(v.type===nx)return{...j,state:v.state};const g=e(j,v);return c&&!Object.is(g.state,j.state)&&d(g.state),g},...f),h=m.state,x=u.useRef(h);u.useEffect(()=>{x.current!==h&&(x.current=h,c||d(h))},[h,x,c]);const y=u.useMemo(()=>o!==void 0?{...m,state:o}:m,[m,o]);return u.useEffect(()=>{c&&!Object.is(o,m.state)&&p({type:nx,state:o})},[o,m.state,c]),[y,p]}ci(lR,"useControllableStateReducer");var aR=Object.defineProperty,iR=(e,t)=>aR(e,"name",{value:t,configurable:!0});function Hw(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}iR(Hw,"usePrevious");var cR=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nl=new WeakMap,Ai=new WeakMap,Oi={},md=0,Uw=function(e){return e&&(e.host||Uw(e.parentNode))},dR=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Uw(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fR=function(e,t,n,s){var o=dR(t,Array.isArray(e)?e:[e]);Oi[n]||(Oi[n]=new WeakMap);var l=Oi[n],a=[],i=new Set,c=new Set(o),d=function(m){!m||i.has(m)||(i.add(m),d(m.parentNode))};o.forEach(d);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(s),x=h!==null&&h!=="false",y=(nl.get(p)||0)+1,j=(l.get(p)||0)+1;nl.set(p,y),l.set(p,j),a.push(p),y===1&&x&&Ai.set(p,!0),j===1&&p.setAttribute(n,"true"),x||p.setAttribute(s,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),md++,function(){a.forEach(function(m){var p=nl.get(m)-1,h=l.get(m)-1;nl.set(m,p),l.set(m,h),p||(Ai.has(m)||m.removeAttribute(s),Ai.delete(m)),h||m.removeAttribute(n)}),md--,md||(nl=new WeakMap,nl=new WeakMap,Ai=new WeakMap,Oi={})}},Vw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=uR(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),fR(s,o,n,"aria-hidden")):function(){return null}},Hs=function(){return Hs=Object.assign||function(t){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Hs.apply(this,arguments)};function Ww(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(n[s[o]]=e[s[o]]);return n}function pR(e,t,n){if(n||arguments.length===2)for(var s=0,o=t.length,l;s<o;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var uc="right-scroll-bar-position",dc="width-before-scroll-bar",mR="with-scroll-bars-hidden",hR="--removed-body-scroll-bar-size";function hd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gR(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=t,n.facade}var xR=typeof window<"u"?u.useLayoutEffect:u.useEffect,sx=new WeakMap;function vR(e,t){var n=gR(null,function(s){return e.forEach(function(o){return hd(o,s)})});return xR(function(){var s=sx.get(n);if(s){var o=new Set(s),l=new Set(e),a=n.current;o.forEach(function(i){l.has(i)||hd(i,null)}),l.forEach(function(i){o.has(i)||hd(i,a)})}sx.set(n,e)},[e]),n}function yR(e){return e}function wR(e,t){t===void 0&&(t=yR);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var a=t(l,s);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(l){for(s=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(i){return l(i)},filter:function(){return n}}},assignMedium:function(l){s=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(l),a=n}var c=function(){var f=a;a=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return o}function jR(e){e===void 0&&(e={});var t=wR(null);return t.options=Hs({async:!0,ssr:!1},e),t}var qw=function(e){var t=e.sideCar,n=Ww(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return u.createElement(s,Hs({},n))};qw.isSideCarExport=!0;function bR(e,t){return e.useMedium(t),qw}var Gw=jR(),gd=function(){},bu=u.forwardRef(function(e,t){var n=u.useRef(null),s=u.useState({onScrollCapture:gd,onWheelCapture:gd,onTouchMoveCapture:gd}),o=s[0],l=s[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noRelative,x=e.noIsolation,y=e.inert,j=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,w=e.gapMode,b=Ww(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,N=vR([n,t]),_=Hs(Hs({},b),o);return u.createElement(u.Fragment,null,f&&u.createElement(S,{sideCar:Gw,removeScrollBar:d,shards:m,noRelative:h,noIsolation:x,inert:y,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:w}),a?u.cloneElement(u.Children.only(i),Hs(Hs({},_),{ref:N})):u.createElement(g,Hs({},_,{className:c,ref:N}),i))});bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bu.classNames={fullWidth:dc,zeroRight:uc};var kR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _R(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kR();return t&&e.setAttribute("nonce",t),e}function SR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_R())&&(SR(t,n),NR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ER=function(){var e=CR();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kw=function(){var e=ER(),t=function(n){var s=n.styles,o=n.dynamic;return e(s,o),null};return t},RR={left:0,top:0,right:0,gap:0},xd=function(e){return parseInt(e||"",10)||0},PR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xd(n),xd(s),xd(o)]},MR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RR;var t=PR(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},TR=Kw(),Pl="data-scroll-locked",$R=function(e,t,n,s){var o=e.left,l=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
412
|
-
.`.concat(mR,` {
|
|
413
|
-
overflow: hidden `).concat(s,`;
|
|
414
|
-
padding-right: `).concat(i,"px ").concat(s,`;
|
|
415
|
-
}
|
|
416
|
-
body[`).concat(Pl,`] {
|
|
417
|
-
overflow: hidden `).concat(s,`;
|
|
418
|
-
overscroll-behavior: contain;
|
|
419
|
-
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
420
|
-
padding-left: `.concat(o,`px;
|
|
421
|
-
padding-top: `).concat(l,`px;
|
|
422
|
-
padding-right: `).concat(a,`px;
|
|
423
|
-
margin-left:0;
|
|
424
|
-
margin-top:0;
|
|
425
|
-
margin-right: `).concat(i,"px ").concat(s,`;
|
|
426
|
-
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
.`).concat(uc,` {
|
|
430
|
-
right: `).concat(i,"px ").concat(s,`;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
.`).concat(dc,` {
|
|
434
|
-
margin-right: `).concat(i,"px ").concat(s,`;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
.`).concat(uc," .").concat(uc,` {
|
|
438
|
-
right: 0 `).concat(s,`;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.`).concat(dc," .").concat(dc,` {
|
|
442
|
-
margin-right: 0 `).concat(s,`;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
body[`).concat(Pl,`] {
|
|
446
|
-
`).concat(hR,": ").concat(i,`px;
|
|
447
|
-
}
|
|
448
|
-
`)},rx=function(){var e=parseInt(document.body.getAttribute(Pl)||"0",10);return isFinite(e)?e:0},IR=function(){u.useEffect(function(){return document.body.setAttribute(Pl,(rx()+1).toString()),function(){var e=rx()-1;e<=0?document.body.removeAttribute(Pl):document.body.setAttribute(Pl,e.toString())}},[])},AR=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;IR();var l=u.useMemo(function(){return MR(o)},[o]);return u.createElement(TR,{styles:$R(l,!t,o,n?"":"!important")})},Bf=!1;if(typeof window<"u")try{var Li=Object.defineProperty({},"passive",{get:function(){return Bf=!0,!0}});window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Bf=!1}var sl=Bf?{passive:!1}:!1,OR=function(e){return e.tagName==="TEXTAREA"},Yw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!OR(e)&&n[t]==="visible")},LR=function(e){return Yw(e,"overflowY")},DR=function(e){return Yw(e,"overflowX")},ox=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Qw(e,s);if(o){var l=Xw(e,s),a=l[1],i=l[2];if(a>i)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},zR=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},FR=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Qw=function(e,t){return e==="v"?LR(t):DR(t)},Xw=function(e,t){return e==="v"?zR(t):FR(t)},BR=function(e,t){return e==="h"&&t==="rtl"?-1:1},HR=function(e,t,n,s,o){var l=BR(e,window.getComputedStyle(t).direction),a=l*s,i=n.target,c=t.contains(i),d=!1,f=a>0,m=0,p=0;do{if(!i)break;var h=Xw(e,i),x=h[0],y=h[1],j=h[2],v=y-j-l*x;(x||v)&&Qw(e,i)&&(m+=v,p+=x);var g=i.parentNode;i=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(d=!0),d},Di=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lx=function(e){return[e.deltaX,e.deltaY]},ax=function(e){return e&&"current"in e?e.current:e},UR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VR=function(e){return`
|
|
449
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
450
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
451
|
-
`)},WR=0,rl=[];function qR(e){var t=u.useRef([]),n=u.useRef([0,0]),s=u.useRef(),o=u.useState(WR++)[0],l=u.useState(Kw)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=pR([e.lockRef.current],(e.shards||[]).map(ax),!0).filter(Boolean);return y.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(y,j){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=Di(y),g=n.current,w="deltaX"in y?y.deltaX:g[0]-v[0],b="deltaY"in y?y.deltaY:g[1]-v[1],S,N=y.target,_=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in y&&_==="h"&&N.type==="range")return!1;var C=window.getSelection(),O=C&&C.anchorNode,P=O?O===N||O.contains(N):!1;if(P)return!1;var D=ox(_,N);if(!D)return!0;if(D?S=_:(S=_==="v"?"h":"v",D=ox(_,N)),!D)return!1;if(!s.current&&"changedTouches"in y&&(w||b)&&(s.current=S),!S)return!0;var K=s.current||S;return HR(K,j,y,K==="h"?w:b)},[]),c=u.useCallback(function(y){var j=y;if(!(!rl.length||rl[rl.length-1]!==l)){var v="deltaY"in j?lx(j):Di(j),g=t.current.filter(function(S){return S.name===j.type&&(S.target===j.target||j.target===S.shadowParent)&&UR(S.delta,v)})[0];if(g&&g.should){j.cancelable&&j.preventDefault();return}if(!g){var w=(a.current.shards||[]).map(ax).filter(Boolean).filter(function(S){return S.contains(j.target)}),b=w.length>0?i(j,w[0]):!a.current.noIsolation;b&&j.cancelable&&j.preventDefault()}}},[]),d=u.useCallback(function(y,j,v,g){var w={name:y,delta:j,target:v,should:g,shadowParent:GR(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),f=u.useCallback(function(y){n.current=Di(y),s.current=void 0},[]),m=u.useCallback(function(y){d(y.type,lx(y),y.target,i(y,e.lockRef.current))},[]),p=u.useCallback(function(y){d(y.type,Di(y),y.target,i(y,e.lockRef.current))},[]);u.useEffect(function(){return rl.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,sl),document.addEventListener("touchmove",c,sl),document.addEventListener("touchstart",f,sl),function(){rl=rl.filter(function(y){return y!==l}),document.removeEventListener("wheel",c,sl),document.removeEventListener("touchmove",c,sl),document.removeEventListener("touchstart",f,sl)}},[]);var h=e.removeScrollBar,x=e.inert;return u.createElement(u.Fragment,null,x?u.createElement(l,{styles:VR(o)}):null,h?u.createElement(AR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function GR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const KR=bR(Gw,qR);var Sm=u.forwardRef(function(e,t){return u.createElement(bu,Hs({},e,{ref:t,sideCar:KR}))});Sm.classNames=bu.classNames;var YR=Object.defineProperty,Qe=(e,t)=>YR(e,"name",{value:t,configurable:!0}),QR=[" ","Enter","ArrowUp","ArrowDown"],XR=[" ","Enter"],Ul="Select",[ku,_u,JR]=mm(Ul),[Qo,qI]=uo(Ul,[JR,Pw]),Nm=Pw(),[ZR,po]=Qo(Ul),[eP,tP]=Qo(Ul);function Jw(e){const{__scopeSelect:t,children:n,open:s,defaultOpen:o,onOpenChange:l,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:m,disabled:p,required:h,form:x,internal_do_not_use_render:y}=e,j=Nm(t),[v,g]=u.useState(null),[w,b]=u.useState(null),[S,N]=u.useState(!1),_=mu(d),[C,O]=Hl({prop:s,defaultProp:o??!1,onChange:l,caller:Ul}),[P,D]=Hl({prop:a,defaultProp:i,onChange:c,caller:Ul}),K=u.useRef(null),L=u.useRef(P);u.useEffect(()=>{const Z=x?v==null?void 0:v.ownerDocument.getElementById(x):v==null?void 0:v.form;if(Z instanceof HTMLFormElement){const Te=Qe(()=>D(L.current),"reset");return Z.addEventListener("reset",Te),()=>Z.removeEventListener("reset",Te)}},[x,v,D]);const I=v?!!x||!!v.closest("form"):!0,[q,ee]=u.useState(new Set),G=Qr(),z=Array.from(q).map(Z=>Z.props.value).join(";"),Y=u.useCallback(Z=>{ee(Te=>new Set(Te).add(Z))},[]),B=u.useCallback(Z=>{ee(Te=>{const ke=new Set(Te);return ke.delete(Z),ke})},[]),me={required:h,trigger:v,onTriggerChange:g,valueNode:w,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:G,value:P,onValueChange:D,open:C,onOpenChange:O,dir:_,triggerPointerDownPosRef:K,disabled:p,name:f,autoComplete:m,form:x,nativeOptions:q,nativeSelectKey:z,isFormControl:I};return r.jsx(QE,{...j,children:r.jsx(ZR,{scope:t,...me,children:r.jsx(ku.Provider,{scope:t,children:r.jsx(eP,{scope:t,onNativeOptionAdd:Y,onNativeOptionRemove:B,children:nj(y)?y(me):n})})})})}Qe(Jw,"SelectProvider");var nP=Qe(e=>{const{__scopeSelect:t,children:n,...s}=e;return r.jsx(Jw,{__scopeSelect:t,...s,internal_do_not_use_render:({isFormControl:o})=>r.jsxs(r.Fragment,{children:[n,o?r.jsx(TP,{__scopeSelect:t}):null]})})},"Select"),sP="SelectTrigger",rP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,disabled:o=!1,...l}=t,a=Nm(s),i=po(sP,s),c=i.disabled||o,d=wt(n,i.onTriggerChange),f=_u(s),m=u.useRef("touch"),[p,h,x]=Em(j=>{const v=f().filter(b=>!b.disabled),g=v.find(b=>b.value===i.value),w=Rm(v,j,g);w!==void 0&&i.onValueChange(w.value)}),y=Qe(j=>{c||(i.onOpenChange(!0),x()),j&&(i.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return r.jsx(XE,{asChild:!0,...a,children:r.jsx(ut.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ui(i.value)?"":void 0,...l,ref:d,onClick:Xe(l.onClick,j=>{j.currentTarget.focus(),m.current!=="mouse"&&y(j)}),onPointerDown:Xe(l.onPointerDown,j=>{m.current=j.pointerType;const v=j.target;v.hasPointerCapture(j.pointerId)&&v.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(y(j),j.preventDefault())}),onKeyDown:Xe(l.onKeyDown,j=>{const v=p.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&h(j.key),!(v&&j.key===" ")&&QR.includes(j.key)&&(y(),j.preventDefault())})})})},"SelectTrigger")),oP="SelectValue",lP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,className:o,style:l,children:a,placeholder:i="",...c}=t,d=po(oP,s),{onValueNodeHasChildrenChange:f}=d,m=a!==void 0,p=wt(n,d.onValueNodeChange);Lt(()=>{f(m)},[f,m]);const h=ui(d.value);return r.jsx(ut.span,{...c,asChild:h?!1:c.asChild,ref:p,style:{pointerEvents:"none"},children:r.jsx(u.Fragment,{children:h?i:a},h?"placeholder":"value")})},"SelectValue")),aP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,children:o,...l}=t;return r.jsx(ut.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})},"SelectIcon")),iP="SelectPortal",[cP,uP]=Qo(iP,{forceMount:void 0}),dP=Qe(e=>{const{__scopeSelect:t,forceMount:n,...s}=e;return r.jsx(cP,{scope:e.__scopeSelect,forceMount:n,children:r.jsx(Iw,{asChild:!0,...s})})},"SelectPortal"),Uo="SelectContent",fP=u.forwardRef(Qe(function(t,n){const s=uP(Uo,t.__scopeSelect),{forceMount:o=s.forceMount,...l}=t,a=po(Uo,t.__scopeSelect),[i,c]=u.useState();return Lt(()=>{c(new DocumentFragment)},[]),r.jsx(ii,{present:o||a.open,children:({present:d})=>d?r.jsx(hP,{...l,ref:n}):r.jsx(pP,{...l,fragment:i})})},"SelectContent")),pP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,children:o,fragment:l}=t;return l?Ko.createPortal(r.jsx(Zw,{scope:s,children:r.jsx(ku.Slot,{scope:s,children:r.jsx("div",{ref:n,children:o})})}),l):null},"SelectContentFragment")),js=10,[Zw,Xo]=Qo(Uo),mP=xr("SelectContent.RemoveScroll"),hP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s}=t,{position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:x,sticky:y,hideWhenDetached:j,avoidCollisions:v,...g}=t,w=po(Uo,s),[b,S]=u.useState(null),[N,_]=u.useState(null),C=wt(n,S),[O,P]=u.useState(null),[D,K]=u.useState(null),L=_u(s),[I,q]=u.useState(!1),ee=u.useRef(!1);u.useEffect(()=>{if(b)return Vw(b)},[b]),hu();const G=u.useCallback(ue=>{const[fe,...Se]=L().map(U=>U.ref.current),[te]=Se.slice(-1),E=document.activeElement;for(const U of ue)if(U===E||(U==null||U.scrollIntoView({block:"nearest"}),U===fe&&N&&(N.scrollTop=0),U===te&&N&&(N.scrollTop=N.scrollHeight),U==null||U.focus(),document.activeElement!==E))return},[L,N]),z=u.useCallback(()=>G([O,b]),[G,O,b]);u.useEffect(()=>{I&&z()},[I,z]);const{onOpenChange:Y,triggerPointerDownPosRef:B}=w;u.useEffect(()=>{if(b){let ue={x:0,y:0};const fe=Qe(te=>{var E,U;ue={x:Math.abs(Math.round(te.pageX)-(((E=B.current)==null?void 0:E.x)??0)),y:Math.abs(Math.round(te.pageY)-(((U=B.current)==null?void 0:U.y)??0))}},"handlePointerMove"),Se=Qe(te=>{ue.x<=10&&ue.y<=10?te.preventDefault():te.composedPath().includes(b)||Y(!1),document.removeEventListener("pointermove",fe),B.current=null},"handlePointerUp");return B.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",Se,{capture:!0})}}},[b,Y,B]),u.useEffect(()=>{const ue=Qe(()=>Y(!1),"close");return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[Y]);const[me,Z]=Em(ue=>{const fe=L().filter(E=>!E.disabled),Se=fe.find(E=>E.ref.current===document.activeElement),te=Rm(fe,ue,Se);te&&setTimeout(()=>{var E;return(E=te.ref.current)==null?void 0:E.focus()})}),Te=u.useCallback((ue,fe,Se)=>{const te=!ee.current&&!Se;(w.value!==void 0&&w.value===fe||te)&&(P(ue),te&&(ee.current=!0))},[w.value]),ke=u.useCallback(()=>b==null?void 0:b.focus(),[b]),_e=u.useCallback((ue,fe,Se)=>{const te=!ee.current&&!Se;(w.value!==void 0&&w.value===fe||te)&&K(ue)},[w.value]),Ce=o==="popper"?ix:gP,$e=Ce===ix?{side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:x,sticky:y,hideWhenDetached:j,avoidCollisions:v}:{};return r.jsx(Zw,{scope:s,content:b,viewport:N,onViewportChange:_,itemRefCallback:Te,selectedItem:O,onItemLeave:ke,itemTextRefCallback:_e,focusSelectedItem:z,selectedItemText:D,position:o,isPositioned:I,searchRef:me,children:r.jsx(Sm,{as:mP,allowPinchZoom:!0,children:r.jsx(cw,{asChild:!0,trapped:w.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Xe(l,ue=>{var fe;(fe=w.trigger)==null||fe.focus({preventScroll:!0}),ue.preventDefault()}),children:r.jsx(ow,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:r.jsx(Ce,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ue=>ue.preventDefault(),...g,...$e,onPlaced:()=>q(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Xe(g.onKeyDown,ue=>{const fe=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!fe&&ue.key.length===1&&Z(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let te=L().filter(E=>!E.disabled).map(E=>E.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const E=ue.target,U=te.indexOf(E);te=te.slice(U+1)}setTimeout(()=>G(te)),ue.preventDefault()}})})})})})})},"SelectContentImpl")),gP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,onPlaced:o,...l}=t,a=po(Uo,s),i=Xo(Uo,s),[c,d]=u.useState(null),[f,m]=u.useState(null),p=wt(n,m),h=_u(s),x=u.useRef(!1),y=u.useRef(!0),{viewport:j,selectedItem:v,selectedItemText:g,focusSelectedItem:w}=i,b=u.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&f&&j&&v&&g){const C=a.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),P=a.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(a.dir!=="rtl"){const E=D.left-O.left,U=P.left-E,A=C.left-U,se=C.width+A,oe=Math.max(se,O.width),ze=window.innerWidth-js,Je=Pf(U,[js,Math.max(js,ze-oe)]);c.style.minWidth=se+"px",c.style.left=Je+"px"}else{const E=O.right-D.right,U=window.innerWidth-P.right-E,A=window.innerWidth-C.right-U,se=C.width+A,oe=Math.max(se,O.width),ze=window.innerWidth-js,Je=Pf(U,[js,Math.max(js,ze-oe)]);c.style.minWidth=se+"px",c.style.right=Je+"px"}const K=h(),L=window.innerHeight-js*2,I=j.scrollHeight,q=window.getComputedStyle(f),ee=parseInt(q.borderTopWidth,10),G=parseInt(q.paddingTop,10),z=parseInt(q.borderBottomWidth,10),Y=parseInt(q.paddingBottom,10),B=ee+G+I+Y+z,me=Math.min(v.offsetHeight*5,B),Z=window.getComputedStyle(j),Te=parseInt(Z.paddingTop,10),ke=parseInt(Z.paddingBottom,10),_e=C.top+C.height/2-js,Ce=L-_e,$e=v.offsetHeight/2,ue=v.offsetTop+$e,fe=ee+G+ue,Se=B-fe;if(fe<=_e){const E=K.length>0&&v===K[K.length-1].ref.current;c.style.bottom="0px";const U=f.clientHeight-j.offsetTop-j.offsetHeight,A=Math.max(Ce,$e+(E?ke:0)+U+z),se=fe+A;c.style.height=se+"px"}else{const E=K.length>0&&v===K[0].ref.current;c.style.top="0px";const A=Math.max(_e,ee+j.offsetTop+(E?Te:0)+$e)+Se;c.style.height=A+"px",j.scrollTop=fe-_e+j.offsetTop}c.style.margin=`${js}px 0`,c.style.minHeight=me+"px",c.style.maxHeight=L+"px",o==null||o(),requestAnimationFrame(()=>x.current=!0)}},[h,a.trigger,a.valueNode,c,f,j,v,g,a.dir,o]);Lt(()=>b(),[b]);const[S,N]=u.useState();Lt(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const _=u.useCallback(C=>{C&&y.current===!0&&(b(),w==null||w(),y.current=!1)},[b,w]);return r.jsx(xP,{scope:s,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:_,children:r.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:r.jsx(ut.div,{...l,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),ix=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,align:o="start",collisionPadding:l=js,...a}=t,i=Nm(s);return r.jsx(JE,{...i,...a,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[xP,Cm]=Qo(Uo,{}),cx="SelectViewport",vP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,nonce:o,...l}=t,a=Xo(cx,s),i=Cm(cx,s),c=wt(n,a.onViewportChange),d=u.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),r.jsx(ku.Slot,{scope:s,children:r.jsx(ut.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Xe(l.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&p){const x=Math.abs(d.current-m.scrollTop);if(x>0){const y=window.innerHeight-js*2,j=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),g=Math.max(j,v);if(g<y){const w=g+x,b=Math.min(y,w),S=w-b;p.style.height=b+"px",p.style.bottom==="0px"&&(m.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})},"SelectViewport")),yP="SelectGroup",[GI,wP]=Qo(yP),jP="SelectLabel",bP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,...o}=t,l=wP(jP,s);return r.jsx(ut.div,{id:l.id,...o,ref:n})},"SelectLabel")),Hf="SelectItem",[kP,ej]=Qo(Hf),_P=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,value:o,disabled:l=!1,textValue:a,...i}=t,c=po(Hf,s),d=Xo(Hf,s),f=c.value===o,[m,p]=u.useState(a??""),[h,x]=u.useState(!1),y=Es(b=>{var S;return(S=d.itemRefCallback)==null?void 0:S.call(d,b,o,l)}),j=wt(n,y),v=Qr(),g=u.useRef("touch"),w=Qe(()=>{l||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return r.jsx(kP,{scope:s,value:o,disabled:l,textId:v,isSelected:f,onItemTextChange:u.useCallback(b=>{p(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:r.jsx(ku.ItemSlot,{scope:s,value:o,disabled:l,textValue:m,children:r.jsx(ut.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":f&&h,"data-state":f?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...i,ref:j,onFocus:Xe(i.onFocus,()=>x(!0)),onBlur:Xe(i.onBlur,()=>x(!1)),onClick:Xe(i.onClick,()=>{g.current!=="mouse"&&w()}),onPointerUp:Xe(i.onPointerUp,()=>{g.current==="mouse"&&w()}),onPointerDown:Xe(i.onPointerDown,b=>{g.current=b.pointerType}),onPointerMove:Xe(i.onPointerMove,b=>{var S;g.current=b.pointerType,l?(S=d.onItemLeave)==null||S.call(d):g.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Xe(i.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=d.onItemLeave)==null||S.call(d))}),onKeyDown:Xe(i.onKeyDown,b=>{var N;l||b.target!==b.currentTarget||((N=d.searchRef)==null?void 0:N.current)!==""&&b.key===" "||(XR.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})},"SelectItem")),zi="SelectItemText",SP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,className:o,style:l,...a}=t,i=po(zi,s),c=Xo(zi,s),d=ej(zi,s),f=tP(zi,s),[m,p]=u.useState(null),h=Es(w=>{var b;return(b=c.itemTextRefCallback)==null?void 0:b.call(c,w,d.value,d.disabled)}),x=wt(n,p,d.onItemTextChange,h),y=m==null?void 0:m.textContent,j=u.useMemo(()=>r.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=f;return Lt(()=>(v(j),()=>g(j)),[v,g,j]),r.jsxs(r.Fragment,{children:[r.jsx(ut.span,{id:d.textId,...a,ref:x}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!ui(i.value)?Ko.createPortal(a.children,i.valueNode):null]})},"SelectItemText")),NP="SelectItemIndicator",CP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,...o}=t;return ej(NP,s).isSelected?r.jsx(ut.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),ux="SelectScrollUpButton",EP=u.forwardRef(Qe(function(t,n){const s=Xo(ux,t.__scopeSelect),o=Cm(ux,t.__scopeSelect),[l,a]=u.useState(!1),i=wt(n,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollTop>0;a(f)};Qe(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(tj,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),dx="SelectScrollDownButton",RP=u.forwardRef(Qe(function(t,n){const s=Xo(dx,t.__scopeSelect),o=Cm(dx,t.__scopeSelect),[l,a]=u.useState(!1),i=wt(n,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;a(m)};Qe(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(tj,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),tj=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,onAutoScroll:o,...l}=t,a=Xo("SelectScrollButton",s),i=u.useRef(null),c=_u(s),d=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>d(),[d]),Lt(()=>{var m;const f=c().find(p=>p.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[c]),r.jsx(ut.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Xe(l.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:Xe(l.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:Xe(l.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),PP=u.forwardRef(Qe(function(t,n){const{__scopeSelect:s,...o}=t;return r.jsx(ut.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),MP="SelectBubbleInput",TP=u.forwardRef(Qe(function({__scopeSelect:t,...n},s){const o=po(MP,t),{value:l,onValueChange:a,required:i,disabled:c,name:d,autoComplete:f,form:m}=o,{nativeOptions:p,nativeSelectKey:h}=o,x=u.useRef(null),y=wt(s,x),j=l??"",v=Hw(j),g=Array.from(p).some(w=>(w.props.value??"")==="");return u.useEffect(()=>{const w=x.current;if(!w)return;const b=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(b,"value").set;if(v!==j&&N){const _=new Event("change",{bubbles:!0});N.call(w,j),w.dispatchEvent(_)}},[v,j]),r.jsxs(ut.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:d,autoComplete:f,disabled:c,form:m,onChange:w=>a(w.target.value),...n,style:{...cR,...n.style},ref:y,defaultValue:j,children:[ui(l)&&!g?r.jsx("option",{value:""}):null,Array.from(p)]},h)},"SelectBubbleInput"));function nj(e){return typeof e=="function"}Qe(nj,"isFunction");function ui(e){return e===""||e===void 0}Qe(ui,"shouldShowPlaceholder");function Em(e){const t=Es(e),n=u.useRef(""),s=u.useRef(0),o=u.useCallback(a=>{const i=n.current+a;t(i),Qe(function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))},"updateSearch")(i)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,l]}Qe(Em,"useTypeaheadSearch");function Rm(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=sj(e,Math.max(l,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}Qe(Rm,"findNextItem");function sj(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Qe(sj,"wrapArray");const At=nP,Pt=u.forwardRef((e,t)=>r.jsx(lP,{ref:t,"data-slot":"select-value",...e}));Pt.displayName="SelectValue";const Mt=u.forwardRef(({className:e,size:t="default",children:n,...s},o)=>r.jsxs(rP,{ref:o,"data-slot":"select-trigger","data-size":t,className:Ge("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:truncate [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[n,r.jsx(aP,{asChild:!0,children:r.jsx(Bl,{className:"size-4 opacity-50"})})]}));Mt.displayName="SelectTrigger";const Tt=u.forwardRef(({className:e,children:t,position:n="popper",...s},o)=>r.jsx(dP,{children:r.jsxs(fP,{ref:o,"data-slot":"select-content",className:Ge("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx(rj,{}),r.jsx(vP,{className:Ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),r.jsx(oj,{})]})}));Tt.displayName="SelectContent";const $P=u.forwardRef(({className:e,...t},n)=>r.jsx(bP,{ref:n,"data-slot":"select-label",className:Ge("text-muted-foreground px-2 py-1.5 text-xs",e),...t}));$P.displayName="SelectLabel";const Oe=u.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(_P,{ref:s,"data-slot":"select-item",className:Ge("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(CP,{children:r.jsx(lr,{className:"size-4"})})}),r.jsx(SP,{children:t})]}));Oe.displayName="SelectItem";const IP=u.forwardRef(({className:e,...t},n)=>r.jsx(PP,{ref:n,"data-slot":"select-separator",className:Ge("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t}));IP.displayName="SelectSeparator";const rj=u.forwardRef(({className:e,...t},n)=>r.jsx(EP,{ref:n,"data-slot":"select-scroll-up-button",className:Ge("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Dc,{className:"size-4"})}));rj.displayName="SelectScrollUpButton";const oj=u.forwardRef(({className:e,...t},n)=>r.jsx(RP,{ref:n,"data-slot":"select-scroll-down-button",className:Ge("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Bl,{className:"size-4"})}));oj.displayName="SelectScrollDownButton";function lj({open:e,query:t,items:n,onSelect:s,onClose:o,onDisabled:l}){const[a,i]=u.useState(0),c=u.useRef(null),d=(n||[]).filter(p=>p.dis||!t||(p.key||"").toLowerCase().includes(t.toLowerCase())),f=d.filter(p=>!p.dis);u.useEffect(()=>{const p=d.findIndex(h=>!h.dis);i(p>=0?p:0)},[t,e]),u.useEffect(()=>{c.current&&c.current.scrollIntoView({block:"nearest"})},[a,d]);function m(p,h){var x;if(!f.length)return p;for(let y=1;y<=d.length;y++){const j=(p+h*y+d.length)%d.length;if(!((x=d[j])!=null&&x.dis))return j}return p}return u.useEffect(()=>{if(!e)return;function p(h){if(!h.isComposing){if(h.key==="Escape"){h.preventDefault(),h.stopPropagation(),o();return}if(f.length){if(h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),i(x=>m(x,1));else if(h.key==="ArrowUp")h.preventDefault(),h.stopPropagation(),i(x=>m(x,-1));else if(h.key==="Enter"){h.preventDefault(),h.stopPropagation();const x=d[a];if(!x)return;x.dis?l==null||l(x):s(x)}}}}return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[e,d,f,a,s,o,l]),e?r.jsx("div",{className:"sess-slashmenu",children:d.length===0?r.jsx("div",{className:"sess-slash-empty",children:"无匹配项"}):d.map((p,h)=>r.jsxs("button",{type:"button",ref:h===a?c:void 0,className:"sess-slash-item"+(h===a?" on":"")+(p.dis?" dis":""),onMouseEnter:()=>i(h),onClick:()=>{p.dis?l==null||l(p):s(p)},children:[r.jsx("span",{className:"sess-slash-key",children:p.key||p.label}),r.jsx("span",{className:"sess-slash-desc",children:p.desc}),p.type==="cmd"&&r.jsx("span",{className:"sess-slash-tag",children:"命令"}),p.type==="skill"&&r.jsx("span",{className:"sess-slash-tag",children:"skill"})]},p.key))}):null}const Uc=[{value:"manual",label:"逐条确认",desc:"每个工具操作都需要你手动确认"},{value:"yolo",label:"自动通过",desc:"自动批准工具操作,但遇到关键问题仍会询问"},{value:"auto",label:"完全自主",desc:"完全自主运行,智能体自己做决定,不再询问"}];function Fi(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function AP({value:e,onChange:t,atts:n,onRemoveAtt:s,uploading:o,inputLocked:l,caps:a,meta:i,onSend:c,onStop:d,stopDisabled:f,chatRunning:m,taskRunning:p,queuedN:h,board:x,sending:y,permMode:j,modelSel:v,modelOpts:g,onSetModel:w,onSetPermission:b,effortSel:S,effortOpts:N,onSetEffort:_,queueRows:C,injecting:O,onInject:P,answerPending:D,deliveringAnswer:K,onDeliverAnswer:L,slashOpen:I,slashQuery:q,slashItems:ee,onSlashSelect:G,onSlashClose:z,onSlashDisabled:Y,onPasteFiles:B,onDropFiles:me,onUploadFiles:Z,taRef:Te}){const ke=u.useRef(null),_e=x&&!!(a!=null&&a.profile),Ce=x&&!!(a!=null&&a.permission),$e=!!(a!=null&&a.profile)&&!!((N==null?void 0:N.options)||[]).length,ue=Uc.find(ce=>ce.value===j)||null,fe=ue?ue.label:"权限",Se=S||(i==null?void 0:i.sessionEffort)||"",te=((N==null?void 0:N.options)||[]).find(ce=>ce.value===Se)||null,E=N!=null&&N.defaultEffort?((N.options||[]).find(ce=>ce.value===N.defaultEffort)||{}).label||N.defaultEffort:"",U=(te==null?void 0:te.label)||(E?`默认(${E})`:"默认"),A=v||(i==null?void 0:i.sessionModel)||(g==null?void 0:g.default)||"默认模型",se=A==="默认模型"?"__default__":A,oe=i==null?void 0:i.ctx,ze=oe&&+oe.max>0?Math.min(100,Math.max(0,Math.round(+oe.used/+oe.max*100))):0,Je=2*Math.PI*7,Fe=(n||[]).filter(ce=>e.includes(ce.md)),et=(i==null?void 0:i.queue_state)||"",Be=!!(i!=null&&i.project_busy),rt=!!et&&et!=="idle"||Be||m||(h||0)>0,$t=a2(et,{found:!!(i!=null&&i.found),board:!!x,canQueue:!!a.queue,chatRunning:m,projectBusy:Be}),it=(h||0)>0||m&&(x||!(a.queue&&p)),Q=(h||0)>0&&!m?"取消排队":"停止",He=!!f&&Q==="停止";return r.jsxs("div",{className:"sess-composer",children:[D&&r.jsx("div",{className:"sess-queue",children:r.jsxs("div",{className:"sess-queue-row",title:"答案已提交,等项目空闲送达",children:[r.jsx("span",{className:"sess-queue-tag on",children:"待送达"}),r.jsx("span",{className:"sess-queue-text",children:"已作答,等待送达(项目忙,空闲后自动送达)"}),r.jsxs(H,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:K,title:"立即送达:不等项目空闲,立即把答案交给等待中的会话",onClick:L,children:[r.jsx(jl,{className:"h-3 w-3"})," 立即送达"]})]})}),C.length>0&&r.jsx("div",{className:"sess-queue",children:C.map(ce=>{const Dt=a.steer&&ce.msgId&&ce.state!=="running";return r.jsxs("div",{className:"sess-queue-row",title:ce.text,children:[r.jsx("span",{className:"sess-queue-tag"+(ce.state==="server"?" on":""),children:ce.state==="server"?"服务端排队":ce.state==="running"?"发送中":"排队中"}),r.jsxs("span",{className:"sess-queue-text",children:[ce.text.slice(0,60),ce.text.length>60?"…":""]}),Dt&&r.jsxs(H,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:O===ce.key,title:"立即注入:不等队列,直接投递到会话当前上下文",onClick:()=>P(ce),children:[r.jsx(jl,{className:"h-3 w-3"})," 立即注入"]})]},ce.key)})}),Fe.length>0&&r.jsx("div",{className:"sess-attachrow",children:Fe.map((ce,Dt)=>r.jsxs("span",{className:"sess-chip",title:ce.name,children:[(ce.mime||"").startsWith("image/")&&ce.url?r.jsx("img",{src:ce.url,alt:ce.name}):r.jsx(B0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:ce.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>s(ce.md),children:r.jsx(vr,{className:"h-3 w-3"})})]},ce.md+Dt))}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(lj,{open:I,query:q,items:ee,onSelect:G,onClose:z,onDisabled:Y}),r.jsx("textarea",{ref:Te,className:"sess-ta",rows:1,value:e,onChange:ce=>t(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),c())},onPaste:B,onDrop:me,placeholder:$t,disabled:l})]}),r.jsxs("div",{className:"sess-bottombar",children:[r.jsx("input",{ref:ke,type:"file",multiple:!0,className:"hidden",onChange:ce=>{Z(ce.target.files),ce.target.value=""}}),r.jsx(H,{variant:"ghost",size:"icon",className:"sess-attach",title:"添加附件(粘贴/拖入亦可)",disabled:o||l,onClick:()=>{var ce;return(ce=ke.current)==null?void 0:ce.click()},children:r.jsx(ai,{className:"h-4 w-4"})}),Ce?r.jsxs(At,{value:j||void 0,onValueChange:b,disabled:!j,children:[r.jsx(Mt,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:ue?`权限:${ue.label}(${ue.desc})`:"权限模式读取中…",children:r.jsx(Pt,{className:"sess-ctl-value",placeholder:"权限",children:fe})}),r.jsx(Tt,{children:Uc.map(ce=>r.jsx(Oe,{value:ce.value,title:ce.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:ce.label}),r.jsx("span",{className:"sess-perm-desc",children:ce.desc})]})},ce.value))})]}):r.jsx("span",{className:"sess-chip",title:"权限模式(会话级)",children:fe}),_e?r.jsxs(At,{value:se,onValueChange:w,children:[r.jsx(Mt,{size:"sm",className:"h-8 max-w-[180px] px-2 text-xs gap-1",title:"切换会话模型(即时生效)",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[se==="__default__"&&r.jsx(Oe,{value:"__default__",disabled:!0,children:"默认模型"}),se!=="__default__"&&!((g==null?void 0:g.models)||[]).some(ce=>ce.name===se)&&r.jsx(Oe,{value:se,children:se}),((g==null?void 0:g.models)||[]).map(ce=>r.jsx(Oe,{value:ce.name,children:ce.display_name||ce.name},ce.name))]})]}):r.jsx("span",{className:"sess-chip",title:"当前会话模型",children:(i==null?void 0:i.sessionModel)||"默认模型"}),$e?r.jsxs(At,{value:Se||"__default__",onValueChange:_,children:[r.jsx(Mt,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:"切换会话思考等级(即时生效)",children:r.jsx(Pt,{className:"sess-ctl-value",placeholder:"思考等级",children:U})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__default__",disabled:!0,children:E?`默认(${E})`:"默认"}),Se&&!te&&r.jsx(Oe,{value:Se,children:Se}),((N==null?void 0:N.options)||[]).map(ce=>r.jsx(Oe,{value:ce.value,title:ce.title,children:ce.label},ce.value))]})]}):r.jsx("span",{className:"sess-chip",title:"思考等级(会话级)",children:U}),r.jsxs("svg",{className:"sess-ring",viewBox:"0 0 18 18",width:"18",height:"18",title:oe?`上下文 ${Fi(oe.used)} / ${Fi(oe.max)}(${ze}%)`:"暂无上下文用量数据",children:[r.jsx("title",{children:oe?`上下文 ${Fi(oe.used)} / ${Fi(oe.max)}(${ze}%)`:"暂无上下文用量数据"}),r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--border)",strokeWidth:"2"}),ze>0&&r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--run)",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${ze/100*Je} ${Je}`,transform:"rotate(-90 9 9)"}),r.jsx("text",{x:"9",y:"9",dominantBaseline:"central",textAnchor:"middle",children:ze})]}),r.jsx("span",{style:{flex:1}}),it&&r.jsxs(H,{variant:"outline",size:"sm",onClick:d,disabled:He,children:[r.jsx(cm,{})," ",Q]}),r.jsxs(H,{size:"sm",onClick:c,disabled:!e.trim()||y||l,children:[r.jsx(Cf,{})," ",rt?"排队":"发送"]})]})]})}const vd=["off","minimal","low","medium","high","xhigh","max"];function Uf(e){return e||""}function OP(e,t){const n=(t||"").trim();return n&&(e.find(s=>s.name===n)||e.find(s=>s.name.endsWith("/"+n)))||null}function fx(e){return(e&&e.efforts||[]).map(t=>t.id).filter(Boolean)}function aj(e,t){const n=e&&e.models||[],s=OP(n,t);let o=fx(s);if(!o.length){const i=[];for(const c of n)for(const d of fx(c))i.includes(d)||i.push(d);o=i}const l=o.length>0;return l||(o=vd.slice()),{options:vd.filter(i=>o.includes(i)).concat(o.filter(i=>!vd.includes(i))).map(i=>({value:i,label:Uf(i),title:`思考等级 ${i}`})),defaultEffort:s&&s.default_effort||"",fromCatalog:l}}function LP(e,t=""){return e?Uf(e):t?`默认(${Uf(t)})`:"默认"}var DP=Object.defineProperty,gs=(e,t)=>DP(e,"name",{value:t,configurable:!0}),Pm="Dialog",[ij,KI]=uo(Pm),[zP,Qs]=ij(Pm),FP=gs(e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:o,onOpenChange:l,modal:a=!0}=e,i=u.useRef(null),c=u.useRef(null),[d,f]=Hl({prop:s,defaultProp:o??!1,onChange:l,caller:Pm}),[m,p]=u.useState(0),[h,x]=u.useState(0);return r.jsx(zP,{scope:t,triggerRef:i,contentRef:c,contentId:Qr(),titleId:Qr(),descriptionId:Qr(),titlePresent:m>0,descriptionPresent:h>0,setTitleCount:p,setDescriptionCount:x,open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(y=>!y),[f]),modal:a,children:n})},"Dialog"),cj="DialogPortal",[BP,uj]=ij(cj,{forceMount:void 0}),HP=gs(e=>{const{__scopeDialog:t,forceMount:n,children:s,container:o}=e,l=Qs(cj,t);return r.jsx(BP,{scope:t,forceMount:n,children:u.Children.map(s,a=>r.jsx(ii,{present:n||l.open,children:r.jsx(Iw,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Vf="DialogOverlay",UP=u.forwardRef(gs(function(t,n){const s=uj(Vf,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Qs(Vf,t.__scopeDialog);return a.modal?r.jsx(ii,{present:o||a.open,children:r.jsx(WP,{...l,ref:n})}):null},"DialogOverlay")),VP=xr("DialogOverlay.RemoveScroll"),WP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Qs(Vf,s),a=lw(),i=wt(n,a);return r.jsx(Sm,{as:VP,allowPinchZoom:!0,shards:[l.contentRef],children:r.jsx(ut.div,{"data-state":Mm(l.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Xa="DialogContent",qP=u.forwardRef(gs(function(t,n){const s=uj(Xa,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Qs(Xa,t.__scopeDialog);return r.jsx(ii,{present:o||a.open,children:a.modal?r.jsx(GP,{...l,ref:n}):r.jsx(KP,{...l,ref:n})})},"DialogContent")),GP=u.forwardRef(gs(function(t,n){const s=Qs(Xa,t.__scopeDialog),o=u.useRef(null),l=wt(n,s.contentRef,o);return u.useEffect(()=>{const a=o.current;if(a)return Vw(a)},[]),r.jsx(dj,{...t,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:Xe(t.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=s.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Xe(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Xe(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),KP=u.forwardRef(gs(function(t,n){const s=Qs(Xa,t.__scopeDialog),o=u.useRef(!1),l=u.useRef(!1);return r.jsx(dj,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=t.onCloseAutoFocus)==null||i.call(t,a),a.defaultPrevented||(o.current||(c=s.triggerRef.current)==null||c.focus(),a.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:a=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const i=a.target;((f=s.triggerRef.current)==null?void 0:f.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&l.current&&a.preventDefault()}})},"DialogContentNonModal")),dj=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,...i}=t,c=Qs(Xa,s);return hu(),r.jsx(r.Fragment,{children:r.jsx(cw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:a,children:r.jsx(ow,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Mm(c.open),...i,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),YP="DialogTitle",QP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Qs(YP,s),{setTitleCount:a}=l;return Lt(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ut.h2,{id:l.titleId,...o,ref:n})},"DialogTitle")),XP="DialogDescription",JP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Qs(XP,s),{setDescriptionCount:a}=l;return Lt(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ut.p,{id:l.descriptionId,...o,ref:n})},"DialogDescription")),ZP="DialogClose",eM=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Qs(ZP,s);return r.jsx(ut.button,{type:"button",...o,ref:n,onClick:Xe(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Mm(e){return e?"open":"closed"}gs(Mm,"getState");const en=FP,tM=HP,fj=u.forwardRef(({className:e,...t},n)=>r.jsx(UP,{ref:n,"data-slot":"dialog-overlay",className:Ge("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));fj.displayName="DialogOverlay";const Ut=u.forwardRef(({className:e,children:t,showCloseButton:n=!0,...s},o)=>r.jsxs(tM,{"data-slot":"dialog-portal",children:[r.jsx(fj,{}),r.jsxs(qP,{ref:o,"data-slot":"dialog-content",className:Ge("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[t,n&&r.jsxs(eM,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(vr,{}),r.jsx("span",{className:"sr-only",children:"关闭"})]})]})]}));Ut.displayName="DialogContent";const Vt=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-header",className:Ge("flex flex-col gap-2 text-center sm:text-left",e),...t}));Vt.displayName="DialogHeader";const jn=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-footer",className:Ge("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t}));jn.displayName="DialogFooter";const Wt=u.forwardRef(({className:e,...t},n)=>r.jsx(QP,{ref:n,"data-slot":"dialog-title",className:Ge("text-lg leading-none font-semibold",e),...t}));Wt.displayName="DialogTitle";const nM=u.forwardRef(({className:e,...t},n)=>r.jsx(JP,{ref:n,"data-slot":"dialog-description",className:Ge("text-muted-foreground text-sm",e),...t}));nM.displayName="DialogDescription";const sM=/\.(md|markdown)$/i;function px(e){const t=+e||0;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/1024/1024).toFixed(1)+" MB"}function rM(e){const t=new Date((+e||0)*1e3);return isNaN(t.getTime())?"":t.toLocaleString()}function oM({pid:e,path:t,onClose:n}){const[s,o]=u.useState([t]),l=s[s.length-1],[a,i]=u.useState({loading:!0});u.useEffect(()=>{let p=!0;return i({loading:!0}),kt.filePreview(e,l).then(h=>{p&&i({data:h})}).catch(h=>{p&&i({error:h.message||"读取失败"})}),()=>{p=!1}},[e,l]);const c=u.useCallback(p=>{const h=p.target&&p.target.closest?p.target.closest("a.md-path"):null,x=h&&h.getAttribute("data-path");x&&(p.preventDefault(),o(y=>y[y.length-1]===x?y:[...y,x]))},[]),d=a.data,f=kt.fileRawUrl(e,l),m=u.useCallback(()=>{var h;const p=d&&d.path||l;(h=navigator.clipboard)==null||h.writeText(p).then(()=>M("已复制路径"),()=>M("复制失败,请手动选择"))},[d,l]);return r.jsx(en,{open:!0,onOpenChange:p=>{p||n()},children:r.jsxs(Ut,{className:"modal fv-modal w-[66vw] h-[78vh] sm:max-w-none flex flex-col gap-2 p-4 overflow-hidden",showCloseButton:!1,children:[r.jsxs(Vt,{className:"text-left fv-head",children:[r.jsxs("div",{className:"fv-titlebar",children:[s.length>1&&r.jsx("button",{type:"button",className:"fv-act",title:"返回上一个文件",onClick:()=>o(p=>p.slice(0,-1)),children:r.jsx(sm,{className:"fv-act-i"})}),r.jsx(Wt,{className:"fv-title",title:d&&d.path||l,children:d&&d.rel||l}),r.jsx("button",{type:"button",className:"fv-act",title:"复制完整路径",onClick:m,children:r.jsx(rm,{className:"fv-act-i"})}),r.jsx("a",{className:"fv-act",href:f,target:"_blank",rel:"noreferrer",title:"在新标签页打开原文(文本按纯文本展示;二进制下载)",children:r.jsx(om,{className:"fv-act-i"})}),r.jsx("button",{type:"button",className:"fv-act",title:"关闭(Esc)",onClick:n,children:r.jsx(vr,{className:"fv-act-i"})})]}),d&&r.jsxs("div",{className:"fv-meta",children:[px(d.size)," · ",rM(d.mtime),d.root==="work"?" · 工作目录":" · 项目目录",d.truncated?" · 仅显示前 256KB":""]})]}),r.jsx("div",{className:"fv-body",children:a.loading?r.jsx("div",{className:"fv-hint",children:"读取中…"}):a.error?r.jsxs("div",{className:"fv-hint err",children:[r.jsx(um,{className:"fv-hint-i"}),r.jsx("span",{children:a.error})]}):d.binary?r.jsxs("div",{className:"fv-hint",children:[r.jsx(GN,{className:"fv-hint-i"}),r.jsxs("span",{children:["二进制文件(",px(d.size),"),无法预览。",r.jsx("a",{className:"md-path",href:f,target:"_blank",rel:"noreferrer",children:"下载"})]})]}):sM.test(l)?r.jsx("div",{className:"md-body",onClick:c,dangerouslySetInnerHTML:{__html:Fo(d.text,{pathLinks:!0})}}):r.jsx("pre",{className:"fv-pre",children:d.text})})]})})}function pj({open:e,info:t,busy:n,disabledReason:s,onHandoff:o,onPass:l,onClose:a}){const i=t||{},c=Number(i.dirty_count||0);return r.jsx(en,{open:!!e,onOpenChange:d=>!d&&a&&a(),children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{children:r.jsx(Wt,{children:"通过前:worktree 改动还没回流主分支"})}),r.jsxs("p",{className:"hint",children:["该卡片在独立 worktree 中开发,改动在分支 ",r.jsx("span",{className:"font-mono",children:i.branch||"—"})," 上, 主分支 ",r.jsx("span",{className:"font-mono",children:i.target||"—"})," 还不知道这些改动。"]}),r.jsxs("p",{className:"hint",children:["待合并提交:",r.jsx("b",{children:i.ahead||0})," 个",i.behind?r.jsxs(r.Fragment,{children:["(主分支领先 ",i.behind," 个提交,需先同步)"]}):null]}),c>0&&r.jsxs("p",{className:"hint",children:["工作树有 ",c," 处未提交改动,交给 agent 时会先提交它们。"]}),r.jsx("p",{className:"hint",children:"「交给 agent 合并」= 平台把合并指令发给卡片主会话并让卡片回开发队列排队: agent 先同步主分支最新代码,再尽量快进(不能快进才生成合并提交)回流,冲突由它解决; 干完这轮卡片自动回「待审核」,那时再点「通过」即完成。"}),i.path&&r.jsxs("p",{className:"hint break-all",children:["工作树:",r.jsx("span",{className:"font-mono",children:i.path})]}),s&&r.jsx("p",{className:"hint",children:s}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",disabled:n,onClick:a,children:"取消"}),r.jsx(H,{variant:"outline",disabled:n,onClick:l,children:"仅通过(不合并)"}),r.jsx(H,{disabled:n||!!s,title:s||void 0,onClick:o,children:n?"提交中…":"交给 agent 合并"})]})]})})}function mj(e,t){const s=e.slice(0,t).match(/(?:^|\s)(\/[^\s]*)$/);return s?{start:t-s[1].length,text:s[1]}:null}const lM="外部会话:本会话由 dsh GUI 直接运行(不是平台启动的),平台的停止/中断对它无效;你仍可发消息,消息按平台队列投递。";function aM(e){return e===!1?lM:""}function iM(e){return e!==!1}const cM="ask_user_question",Vc={pending:"等待回答…",error:"未作答(已中断)"};function hj(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function uM(e){return String(e&&e.name||"").toLowerCase()===cM}function dM(e){const t=hj(e);return(t&&Array.isArray(t.questions)?t.questions:[]).filter(s=>s&&typeof s=="object").map(s=>({id:String(s.id==null?"":s.id),header:String(s.header==null?"":s.header),multiSelect:!!s.multi_select,question:String(s.question==null?"":s.question),options:(Array.isArray(s.options)?s.options:[]).filter(o=>o&&typeof o=="object"&&o.label!=null).map(o=>String(o.label))}))}function fM(e,t=!1){const n=String(e??"").trim();if(t||n.startsWith("Error:"))return{kind:"error",text:""};if(!n)return{kind:"pending",text:""};const s=hj(n);if(!s||!Array.isArray(s.answers))return n.startsWith("{")||n.startsWith("[")?{kind:"pending",text:""}:{kind:"answer",text:n};const o=[];for(const a of s.answers){if(!a||typeof a!="object")continue;const i=(Array.isArray(a.selected)?a.selected:[]).map(d=>String(d)).filter(d=>d.trim()),c=String(a.custom==null?"":a.custom).trim();i.length&&c?o.push(i.join("、")+";"+c):i.length?o.push(i.join("、")):c&&o.push(c)}const l=o.join(";").trim();return l?{kind:"answer",text:l}:{kind:"pending",text:""}}function pM(e){const t=Array.isArray(e)?e:[],n=new Map;for(const o of t)o&&o.kind==="tool_result"&&o.call_id&&n.set(o.call_id,o);const s=[];for(const o of t)if(o){if(o.kind==="user"){const l=String(o.text||"").trim();l&&s.push({key:"u:"+o.seq,seq:o.seq,kind:"user",text:l,ansSeq:null,state:"user",ask:[]})}else if(o.kind==="tool_call"&&uM(o)){const l=o.call_id?n.get(o.call_id):null,a=fM(l&&l.text,!!(l&&l.is_error));s.push({key:"a:"+o.seq,seq:o.seq,kind:"ask",text:a.text,ansSeq:l?l.seq:null,state:l?a.kind==="answer"?"answered":a.kind:"pending",ask:dM(o.args)})}}return s}function mM(e){return e?e.kind!=="ask"||e.state==="answered"?e.text||"":Vc[e.state]||Vc.pending:""}function hM(e){if(!e||e.kind!=="ask")return e&&e.text||"";const t=(e.ask||[]).map(o=>(o.header?o.header+":":"")+(o.question||"")).filter(Boolean),n=t.length?"agent 提问:"+t.join(" / "):"agent 提问",s=e.state==="answered"?"回答:"+e.text:Vc[e.state]||Vc.pending;return n+`
|
|
452
|
-
`+s}const gM=["think","tool_call","tool_result"],xM=60;function vM(e){return!!e&&gM.includes(e.kind)}function yM(e){const t=[],n=new Map,s=e||[];let o=[];const l=()=>{if(o.length){if(o.length>=2){const a=t.length;t.push({key:"r"+o[0].seq,seq:o[0].seq,proc:!0,items:o});for(const i of o)n.set(i.seq,a)}else{const a=t.length;t.push({key:"r"+o[0].seq,seq:o[0].seq,proc:!1,items:o}),n.set(o[0].seq,a)}o=[]}};for(const a of s)if(vM(a))o.push(a);else{l();const i=t.length;t.push({key:"r"+a.seq,seq:a.seq,proc:!1,items:[a]}),n.set(a.seq,i)}return l(),{rows:t,rowIndexOf:n}}function wM(e){const t=[],n=new Map;for(const s of e){const o=String(s||"").trim()||"工具";n.has(o)||(n.set(o,0),t.push(o)),n.set(o,n.get(o)+1)}return t.map(s=>n.get(s)>1?`${s} ×${n.get(s)}`:s)}function jM(e){const t=e||[],n=t.filter(p=>p.kind==="tool_call"),s=t.filter(p=>p.kind==="think"&&String(p.text||"").trim()).length,o=t.filter(p=>p.kind==="tool_result"),l=o.filter(p=>p.is_error).length,a=n.length?n:o,i=wM(a.map(p=>p.name)),c=[];let d=0;for(const p of i){const h=(c.length?2:0)+p.length;if(c.length&&d+h>xM){c.push("…");break}c.push(p),d+=h}const f=c.join(", "),m=[];return n.length?m.push(`工具 ${n.length} 次${f?` · ${f}`:""}`):f&&m.push(f),s&&m.push(`思考 ${s} 段`),l&&m.push(`错误 ${l} 次`),{text:m.join(" · "),calls:n.length,thinks:s,errors:l}}const bM="touchstone:host-probe",kM="touchstone:host-caps",_M="touchstone:open-session";let Ja=null,mx=!1;const Wf=new Set;function SM(){return Ja}function NM(e){return Wf.add(e),()=>{Wf.delete(e)}}function CM(e){Ja=e;for(const t of[...Wf])try{t(Ja)}catch{}}function gj(){return typeof window<"u"&&!!window.parent&&window.parent!==window}function xj(e){if(!Ja||!Ja.openSession||!e||!gj())return!1;try{return window.parent.postMessage({type:_M,sid:String(e)},window.location.origin),!0}catch{return!1}}function EM(){if(!(mx||typeof window>"u")&&(mx=!0,window.addEventListener("message",e=>{if(e.origin!==window.location.origin)return;const t=e.data||{};t.type===kM&&CM(t.caps||{})}),!!gj()))try{window.parent.postMessage({type:bM},window.location.origin)}catch{}}function vj(){return u.useSyncExternalStore(NM,SM,()=>null)}function Ml(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function qf(e){const t=+e||0;return t<1e3?"":t<6e4?(t/1e3).toFixed(1)+"s":Math.floor(t/6e4)+"分"+Math.round(t%6e4/1e3)+"s"}function RM(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e||""}}const PM={family:"该智能体暂不支持会话查看",no_session:"会话尚未生成(任务首轮执行后才有会话)",missing:"未找到会话文件(可能已被清理)"},MM=10,hx=56,gx=10,ua=60,TM=240,$M=60;function yd(e,t){let n=0,s=e.length-2;if(s<0||t<=0)return 0;for(;n<s;){const o=n+s+1>>1;e[o]<=t?n=o:s=o-1}return n}const yj=u.memo(function({e:t,wrap:n,flash:s,taskId:o,agent:l,pid:a,boardPid:i,boardSid:c,expand:d,rwState:f,copied:m,onCopy:p,onRewind:h,onOpenPath:x}){const y=u.useCallback(g=>{const w=g.target&&g.target.closest?g.target.closest("a.md-path"):null,b=w&&w.getAttribute("data-path");!b||!x||(g.preventDefault(),x(b))},[x]),j=u.useRef(null);u.useEffect(()=>{d&&j.current&&(j.current.open=!0)},[d]);const v=(()=>{if(t.kind==="user"){const g=Rf(t.text,a),w=!!(t.text||"").trim();return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sess-msg user",children:r.jsxs("div",{className:"bubble",children:[g&&r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Fo(g)}}),(t.images||[]).map((b,S)=>{const N=b.media?o?Ue.sessionMediaUrl(o,l,b.media):i&&c?Ee.sessionMediaUrl(i,c,l,b.media):"":"";return N?r.jsx("a",{href:N,target:"_blank",rel:"noreferrer",children:r.jsx("img",{className:"sess-img",src:N,alt:"图片",onError:_=>{_.currentTarget.closest("a").replaceWith("[图片]")}})},S):r.jsx("span",{className:"sess-img-ph",children:"[图片]"},S)})]})}),(f||w)&&r.jsxs("div",{className:"sess-actrow",children:[f&&r.jsx("button",{type:"button",className:"sess-act rw"+(f==="on"?"":" off"),disabled:f!=="on",title:f==="busy"?"会话运行中或有排队消息,稍后再试":f==="running"?"回退中…":"回退到该提问之前(撤销该提问及其后对话,不回退文件改动)",onClick:()=>h(t),children:r.jsx(wl,{className:"sess-act-i"})}),w&&r.jsx("button",{type:"button",className:"sess-act cp",title:m?"已复制":"复制该提问",onClick:()=>p(t),children:m?r.jsx(lr,{className:"sess-act-i"}):r.jsx(rm,{className:"sess-act-i"})})]})]})}if(t.kind==="assistant")return r.jsx("div",{className:"sess-msg assistant",children:r.jsx("div",{className:"md-body",onClick:y,dangerouslySetInnerHTML:{__html:Fo(t.text,{pathLinks:!0})}})});if(t.kind==="think")return t.text?r.jsxs("details",{className:"sess-msg think",children:[r.jsx("summary",{children:"思考过程"}),r.jsx("div",{className:"think-text",children:t.text})]}):null;if(t.kind==="tool_call")return r.jsxs("details",{className:"sess-msg tool",ref:j,children:[r.jsxs("summary",{children:[r.jsx(dm,{className:"inline h-3 w-3"})," ",t.name||"工具调用"]}),r.jsx("pre",{children:RM(t.args)})]});if(t.kind==="tool_result")return r.jsxs("details",{className:"sess-msg tool result"+(t.is_error?" err":""),ref:j,children:[r.jsxs("summary",{children:[t.is_error?"错误":"结果",t.name?` · ${t.name}`:"","(",String(t.text||"").trim().length," 字符",t.truncated?" · 已截断":"",")"]}),r.jsx("pre",{children:String(t.text||"").trim()})]});if(t.kind==="usage"){const g=[];return t.input&&g.push("↑"+Ml(t.input)),t.output&&g.push("↓"+Ml(t.output)),t.cache_read&&g.push("缓存 "+Ml(t.cache_read)),t.duration_ms&&qf(t.duration_ms)&&g.push(qf(t.duration_ms)),g.length?r.jsx("div",{className:"sess-usage",children:g.join(" · ")}):null}if(t.kind==="divider")return r.jsx("div",{className:"sess-divider",children:t.text});if(t.kind==="error"){const g=[t.text,t.code?`[${t.code}]`:"",t.retryable?"可重试":""].filter(Boolean).join(" · ");return r.jsx("div",{className:"sess-msg error",children:r.jsxs("div",{className:"sess-errbox",children:[r.jsx(um,{className:"sess-errbox-i"}),r.jsxs("div",{children:[r.jsx("div",{className:"sess-errbox-t",children:"模型请求失败,本轮对话已中断"}),g&&r.jsx("div",{className:"sess-errbox-d",children:g})]})]})})}return null})();return v?n?r.jsx("div",{className:"sess-entry"+(s?" flash":""),"data-seq":t.seq,children:v}):v:null}),IM=u.memo(function({row:t,flash:n,expandSeqs:s,taskId:o,agent:l,pid:a,boardPid:i,boardSid:c,onOpenPath:d}){const f=u.useRef(null),m=!!s&&t.items.some(h=>s.has(h.seq));u.useEffect(()=>{m&&f.current&&(f.current.open=!0)},[m]);const p=jM(t.items);return r.jsx("div",{className:"sess-entry"+(n?" flash":""),"data-seq":t.seq,children:r.jsxs("details",{className:"sess-msg proc"+(p.errors?" has-err":""),ref:f,children:[r.jsxs("summary",{children:[r.jsx(dm,{className:"inline h-3 w-3"})," ",p.text]}),r.jsx("div",{className:"sess-proc-body",children:t.items.map(h=>r.jsx(yj,{e:h,taskId:o,agent:l,pid:a,boardPid:i,boardSid:c,onOpenPath:d,expand:!!s&&s.has(h.seq)},h.seq))})]})})}),AM=u.memo(function({entries:t,metaNull:n,found:s,reason:o,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flashSeq:f,expandSeqs:m,chatRunning:p,exitCode:h,boxRef:x,atBottomRef:y,onScroll:j,jumpSeq:v,onJumpHandled:g,rwEnabled:w,rwBusy:b,rewindingMid:S,copiedSeq:N,onCopy:_,onRewind:C,onSwitchSession:O,onOpenPath:P}){const{rows:D,rowIndexOf:K}=u.useMemo(()=>yM(t),[t]),L=D.length,I=u.useRef(new Map),q=u.useRef(new Set),ee=u.useRef(null),[G,z]=u.useState(0),[Y,B]=u.useState(null),me=u.useRef(!0),Z=u.useRef(0),Te=u.useRef(null),ke=u.useRef(0),_e=u.useRef(!1),Ce=u.useRef(null),$e=u.useMemo(()=>{const te=new Float64Array(L+1),E=I.current;let U=0;for(const se of E.values())U+=se;const A=E.size?U/E.size:hx;for(let se=0;se<L;se++)te[se+1]=te[se]+(E.get(D[se].seq)||A);return te},[D,L,G]),[ue,fe]=Y??[Math.max(0,L-ua),L],Se=u.useCallback(()=>{const te=x.current;te&&(j(),me.current=te.scrollHeight-te.scrollTop-te.clientHeight<$M,!Z.current&&(Z.current=requestAnimationFrame(()=>{Z.current=0;const E=x.current;E&&B(U=>{const[A,se]=U??[Math.max(0,L-ua),L];if(me.current)return se===L?U:[Math.max(0,L-ua),L];const oe=Math.max(0,yd($e,E.scrollTop)-gx),ze=Math.min(L,yd($e,E.scrollTop+E.clientHeight)+1+gx);return oe===A&&ze===se?U:[oe,Math.max(oe+1,ze)]})})))},[x,j,L,$e]);return u.useEffect(()=>()=>{cancelAnimationFrame(Z.current),cancelAnimationFrame(ke.current)},[]),u.useLayoutEffect(()=>{if(!L){I.current.size&&(I.current=new Map),Ce.current=null,B(null);return}B(te=>{const[E,U]=te??[Math.max(0,L-ua),L];return y.current?[L-E>TM?Math.max(0,L-ua):Math.min(E,L-1),L]:[Math.min(E,L-1),Math.min(U,L)]})},[L,y]),u.useEffect(()=>{if(v==null)return;const te=K.get(v);if(te==null){g(v);return}me.current=!1,Te.current={row:D[te].seq,seq:v},B([Math.max(0,te-5),Math.min(L,te+25)])},[v,D,K,L,g]),u.useEffect(()=>{if(typeof ResizeObserver>"u")return;const te=new ResizeObserver(()=>z(E=>E+1));return ee.current=te,x.current&&te.observe(x.current),()=>{te.disconnect(),ee.current=null,q.current=new Set}},[x]),u.useLayoutEffect(()=>{const te=x.current;if(!te)return;const E=I.current;let U=!1,A=0;const se=yd($e,te.scrollTop),oe=te.querySelectorAll(".sess-entry[data-seq]");for(let Be=0;Be<oe.length;Be++){const Ke=oe[Be],rt=+Ke.dataset.seq,$t=Ke.offsetHeight+MM,it=E.get(rt);it!==$t&&(E.set(rt,$t),U=!0,ue+Be<se&&(A+=$t-(it??hx)))}A&&!me.current&&!_e.current&&(te.scrollTop+=A);const ze=Ce.current,Je=!ze||te.scrollHeight!==ze.sh||te.clientHeight<ze.ch;Ce.current={sh:te.scrollHeight,ch:te.clientHeight},me.current&&y.current&&Je&&(te.scrollTop=te.scrollHeight);const Fe=ee.current;if(Fe){const Be=new Set;for(let Ke=0;Ke<oe.length;Ke++){const rt=oe[Ke];Be.add(rt),q.current.has(rt)||(Fe.observe(rt),q.current.add(rt))}for(const Ke of q.current)Be.has(Ke)||(Fe.unobserve(Ke),q.current.delete(Ke))}const et=Te.current;if(et!=null){const Be=te.querySelector(`[data-seq="${et.row}"]`);if(Be){Be.scrollIntoView({block:"start"}),Te.current=null,cancelAnimationFrame(ke.current),_e.current=!0;let Ke=20,rt=0;const $t=()=>{const it=x.current,Q=it&&it.querySelector(`[data-seq="${et.row}"]`);if(!Q||!it){_e.current=!1,ke.current=0;return}const He=Math.round(Q.getBoundingClientRect().top-it.getBoundingClientRect().top);rt=He===0?rt+1:0,He!==0&&Q.scrollIntoView({block:"start"}),--Ke>0&&rt<6?ke.current=requestAnimationFrame($t):(_e.current=!1,ke.current=0)};ke.current=requestAnimationFrame($t),g(et.seq)}}U&&z(Be=>Be+1)}),r.jsxs("div",{className:"sess-body scroll",ref:x,onScroll:Se,children:[n?r.jsx("div",{className:"sess-empty",children:"加载中…"}):s?L?r.jsxs(r.Fragment,{children:[ue>0&&r.jsx("div",{className:"sess-pad",style:{height:$e[ue]}}),D.slice(ue,fe).map(te=>{const E=f!=null&&te.items.some(se=>se.seq===f);if(te.proc)return r.jsx(IM,{row:te,flash:E,expandSeqs:m,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,onOpenPath:P},te.key);const U=te.items[0],A=!w||!U.mid?"":S===U.mid?"running":b?"busy":"on";return r.jsx(yj,{e:U,wrap:!0,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flash:E,expand:!!m&&m.has(U.seq),rwState:A,copied:N===U.seq,onCopy:_,onRewind:C,onOpenPath:P},te.key)}),fe<L&&r.jsx("div",{className:"sess-pad",style:{height:$e[L]-$e[fe]}})]}):r.jsx("div",{className:"sess-empty",children:"会话暂无内容"}):r.jsx("div",{className:"sess-empty",children:PM[o]||"会话不可用"}),p&&r.jsxs("div",{className:"sess-running",children:[r.jsx("span",{className:"sess-pulse"}),"工作中…"]}),!p&&h!=null&&h!==0&&r.jsxs("div",{className:"sess-chaterr",children:[r.jsx(ON,{className:"inline h-3 w-3"})," 对话进程异常结束(exit=",h,")"]})]})}),OM=u.memo(function({withQBar:t,qbarOpen:n,questions:s,flashSeq:o,onJump:l}){return!t||!n?null:r.jsxs("aside",{className:"sess-qbar",children:[r.jsxs("div",{className:"sess-qbar-t",children:["提问索引 ",r.jsx("span",{className:"sess-qbar-n",children:s.length})]}),r.jsxs("div",{className:"sess-qbar-list",children:[s.length===0&&r.jsx("div",{className:"sess-qbar-empty",children:"暂无提问"}),s.map((a,i)=>{const c=mM(a).replace(/\s+/g," "),d=a.kind==="ask";return r.jsxs("button",{type:"button",className:"sess-qitem"+(d?" ask":"")+(d&&a.state!=="answered"?" pend":"")+(o===a.seq?" on":""),onClick:()=>l(a),title:hM(a),children:[r.jsx("span",{className:"sess-qitem-i",children:i+1}),r.jsxs("span",{className:"sess-qitem-t",children:[d&&r.jsx("span",{className:"sess-qitem-ask",children:"🤔"}),c.slice(0,60),c.length>60?"…":""]})]},a.key)})]})]})}),LM=u.memo(function({data:t,answer:n}){const[s,o]=u.useState({}),[l,a]=u.useState(!1),[i,c]=u.useState(0),[d,f]=u.useState(!1),m=t==null?void 0:t.qid,p=t==null?void 0:t.approval_id;if(u.useEffect(()=>{o({}),c(0),f(!1)},[m,p]),!(t!=null&&t.pending))return null;const h=t.questions&&t.questions.length?t.questions:[{id:t.wire||"q_0",question:t.question,header:t.header,body:t.body,options:t.options||[],multi_select:t.multi_select,allow_other:t.allow_other,other_label:t.other_label,other_description:t.other_description}],x=h.length>1,y=I=>s[I]||{sel:[],other:"",useOther:!1},j=(I,q)=>o(ee=>({...ee,[I]:{...ee[I]||{sel:[],other:"",useOther:!1},...q}}));async function v(I){a(!0);try{await n(I)}finally{a(!1)}}function g(I,q){const ee=y(I.id);I.multi_select?j(I.id,{sel:ee.sel.includes(q)?ee.sel.filter(G=>G!==q):[...ee.sel,q]}):j(I.id,{sel:[q],useOther:!1})}function w(I){j(I.id,I.multi_select?{useOther:!0}:{useOther:!0,sel:[]})}function b(I,q){j(I.id,I.multi_select?{other:q,useOther:!0}:{other:q,useOther:!0,sel:[]})}function S(I){const q=y(I.id),ee=(q.other||"").trim();return I.multi_select?q.sel.length&&ee?{wire:I.id,kind:"multi_with_other",option_ids:q.sel,text:ee}:q.sel.length?{wire:I.id,kind:"multi",option_ids:q.sel}:ee?{wire:I.id,kind:"other",text:ee}:null:q.sel.length?{wire:I.id,kind:"single",option_id:q.sel[0]}:ee?{wire:I.id,kind:"other",text:ee}:null}const N=h.map(S),_=!l&&N.every(Boolean);function C(){if(_)return v({qid:m,answers:N})}const O=N.filter(Boolean).length,P=Math.min(Math.max(i,0),h.length-1),D=h[P],K=y(D.id),L=D.options||[];return t.kind==="approval"?d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx(Dc,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Bl,{className:"h-3.5 w-3.5"})})]}),t.input&&r.jsx("pre",{className:"sess-interaction-pre",children:t.input}),r.jsxs("div",{className:"sess-interaction-opts",children:[r.jsx(H,{size:"sm",disabled:l,onClick:()=>v({approval_id:p,decision:"approved"}),children:"批准"}),r.jsx(H,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"approved",scope:"session"}),children:"本会话内批准"}),r.jsx(H,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"rejected"}),children:"拒绝"})]})]}):d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🤔 agent 等待你的回答",x?` · 已答 ${O}/${h.length}`:""]}),r.jsx(Dc,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🤔 ",x?`问题 ${P+1}/${h.length}`:"agent 等待你的回答",D.header?`(${D.header})`:"",":",D.question||"(详情见会话记录)"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Bl,{className:"h-3.5 w-3.5"})})]}),D.body&&r.jsx("div",{className:"sess-interaction-body",children:D.body}),t.answerable&&r.jsxs("div",{className:"sess-interaction-list",children:[L.map((I,q)=>r.jsxs("label",{className:"sess-iopt"+(K.sel.includes(I.id)?" on":""),children:[r.jsx("input",{type:D.multi_select?"checkbox":"radio",checked:K.sel.includes(I.id),disabled:l,onChange:()=>g(D,I.id)}),r.jsx("span",{className:"sess-iopt-key",children:q+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:I.label}),I.description&&r.jsx("span",{className:"sess-iopt-desc",children:I.description})]})]},I.id)),D.allow_other&&r.jsxs("label",{className:"sess-iopt"+(K.useOther?" on":""),children:[r.jsx("input",{type:D.multi_select?"checkbox":"radio",checked:K.useOther,disabled:l,onChange:()=>w(D)}),r.jsx("span",{className:"sess-iopt-key",children:L.length+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:D.other_label||"其他…"}),D.other_description&&r.jsx("span",{className:"sess-iopt-desc",children:D.other_description}),r.jsx("input",{className:"sess-iopt-input",type:"text",value:K.other,placeholder:D.other_label||"其他…",disabled:l,onFocus:()=>w(D),onChange:I=>b(D,I.target.value)})]})]})]}),(t.answerable||x)&&r.jsxs("div",{className:"sess-interaction-foot",children:[x?r.jsxs("div",{className:"sess-inav",children:[r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:P===0,onClick:()=>c(P-1),children:"‹ 上一题"}),h.map((I,q)=>r.jsx("button",{type:"button",className:"sess-inav-dot"+(q===P?" on":"")+(N[q]?" done":""),title:`第 ${q+1} 题${N[q]?"(已答)":"(未答)"}`,onClick:()=>c(q),children:q+1},I.id)),r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:P===h.length-1,onClick:()=>c(P+1),children:"下一题 ›"})]}):r.jsx("span",{className:"sess-interaction-hint",children:D.multi_select?"可多选,选好后点「提交」":"选择后点「提交」"}),t.answerable&&r.jsx(H,{size:"sm",disabled:!_,title:!l&&!_?"还有题目未作答":void 0,onClick:C,children:"提交"})]})]})});function Gf({task:e,board:t,withQBar:n=!0,onUnitState:s,onCardColumn:o,onPassed:l}){var ys,Js,ea,Ym,Qm,Xm;const a=e==null?void 0:e.id,i=t==null?void 0:t.sid,c=t==null?void 0:t.projectId,d=t==null?void 0:t.cid,[f,m]=u.useState(null),[p,h]=u.useState([]),[x,y]=u.useState({running:!1}),[j,v]=u.useState("main"),[g,w]=u.useState(!1),[b,S]=u.useState(""),[N,_]=u.useState(!1),[C,O]=u.useState(""),[P,D]=u.useState(""),[K,L]=u.useState(!1),[I,q]=u.useState(null),[ee,G]=u.useState(!1),[z,Y]=u.useState(!1),[B,me]=u.useState(null),[Z,Te]=u.useState(""),ke=u.useRef(null),[_e,Ce]=u.useState(!1),[$e,ue]=u.useState([]),[fe,Se]=u.useState([]),[te,E]=u.useState(null),[U,A]=u.useState(null),[se,oe]=u.useState({models:[],default:""}),[ze,Je]=u.useState(null),Fe=On($=>$.projects),[et,Be]=u.useState(-1),[Ke,rt]=u.useState(!1),[$t,it]=u.useState([]),[Q,He]=u.useState(!0),[ce,Dt]=u.useState(null),[Gt,un]=u.useState(null),[dn,kr]=u.useState(()=>new Set),fn=u.useRef(null),Ps=u.useRef(null),R=u.useRef(!0),F=u.useRef(-1),ne=u.useRef(""),ae=u.useRef(""),ie=u.useRef(null),de=u.useRef(null),Re=u.useRef(null),Ve=u.useRef(null),tt=u.useRef([1,0]),ot=!!t&&!!(f!=null&&f.running),tn=["running","queued"].includes(e==null?void 0:e.status)||ot,Tn=!!(x!=null&&x.running),Nt=(f==null?void 0:f.capabilities)||{},nt=vj(),Kt=i||(f==null?void 0:f.session_id)||"",Yt=aM(f==null?void 0:f.owned),zt=!iM(f==null?void 0:f.owned),mt=!(f!=null&&f.found),Ct=(x==null?void 0:x.queued)||0,nn=((ys=f==null?void 0:f.unit_state)==null?void 0:ys.state)||"",ts=(f==null?void 0:f.queue_state)||"",_r=((Js=f==null?void 0:f.unit_state)==null?void 0:Js.pos)||0,ns=((ea=f==null?void 0:f.unit_state)==null?void 0:ea.total)||0,xs=u.useMemo(()=>ts?{kind:ts,pos:_r,total:ns}:null,[ts,_r,ns]);u.useEffect(()=>{s&&s(xs)},[xs,s]);const ss=t&&(f==null?void 0:f.card_column)||"";u.useEffect(()=>{o&&o(ss)},[ss,o]);const vs=!!(t&&(f==null?void 0:f.queue_state)==="answer_pending"),mo=!!Nt.rewind,Zo=tn||Tn||nn==="running"||Ct>0||(((Ym=f==null?void 0:f.queue)==null?void 0:Ym.length)||0)>0||N;u.useEffect(()=>()=>clearTimeout(ke.current),[]);const Ms=t?t.projectId:e==null?void 0:e.project_id,Et=Fe.find($=>$.id===Ms);u.useEffect(()=>{if(!(Et!=null&&Et.agent_path)||!Ms)return;let $=!1;return it(X=>X.filter(je=>je.type!=="skill")),kt.agentSkills(Et.agent_path,Et.project_dir||Et.work_dir||"").then(X=>{if($)return;const je=Array.isArray(X)?X:(X==null?void 0:X.skills)||[];it(pe=>[...pe.filter(Ie=>Ie.type!=="skill"),...je.map(Ie=>({key:Ie.name||Ie.id,label:Ie.name||Ie.id,desc:(Ie.description||Ie.summary||"").slice(0,40),type:"skill"}))])}).catch(()=>{}),()=>{$=!0}},[Et==null?void 0:Et.agent_path,Ms]);const Sr=[{key:"/stop",desc:"停止当前对话",type:"cmd",on:()=>!!Nt.chat,run:lt},{key:"/compact",desc:"压缩会话历史",type:"cmd",on:()=>!!t&&!!Nt.compact,run:async()=>{await Ee.compact(c,d,i)}},{key:"/new",desc:"创建新会话",type:"cmd",dis:!0},{key:"/clear",desc:"清空并新建会话",type:"cmd",dis:!0},{key:"/plan",desc:"切换计划模式 开/关",type:"cmd",dis:!0},{key:"/swarm",desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行",type:"cmd",dis:!0},{key:"/goal",desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel",type:"cmd",dis:!0},{key:"/btw",desc:"侧边聊天:/btw <问题> 向 fork 的侧边聊天提问",type:"cmd",dis:!0},{key:"/undo",desc:"撤销上一条消息",type:"cmd",dis:!0}],rs=Sr.filter($=>$.dis||$.on()),sn=u.useMemo(()=>mj(b,et>=0?et:b.length),[b,et]),ho=sn!=null&&!Ke,Xs=sn?sn.text.slice(1):"";u.useEffect(()=>{if(!a||t)return;let $=!1;m(null),h([]),y({running:!1}),Se([]),w(!1),F.current=-1,ne.current="";function X(Ie){Ie.addEventListener("meta",De=>{if($)return;const vt=JSON.parse(De.data);if(vt.session_id&&ne.current&&vt.session_id!==ne.current&&(F.current=-1,h([])),vt.session_id&&(ne.current=vt.session_id),vt.found&&vt.total<F.current+1){pe();return}m(vt)}),Ie.addEventListener("entries",De=>{if($)return;const vt=JSON.parse(De.data);if(vt.total<F.current+1){pe();return}const jt=(vt.entries||[]).filter(rn=>rn.seq>F.current);jt.length&&(F.current=jt[jt.length-1].seq,h(rn=>[...rn,...jt]),Se(rn=>rn.filter(Er=>!jt.some($s=>$s.kind==="user"&&($s.text||"").includes(Er.text.slice(0,50))))))}),Ie.addEventListener("chat",De=>{$||y(JSON.parse(De.data))}),Ie.onopen=()=>{$||w(!0)},Ie.onerror=()=>{$||w(!1)}}function je(){const Ie=Ue.sessionStream(a,j);ie.current=Ie,X(Ie)}function pe(){F.current=-1,h([]),ie.current&&(ie.current.close(),ie.current=null),je()}return je(),()=>{$=!0,ie.current&&(ie.current.close(),ie.current=null)}},[a,j]),u.useEffect(()=>{if(!i)return;let $=!1;m(null),h([]),y({running:!1}),Se([]),w(!1),F.current=-1;let X=null,je=setInterval(Ie,2e3);const pe=()=>{Re.current||(Re.current=setTimeout(()=>{Re.current=null,Ie()},150))};de.current=De=>{if(!(!De||X)){clearInterval(je),je=setInterval(Ie,6e4);try{X=Ee.sessionStream(c,i),X.addEventListener("hello",pe),X.addEventListener("refresh",pe)}catch{X=null}}};async function Ie(){try{const De=await Ee.sessionMessages(c,i,F.current+1,j);if($)return;if(De.found&&De.total<F.current+1){F.current=-1,h([]);return}const vt=(De.entries||[]).filter(jt=>jt.seq>F.current);vt.length&&(F.current=vt[vt.length-1].seq,h(jt=>[...jt,...vt]),Se(jt=>jt.filter(rn=>!vt.some(Er=>Er.kind==="user"&&(Er.text||"").includes(rn.text.slice(0,50)))))),m(jt=>({found:De.found,reason:De.reason,agents:De.agents,agent:De.agent,total:De.total,totals:De.totals,session_id:i,capabilities:De.capabilities,running:De.running,interaction:De.interaction,owned:De.owned,family:De.family,ctx:De.ctx,permission:De.permission,sessionModel:De.sessionModel,sessionEffort:De.sessionEffort,unit_state:De.unit_state,queue_state:De.queue_state,project_busy:De.project_busy,card_column:De.card_column,answer_pending:De.answer_pending,card_worktree:De.card_worktree,queue:De.queue==null?jt==null?void 0:jt.queue:De.queue})),y(De.chat||{running:!1}),w(!0)}catch{$||w(!1)}}return Ie(),()=>{$=!0,de.current=null,clearInterval(je),Re.current&&(clearTimeout(Re.current),Re.current=null);try{X==null||X.close()}catch{}}},[i,c,j]),u.useEffect(()=>{var $,X;(X=de.current)==null||X.call(de,!!(($=f==null?void 0:f.capabilities)!=null&&$.events))},[(Qm=f==null?void 0:f.capabilities)==null?void 0:Qm.events,i]),u.useEffect(()=>{ae.current=i},[i]);const Nr=u.useRef(new Set);u.useEffect(()=>{const $=((x==null?void 0:x.msgs)||[]).filter(X=>X.state==="error");if($.length)for(const X of $)Nr.current.has(X.id)||(Nr.current.add(X.id),M(`消息发送失败:${X.error||"未知原因"}`),X.id&&Se(je=>je.filter(pe=>pe.id!==X.id)))},[x]),u.useEffect(()=>{if(E(null),A(null),Je(null),!i)return;let $=!1;return Et!=null&&Et.agent_path?kt.agentModels(Et.agent_path).then(X=>{$||oe(X||{models:[],default:""})}).catch(()=>{$||oe({models:[],default:""})}):oe({models:[],default:""}),()=>{$=!0}},[i,Et==null?void 0:Et.agent_path]),u.useEffect(()=>{(f==null?void 0:f.permission)!=null&&E(f.permission),f!=null&&f.sessionModel&&A(f.sessionModel),f!=null&&f.sessionEffort&&Je(f.sessionEffort)},[f==null?void 0:f.permission,f==null?void 0:f.sessionModel,f==null?void 0:f.sessionEffort]);const el=u.useMemo(()=>aj(se,U||(f==null?void 0:f.sessionModel)||(se==null?void 0:se.default)||""),[se,U,f==null?void 0:f.sessionModel]),T=u.useCallback(()=>{const $=Ps.current;R.current=$?$.scrollHeight-$.scrollTop-$.clientHeight<60:!0},[]),V=u.useMemo(()=>{const $=[],X=[],je=pe=>X.some(Ie=>Ie&&pe&&Ie.slice(0,40)===pe.slice(0,40));for(const pe of(f==null?void 0:f.queue)||[])pe!=null&&pe.text&&($.push({key:"k"+pe.id,text:pe.text,msgId:"",state:"server"}),X.push(pe.text));for(const pe of(x==null?void 0:x.msgs)||[])pe.state==="error"||!pe.text||je(pe.text)||($.push({key:"m"+pe.id,text:pe.text,msgId:pe.id,state:pe.state}),X.push(pe.text));for(const pe of fe)!pe.text||je(pe.text)||($.push({key:"p"+(pe.id||pe.ts),text:pe.text,msgId:pe.id||"",state:"pending"}),X.push(pe.text));return $},[f==null?void 0:f.queue,x,fe]),ve=u.useMemo(()=>pM(p),[p]),he=u.useCallback($=>{const X=$&&typeof $=="object"?$:{seq:$,kind:"user"};kr(X.kind==="ask"?new Set([X.seq,X.ansSeq].filter(je=>je!=null)):new Set),un(X.seq)},[]),Le=u.useCallback($=>{un(null),Dt($),clearTimeout(fn.current),fn.current=setTimeout(()=>Dt(null),1600)},[]);function ge(){const $=Ve.current;if(!$)return;const X=$.value.split(`
|
|
453
|
-
`).length,je=$.value.length,[pe,Ie]=tt.current;X===pe&&Math.abs(je-Ie)<40||(tt.current=[X,je],$.style.height="auto",$.style.height=Math.min($.scrollHeight,320)+"px")}async function ct($){const X=Array.from($||[]);if(!X.length||_e)return;const je=t?t.projectId:e==null?void 0:e.project_id;if(je)for(const pe of X){if(pe.size>10*1024*1024){M(`附件过大(>10MB):${pe.name}`);continue}if(await pm(pe)){M(`已跳过占位图(极小尺寸):${pe.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}Ce(!0);try{const Ie=await new Promise((rn,Er)=>{const $s=new FileReader;$s.onload=()=>rn(String($s.result||"").split(",")[1]||""),$s.onerror=()=>Er(new Error("文件读取失败")),$s.readAsDataURL(pe)}),De=await Ee.uploadMedia(je,{name:pe.name,mime:pe.type||"application/octet-stream",data:Ie}),vt=(pe.type||"").startsWith("image/")?``:`[${pe.name}](${De.abs||De.url})`;ue(rn=>[...rn,{md:vt,url:fm(De.url),abs:De.abs,name:pe.name,mime:pe.type}]);const jt=Ve.current;if(jt&&document.activeElement===jt&&jt.selectionStart!=null){const rn=jt.selectionStart,Er=jt.selectionEnd;S($s=>$s.slice(0,rn)+vt+$s.slice(Er)),requestAnimationFrame(()=>{jt.selectionStart=jt.selectionEnd=rn+vt.length,Be(rn+vt.length)})}else S(rn=>(rn?rn+`
|
|
454
|
-
`:"")+vt+`
|
|
455
|
-
`),Be(-1);ge(),M(`已添加附件:${pe.name}`)}catch(Ie){M(Ie.message||"附件上传失败")}finally{Ce(!1)}}}function dt($){var pe;const je=Array.from(((pe=$.clipboardData)==null?void 0:pe.items)||[]).filter(Ie=>Ie.kind==="file").map(Ie=>Ie.getAsFile()).filter(Boolean);je.length&&($.preventDefault(),ct(je))}function Qt($){var je;const X=Array.from(((je=$.dataTransfer)==null?void 0:je.files)||[]);X.length&&($.preventDefault(),ct(X))}async function W(){const $=b.trim();if(!(!$||N||mt)){if(/^\/[\w-]+$/.test($)){const X=Sr.find(je=>je.key===$);if(X){if(X.dis||!(X.on&&X.on())){M(`当前环境不支持 ${$}`);return}S(""),Be(0),requestAnimationFrame(ge);try{if(await X.run()===!1)return;M(`已执行 ${$}`)}catch(je){M(je.message||`指令执行失败:${$}`)}return}}_(!0);try{if(t){const X=await Ee.addComment(c,d,$),je=await Ee.sendComment(c,d,X.id,!1);je!=null&&je.queued&&Se(pe=>[...pe,{text:$,ts:Date.now(),id:je.msg_id||""}])}else{const X=await Ue.sessionChat(a,$);X!=null&&X.queued&&Se(je=>[...je,{text:$,ts:Date.now(),id:X.msg_id||""}])}S(""),R.current=!0,requestAnimationFrame(ge)}catch(X){M(X.message)}finally{_(!1)}}}async function lt(){try{if(t){const $=await Ee.stopCard(c,d);if($&&$.stopped===!1)return M("该会话未在运行或无法停止"),!1}else await Ue.sessionChatStop(a);return Se([]),!0}catch($){return M($.message),!1}}async function $n($){if(!$||$===te)return;const X=i;try{if(await Ee.setSessionProfile(c,X,{permission_mode:$}),X!==ae.current)return;E($),M(`权限已切换:${(Uc.find(je=>je.value===$)||{}).label||$}`)}catch(je){X===ae.current&&M(je.message)}}async function os($){const X=i;try{if(await Ee.setSessionProfile(c,X,{model:$}),X!==ae.current)return;A($),M(`模型已切换:${$}`)}catch(je){X===ae.current&&M(je.message)}}async function Sn($){if(!$||$==="__default__"||$===ze)return;const X=i;try{if(t?await Ee.setSessionProfile(c,X,{reasoning_effort:$}):await Ue.sessionProfile(a,{reasoning_effort:$}),X&&X!==ae.current)return;Je($),M(`思考等级已切换:${LP($)}`)}catch(je){(!X||X===ae.current)&&M(je.message)}}async function go($){try{const X=t?await Ee.answerInteraction(c,d,$):await Ue.answerInteraction(a,$);M(X&&X.queued?"已提交答案:项目忙,等待空闲后自动送达":"已回答")}catch(X){M(X.message)}}async function xo($){if($!=null&&$.msgId){D($.key);try{t?await Ee.injectSessionMsg(c,i,$.msgId):await Ue.sessionChatInject(a,$.msgId),M("已注入当前上下文"),Se(X=>X.filter(je=>je.id!==$.msgId))}catch(X){M(X.message)}finally{D("")}}}async function vo(){Y(!0);try{await Ee.deliverAnswer(c,d),M("已送达答案")}catch($){M($.message)}finally{Y(!1)}}async function k(){L(!0);try{if(t&&(f!=null&&f.card_worktree)){let $=null;try{$=await Ee.worktreePreview(c,d)}catch{$=null}if($&&$.merge&&$.merge.ahead>0){q($.merge);return}}await Ee.moveCard(c,d,"done"),M("已通过,卡片移入「已完成」"),l&&l()}catch($){M($.message)}finally{L(!1)}}async function le(){G(!0);try{await Ee.mergeWorktree(c,d),q(null),M("已交给 agent 合并:卡片回到开发队列排队,完成后自动回「待审核」")}catch($){M($.message)}finally{G(!1)}}async function be(){q(null),L(!0);try{await Ee.moveCard(c,d,"done",void 0,null,!0),M("已通过,卡片移入「已完成」"),l&&l()}catch($){M($.message)}finally{L(!1)}}const Pe=u.useCallback($=>O($||""),[]);function We($){var pe;const X=($==null?void 0:$.text)||"";if(!X.trim())return;const je=(pe=navigator.clipboard)==null?void 0:pe.writeText(X);je&&je.catch&&je.catch(()=>M("复制失败:浏览器未授予剪贴板权限")),me($.seq),clearTimeout(ke.current),ke.current=setTimeout(()=>me(null),1400)}async function Me($){const X=($==null?void 0:$.mid)||"";if(!X||Z)return;const je=p.filter(Ie=>Ie.kind==="user"&&Ie.seq>=$.seq).length,pe=($.text||"").trim().replace(/\s+/g," ").slice(0,60);if(window.confirm(`回退到该提问之前?
|
|
456
|
-
|
|
457
|
-
将撤销该提问及其后共 ${je} 轮对话:
|
|
458
|
-
${pe}${pe.length>=60?"…":""}
|
|
459
|
-
|
|
460
|
-
只回退对话上下文,不回退文件改动;此操作不可撤销。`)){Te(X);try{const Ie=t?await Ee.rewindSession(c,i,X):await Ue.sessionRewind(a,X);Ie!=null&&Ie.new_session_id&&!Ie.rebound?(M(`已回退 ${je} 轮对话:历史已复制为新会话,正在切换`),onSwitchSession==null||onSwitchSession(Ie.new_session_id)):M(`已回退 ${je} 轮对话,原提问已回填输入框`),S($.text||""),h(De=>De.filter(vt=>vt.seq<$.seq)),F.current=$.seq-1,ge()}catch(Ie){M(`回退失败:${(Ie==null?void 0:Ie.message)||"未知原因"}`)}finally{Te("")}}}function ht($){S(X=>X.replace($,""))}u.useEffect(()=>{const $=Ve.current;if(!$)return;const X=()=>Be($.selectionStart??0),je=()=>{Be($.selectionStart??0),rt(!1)};return $.addEventListener("keyup",X),$.addEventListener("click",je),()=>{$.removeEventListener("keyup",X),$.removeEventListener("click",je)}},[Nt.chat]);function It($){var X;S($),Be(((X=Ve.current)==null?void 0:X.selectionStart)??$.length),rt(!1),ge()}function yo($){if(!sn)return;const X=$.type==="skill"?`使用 skill「${$.label}」`:$.key;rt(!0),S(pe=>pe.slice(0,sn.start)+X+pe.slice(sn.start+sn.text.length));const je=sn.start+X.length;Be(je),requestAnimationFrame(()=>{const pe=Ve.current;pe&&(pe.selectionStart=pe.selectionEnd=je)}),ge()}function wo($){M(`当前环境不支持 ${$.key}`)}const Ts=(f==null?void 0:f.agents)||[],In=f==null?void 0:f.totals,Cr=In&&(f!=null&&f.found)?[`共 ${f.total} 条`,In.input?`↑${Ml(In.input)}`:"",In.output?`↓${Ml(In.output)}`:"",In.cache_read?`缓存 ${Ml(In.cache_read)}`:"",qf(In.duration_ms)].filter(Boolean).join(" · "):"";return r.jsxs("div",{className:"sess-view",children:[r.jsxs("div",{className:"sess-wrap",children:[r.jsx(OM,{withQBar:n,qbarOpen:Q,questions:ve,flashSeq:ce,onJump:he}),r.jsxs("div",{className:"sess-main",children:[r.jsxs("div",{className:"sess-sub",children:[n&&r.jsx("button",{type:"button",className:"sess-qbar-toggle",title:Q?"收起提问索引":"展开提问索引",onClick:()=>He($=>!$),children:r.jsx(sC,{className:"h-3.5 w-3.5"})}),r.jsx("span",{className:"sess-conn"+(g?" on":""),title:g?"SSE 已连接(实时更新)":"连接中断,自动重连中…"}),(f==null?void 0:f.session_id)&&r.jsx("span",{className:"sess-chip mono",title:f.session_id,children:f.session_id.replace(/^session_/,"").slice(0,8)}),(f==null?void 0:f.model)&&r.jsx("span",{className:"sess-chip",children:f.model}),Ts.length>1&&r.jsx("span",{className:"sess-agents",children:Ts.map($=>r.jsxs("button",{type:"button",className:"sess-agent"+(((f==null?void 0:f.agent)||j)===$.id?" on":""),onClick:()=>v($.id),children:[$.id,$.type==="sub"?" (子)":""]},$.id))}),r.jsx("span",{style:{flex:1}}),!!(nt!=null&&nt.openSession)&&r.jsx(H,{size:"sm",variant:"ghost",className:"sess-open-dsh",title:Kt?"在 dsh 界面打开当前会话":"尚无会话",disabled:!Kt,onClick:()=>xj(Kt),children:r.jsx(om,{className:"h-3.5 w-3.5"})}),t&&["doing","review"].includes(t.column)&&r.jsxs(H,{size:"sm",variant:"outline",className:"sess-pass",disabled:K,title:"通过:卡片移入「已完成」",onClick:k,children:[r.jsx(lr,{className:"h-3.5 w-3.5"})," 通过"]}),Cr&&r.jsx("span",{className:"sess-totals",title:"输入 / 输出 / 缓存读取 / 总耗时",children:Cr})]}),Yt&&r.jsxs("div",{className:"mb-2 flex items-start gap-2 rounded-md border border-border bg-secondary/60 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:[r.jsx(um,{className:"mt-0.5 h-3.5 w-3.5 flex-none text-primary"}),r.jsx("span",{children:Yt})]}),r.jsx(AM,{entries:p,metaNull:!f,found:!!(f!=null&&f.found),reason:f==null?void 0:f.reason,taskId:a,agent:(f==null?void 0:f.agent)||j,pid:t?c:Ms,boardPid:t?c:"",boardSid:t?i:"",flashSeq:ce,expandSeqs:dn,chatRunning:Tn,exitCode:x==null?void 0:x.exit_code,boxRef:Ps,atBottomRef:R,onScroll:T,jumpSeq:Gt,onJumpHandled:Le,rwEnabled:mo,rwBusy:Zo,rewindingMid:Z,copiedSeq:B,onCopy:We,onRewind:Me,onOpenPath:Pe}),((Xm=f==null?void 0:f.interaction)==null?void 0:Xm.pending)&&r.jsx(LM,{data:f.interaction,answer:go}),Nt.chat&&r.jsx(AP,{value:b,onChange:It,atts:$e,onRemoveAtt:ht,uploading:_e,inputLocked:mt,caps:Nt,meta:f,onSend:W,onStop:lt,stopDisabled:zt,chatRunning:Tn,taskRunning:tn,queuedN:Ct,board:t,sending:N,permMode:te,modelSel:U,modelOpts:se,onSetModel:os,onSetPermission:$n,effortSel:ze,effortOpts:el,onSetEffort:Sn,queueRows:V,injecting:P,onInject:xo,answerPending:vs,deliveringAnswer:z,onDeliverAnswer:vo,slashOpen:ho,slashQuery:Xs,slashItems:[...rs,...$t],onSlashSelect:yo,onSlashClose:()=>rt(!0),onSlashDisabled:wo,onPasteFiles:dt,onDropFiles:Qt,onUploadFiles:ct,taRef:Ve})]})]}),C&&(t?c:Ms)&&r.jsx(oM,{pid:t?c:Ms,path:C,onClose:()=>O("")}),r.jsx(pj,{open:!!I,info:I,busy:ee,disabledReason:f!=null&&f.running||x!=null&&x.running?"会话运行中:等这一轮跑完,或先点「停止」再交接":"",onHandoff:le,onPass:be,onClose:()=>!ee&&q(null)})]})}const DM={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function zM({column:e}){const t=DM[e];return t?r.jsx("span",{className:"sess-colstate",title:"卡片当前所在列(看板队列)",children:t}):null}const FM={running:"该会话所属任务/卡片正在运行",starting:"卡片已交平台启动,等待会话证实运行(启动中)",answer_pending:"答案已被平台收下,等项目空闲送达",interaction_pending:"agent 向用户提问挂起,等待作答",server_queued:"消息已在 agent 服务端队列排队",foreign_busy:"项目被外部同步会话占用,等其结束后按队列补位"};function BM({state:e}){if(!e||!e.kind)return null;const t=e.kind,n=e.pos||0,s=e.total||0;if(t==="idle")return r.jsxs("span",{className:"sess-qstate",title:"不在统一队列中(既未排队也无运行中的单元)",children:[r.jsx("span",{className:"dot"}),"空闲"]});const o=(t==="queued_serial"||t==="answer_pending")&&n>0,l=Ef[t]||t,a=o?`统一队列排队中:本项目前面还有 ${Math.max(0,n-1)} 个单元(本项目排队 ${s} 个)`:FM[t]||"";return r.jsxs("span",{className:G0(t,"sess"),title:a,children:[r.jsx("span",{className:"dot"}),l,o?` · 第 ${n} 位`:""]})}function Wc({task:e,board:t,onClose:n,onSwitchSession:s}){const o=!!e||!!t,{rzOn:l,rzStyle:a,rzStart:i,rzDragStart:c,rzReset:d}=ar("ts.sessW"),[f,m]=u.useState(null),[p,h]=u.useState("");return u.useEffect(()=>{o||(m(null),h(""))},[o]),r.jsx(en,{open:o,onOpenChange:x=>{x||n()},children:r.jsxs(Ut,{className:"modal modal-rz sess-modal w-[75vw] h-[90vh] sm:max-w-[94vw] grid-rows-[auto_minmax(0,1fr)]"+(l?" rz-drag":""),style:{...a,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:i,reset:d}),r.jsx(Vt,{className:"text-left",children:r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsxs(Wt,{className:"cursor-move select-none text-sm",onMouseDown:c,children:["会话 · ",(e==null?void 0:e.name)||(t==null?void 0:t.title)||(t==null?void 0:t.sid)]}),r.jsx(zM,{column:p}),r.jsx(BM,{state:f})]})}),e&&r.jsx(Gf,{task:e,onUnitState:m}),t&&r.jsx(Gf,{board:t,onUnitState:m,onCardColumn:h,onPassed:n,onSwitchSession:s})]})})}const ps=u.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{ref:n,"data-slot":"textarea",className:Ge("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t}));ps.displayName="Textarea";function Tm({className:e,...t}){return r.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:r.jsx("table",{"data-slot":"table",className:Ge("w-full caption-bottom text-sm",e),...t})})}function $m({className:e,...t}){return r.jsx("thead",{"data-slot":"table-header",className:Ge("[&_tr]:border-b",e),...t})}function Im({className:e,...t}){return r.jsx("tbody",{"data-slot":"table-body",className:Ge("[&_tr:last-child]:border-0",e),...t})}function Io({className:e,...t}){return r.jsx("tr",{"data-slot":"table-row",className:Ge("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Cn({className:e,...t}){return r.jsx("th",{"data-slot":"table-head",className:Ge("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function yn({className:e,...t}){return r.jsx("td",{"data-slot":"table-cell",className:Ge("p-2 align-middle whitespace-nowrap",e),...t})}const HM={rounds:"达到轮数后自动停止(每轮由 agent 执行一次内置测试流程)",bugs:"案例库新增 bug_report 数达到后自动停止",deadline:"到达截止时间后结束本轮并停止(日历点选日期与时间)",duration:"运行达到设定时长后停止(每轮结束后检查;一轮进行中不打断)"},xx=["stopped","failed","interrupted"],vx={name:"",task_type:"normal",brief:"",end_stage:"report",auto_fix:!1,retest:"不复测",stop_type:"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min",extra:"",date_from:"",date_to:""};function UM(e){return e.stop_type==="deadline"?e.deadline_date?{value:e.deadline_date+"T"+(e.deadline_time||"23:59")}:{err:"请选择截止日期"}:e.stop_type==="duration"?!e.dur_value||e.dur_value<=0?{err:"请填写时长"}:{value:String(Math.round(e.dur_value*{min:60,hour:3600,day:86400}[e.dur_unit]))}:e.stop_value?{value:String(e.stop_value)}:{err:"请填写停止条件"}}function VM(e){const t={stop_type:e.stop_type||"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min"};if(t.stop_type==="deadline"){const[n,s]=String(e.stop_value||"").split("T");t.deadline_date=n||"",t.deadline_time=s||"23:59"}else if(t.stop_type==="duration"){const n=+e.stop_value||0;n%86400===0&&n?(t.dur_value=n/86400,t.dur_unit="day"):n%3600===0&&n?(t.dur_value=n/3600,t.dur_unit="hour"):(t.dur_value=Math.max(1,Math.round(n/60)),t.dur_unit="min")}return t}const yx={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},Kf=[{v:"gen_case",label:"测试用例生成"},{v:"execute",label:"测试"},{v:"report",label:"生成报告"},{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],Bi={normal:Kf,regression:Kf.filter(e=>e.v!=="gen_case")},wd=e=>(Kf.find(t=>t.v===e)||{}).label||"",WM={rounds:"执行轮数",bugs:"累计新 bug",deadline:"截止时间",duration:"持续时长"},qM={queued:0,running:1,done:2,stopped:3,failed:4,interrupted:5},GM=[{k:"name",label:"任务"},{k:"status",label:"状态"},{k:"round",label:"轮次",cls:"num"},{k:"bugs",label:"新bug",cls:"num"},{k:"created",label:"创建"},{k:"ended",label:"结束"}];function KM(e){const t=e.stop_value||"";return e.stop_type==="rounds"?`执行 ${t} 轮`:e.stop_type==="bugs"?`累计新 bug ≥ ${t}`:e.stop_type==="deadline"?`截止 ${String(t).replace("T"," ")}`:e.stop_type==="duration"?`持续 ${YM(t)}`:e.stop_type}function YM(e){const t=+e;return!t||t<=0?String(e||""):t%86400===0?t/86400+" 天":t%3600===0?t/3600+" 小时":t%60===0?t/60+" 分钟":t+" 秒"}function QM({onCreated:e}={}){const t=On(),n=t.currentProject,[s,o]=u.useState(vx),[l,a]=u.useState(!1),[i,c]=u.useState(null),[d,f]=u.useState(!1),[m,p]=u.useState(""),[h,x]=u.useState(null),[y,j]=u.useState(1),[v,g]=u.useState(null),[w,b]=u.useState(null),[S,N]=u.useState([]),[_,C]=u.useState(null),O=t.tasks.find(E=>E.id===_)||null,{rzOn:P,rzStyle:D,rzStart:K,rzDragStart:L,rzReset:I}=ar(),[q,ee]=u.useState(""),G=t.tasks.filter(E=>E.project_id===(n==null?void 0:n.id)),z=u.useMemo(()=>{const E=q.trim().toLowerCase();return E?G.filter(U=>(U.name||"").toLowerCase().includes(E)||(U.session_title||"").toLowerCase().includes(E)||(U.session_id||"").toLowerCase().includes(E)):G},[G,q]),Y=u.useMemo(()=>{if(!h)return z;const E=U=>{switch(h){case"status":return qM[U.status]??99;case"round":return U.current_round??0;case"bugs":return U.new_bugs??0;case"created":return U.created_at||"";case"ended":return U.ended_at||"";default:return U.name||""}};return[...G].sort((U,A)=>{const se=E(U),oe=E(A);return se===oe?0:se===""||se==null?1:oe===""||oe==null?-1:se<oe?-y:y})},[z,h,y]);function B(E){h!==E?(x(E),j(1)):y===1?j(-1):(x(null),j(1))}async function me(){try{await t.updateProject(n.id,{guide_text:m}),f(!1),M("项目提示词已保存")}catch(E){M(E.message)}}async function Z(){if(!i&&s.task_type==="regression"&&!s.extra.trim()){M("请填写重跑指令");return}if(!i&&s.task_type==="retest_bug"&&!s.date_from&&!s.date_to){M("复测任务需填写提交日期范围");return}if(s.date_from&&s.date_to&&s.date_from>s.date_to){M("日期范围不正确:起始晚于结束");return}const E=!i&&s.task_type==="stress"?{value:"1"}:UM(s);if(E.err){M(E.err);return}const U={name:s.name,task_type:s.task_type,brief:s.brief.trim(),end_stage:s.end_stage||void 0,auto_fix:s.auto_fix,retest:s.retest,stop_type:s.stop_type,stop_value:E.value,extra:s.extra.trim(),date_from:s.date_from||void 0,date_to:s.date_to||void 0};try{i?(await Ue.continue(i.id,U),M("已入队,接着原会话续跑")):(await Ue.create(n.id,U),M("任务已入队"),s.task_type==="stress"&&(e==null||e("stress"))),o({...s,name:"",brief:"",extra:""}),a(!1),c(null),await t.loadTasks()}catch(A){M(A.message)}}async function Te(E){if(window.confirm(`确认删除任务「${E.name}」?
|
|
461
|
-
轮次记录一并删除(日志文件保留在磁盘),该操作不可恢复。`))try{await Ue.remove(E.id),M("任务已删除"),v===E.id&&te(),_===E.id&&C(null),await t.loadTasks()}catch(U){M(U.message)}}async function ke(E,U){try{await Ue[U](E),M(U==="stop"?"已请求停止":"已清空轮次重启入队(从第一轮重跑)"),await t.loadTasks(),v===E&&await Ce(E)}catch(A){M(A.message)}}async function _e(E){if(v===E){te();return}try{const U=await Ue.get(E);b(U),g(E),await $e(E)}catch(U){M(U.message)}}async function Ce(E){try{b(await Ue.get(E)),await $e(E)}catch(U){M(U.message)}}async function $e(E){N(await Ue.rounds(E))}function ue(E,U){window.open(`/log?task=${E}&round=${U}`,"_blank")}function fe(){o({...vx}),c(null),a(!0)}function Se(E){const U=VM(E);o({name:E.name,task_type:E.task_type||"normal",brief:"",end_stage:E.end_stage||"",auto_fix:!!E.auto_fix,retest:E.retest||"不复测",stop_type:U.stop_type,stop_value:U.stop_value,deadline_date:U.deadline_date,deadline_time:U.deadline_time,dur_value:U.dur_value,dur_unit:U.dur_unit,extra:E.extra||""}),c(E),a(!0)}function te(){g(null),b(null),N([])}return r.jsxs("div",{className:"tasks-tab scroll",children:[n&&r.jsxs("div",{className:"card",children:[r.jsx("h3",{children:"项目信息"}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"项目目录"}),r.jsx("span",{className:"v",children:n.project_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"智能体"}),r.jsx("span",{className:"v",children:(n.agent_path||"").startsWith("dsh-plugin:")?`dsh(插件·进程内) ${n.agent_path.slice(11)}`:n.agent_path||"(未设置)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:n.model||"(智能体默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"工作目录"}),r.jsx("span",{className:"v",children:n.work_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"环境标签"}),r.jsx("span",{className:"v",children:n.env_label||"(未设置)"})]}),r.jsxs("div",{className:"guide-block",children:[r.jsxs("div",{className:"guide-head",children:[r.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"项目附加提示词"}),r.jsx("span",{className:"hint",children:"编辑后保存;内容会加入每个任务的提示词"}),r.jsx("span",{className:"spacer"}),d?r.jsxs(r.Fragment,{children:[r.jsxs(H,{size:"sm",onClick:me,children:[r.jsx(kC,{})," 保存"]}),r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>f(!1),children:[r.jsx(vr,{})," 取消"]})]}):r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>{p(n.guide_text||""),f(!0)},children:[r.jsx(im,{})," 编辑"]})]}),d?r.jsx(ps,{value:m,onChange:E=>p(E.target.value),rows:4,placeholder:"填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息…"}):r.jsx("div",{className:"guide-read"+(n.guide_text?"":" empty"),children:n.guide_text||"未填写项目附加提示词。点击「编辑」填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息;内容会加入每个任务的提示词。"})]})]}),n&&r.jsxs("div",{className:"card",children:[r.jsxs("h3",{className:"card-title-row",children:["任务列表",r.jsx("span",{className:"spacer"}),r.jsx(Ae,{className:"h-8 w-[240px]",placeholder:"搜索任务名称 / session id",value:q,onChange:E=>ee(E.target.value)}),r.jsxs(H,{size:"sm",className:"ml-2",onClick:fe,children:[r.jsx(ai,{})," 新建任务"]})]}),G.length?z.length?r.jsxs("div",{className:"tl",children:[r.jsxs("div",{className:"tl-head tl-grid",children:[GM.map(E=>r.jsxs("span",{className:"th-sort"+(E.cls?" "+E.cls:"")+(h===E.k?" on":""),onClick:()=>B(E.k),title:"点击排序:升序 → 降序 → 还原",children:[E.label,h===E.k&&(y===1?r.jsx(Dc,{className:"inline h-3 w-3"}):r.jsx(Bl,{className:"inline h-3 w-3"}))]},E.k)),r.jsx("span",{className:"tl-ops",children:"操作"})]}),Y.map(E=>r.jsxs("div",{children:[r.jsxs("div",{className:"tl-row tl-grid"+(v===E.id?" open":""),onClick:()=>_e(E.id),title:v===E.id?"收起详情":"点击查看详情",children:[r.jsxs("div",{className:"tl-name",children:[E.name,E.task_type!=="normal"&&r.jsx("span",{className:"badge st-running",style:{verticalAlign:-2},children:yx[E.task_type]||E.task_type}),E.task_type==="fix"&&(E.auto_commit||E.auto_deploy||E.auto_retest)&&r.jsxs("span",{className:"badge st-stopped",style:{verticalAlign:-2},children:[E.auto_commit?"自动提交":"",E.auto_commit&&E.auto_deploy?"/":"",E.auto_deploy?"自动部署":"",E.auto_deploy&&E.auto_retest?"/":"",E.auto_retest?"自动复测":""]}),E.error&&r.jsx("div",{className:"tl-err",children:E.error})]}),r.jsx("div",{children:r.jsxs("span",{className:"badge st-"+E.status,children:[r.jsx("span",{className:"dot"}),ur[E.status]||E.status]})}),r.jsx("div",{className:"mono num",children:E.current_round}),r.jsx("div",{className:"mono num",children:E.new_bugs}),r.jsx("div",{className:"mono",children:ls(E.created_at)}),r.jsx("div",{className:"mono",children:ls(E.ended_at)}),r.jsxs("div",{className:"tl-ops",children:[r.jsx(H,{variant:"outline",size:"sm",className:"px-2",title:"会话(查看原始对话内容,可直接在会话中继续对话)",onClick:U=>{U.stopPropagation(),C(E.id)},children:r.jsx(pC,{})}),(E.status==="running"||E.status==="queued")&&r.jsxs(H,{variant:"outline",size:"sm",onClick:U=>{U.stopPropagation(),ke(E.id,"stop")},children:[r.jsx(cm,{})," 停止"]}),E.task_type!=="stress"&&["stopped","failed","interrupted","done"].includes(E.status)&&r.jsxs(H,{variant:"outline",size:"sm",title:"继续:修改参数后接着当前会话续跑(不新建会话、不清空轮次)",onClick:U=>{U.stopPropagation(),Se(E)},children:[r.jsx(TC,{})," 继续"]}),(xx.includes(E.status)||E.task_type==="stress"&&E.status==="done")&&r.jsxs(H,{variant:"outline",size:"sm",onClick:U=>{U.stopPropagation(),ke(E.id,"restart")},children:[r.jsx(Nf,{})," 重启"]}),E.status!=="running"&&r.jsx(H,{variant:"outline",size:"sm",className:"px-2",title:"删除任务(轮次记录一并删除,不可恢复)",onClick:U=>{U.stopPropagation(),Te(E)},children:r.jsx(Gs,{})})]})]}),v===E.id&&w&&r.jsxs("div",{className:"tl-detail",children:[r.jsxs("div",{className:"tl-detail-head",children:[r.jsx("b",{children:"任务详情"}),r.jsxs("span",{className:"dim",children:["「",w.name,"」"]}),r.jsx("span",{className:"spacer"}),r.jsxs(H,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:()=>Ce(E.id),children:[r.jsx(Ka,{})," 刷新"]}),r.jsxs(H,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:te,children:[r.jsx(vr,{})," 收起"]})]}),r.jsxs("div",{className:"detail-grid",children:[r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"状态"}),r.jsx("span",{className:"v",children:r.jsxs("span",{className:"badge st-"+w.status,children:[r.jsx("span",{className:"dot"}),ur[w.status]||w.status]})})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"任务类型"}),r.jsx("span",{className:"v",children:yx[w.task_type]||w.task_type})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"阶段范围"}),r.jsx("span",{className:"v",children:w.start_stage?`${wd(w.start_stage)} → ${wd(w.end_stage)||w.end_stage}`:"(按类型默认)"})]}),w.task_type==="pipeline"&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"前段任务"}),r.jsxs("span",{className:"v",children:["#",(()=>{try{return JSON.parse(w.payload||"{}").parent_task_id||"?"}catch{return"?"}})()]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"停止条件"}),r.jsxs("span",{className:"v",children:[WM[w.stop_type]||w.stop_type," · ",KM(w)]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动修复"}),r.jsx("span",{className:"v",children:w.auto_fix?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"复测"}),r.jsx("span",{className:"v",children:w.retest||"不复测"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:w.model||"(默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"权限"}),r.jsx("span",{className:"v",children:w.permission||"(CLI 默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动提交"}),r.jsx("span",{className:"v",children:w.auto_commit?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动部署"}),r.jsx("span",{className:"v",children:w.auto_deploy?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动复测"}),r.jsx("span",{className:"v",children:w.auto_retest?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话 ID"}),r.jsx("span",{className:"v",children:w.session_id||"(首轮后生成)"})]}),w.session_title&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话标题"}),r.jsx("span",{className:"v",children:w.session_title})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"创建时间"}),r.jsx("span",{className:"v",children:ls(w.created_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"开始时间"}),r.jsx("span",{className:"v",children:ls(w.started_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"结束时间"}),r.jsx("span",{className:"v",children:ls(w.ended_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"当前轮次"}),r.jsx("span",{className:"v",children:w.current_round})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增案例"}),r.jsxs("span",{className:"v",style:{color:"var(--pass)"},children:["+",w.new_cases??0]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增 bug"}),r.jsx("span",{className:"v",children:w.new_bugs})]})]}),w.error&&r.jsxs("div",{className:"detail-err",children:["错误:",w.error]}),w.extra&&r.jsxs("div",{className:"kv",style:{marginTop:8},children:[r.jsx("span",{className:"k",children:"其他要求"}),r.jsx("span",{className:"v",style:{fontFamily:"inherit",color:"var(--muted)",whiteSpace:"pre-wrap"},children:w.extra})]}),(xx.includes(w.status)||w.task_type==="stress"&&w.status==="done")&&r.jsx("div",{className:"form-row",style:{marginTop:8},children:r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>ke(w.id,"restart"),children:[r.jsx(Nf,{})," 重启任务(清空轮次,从第一轮重跑)"]})}),r.jsxs(Tm,{className:"mt-2.5 text-xs",children:[r.jsx($m,{children:r.jsxs(Io,{className:"hover:bg-transparent",children:[r.jsx(Cn,{className:"px-2",children:"轮次"}),r.jsx(Cn,{className:"px-2",children:"状态"}),r.jsx(Cn,{className:"px-2",children:"退出码"}),r.jsx(Cn,{className:"px-2",children:"开始"}),r.jsx(Cn,{className:"px-2",children:"结束"}),r.jsx(Cn,{className:"px-2",children:"日志"})]})}),r.jsxs(Im,{children:[S.map(U=>r.jsxs(Io,{className:"cursor-pointer",title:"新标签页查看日志",onClick:()=>ue(w.id,U.round_no),children:[r.jsx(yn,{className:"px-2",children:U.round_no}),r.jsx(yn,{className:"px-2",children:U.status}),r.jsx(yn,{className:"px-2 font-mono",children:U.exit_code==null?"—":U.exit_code}),r.jsx(yn,{className:"px-2 font-mono text-xs",children:ls(U.started_at)}),r.jsx(yn,{className:"px-2 font-mono text-xs",children:ls(U.ended_at)}),r.jsx(yn,{className:"px-2 text-[var(--star-text)]",children:"查看日志"})]},U.round_no)),!S.length&&r.jsx(Io,{children:r.jsx(yn,{colSpan:6,className:"px-2 text-muted-foreground",children:"尚未执行轮次"})})]})]})]})]},E.id))]}):r.jsxs("div",{className:"hint",children:["没有匹配「",q.trim(),"」的任务"]}):r.jsx("div",{className:"hint",children:"暂无任务,点击右上角「新建任务」创建"})]}),n&&r.jsx(en,{open:l,onOpenChange:E=>{a(E),E||c(null)},children:r.jsxs(Ut,{className:"modal modal-rz"+(P?" rz-drag":""),style:{...D,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:K,reset:I}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:L,children:i?`继续任务「${i.name}」`:"新建任务"})}),i&&r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"接着当前会话继续执行(不新建会话、历史轮次保留);停止条件中的轮数/bug 数指「再跑/再增」的数量"}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务名称"}),r.jsx(Ae,{value:s.name,onChange:E=>o({...s,name:E.target.value.trim()}),placeholder:"留空自动命名"})]}),!i&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务类型"}),r.jsxs(At,{value:s.task_type,onValueChange:E=>o(U=>{const A={...U,task_type:E},se=Bi[E];return se&&!se.some(oe=>oe.v===A.end_stage)&&(A.end_stage="report"),A}),children:[r.jsx(Mt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"normal",children:"探索"}),r.jsx(Oe,{value:"regression",children:"回归"}),r.jsx(Oe,{value:"retest_bug",children:"复测(按提交范围)"}),r.jsx(Oe,{value:"stress",children:"压力测试"})]})]})]}),!i&&(s.task_type==="retest_bug"||s.task_type==="normal")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"提交日期范围"}),r.jsx(Ae,{type:"date",className:"h-8 w-auto",value:s.date_from,onChange:E=>o({...s,date_from:E.target.value})}),r.jsx("span",{className:"hint",children:"至"}),r.jsx(Ae,{type:"date",className:"h-8 w-auto",value:s.date_to,onChange:E=>o({...s,date_to:E.target.value})}),r.jsx("span",{className:"hint",children:s.task_type==="retest_bug"?"LLM 分析范围内提交影响的用例并执行复测(必填)":"本轮优先设计/执行与该范围提交相关的用例(选填)"})]}),!i&&Bi[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(At,{value:s.end_stage,onValueChange:E=>o({...s,end_stage:E}),children:[r.jsx(Mt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Pt,{})}),r.jsx(Tt,{children:Bi[s.task_type].map(E=>r.jsx(Oe,{value:E.v,children:E.label},E.v))})]}),r.jsx("span",{className:"hint",children:"任务执行到该阶段为止;终点在「生成报告」之后会自动追加一个后段任务"})]}),i&&Bi[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsx("span",{className:"hint",children:wd(s.end_stage)||"(按类型默认)"})]}),s.task_type==="stress"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"压测任务固定两步:第 1 轮 agent 生成压测场景 → 平台自动发压并出报告;生命周期:测试 → 生成报告。不支持「继续」,重启=重跑。"}),r.jsxs("div",{className:"form-col",children:[r.jsx(st,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:"压测说明(目标服务地址、关注接口、并发/时长期望)"}),r.jsx(ps,{value:s.brief,onChange:E=>o({...s,brief:E.target.value}),rows:4,placeholder:"例如:目标 http://127.0.0.1:8080,压 /api/order 下单与 /api/order/123 查询,按 10→50→100 并发各 1 分钟"})]})]}),!i&&(s.task_type==="normal"||s.task_type==="regression")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试任务行为:测试中发现的 bug 由 agent 自动修复代码",children:"自动修复 bug"}),r.jsx("input",{type:"checkbox",checked:s.auto_fix,onChange:E=>o({...s,auto_fix:E.target.checked})}),r.jsx("label",{style:{marginLeft:14},children:"复测"}),r.jsxs(At,{value:s.retest,onValueChange:E=>o({...s,retest:E}),children:[r.jsx(Mt,{size:"sm",className:"min-w-[130px]",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"不复测",children:"不复测"}),r.jsx(Oe,{value:"全部失败用例",children:"全部失败用例"}),r.jsx(Oe,{value:"指定范围复测",children:"指定范围复测"})]})]})]}),s.task_type!=="stress"&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"停止条件"}),r.jsxs(At,{value:s.stop_type,onValueChange:E=>o({...s,stop_type:E}),children:[r.jsx(Mt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"rounds",children:"执行轮数"}),r.jsx(Oe,{value:"bugs",children:"累计新 bug 数"}),r.jsx(Oe,{value:"deadline",children:"截止时间"}),r.jsx(Oe,{value:"duration",children:"持续时长"})]})]}),(s.stop_type==="rounds"||s.stop_type==="bugs")&&r.jsx(Ae,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.stop_value,onChange:E=>o({...s,stop_value:E.target.value===""?"":+E.target.value})}),s.stop_type==="deadline"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ae,{type:"date",className:"h-8 w-auto",value:s.deadline_date,onChange:E=>o({...s,deadline_date:E.target.value})}),r.jsx(Ae,{type:"time",className:"h-8 w-[110px]",value:s.deadline_time,onChange:E=>o({...s,deadline_time:E.target.value})})]}),s.stop_type==="duration"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ae,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.dur_value,onChange:E=>o({...s,dur_value:E.target.value===""?"":+E.target.value})}),r.jsxs(At,{value:s.dur_unit,onValueChange:E=>o({...s,dur_unit:E}),children:[r.jsx(Mt,{size:"sm",className:"min-w-[70px]",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"min",children:"分钟"}),r.jsx(Oe,{value:"hour",children:"小时"}),r.jsx(Oe,{value:"day",children:"天"})]})]})]}),r.jsx("span",{className:"hint",children:HM[s.stop_type]||""})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(st,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:!i&&s.task_type==="regression"?"重跑指令(必填:描述要重跑的范围,如模块 / 用例 ID / 变更说明)":"其他要求(选填,原样传给 agent)"}),r.jsx(ps,{value:s.extra,onChange:E=>o({...s,extra:E.target.value}),rows:3,placeholder:!i&&s.task_type==="regression"?"例如:重跑登录模块全部用例;或:本次变更涉及订单接口,重跑 ORD-003、ORD-004":"自由填写,例如:本轮优先测试订单模块;只读代码,不要提出修复方案;执行前先阅读 src/X 目录……"})]})]}),r.jsxs(jn,{className:"flex-none",children:[r.jsx(H,{variant:"outline",onClick:()=>{a(!1),c(null)},children:"取消"}),r.jsx(H,{onClick:Z,children:i?"继续执行":"开始任务"})]})]})}),O&&r.jsx(Wc,{task:O,onClose:()=>C(null)})]})}let Tr=null,Hi=null,Ui=null;function Vi(e,t){if(e==null||t==null||e===t)return t;try{return JSON.stringify(t)===JSON.stringify(e)?e:t}catch{return t}}function wx(e,t){const n=zs.getState();t({project:e.project||n.project,live:Vi(n.live,e.live),library:Vi(n.library,e.library),bugs:Vi(n.bugs,e.bugs||[]),rounds:Vi(n.rounds,e.rounds||[]),updatedAt:e.generated_at||""})}const zs=Zp((e,t)=>({connected:!1,project:null,live:null,library:null,bugs:[],rounds:[],updatedAt:"",connect:async n=>{Tr&&Ui===n||(t().disconnect(),Ui=n,Tr=bg.stream(n),Tr.onopen=()=>e({connected:!0}),Tr.onerror=()=>e({connected:!1}),Tr.onmessage=s=>{try{const o=JSON.parse(s.data);if(o.error)return;wx(o,e)}catch{}},Hi=setInterval(()=>t().fetchSnapshot(),3e4),await t().fetchSnapshot())},fetchSnapshot:async()=>{try{const n=await bg.state(Ui);n&&!n.error&&wx(n,e)}catch{}},disconnect:()=>{Tr&&(Tr.close(),Tr=null),Hi&&(clearInterval(Hi),Hi=null),Ui=null,e({connected:!1})}}));function Yf(e){return/已拒绝/.test(e)?"reject":/复测通过/.test(e)?"pass":/已修复/.test(e)?"fix":/已分析/.test(e)||/修复方案/.test(e)?"run":/待分析/.test(e)||/复测未通过/.test(e)?"retest":"pending"}const jx=[["retest","R","复测"],["angle","1","角度"],["scan","2","盘点"],["generate","3","生成"],["review","4","判重"],["execute","5","执行"],["cluster","6","聚类"],["analyze","7","分析"],["fix","7b","修复"],["wrapup","8","收尾"]],XM={通过:"pass",失败:"fail",需要复测:"retest",跳过:"skip",未执行:"pending"},JM={round_start:["轮次","ev-round"],phase:["阶段","ev-phase"],proposal:["提案",""],reject:["拒绝","ev-reject"],case_start:["开始",""],case_pass:["通过","ev-pass"],case_fail:["失败","ev-fail"],case_skip:["跳过",""],bug_new:["新Bug","ev-bug"],bug_append:["补证据","ev-bug"],analyze_done:["分析","ev-fix"],fix_done:["修复","ev-fix"],note:["备注",""]},ZM={all:null,fail:e=>e.type==="case_fail"||e.type==="bug_new",case:e=>e.type.startsWith("case_"),phase:e=>e.type==="phase"||e.type==="round_start",bug:e=>e.type==="bug_new"||e.type==="bug_append"||e.type==="analyze_done"||e.type==="fix_done"},eT={all:"全部",fail:"失败",case:"用例",phase:"阶段",bug:"Bug"},tT=["all","fail","case","phase","bug"],ya=["status","module","trend","bug","funnel"],nT={status:{title:"案例库状态"},module:{title:"模块通过率"},trend:{title:"轮次趋势"},bug:{title:"Bug 统计"},funnel:{title:"产出漏斗"}},bx=[["pending","待处理","var(--dim)"],["run","已出方案","var(--run)"],["retest","待分析/复测未过","var(--retest)"],["fix","已修复","var(--fix)"],["pass","复测通过","var(--pass)"],["reject","已拒绝","var(--dim)"]],wj="ts.chartSlots";function sT(){try{const e=JSON.parse(localStorage.getItem(wj)||"null");if(Array.isArray(e)&&e.length===3&&e.every(t=>ya.includes(t))&&new Set(e).size===3)return e}catch{}return["status","module","trend"]}const _o={tree:"ts.treeW",side:"ts.sideW",chartsH:"ts.chartsH",c1:"ts.c1w",c2:"ts.c2w"},Ls={tree:"tree",side:"side",chartsH:"chartsH",c1:"c1",c2:"c2"},ft=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),jd=e=>XM[e]||"pending",rT=e=>{const t=new Date(String(e).replace(" ","T"));return isNaN(t)?null:t},oT=e=>{const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60);return(n?n+"h":"")+(s?s+"m":"")+t%60+"s"},Wi=(e,t,n)=>Math.max(t,Math.min(n,e));function lT({project:e}){var Ps;const t=e==null?void 0:e.id,n=zs(R=>R.connected),s=zs(R=>R.live),o=zs(R=>R.library),l=zs(R=>R.bugs),a=zs(R=>R.rounds),i=zs(R=>R.updatedAt),c=u.useRef(null),d=u.useRef(null),f=u.useRef(null),m=u.useRef(null),p=u.useRef(null),[h,x]=u.useState(null),[y,j]=u.useState("all"),[v,g]=u.useState(!0),[w,b]=u.useState(sT);function S(R,F){b(ne=>{const ae=new Set(ne.filter((Re,Ve)=>Ve!==R));let ie=ne[R];do ie=ya[(ya.indexOf(ie)+F+ya.length)%ya.length];while(ae.has(ie));const de=[...ne];return de[R]=ie,localStorage.setItem(wj,JSON.stringify(de)),de})}const[N,_]=u.useState(()=>new Set),[C,O]=u.useState(""),P=u.useRef({}),D=u.useRef(null),K=u.useRef(null),L=u.useRef(0),I=u.useRef(""),q=u.useRef("all"),ee=u.useRef(!1),G=!!(s&&s.phase&&s.phase!=="done"&&s.phase!=="idle"),z=jx.findIndex(R=>R[0]===(s==null?void 0:s.phase)),Y=(s==null?void 0:s.phase)==="done",B=s?s.phase==="done"?{cls:"done",text:"本轮运行已结束"}:{cls:"running",text:s.phase_label||s.phase||"运行中"}:{cls:"idle",text:"空闲(未在运行)"},me=(()=>{const R=s==null?void 0:s.stop_condition;return R!=null&&R.label?"停止条件: "+R.label+(R.new_bugs!=null?" · 新Bug "+R.new_bugs:"")+(R.target_bugs!=null?"/"+R.target_bugs:""):""})(),Z=n?"":"down";function Te(R){let F=R.cases.length;for(const ne of R.children)F+=Te(ne);return F}const ke=(Ps=s==null?void 0:s.current_case)==null?void 0:Ps.id,_e=u.useMemo(()=>{const R=o;if(!R)return{__html:""};function F(ae){let ie="";for(const de of ae.cases){P.current[de.id]=de;const Re=ke===de.id,Ve=jd(de.status);ie+=`<div class="case${h===de.id?" selected":""}${Re?" running":""}" data-id="${de.id}" title="${ft(de.point||de.name)}"><span class="dot ${Re?"":Ve}"></span><span class="cid">${de.id}</span><span class="cname">${ft(de.name)}</span></div>`}for(const de of ae.children){const Re=N.has(de.path)?"":" open";ie+=`<details data-path="${ft(de.path)}"${Re}><summary><span class="arrow">▶</span><span>${ft(de.name)}</span><span class="fcount">${Te(de)}</span>${de.desc?`<span class="fdesc">${ft(de.desc)}</span>`:""}</summary><div class="folder-body">${F(de)}</div></details>`}return ie}return{__html:R.tree.children.length||R.tree.cases.length?F(R.tree):'<div class="empty">案例库为空——运行测试任务生成用例后在此展示。</div>'}},[o,N,h,ke]);function Ce(R){const F=[];for(const ne of R.children)F.push(ne.path),F.push(...Ce(ne));return F}function $e(){_(new Set)}function ue(){const R=o;R&&_(new Set(Ce(R.tree)))}function fe(R){const F=R.target.closest(".case");if(!F)return;const ne=F.dataset.id;x(ae=>{const ie=ae===ne?null:ne;return ie?localStorage.setItem("ts_monitor_pick",JSON.stringify({proj:t,id:ie})):localStorage.removeItem("ts_monitor_pick"),ie})}u.useEffect(()=>{const R=d.current;if(!R)return;const F=ne=>{const ae=ne.target;ae.tagName==="DETAILS"&&ae.dataset.path&&_(ie=>{const de=new Set(ie);return ae.open?de.delete(ae.dataset.path):de.add(ae.dataset.path),de})};return R.addEventListener("toggle",F),()=>R.removeEventListener("toggle",F)},[]);function Se(R){return!R.request&&!R.response?"":'<details class="payload"><summary>请求 / 返回</summary>'+(R.request?`<div class="plabel">请求</div><pre>${ft(R.request)}</pre>`:"")+(R.response?`<div class="plabel">返回</div><pre>${ft(R.response)}</pre>`:"")+"</details>"}function te(R){const F=JM[R.type]||["事件",""];return`<div class="ev ${F[1]}"><span class="ts">${ft(R.ts||"")}</span><span class="badge">${F[0]}</span>`+(R.case_id?`<span class="cid">${R.case_id}</span>`:"")+`<span class="msg">${ft(R.message||"")}</span>${Se(R)}</div>`}function E(){return'<div id="feed-empty">'+(s?"(当前筛选下暂无事件)":"当前没有运行中的测试。<br>在会话中开启实时监控后,运行期间的事件会实时出现在这里。")+"</div>"}function U(){const R=(s==null?void 0:s.events)||[],F=ZM[y],ne=F?R.filter(F):R,ae=ne.length?JSON.stringify(ne[0]):"",ie=f.current;ie&&(y!==q.current||ae!==I.current||ne.length<L.current?(q.current=y,I.current=ae,ie.innerHTML=ne.length?ne.map(te).join(""):E(),L.current=ne.length):ne.length>L.current&&(L.current===0&&(ie.innerHTML=""),ie.insertAdjacentHTML("beforeend",ne.slice(L.current).map(te).join("")),L.current=ne.length),v&&(ie.scrollTop=ie.scrollHeight))}u.useEffect(()=>{U(),kr()},[y,o,s,a]);function A(R){const F={pass:0,fail:0,retest:0,pending:0,total:0};return function ne(ae){for(const ie of ae.cases){let de=jd(ie.status);de==="skip"&&(de="pending"),F[de]=(F[de]||0)+1,F.total++}for(const ie of ae.children)ne(ie)}(R),F}const se=u.useMemo(()=>{const R=o==null?void 0:o.stats;if(!R)return{sub:"",body:""};const F=R.total,ne=F?Math.round(R.passed/F*100):0,ae=[["通过",R.passed,"var(--pass)"],["失败",R.failed,"var(--fail)"],["需复测",R.retest,"var(--retest)"],["未执行",R.pending+R.skipped,"var(--dim)"]];let ie=0;const de=ae.filter(Re=>Re[1]>0).map(Re=>{const Ve=F?Re[1]/F*100:0,tt=Math.max(0,Ve-1.5),ot=`<circle cx="21" cy="21" r="15.915" fill="none" stroke="${Re[2]}" stroke-width="6" pathLength="100" stroke-linecap="round" stroke-dasharray="${tt} ${100-tt}" stroke-dashoffset="${25-ie}"/>`;return ie+=Ve,ot}).join("");return{sub:`通过率 <b class="hl-pass">${ne}%</b>`,body:'<div class="cbody">'+(F?`<svg viewBox="0 0 42 42" class="donut">${de}<text x="21" y="19.5" class="dnum" text-anchor="middle">${F}</text><text x="21" y="26" class="dsub" text-anchor="middle">用例</text></svg><div class="dlegend">${ae.map(Re=>`<div class="li"><span class="sw" style="background:${Re[2]}"></span>${Re[0]}<span class="lm">${Re[1]}</span><span class="pct">${F?Math.round(Re[1]/F*100):0}%</span></div>`).join("")}</div>`:'<div class="empty">案例库为空</div>')+"</div>"}},[o]),oe=u.useMemo(()=>{const R=o;if(!R)return{sub:"",body:""};let F=R.tree;for(;F.children.length===1&&!F.cases.length&&F.children[0].children.length;)F=F.children[0];const ne=F.children.map(ae=>({name:ae.name,a:A(ae)})).filter(ae=>ae.a.total>0);return F.cases.length&&ne.push({name:"(根目录)",a:A({cases:F.cases,children:[]})}),ne.sort((ae,ie)=>ie.a.total-ae.a.total),{sub:`${ne.length} 个分类`,body:'<div class="cbody">'+(ne.length?`<div class="mbars">${ne.map(ae=>{const ie=ae.a.total,de=ie?Math.round(ae.a.pass/ie*100):0,Re=(Ve,tt)=>ae.a[Ve]?`<div class="seg ${tt}" style="width:${ae.a[Ve]/ie*100}%"></div>`:"";return`<div class="mbar-row"><span class="mbar-label" title="${ft(ae.name)}">${ft(ae.name)}</span><div class="mbar-track"><div class="mbar-inner">${Re("pass","pass")}${Re("fail","fail")}${Re("retest","retest")}${Re("pending","pending")}</div></div><span class="mbar-num" title="通过/总数"><b class="hl-pass">${ae.a.pass}</b><em>/${ie}</em><i class="pctn">${de}%</i></span></div>`}).join("")}</div>`:'<div class="empty">案例库为空</div>')+'</div><div class="mlegend"><span><span class="sw" style="background:var(--pass)"></span>通过</span><span><span class="sw" style="background:var(--fail)"></span>失败</span><span><span class="sw" style="background:var(--retest)"></span>需复测</span><span><span class="sw" style="background:var(--dim)"></span>未执行</span></div>'}},[o]),ze=u.useMemo(()=>{const R=a||[];if(!R.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无轮次记录</div></div>'};const F=340,ne=126,ae=30,ie=20,de=22,Re=Math.max(1,...R.map(nt=>nt.passed+nt.failed)),Ve=(F-de)/R.length,tt=Math.min(34,Ve*.52),ot=ne-ie,tn=ne-ae-ie;let Tn="";for(let nt=0;nt<=2;nt++){const Kt=ot-tn*(nt/2);Tn+=`<line x1="${de}" y1="${Kt}" x2="${F-2}" y2="${Kt}" class="t-grid"/>`,Tn+=`<text x="${de-5}" y="${Kt+2.5}" class="t-ytick" text-anchor="end">${Math.round(Re*nt/2)}</text>`}let Nt="";return R.forEach((nt,Kt)=>{const Yt=Math.round(de+Kt*Ve+(Ve-tt)/2),zt=Math.round(de+Kt*Ve+Ve/2),mt=Math.round(nt.passed/Re*tn),Ct=Math.round(nt.failed/Re*tn);mt&&(Nt+=`<rect x="${Yt}" y="${ot-mt}" width="${tt}" height="${mt}" fill="url(#grad-pass)" rx="2"><title>第 ${nt.round} 轮 通过 ${nt.passed}</title></rect>`),Ct&&(Nt+=`<rect x="${Yt}" y="${ot-mt-Ct}" width="${tt}" height="${Ct}" fill="url(#grad-fail)" rx="2"><title>第 ${nt.round} 轮 失败 ${nt.failed}</title></rect>`);const nn=nt.passed+nt.failed,ts=ot-mt-Ct;nt.new_bugs>0&&(Nt+=`<text x="${zt}" y="${ts-16}" class="t-bug" text-anchor="middle">+${nt.new_bugs}bug</text>`),nn>0&&(Nt+=`<text x="${zt}" y="${ts-6}" class="t-val" text-anchor="middle">${nn}</text>`),Nt+=`<text x="${zt}" y="${ne-5}" class="t-lab" text-anchor="middle">R${nt.round}</text>`}),{sub:"绿通过 / 红失败 · 黄字=新建Bug",body:`<div class="cbody"><svg viewBox="0 0 ${F} ${ne}" class="trend" preserveAspectRatio="xMidYMid meet"><defs><linearGradient id="grad-pass" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-pass-1)"/><stop offset="1" stop-color="var(--grad-pass-2)"/></linearGradient><linearGradient id="grad-fail" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-fail-1)"/><stop offset="1" stop-color="var(--grad-fail-2)"/></linearGradient></defs><line x1="${de}" y1="${ot}" x2="${F-2}" y2="${ot}" class="t-axis"/>${Tn}${Nt}</svg></div>`}},[a]),Je=u.useMemo(()=>{const R=l||[];if(!R.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无 bug 报告</div></div>'};const F={};for(const ie of R){const de=Yf(ie.status);F[de]=(F[de]||0)+1}const ne=Math.max(1,...bx.map(ie=>F[ie[0]]||0)),ae=bx.filter(ie=>F[ie[0]]>0).map(([ie,de,Re])=>`<div class="mbar-row"><span class="mbar-label" title="${de}">${de}</span><div class="mbar-track"><div class="bbar" style="width:${F[ie]/ne*100}%;background:${Re}"></div></div><span class="mbar-num"><b>${F[ie]}</b><i class="pctn">${Math.round(F[ie]/R.length*100)}%</i></span></div>`).join("");return{sub:`共 <b>${R.length}</b> 个`,body:`<div class="cbody"><div class="mbars">${ae}</div></div>`}},[l]),Fe=u.useMemo(()=>{var Re;const R=s==null?void 0:s.stats;if(!R||R.proposed==null&&R.accepted==null&&R.executed==null)return{sub:"",body:'<div class="cbody"><div class="empty">暂无运行统计</div></div>'};const F=[["提案",R.proposed],["入库",R.accepted],["执行",R.executed],["通过",R.passed]],ne=Math.max(1,...F.map(Ve=>Ve[1]||0));let ae=null;const ie=F.map(([Ve,tt])=>{const ot=ae!=null&&ae>0&&tt!=null?Math.round(tt/ae*100)+"%":"—";return ae=tt,`<div class="frow"><span class="fl">${Ve}</span><div class="ftrack"><div class="fbar" style="width:${tt?Math.round(tt/ne*100):0}%"></div></div><span class="fr">${tt??"—"} · ${ot}</span></div>`}).join("");let de="";if((Re=s==null?void 0:s.options)!=null&&Re.auto_fix&&R.fixed!=null){const Ve=Math.max(1,R.failed||0);de=`<div class="frow fixbar"><span class="fl">已修复</span><div class="ftrack"><div class="fbar" style="width:${Math.round((R.fixed||0)/Ve*100)}%"></div></div><span class="fr">${R.fixed} / ${R.failed??0}</span></div>`}return{sub:R.rejected>0?`拒绝 <b>${R.rejected}</b>`:"",body:`<div class="cbody"><div class="funnel">${ie}${de}</div></div>`}},[s]),et={status:se,module:oe,trend:ze,bug:Je,funnel:Fe},Be=u.useMemo(()=>{const R=o==null?void 0:o.stats;return R?{__html:`<span class="chip"><span class="dot pass"></span><b>${R.passed}</b></span><span class="chip"><span class="dot fail"></span><b>${R.failed}</b></span><span class="chip"><span class="dot retest"></span><b>${R.retest}</b></span><span class="chip"><span class="dot pending"></span><b>${R.pending+R.skipped}</b></span><span class="chip">共 <b>${R.total}</b></span>`}:null},[o]);function Ke(R){const F=(s==null?void 0:s.events)||[];for(let ne=F.length-1;ne>=0;ne--){const ae=F[ne];if(ae.case_id===R&&(ae.request||ae.response))return ae}return null}const rt=u.useMemo(()=>{var ot,tn;const R=s,F=h||((ot=R==null?void 0:R.current_case)==null?void 0:ot.id),ne=F?P.current[F]:null,ae=!!(R&&((tn=R.current_case)==null?void 0:tn.id)===F&&R.phase!=="done"),ie=F?Ke(F):null;if(!F)return{__html:'<h3>用例详情</h3><div class="empty">点击左侧用例查看详情;运行中默认显示当前用例。</div>'};const de=ne||R&&R.current_case,Re=ae?"执行中":ne?ne.status:"",Ve=ne&&ne.bug_report&&ne.bug_report!=="无"?ne.bug_report:"";let tt="<h3>用例详情"+(h?"":"(当前执行)")+`</h3><div class="kv"><span class="k">ID</span><span class="v mono">${ft(F)}</span></div><div class="kv"><span class="k">名称</span><span class="v">${ft(ne?ne.name:de&&de.name||"")}</span></div>`+(ne&&ne.point?`<div class="kv"><span class="k">测试点</span><span class="v">${ft(ne.point)}</span></div>`:"")+`<div class="kv"><span class="k">状态</span><span class="v"><span class="badge-st ${ae?"run":jd(Re)}">${ft(Re||"—")}</span></span></div>`+(ne&&ne.fail_reason?`<div class="kv"><span class="k">失败原因</span><span class="v">${ft(ne.fail_reason)}</span></div>`:"")+(ne&&ne.summary?`<div class="kv"><span class="k">结果摘要</span><span class="v">${ft(ne.summary)}</span></div>`:"")+(ne&&ne.last_run?`<div class="kv"><span class="k">最近执行</span><span class="v mono">${ft(ne.last_run)}</span></div>`:"")+(Ve?`<div class="kv"><span class="k">bug_report</span><span class="v mono">${ft(Ve)}</span></div>`:"");return ie&&(tt+=`<div class="plabel">请求</div><pre>${ft(ie.request||"(无记录)")}</pre><div class="plabel">返回</div><pre>${ft(ie.response||"(无记录)")}</pre>`),{__html:tt}},[h,s]),$t=u.useMemo(()=>{var F;const R=s==null?void 0:s.stats;return{__html:R?`本轮: 提案 <b>${R.proposed??"—"}</b> · 入库 <b>${R.accepted??"—"}</b> · 拒绝 <b>${R.rejected??"—"}</b> · 已执行 <b>${R.executed??"—"}</b> · 通过 <b style="color:var(--pass)">${R.passed??0}</b> · 失败 <b style="color:var(--fail)">${R.failed??0}</b> · 跳过 <b>${R.skipped??0}</b> · 新建Bug <b style="color:var(--fail)">${R.new_bug_reports??0}</b>`+(R.fixed!=null&&((F=s==null?void 0:s.options)!=null&&F.auto_fix)?` · 已修复 <b style="color:var(--fix)">${R.fixed}</b>`:""):"案例库统计见左侧。"}},[s]),it=u.useMemo(()=>{var ne;const R=(ne=s==null?void 0:s.priorities)==null?void 0:ne.levels;return!Array.isArray(R)||!R.length?null:{__html:'<div class="prio-title">测试进度(按功能分级)</div>'+R.map(ae=>{const ie=Array.isArray(ae.domains)?ae.domains:[],de=ie.length,Re=ie.filter(ot=>ot.status==="已覆盖").length,Ve=de?Math.round(Re/de*100):0,tt=ie.map(ot=>`<span class="pchip${ot.status==="已覆盖"?" ok":""}" title="${ft(ot.name)}:${ft(ot.status||"未覆盖")}">${ft(ot.name)}</span>`).join("");return`<div class="prio-row"><span class="prio-level">${ft(ae.level||"")}</span><span class="prio-label">${ft(ae.label||"")}</span><span class="prio-track"><span class="prio-in" style="width:${Ve}%"></span></span><span class="prio-num">${Re}<em>/${de}</em></span><span class="prio-chips">${tt}</span></div>`}).join("")}},[s]),Q={tree:300,side:370,chartsH:176,chartRatio:[1,1.15,1.35]},He=.22;function ce(){const R=getComputedStyle(m.current),F=parseFloat(R.getPropertyValue("--c1-fr"))||Q.chartRatio[0],ne=parseFloat(R.getPropertyValue("--c2-fr"))||Q.chartRatio[1],ae=parseFloat(R.getPropertyValue("--c3-fr"))||Q.chartRatio[2],ie=F+ne+ae;return[F/ie,ne/ie,ae/ie]}function Dt(R){const F=m.current;F.style.setProperty("--c1-fr",R[0]+"fr"),F.style.setProperty("--c2-fr",R[1]+"fr"),F.style.setProperty("--c3-fr",R[2]+"fr")}function Gt(R,F){if(R.button!==0||R.detail>1)return;const ne=c.current.querySelector(".m-main"),ae=m.current;if(!ne||!ae)return;const ie=()=>F==="tree"?parseInt(getComputedStyle(ne).getPropertyValue("--tree-w"),10)||Q.tree:F==="side"?parseInt(getComputedStyle(ne).getPropertyValue("--side-w"),10)||Q.side:F==="chartsH"?ae.getBoundingClientRect().height||Q.chartsH:0,de=Yt=>{F==="tree"?ne.style.setProperty("--tree-w",Wi(Yt,180,600)+"px"):F==="side"?ne.style.setProperty("--side-w",Wi(Yt,260,720)+"px"):F==="chartsH"&&(ae.style.height=Wi(Yt,150,520)+"px")},Re=ie(),Ve=F==="chartsH"?R.clientY:R.clientX,tt=F==="side",ot=F==="chartsH",tn=F==="c1"||F==="c2",Tn=tn?ce():null,Nt=R.currentTarget;Nt.classList.add("drag"),document.body.classList.add(ot?"resizing-y":"resizing-x");const nt=Yt=>{let zt=(ot?Yt.clientY:Yt.clientX)-Ve;if(tt&&(zt=-zt),tn){const mt=[...Tn],Ct=F==="c1"?0:1,nn=[0,1,2].filter(vs=>vs!==Ct),ts=ae.getBoundingClientRect().width,_r=zt/Math.max(1,ts);let ns=mt[Ct]+_r;ns=Wi(ns,He,1-2*He);const xs=1-ns,ss=1-mt[Ct];ss>1e-4&&(mt[Ct]=ns,mt[nn[0]]=mt[nn[0]]/ss*xs,mt[nn[1]]=mt[nn[1]]/ss*xs),Dt(mt)}else de(Re+zt)},Kt=()=>{Nt.classList.remove("drag"),document.body.classList.remove("resizing-x","resizing-y"),document.removeEventListener("mousemove",nt),document.removeEventListener("mouseup",Kt),tn?localStorage.setItem(_o.c1,JSON.stringify(ce())):localStorage.setItem(_o[F],String(Math.round(ie())))};document.addEventListener("mousemove",nt),document.addEventListener("mouseup",Kt)}function un(R){const F=c.current.querySelector(".m-main"),ne=m.current;R==="tree"?F.style.removeProperty("--tree-w"):R==="side"?F.style.removeProperty("--side-w"):R==="chartsH"?ne.style.height="":(ne.style.removeProperty("--c1-fr"),ne.style.removeProperty("--c2-fr"),ne.style.removeProperty("--c3-fr")),localStorage.removeItem(_o[R])}function dn(){const R=c.current.querySelector(".m-main"),F=m.current;if(!(!R||!F))try{const ne=+localStorage.getItem(_o.tree);ne>0&&R.style.setProperty("--tree-w",ne+"px");const ae=+localStorage.getItem(_o.side);ae>0&&R.style.setProperty("--side-w",ae+"px");const ie=+localStorage.getItem(_o.chartsH);ie>0&&(F.style.height=ie+"px");const de=JSON.parse(localStorage.getItem(_o.c1)||"null");Array.isArray(de)&&de.length===3&&Dt(de)}catch{}}function kr(){if(!ee.current)try{const R=JSON.parse(localStorage.getItem("ts_monitor_pick")||"null");R&&R.proj===t&&P.current[R.id]&&(x(R.id),ee.current=!0)}catch{}}function fn(){const R=zs.getState().live;K.current=(R==null?void 0:R.live_mtime)!=null?Date.now()/1e3-R.live_mtime:null,D.current&&p.current&&(p.current.textContent="已运行 "+oT(Date.now()-D.current.getTime()));const F=R&&R.phase&&R.phase!=="done"&&R.phase!=="idle";K.current!=null&&F&&K.current>30?O("状态文件 "+Math.round(K.current)+"s 未更新"):O("")}return u.useEffect(()=>{dn();const R=setInterval(fn,1e3);return()=>clearInterval(R)},[]),u.useEffect(()=>{t&&zs.getState().connect(t)},[t]),u.useEffect(()=>()=>{zs.getState().disconnect()},[]),u.useEffect(()=>{D.current==null&&(s!=null&&s.run_started_at)&&(D.current=rT(s.run_started_at))},[s]),r.jsxs("div",{className:"monitor-tab",ref:c,children:[r.jsxs("header",{className:"m-head",children:[r.jsxs("div",{className:"logo",children:[r.jsx("span",{className:"pulse"+(G?" on":"")}),"Free-Style 测试监控",r.jsxs("span",{style:{color:"var(--dim)"},children:[" · ",e==null?void 0:e.name]})]}),r.jsx("span",{className:"pill "+B.cls,children:B.text}),(s==null?void 0:s.round)!=null&&r.jsx("span",{className:"pill mono",children:"第 "+s.round+" 轮"}),D.current&&r.jsx("span",{className:"pill mono",ref:p}),me&&r.jsx("span",{className:"pill",children:me}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"自动修复: "+(s.options.auto_fix?"开":"关")}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"复测: "+(s.options.retest||"不复测")}),r.jsx("div",{className:"spacer"}),C&&r.jsx("span",{className:"pill warn",children:C}),r.jsx("span",{className:Z,title:"与监控服务器的连接状态"})]}),r.jsx("nav",{className:"phases",children:jx.map((R,F)=>r.jsxs("span",{className:"step"+(Y||F<z?" done":"")+(!Y&&F===z?" active":""),children:[r.jsx("span",{className:"no",children:R[1]}),R[2]]},R[0]))}),r.jsxs("div",{className:"m-main",children:[r.jsxs("aside",{className:"tree-panel",children:[r.jsxs("div",{className:"panel-head",children:["案例库 ",r.jsx("span",{className:"lib-stats",dangerouslySetInnerHTML:Be||void 0}),r.jsx("div",{className:"spacer"}),r.jsxs("div",{className:"tree-tools",children:[r.jsx("span",{className:"tbtn",onClick:$e,children:"全部展开"}),r.jsx("span",{className:"tbtn",onClick:ue,children:"全部折叠"})]})]}),r.jsx("div",{className:"panel-body",ref:d,onClick:fe,dangerouslySetInnerHTML:_e})]}),r.jsx("div",{className:"vsplit",onMouseDown:R=>Gt(R,Ls.tree),onDoubleClick:()=>un(Ls.tree)}),r.jsxs("section",{className:"feed-panel",children:[r.jsx("div",{className:"charts",ref:m,children:w.map((R,F)=>{const ne=et[R];return r.jsxs(u.Fragment,{children:[F>0&&r.jsx("div",{className:"vsplit",onMouseDown:ae=>Gt(ae,F===1?Ls.c1:Ls.c2),onDoubleClick:()=>un(F===1?Ls.c1:Ls.c2)}),r.jsxs("div",{className:"chart",children:[r.jsxs("h4",{children:[r.jsx("span",{className:"t",children:nT[R].title}),r.jsx("span",{className:"sub",dangerouslySetInnerHTML:{__html:ne.sub||""}}),r.jsxs("span",{className:"bswitch",children:[r.jsx("span",{className:"swbtn",title:"上一张图",onClick:()=>S(F,-1),children:"‹"}),r.jsx("span",{className:"swbtn",title:"下一张图",onClick:()=>S(F,1),children:"›"})]})]}),r.jsx("div",{className:"cwrap",dangerouslySetInnerHTML:{__html:ne.body}})]})]},R)})}),r.jsx("div",{className:"hsplit",onMouseDown:R=>Gt(R,Ls.chartsH),onDoubleClick:()=>un(Ls.chartsH)}),r.jsxs("div",{className:"panel-head",children:["实时事件流",r.jsx("div",{className:"feed-tools",children:tT.map(R=>r.jsx("span",{className:"chip fchip"+(y===R?" on":""),"data-f":R,onClick:()=>j(R),children:eT[R]},R))}),r.jsx("div",{className:"spacer"}),r.jsxs("label",{className:"chip fchip on",style:{cursor:"pointer"},children:[r.jsx("input",{type:"checkbox",checked:v,onChange:R=>g(R.target.checked),style:{verticalAlign:-1}})," 自动滚动"]})]}),r.jsx("div",{className:"feed",ref:f})]}),r.jsx("div",{className:"vsplit",onMouseDown:R=>Gt(R,Ls.side),onDoubleClick:()=>un(Ls.side)}),r.jsx("aside",{className:"side-panel",dangerouslySetInnerHTML:rt})]}),it&&r.jsx("section",{className:"prio-bar",dangerouslySetInnerHTML:it}),r.jsxs("footer",{className:"statusbar",children:[r.jsx("span",{dangerouslySetInnerHTML:$t}),r.jsx("div",{className:"spacer"}),r.jsx("span",{children:"数据更新于 "+(i||"—")})]})]})}const aT=e=>/复测通过|已拒绝/.test(e||"");function iT(e){return e==="running"?"run":e==="done"?"pass":e==="failed"?"retest":"pending"}function cT(e){return e==="通过"?"pass":e==="失败"?"retest":e==="需要复测"?"run":"pending"}const uT=(e,t,n)=>Math.max(t,Math.min(n,e));function dT({project:e}){const t=e==null?void 0:e.id,n=On(),s=n.bugs,o=u.useRef(null),[l,a]=u.useState(null),i=u.useRef(null),[c,d]=u.useState(null),[f,m]=u.useState("report"),p=u.useRef("report"),[h,x]=u.useState(null),[y,j]=u.useState(null),[v,g]=u.useState(null),[w,b]=u.useState({auto_commit:!1}),[S,N]=u.useState(!1),[_,C]=u.useState(""),[O,P]=u.useState("fix"),[D,K]=u.useState(!1),[L,I]=u.useState(""),[q,ee]=u.useState(!1),[G,z]=u.useState("retest_only"),Y=[{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],B=[{v:"retest_only",label:"仅复测(现状行为,不部署)"},{v:"deploy_retest",label:"重新部署 → 复测"},{v:"deploy_only",label:"仅重新部署(不复测)"}],me=u.useRef({auto_commit:!1}),Z=u.useRef(null),Te=u.useRef(!1),ke=u.useMemo(()=>c?{__html:Fo(c.content)}:null,[c]),_e=(y==null?void 0:y.status)==="running",Ce=(y==null?void 0:y.status)==="queued",$e=(v==null?void 0:v.status)==="running",ue=(v==null?void 0:v.status)==="queued",fe=v?`任务「${v==null?void 0:v.name}」 ${ur[v==null?void 0:v.status]||(v==null?void 0:v.status)} · 轮次 ${v==null?void 0:v.current_round} · 会话 ${(v==null?void 0:v.session_id)||"(首轮后生成)"}`+((v==null?void 0:v.task_type)==="fix"?` · ${v!=null&&v.auto_commit?"自动提交":"不提交"}/${v!=null&&v.auto_deploy?"自动部署":"不部署"}/${v!=null&&v.auto_retest?"自动复测":"不复测"}`:""):"尚无修复/修例任务";function Se(){!l||!t||localStorage.setItem("ts_cur_bug",JSON.stringify({proj:t,dir:l,stab:p.current}))}async function te(Q){a(Q),i.current=Q,m("report"),p.current="report",x(null),Z.current=null,j(null),g(null),b({auto_commit:!1}),me.current={auto_commit:!1},await E(Q)}async function E(Q=l){if(!(!Q||!t))try{const He=await bf.get(t,Q);d(He),await A(),Se()}catch(He){M(He.message)}}function U(Q){m(Q),p.current=Q,Se()}async function A(){const Q=i.current;if(!(!Q||!t))try{const ce=(await Ue.list(t)).filter(dn=>(dn.task_type==="fix"||dn.task_type==="reject")&&(()=>{try{return JSON.parse(dn.payload||"{}").bug_dir===Q}catch{return!1}})()),Dt=ce[0]||null,Gt=ce.find(dn=>dn.task_type==="fix")||null;g(Dt);const un=Gt?Gt.id:null;j(Gt),x(un),Z.current=un,Gt&&b(dn=>({auto_commit:me.current.auto_commit?dn.auto_commit:!!Gt.auto_commit}))}catch{}}u.useEffect(()=>{if(f!=="fix")return;const Q=setInterval(()=>{A().catch(()=>{})},2e3);return()=>clearInterval(Q)},[f,l,t]),u.useEffect(()=>{const Q=setInterval(()=>{l&&E().catch(()=>{})},5e3);return()=>clearInterval(Q)},[l,t]);function se(){if(!l){M("请先选择 bug 报告");return}z("retest_only"),ee(!0)}async function oe(){try{await Ue.create(t,{task_type:"retest_bug",bug_dir:l,retest_scope:G}),M("复测任务已入队,可在「任务」标签页查看"),ee(!1),await n.loadTasks(),await A()}catch(Q){M(Q.message)}}function ze(){if(!l){M("请先选择 bug 报告");return}C((y==null?void 0:y.extra)||""),P((y==null?void 0:y.end_stage)||"fix"),N(!0)}async function Je(){const Q=_.trim();try{if(!h)await Ue.create(t,{task_type:"fix",bug_dir:l,end_stage:O,auto_commit:w.auto_commit,extra:Q}),M("修复任务已入队");else{if(_e||Ce){M("任务运行中,请先停止再修复");return}await Ue.update(h,{extra:Q,auto_commit:w.auto_commit,start_stage:"analyze",end_stage:O}),await Ue.restart(h),M("修复任务已重启入队")}N(!1),C(""),await n.loadTasks(),await A(),U("fix")}catch(He){M(He.message)}}async function Fe(){const Q=L.trim();if(!Q){M("请填写拒绝理由");return}try{await bf.reject(t,l,Q),M("已标记拒绝,修例任务已入队"),K(!1),I(""),await n.loadTasks(),await E(),U("fix")}catch(He){M(He.message)}}async function et(Q,He){if(b(ce=>({...ce,[Q]:He})),me.current={...me.current,[Q]:!0},!!Z.current)try{await Ue.update(Z.current,{[Q]:He}),me.current={...me.current,[Q]:!1},M("已保存,下次向 agent 发送指令时生效"),await A()}catch(ce){M(ce.message)}}async function Be(){if(v)try{await Ue.stop(v.id),M("已请求停止"),setTimeout(()=>A().catch(()=>{}),800)}catch(Q){M(Q.message)}}async function Ke(){if(!v){M("尚无修复/修例任务");return}if($e||ue){M("任务运行中,请先停止再重启");return}try{await Ue.restart(v.id),M("任务已重启入队"),await A()}catch(Q){M(Q.message)}}function rt(Q){if(Q.button!==0||Q.detail>1)return;const He=o.current,ce=parseInt(getComputedStyle(He).getPropertyValue("--bugw"),10)||400,Dt=Q.clientX;Q.currentTarget.classList.add("drag"),document.body.classList.add("resizing-x");const Gt=dn=>He.style.setProperty("--bugw",uT(ce+(dn.clientX-Dt),260,760)+"px"),un=()=>{Q.currentTarget.classList.remove("drag"),document.body.classList.remove("resizing-x"),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",un),localStorage.setItem("ts.bugw",getComputedStyle(He).getPropertyValue("--bugw"))};document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",un)}function $t(){o.current.style.removeProperty("--bugw"),localStorage.removeItem("ts.bugw")}u.useEffect(()=>{try{const Q=+localStorage.getItem("ts.bugw");Q>0&&o.current.style.setProperty("--bugw",Q+"px")}catch{}},[]),u.useEffect(()=>{if(Te.current||!t||!s.length)return;if(i.current){Te.current=!0;return}let Q=null;try{Q=JSON.parse(localStorage.getItem("ts_cur_bug")||"null")}catch{}Q&&Q.proj===t&&s.some(He=>He.dir===Q.dir)&&(Te.current=!0,te(Q.dir).then(()=>{const He=Q.stab==="fix"?"fix":"report";m(He),p.current=He}))},[t,s]);const it=r.jsxs("div",{className:"fix-opts",children:[r.jsxs("label",{style:{display:"flex",gap:5,alignItems:"center",cursor:"pointer",color:"var(--text)"},children:[r.jsx("input",{type:"checkbox",checked:w.auto_commit,onChange:Q=>et("auto_commit",Q.target.checked)}),"自动提交(修复完成后 git commit,不 push)"]}),r.jsx("span",{className:"hint",children:"部署/复测是否执行由「修复」弹窗中的任务终点决定(终点≥重新部署即部署、终点=复测即任务内复测)"})]});return r.jsxs("div",{className:"bugs-tab",children:[e&&r.jsxs("div",{className:"bugwrap",ref:o,children:[r.jsxs("div",{className:"bug-left",children:[r.jsxs("div",{className:"bug-head",children:["Bug 报告 ",r.jsx("span",{className:"dim",children:s.length?"共 "+s.length:""})]}),r.jsxs("div",{className:"bug-list scroll",children:[!s.length&&r.jsx("div",{className:"hint",style:{padding:12},children:"暂无 bug 报告"}),s.map(Q=>r.jsxs("div",{className:"bugitem"+(l===Q.dir?" sel":"")+(aT(Q.status)?" history":""),title:/已拒绝/.test(Q.status||"")?"已被拒绝的报告":/复测通过/.test(Q.status||"")?"复测通过的历史报告":void 0,onClick:()=>te(Q.dir),children:[r.jsx("div",{className:"bt",children:Q.title}),r.jsxs("div",{className:"bmeta",children:[r.jsx("span",{className:"bug-status "+Yf(Q.status),children:Q.status||"—"}),Q.last_task&&r.jsxs("span",{className:"bug-status "+iT(Q.last_task.status),children:[Q.last_task.name," · ",ur[Q.last_task.status]||Q.last_task.status]}),r.jsxs("span",{children:[Q.cases.length," 用例"]})]})]},Q.dir))]})]}),r.jsx("div",{className:"vsplit bug-split",onMouseDown:rt,onDoubleClick:$t}),r.jsx("div",{className:"bug-right",children:c?r.jsxs("div",{className:"bug-content scroll"+(f==="fix"?" fix-mode":""),children:[r.jsxs("div",{className:"head",children:[r.jsx("h3",{children:c.title}),r.jsx("span",{className:"bug-status "+Yf(c.status),children:c.status||"—"})]}),r.jsxs("div",{className:"mut",children:["bug_report/",c.dir,c.last_task&&r.jsxs(r.Fragment,{children:[" · 最近任务「",c.last_task.name,"」:",ur[c.last_task.status]||c.last_task.status]}),"· ",r.jsxs(H,{variant:"ghost",size:"sm",className:"inline-flex h-5 px-1.5 text-[calc(11px*var(--fs))]",onClick:()=>E(),children:[r.jsx(Ka,{})," 刷新"]})]}),r.jsxs("div",{className:"sub-tabs",children:[r.jsx("span",{className:"sub-tab"+(f==="report"?" on":""),onClick:()=>U("report"),children:"报告"}),r.jsx("span",{className:"sub-tab"+(f==="fix"?" on":""),onClick:()=>U("fix"),children:"对话"})]}),f==="report"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"ops",children:[!/已拒绝/.test(c.status||"")&&r.jsxs(H,{variant:"outline",size:"sm",onClick:se,children:[r.jsx(va,{})," 复测"]}),!["复测通过","已修复"].some(Q=>(c.status||"").includes(Q))&&r.jsxs(H,{size:"sm",onClick:ze,children:[r.jsx(dm,{})," 修复"]}),!/已拒绝/.test(c.status||"")&&r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>{I(""),K(!0)},children:[r.jsx(CN,{})," 拒绝"]}),r.jsx("span",{className:"hint",children:"复测/修复/拒绝都会创建任务(固定一轮)执行; 复测后若关联用例全部通过,bug 状态自动改为「已修复」; 拒绝会标记「已拒绝」并按理由修正关联用例; 修复/修例过程在「对话」标签页实时查看"})]}),it,r.jsxs("div",{className:"sec-title",children:["关联用例(",c.cases.length,")"]}),c.cases.length?r.jsxs(Tm,{className:"text-xs",children:[r.jsx($m,{children:r.jsxs(Io,{className:"hover:bg-transparent",children:[r.jsx(Cn,{className:"px-2",children:"ID"}),r.jsx(Cn,{className:"px-2",children:"名称"}),r.jsx(Cn,{className:"px-2",children:"状态"}),r.jsx(Cn,{className:"px-2",children:"最近执行"})]})}),r.jsx(Im,{children:c.cases.map(Q=>r.jsxs(Io,{children:[r.jsx(yn,{className:"px-2 font-mono text-xs",children:Q.id}),r.jsx(yn,{className:"px-2",children:Q.name}),r.jsx(yn,{className:"px-2",children:r.jsx("span",{className:"bug-status "+cT(Q.status),children:Q.status||"—"})}),r.jsx(yn,{className:"px-2 font-mono text-xs",children:ls(Q.last_run)})]},Q.id))})]}):r.jsx("div",{className:"hint",children:"未解析到关联用例"}),r.jsx("div",{className:"sec-title",children:"完整内容(bug_report.md)"}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:ke})]}):r.jsxs("div",{className:"fix-panel",children:[r.jsxs("div",{className:"fix-controls",children:[v&&($e||ue)&&r.jsxs(H,{size:"sm",variant:"outline",onClick:Be,children:[r.jsx(cm,{})," 停止"]}),v&&["stopped","failed","done","interrupted"].includes(v==null?void 0:v.status)&&r.jsxs(H,{size:"sm",variant:"outline",onClick:Ke,children:[r.jsx(Nf,{})," 重启任务"]}),r.jsx("span",{className:"hint fix-status",children:fe})]}),v?r.jsx(Gf,{task:v,withQBar:!1}):r.jsx("div",{className:"sess-empty",style:{flex:1},children:"尚无修复/修例会话。在「报告」标签页点击「修复」或「拒绝」创建任务后,对话会在这里实时展示。"})]})]}):r.jsx("div",{className:"bug-empty",children:"← 选择左侧 bug 报告查看详情;修复 / 复测会创建任务并放入「任务」标签页执行"})})]}),r.jsx(en,{open:S,onOpenChange:N,children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{className:"text-left",children:r.jsxs(Wt,{className:"text-sm",children:["修复「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"修改意见(可选)"}),r.jsx(ps,{rows:4,value:_,onChange:Q=>C(Q.target.value),placeholder:"例如:只修第 3 节指出的空指针判断,不要动缓存层;留空则按报告推荐方案修复"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(At,{value:O,onValueChange:P,children:[r.jsx(Mt,{size:"sm",className:"min-w-[160px]",children:r.jsx(Pt,{})}),r.jsx(Tt,{children:Y.map(Q=>r.jsx(Oe,{value:Q.v,children:Q.label},Q.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"起点=报告分析;终点≥重新部署时自动部署、终点=复测时任务内复测(复测通过自动标记已修复)"})]}),r.jsx(jn,{className:"flex-none",children:r.jsx(H,{onClick:Je,children:h?"重启修复":"开始修复"})})]})}),r.jsx(en,{open:D,onOpenChange:K,children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{className:"text-left",children:r.jsxs(Wt,{className:"text-sm",children:["拒绝「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"拒绝理由(必填)"}),r.jsx(ps,{rows:4,value:L,onChange:Q=>I(Q.target.value),placeholder:"例如:误报——MCP 超时是环境抖动,不是协议实现问题"}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"确认后报告标记为「已拒绝」并调暗沉底;平台将创建修例任务:按理由修正关联用例, 并把教训记入案例库 PITFALLS.md,后续生成用例时避开同类误报"})]}),r.jsx(jn,{className:"flex-none",children:r.jsx(H,{variant:"destructive",onClick:Fe,children:"确认拒绝"})})]})}),r.jsx(en,{open:q,onOpenChange:ee,children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{className:"text-left",children:r.jsxs(Wt,{className:"text-sm",children:["复测「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务范围"}),r.jsxs(At,{value:G,onValueChange:z,children:[r.jsx(Mt,{size:"sm",className:"min-w-[220px]",children:r.jsx(Pt,{})}),r.jsx(Tt,{children:B.map(Q=>r.jsx(Oe,{value:Q.v,children:Q.label},Q.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"仅复测且关联用例全部已固化 verify.py 时走平台脚本复测;范围含重新部署时由 agent 先按项目部署说明部署再复测"})]}),r.jsx(jn,{className:"flex-none",children:r.jsx(H,{onClick:oe,children:"开始复测"})})]})})]})}const fT=new Set(["done"]);function pT(e){return!!(e!=null&&e.unread)&&!fT.has(e.column)}const Qf=60*1e3,Xf=60*Qf,Jf=24*Xf,mT=7*Jf,Co=e=>String(e).padStart(2,"0");function Zf(e){return typeof e=="number"&&Number.isFinite(e)}function hT(e,t=Date.now()){if(!Zf(e)||!Zf(t))return"";const n=t-e;if(n<Qf)return"刚刚";if(n<Xf)return`${Math.floor(n/Qf)} 分钟前`;if(n<Jf)return`${Math.floor(n/Xf)} 小时前`;if(n<mT)return`${Math.floor(n/Jf)} 天前`;const s=new Date(e),o=new Date(t),l=`${Co(s.getMonth()+1)}-${Co(s.getDate())}`;return s.getFullYear()===o.getFullYear()?l:`${s.getFullYear()}-${l}`}function gT(e){if(!Zf(e))return"";const t=new Date(e);return`${t.getFullYear()}-${Co(t.getMonth()+1)}-${Co(t.getDate())} ${Co(t.getHours())}:${Co(t.getMinutes())}:${Co(t.getSeconds())}`}function xT(e,t=Date.now()){return hT(e==null?void 0:e.updated_at_ts,t)}function vT(e){const t=gT(e==null?void 0:e.updated_at_ts);return t?`最后更新:${t}`:""}function jj(e){const t=e&&e.session_rename;return t?t.ok===!1?`卡名已改;DSH 会话名未同步:${t.error||"未知原因"}`:t.accepted_title?`DSH 侧标题被截断为「${t.accepted_title}」(卡面保留原文)`:"":""}const yT=1;function kx(e){const t=e&&typeof e.querySelectorAll=="function"?Array.from(e.querySelectorAll(".board-card-ops")):[];if(!t.length)return{total:0,compacted:0};t.forEach(l=>l.classList.remove("is-compact"));const n=e.classList&&typeof e.classList.add=="function";n&&e.classList.add("board-ops-measure");const s=t.map(l=>l.scrollWidth-l.clientWidth);let o=0;return t.forEach((l,a)=>{const i=s[a]>yT;l.classList.toggle("is-compact",i),i&&(o+=1)}),n&&e.classList.remove("board-ops-measure"),{total:t.length,compacted:o}}function qc({options:e=[],value:t,onChange:n,placeholder:s="搜索…",emptyHint:o="无匹配项",className:l,inputClassName:a}){const[i,c]=u.useState(!1),[d,f]=u.useState(""),[m,p]=u.useState(0),h=u.useRef(null),x=u.useRef(null),y=e.find(S=>S.value===t)||null,j=d.trim().toLowerCase(),v=j?e.filter(S=>((S.search||"")+" "+S.label).toLowerCase().includes(j)):e;u.useEffect(()=>{if(!i)return;const S=N=>{var _;(_=h.current)!=null&&_.contains(N.target)||c(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[i]),u.useEffect(()=>{p(0)},[d,i]);function g(){var S;if(i){c(!1);return}f(""),c(!0),(S=x.current)==null||S.focus()}function w(S){n(S.value),c(!1),f("")}function b(S){if(!i&&(S.key==="ArrowDown"||S.key==="Enter")&&S.preventDefault(),!i){S.key==="ArrowDown"&&g();return}if(S.key==="Escape"){c(!1),f("");return}if(S.key==="ArrowDown"){S.preventDefault(),p(N=>Math.min(N+1,v.length-1));return}if(S.key==="ArrowUp"){S.preventDefault(),p(N=>Math.max(N-1,0));return}if(S.key==="Enter"){S.preventDefault(),v[m]&&w(v[m]);return}}return r.jsxs("div",{ref:h,className:Ge("relative",l),children:[r.jsx(Ae,{ref:x,className:Ge("pr-8",a),value:i?d:y?y.label:"",placeholder:s,onChange:S=>{c(!0),f(S.target.value)},onFocus:()=>{i||c(!0)},onKeyDown:b,title:y?y.label:void 0}),r.jsx("button",{type:"button",tabIndex:-1,className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded hover:bg-accent",onClick:()=>g(),children:r.jsx(Bl,{className:Ge("size-4 opacity-50 transition-transform",i&&"rotate-180")})}),i&&r.jsxs("div",{className:`absolute left-0 right-0 top-full z-50 mt-1 max-h-56 overflow-y-auto
|
|
462
|
-
rounded-md border bg-popover text-popover-foreground p-1 shadow-md`,children:[v.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:o}),v.map((S,N)=>r.jsx("div",{className:Ge("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm select-none",S.value===t&&"bg-accent text-accent-foreground",S.value!==t&&(N===m?"bg-accent/60 text-accent-foreground":"hover:bg-accent")),onMouseEnter:()=>p(N),onClick:()=>w(S),children:r.jsx("span",{className:"flex-1 truncate",children:S.label})},S.value))]})]})}const wT=10*1024*1024;function jT({project:e,card:t,comments:n,onClose:s,reload:o}){const l=e.id,[a,i]=u.useState(!1),[c,d]=u.useState(t.title+`
|
|
463
|
-
`+(t.description||"")),[f,m]=u.useState(""),[p,h]=u.useState(""),[x,y]=u.useState(""),[j,v]=u.useState(!1),[g,w]=u.useState(!1),[b,S]=u.useState(null),[N,_]=u.useState(!1),[C,O]=u.useState(!1),P=u.useRef(null),{rzOn:D,rzStyle:K,rzStart:L,rzDragStart:I,rzReset:q}=ar("ts.boardW",!1);u.useEffect(()=>{a||d(t.title+`
|
|
464
|
-
`+(t.description||""))},[t.title,t.description,a]),u.useEffect(()=>{i(!1),m(""),h(""),y(""),S(null)},[t.id]);const ee=u.useMemo(()=>({__html:Fo(Rf(t.description||"*(无描述)*",l))}),[t.description,l]),[G,z]=u.useState([]),[Y,B]=u.useState(null),[me,Z]=u.useState({}),[Te,ke]=u.useState([]);u.useEffect(()=>{Ee.get(l).then(A=>{z(A.cards||[]),B(A.capabilities||null),Z(A.session_titles||{})}).catch(()=>{}),Ee.listSessions(l).then(A=>ke(A.sessions||[])).catch(()=>{})},[l,t.id,t.updated_at]);async function _e(A){try{const se=await Ee.updateCard(l,t.id,A),oe=jj(se);oe&&M(oe),await o()}catch(se){M(se.message)}}async function Ce(){const A=c.indexOf(`
|
|
465
|
-
`),se=(A<0?c:c.slice(0,A)).trim()||"未命名",oe=A<0?"":c.slice(A+1);await _e({title:se.slice(0,200),description:oe}),i(!1)}async function $e(A){m(A),await _e({scheduled_at:A?new Date(A).getTime():0})}async function ue(A){const se=x.trim();if(se)try{const oe=await Ee.addComment(l,t.id,se);y(""),A&&await Ee.sendComment(l,t.id,oe.id),await o()}catch(oe){M(oe.message),await o()}}async function fe(A){const se=Array.from(A||[]);if(!(!se.length||N))for(const oe of se){if(oe.size>wT){M(`附件过大(>10MB):${oe.name}`);continue}if(await pm(oe)){M(`已跳过占位图(极小尺寸):${oe.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}_(!0);try{const ze=await new Promise((it,Q)=>{const He=new FileReader;He.onload=()=>it(String(He.result||"").split(",")[1]||""),He.onerror=()=>Q(new Error("文件读取失败")),He.readAsDataURL(oe)}),Je=await Ee.uploadMedia(l,{name:oe.name,mime:oe.type||"application/octet-stream",data:ze}),Fe=(oe.type||"").startsWith("image/")?``:`[${oe.name}](${Je.url})`,et=P.current,Be=!!et&&document.activeElement===et,Ke=Be?et.selectionStart??et.value.length:-1,rt=Be?(et.value||"").indexOf(`
|
|
466
|
-
`):-1,$t=Be&&rt>=0&&Ke>rt;d(it=>$t?it.slice(0,Ke)+Fe+it.slice(et.selectionEnd??Ke):(it?it+`
|
|
467
|
-
`:"")+Fe+`
|
|
468
|
-
`),M($t||!Be?`已粘贴附件:${oe.name}`:`标题不支持图片,已附加到描述区:${oe.name}`)}catch(ze){M(ze.message||"附件上传失败")}finally{_(!1)}}}function Se(A){var ze;const oe=Array.from(((ze=A.clipboardData)==null?void 0:ze.items)||[]).filter(Je=>Je.kind==="file").map(Je=>Je.getAsFile()).filter(Boolean);oe.length&&(A.preventDefault(),fe(oe))}function te(A){var oe;const se=Array.from(((oe=A.dataTransfer)==null?void 0:oe.files)||[]);se.length&&(A.preventDefault(),fe(se))}async function E(){if(!(C||!window.confirm(`确认清理该独立 worktree?
|
|
469
|
-
|
|
470
|
-
${t.worktree}
|
|
471
|
-
|
|
472
|
-
仅在工作树无未提交改动且会话未运行时才能清理(分支保留,不自动删除)。`))){O(!0);try{await Ee.removeWorktree(l,t.id),M("已清理 worktree"),await o()}catch(se){M(se.message)}finally{O(!1)}}}const U=Y?!Y.chat:!0;return r.jsx(en,{open:!0,onOpenChange:A=>{A||s()},children:r.jsxs(Ut,{className:"modal modal-rz board-detail-modal w-[52vw] h-auto max-h-[90vh] sm:max-w-[94vw] overflow-y-auto"+(D?" rz-drag":""),style:{...K,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:L,reset:q}),r.jsx(Vt,{className:"text-left",children:r.jsxs(Wt,{className:"cursor-move select-none text-sm break-words",onMouseDown:I,children:["#",t.id," ",t.title||"未命名"]})}),r.jsxs("div",{className:"board-detail",children:[r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["📝 标题 / 描述",!a&&r.jsx(H,{size:"sm",variant:"ghost",onClick:()=>i(!0),children:"✏ 编辑"})]}),a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",children:"第一行为标题,其余为描述;支持粘贴/拖入图片与文件(存为附件,10MB 内);Ctrl+Enter 保存"}),r.jsx(ps,{ref:P,rows:10,value:c,onChange:A=>d(A.target.value),onPaste:Se,onDrop:te,onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&(A.preventDefault(),N||Ce())},placeholder:"第一行为标题(空则显示「未命名」),其余为描述…"}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(H,{size:"sm",onClick:Ce,disabled:N,children:N?"附件上传中…":"保存"}),r.jsx(H,{size:"sm",variant:"outline",onClick:()=>{i(!1),d(t.title+`
|
|
473
|
-
`+(t.description||""))},children:"取消"})]})]}):r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:ee})]}),t.column==="todo"&&r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"⏰ 定时开工"}),r.jsx(Ae,{type:"datetime-local",value:f||(t.scheduled_at?bT(t.scheduled_at):""),onChange:A=>$e(A.target.value)}),r.jsx("div",{className:"hint",children:"到点自动进入「正在开发」(受串行门禁约束)"})]}),t.worktree&&r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["🌿 独立 worktree",r.jsx(H,{size:"sm",variant:"ghost",disabled:C,title:"删除该独立工作树目录(会话运行中或工作树有未提交改动时会被后端拒绝)",onClick:E,children:C?"清理中…":"清理 worktree"})]}),r.jsxs("div",{className:"hint break-all",title:t.worktree,children:[r.jsx("span",{className:"font-mono",children:t.worktree}),"(分支 ts/card-",t.id,")"]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💬 相关会话"}),(t.sessions||[]).map(A=>r.jsxs("div",{className:"flex items-center gap-1 py-0.5 text-xs cursor-pointer hover:bg-accent/40 rounded px-1 -mx-1",title:`点击查看会话 ${A}`,onClick:()=>S(A),children:[r.jsx("span",{className:"flex-1 min-w-0 truncate",children:me[A]||r.jsx("span",{className:"font-mono",children:A})}),me[A]&&r.jsx("span",{className:"font-mono text-muted-foreground",children:A.slice(0,8)}),A===t.session_id&&r.jsx("span",{className:"bug-status pass",children:"主"}),r.jsx(H,{size:"sm",variant:"ghost",title:"复制 id",onClick:se=>{var oe;se.stopPropagation(),(oe=navigator.clipboard)==null||oe.writeText(A),M("已复制")},children:r.jsx(rm,{})}),A!==t.session_id&&r.jsx(H,{size:"sm",variant:"ghost",title:"设为主会话",onClick:se=>{se.stopPropagation(),_e({session_id:A})},children:"设主"}),r.jsx(H,{size:"sm",variant:"ghost",title:"解绑",onClick:se=>{se.stopPropagation(),_e({unbind_session:A})},children:"✂"}),(Y==null?void 0:Y.compact)&&r.jsx(H,{size:"sm",variant:"ghost",title:"compact 压缩会话上下文",onClick:async se=>{se.stopPropagation();try{await Ee.compact(l,t.id,A),M("compact 已触发")}catch(oe){M(oe.message)}},children:r.jsx(RC,{})}),(Y==null?void 0:Y.fork)&&r.jsx(H,{size:"sm",variant:"ghost",disabled:j,title:"压缩并新建:压缩会话内容并新建会话(新会话只含压缩摘要、无历史轮次,原会话保留)",onClick:async se=>{if(se.stopPropagation(),!j){v(!0);try{const oe=await Ee.forkCompact(l,t.id,A);M("已新建会话并注入压缩内容"),await _e({bind_session:oe.new_sid})}catch(oe){M(oe.message)}finally{v(!1)}}},children:j?"压缩中…":r.jsx(FN,{})}),(Y==null?void 0:Y.fork)&&r.jsx(H,{size:"sm",variant:"ghost",disabled:g,title:"fork 会话:完整复制为新会话(历史/上下文全量保留)并加入卡片会话列表(不改变主会话,需要时点「设主」)",onClick:async se=>{if(se.stopPropagation(),!g){w(!0);try{const oe=await Ee.forkSession(l,t.id,A);M("已 fork 新会话并加入卡片会话列表"),await _e({bind_session:oe.new_sid})}catch(oe){M(oe.message)}finally{w(!1)}}},children:g?"fork 中…":r.jsx(ZN,{})}),r.jsx(H,{size:"sm",variant:"ghost",title:"查看会话",onClick:se=>{se.stopPropagation(),S(A)},children:"🔍"})]},A)),r.jsxs("div",{className:"mt-1 flex gap-1",children:[r.jsx(qc,{className:"flex-1",placeholder:"搜索或选择已有会话…",emptyHint:"工作区暂无会话",options:Te.map(A=>({value:A.sid,label:`${A.title||A.sid.slice(0,12)}(${new Date(A.mtime*1e3).toLocaleString()})`+(A.bound?" [已绑定]":"")+(A.archived?" [已归档]":""),search:A.sid})),value:p,onChange:h}),r.jsx(H,{size:"sm",variant:"outline",disabled:!p.trim(),onClick:async()=>{await _e({bind_session:p.trim()}),h("")},children:"绑定"})]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🔗 父任务依赖"}),r.jsx(qc,{placeholder:"选择父任务卡片…",emptyHint:"没有匹配的卡片",options:[{value:"",label:"(无依赖)"}].concat(G.filter(A=>A.id!==t.id).map(A=>({value:String(A.id),label:`#${A.id} ${A.title||"未命名"}(${A.column})`,search:A.title||""}))),value:t.parent_card_id?String(t.parent_card_id):"",onChange:A=>_e({parent_card_id:A?+A:null})}),G.filter(A=>A.id!==t.id).length===0&&r.jsx("div",{className:"hint",children:"暂无其他卡片可作为父任务"})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💭 评论"}),(n||[]).map(A=>r.jsxs("div",{className:"py-1 text-xs",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-muted-foreground",children:A.created_at}),A.sent&&r.jsx("span",{className:"bug-status pass",children:"✓ 已投递"}),r.jsx("span",{className:"flex-1"}),!A.sent&&!U&&r.jsx(H,{size:"sm",variant:"ghost",title:"投递到主会话",onClick:async()=>{try{await Ee.sendComment(l,t.id,A.id),await o()}catch(se){M(se.message)}},children:r.jsx(Cf,{})}),r.jsx(H,{size:"sm",variant:"ghost",title:"删除",onClick:async()=>{try{await Ee.removeComment(l,t.id,A.id),await o()}catch(se){M(se.message)}},children:r.jsx(Gs,{})})]}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Fo(Rf(A.text,l))}})]},A.id)),r.jsx(ps,{rows:3,placeholder:U?"评论(dsh 不支持投递,仅保存)":"评论(Ctrl+Enter 保存)",value:x,onChange:A=>y(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&ue(!1)}}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(H,{size:"sm",variant:"outline",onClick:()=>ue(!1),children:"保存"}),!U&&r.jsxs(H,{size:"sm",onClick:()=>ue(!0),disabled:!t.session_id,title:t.session_id?"":"尚无会话,请先开始开发",children:[r.jsx(Cf,{})," 保存并投递"]})]})]})]}),r.jsx(Wc,{board:b?{projectId:l,sid:b,cid:t.id,column:t.column,title:t.title}:null,onSwitchSession:S,onClose:()=>S(null)})]})})}function bT(e){const t=new Date(e),n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}const kT={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function _T({project:e,onClose:t,onChanged:n}){const s=e==null?void 0:e.id,[o,l]=u.useState([]),[a,i]=u.useState(!1);async function c(){try{const p=await Ee.trashList(s);l(p.cards||[])}catch(p){M(p.message)}}u.useEffect(()=>{c()},[s]);async function d(p){try{await Ee.restoreCard(s,p.id),M(`已还原「${p.title||"未命名"}」`),await c(),n==null||n()}catch(h){M(h.message)}}async function f(p){if(window.confirm(`彻底删除「${p.title||"未命名"}」?评论一并删除,不可恢复。`))try{await Ee.purgeCard(s,p.id),await c(),n==null||n()}catch(h){M(h.message)}}async function m(){if(!a&&window.confirm(`清空回收站共 ${o.length} 张卡片?全部彻底删除,不可恢复。`)){i(!0);try{await Ee.emptyTrash(s),l([]),M("回收站已清空"),n==null||n()}catch(p){M(p.message)}finally{i(!1)}}}return r.jsx(en,{open:!0,onOpenChange:p=>!p&&t(),children:r.jsxs(Ut,{className:"modal board-trash-modal w-[52vw] max-h-[85vh] overflow-y-auto sm:max-w-[94vw]",children:[r.jsx(Vt,{className:"text-left",children:r.jsxs(Wt,{className:"text-sm",children:["回收站(",o.length,")"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:"删除的卡片仅移入回收站,可还原;这里的彻底删除不可恢复"}),r.jsxs(H,{size:"sm",variant:"outline",disabled:!o.length||a,onClick:m,children:[r.jsx(Gs,{})," 清空回收站"]})]}),o.length===0?r.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:"回收站是空的"}):r.jsx("div",{className:"flex flex-col gap-2",children:o.map(p=>{var h;return r.jsxs("div",{className:"flex items-start gap-2 rounded border border-border px-3 py-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm break-words",children:p.title||"未命名"}),r.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:[r.jsx("span",{className:"bug-status pending",children:kT[p.column]||p.column}),p.jira_key&&r.jsx("span",{className:"bug-status pending",children:p.jira_key}),r.jsxs("span",{children:["删除于 ",((h=p.trashed_at)==null?void 0:h.replace("T"," "))||""]})]})]}),r.jsxs(H,{size:"sm",variant:"outline",title:"还原(回原列原位置)",onClick:()=>d(p),children:[r.jsx(wl,{})," 还原"]}),r.jsx(H,{size:"sm",variant:"ghost",title:"彻底删除(不可恢复)",onClick:()=>f(p),children:r.jsx(Gs,{})})]},p.id)})}),r.jsx(jn,{children:r.jsx(H,{variant:"outline",onClick:t,children:"关闭"})})]})})}const bd=4,qi=8;function ST({trigger:e,items:t=[],align:n="end"}){const[s,o]=u.useState(!1),[l,a]=u.useState(null),i=u.useRef(null),c=u.useRef(null);function d(f=!1){var m,p;o(!1),a(null),f&&((p=(m=i.current)==null?void 0:m.querySelector("button"))==null||p.focus())}return u.useEffect(()=>{if(!s)return;const f=h=>{var x,y;(x=c.current)!=null&&x.contains(h.target)||(y=i.current)!=null&&y.contains(h.target)||d()},m=h=>{h.key==="Escape"&&d(!0)},p=()=>d();return document.addEventListener("mousedown",f),document.addEventListener("keydown",m),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",m),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]),u.useLayoutEffect(()=>{var y,j,v,g;if(!s)return;const f=(y=i.current)==null?void 0:y.getBoundingClientRect();if(!f)return;const m=((j=c.current)==null?void 0:j.offsetWidth)||0,p=((v=c.current)==null?void 0:v.offsetHeight)||0;let h=n==="start"?f.left:f.right-m;h=Math.max(qi,Math.min(h,window.innerWidth-m-qi));let x=f.bottom+bd;p&&x+p>window.innerHeight-qi&&f.top-bd-p>=qi&&(x=f.top-bd-p),a({left:h,top:x}),(g=c.current)==null||g.focus()},[s,n]),r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:i,className:"inline-flex",onClick:()=>s?d():o(!0),children:e}),s&&Ko.createPortal(r.jsxs("div",{ref:c,role:"menu",tabIndex:-1,style:{position:"fixed",left:l?l.left:-9999,top:l?l.top:-9999,visibility:l?"visible":"hidden"},className:"z-50 min-w-[176px] rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none",children:[t.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"无可选项"}),t.map(f=>r.jsx("div",{title:f.disabled?f.title:void 0,children:r.jsxs("button",{type:"button",role:"menuitem",disabled:!!f.disabled,"aria-disabled":f.disabled||void 0,title:f.disabled?void 0:f.title,className:Ge("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm select-none",f.disabled?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent hover:text-accent-foreground"),onClick:()=>{var m;f.disabled||(d(),(m=f.onSelect)==null||m.call(f))},children:[f.icon&&r.jsx("span",{className:"shrink-0",children:f.icon}),r.jsx("span",{className:"flex-1 truncate",children:f.label})]})},f.key))]}),document.body)]})}function er({icon:e,iconNarrow:t,label:n,className:s="",...o}){return r.jsxs(H,{size:"sm",className:`board-opbtn ${s}`.trim(),"aria-label":n,title:n,...o,children:[r.jsx("span",{className:"board-opwide",children:r.jsx(e,{})}),r.jsx("span",{className:"board-opicon",children:r.jsx(t,{})}),r.jsx("span",{className:"board-oplabel",children:n})]})}function da({className:e="",...t}){return r.jsx(H,{size:"sm",className:`board-opbtn ${e}`.trim(),...t})}const NT=6,CT=10*1024*1024,ET={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},RT=new Set(["doing","review","done"]),PT={running:"run",queued:"pending",done:"pass"},MT=[["all","全部"],["dev","仅开发"],["test","仅测试"]],TT=[{key:"todo",label:"待开发"},{key:"doing",label:"正在开发"},{key:"blocked",label:"阻塞"},{key:"review",label:"待审核"},{key:"done",label:"已完成"}],_x=[["manual","手动"],["created_desc","创建新→旧"],["updated_desc","更新新→旧"],["title","标题"]],$T=e=>e==="done"?[["entered_desc","进入新→旧"],..._x]:_x,IT={serial:"串行",parallel:"并行"},Sx=e=>e.queue_state==="running"||e.queue_state==="starting",Nx=e=>!e.answer_pending&&(!!e.running||e.queue_state==="starting"),Gi=e=>e.block_kind==="queue"&&!e.answer_pending;function AT({project:e}){var ho,Xs,Nr,el;const t=e==null?void 0:e.id,n=vj(),[s,o]=u.useState(null),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),[m,p]=u.useState({}),[h,x]=u.useState(null),[y,j]=u.useState(null),[v,g]=u.useState(""),[w,b]=u.useState(null),[S,N]=u.useState({}),[_,C]=u.useState(null),O=u.useRef({}),[P,D]=u.useState(null),[K,L]=u.useState(!1),[I,q]=u.useState(!1),[ee,G]=u.useState(!1),[z,Y]=u.useState(null),[B,me]=u.useState(null),[Z,Te]=u.useState(""),ke=u.useRef(null),[_e,Ce]=u.useState(null),$e=u.useRef(null),ue=u.useRef(!1),fe=u.useRef([]),Se=u.useRef(null),te=u.useRef(null),E=u.useRef(null),U=u.useRef(null),A=u.useRef(null),se=u.useRef(null),oe=u.useRef(null),ze=u.useRef(null),Je=u.useRef(null);async function Fe(){var T;if(t&&!((T=$e.current)!=null&&T.on))try{te.current=Ke(),o(await Ee.get(t))}catch(V){M(V.message)}}u.useEffect(()=>{o(null),a(null),Y(null),f(""),x(null),C(null),N({}),O.current={},Fe(),yl.get(t).then(he=>{var Le;return p(((Le=he.prefs)==null?void 0:Le.board_filters)||{})}).catch(()=>{});let T=null;const V=()=>{E.current||(E.current=setTimeout(()=>{E.current=null,Fe()},300))};try{T=Ee.stream(t),T.addEventListener("hello",V),T.addEventListener("refresh",V)}catch{}const ve=setInterval(Fe,6e4);return()=>{clearInterval(ve),E.current&&(clearTimeout(E.current),E.current=null);try{T==null||T.close()}catch{}}},[t]);function et(T,V){p(ve=>{const he={...ve,[T]:V};return yl.set(t,"board_filters",he).catch(()=>{}),he})}const Be=u.useMemo(()=>(s==null?void 0:s.cards)||[],[s]);fe.current=Be,Se.current=s;function Ke(){const T=new Map;return document.querySelectorAll(".board-card[data-card-id]").forEach(V=>{T.set(V.dataset.cardId,V.getBoundingClientRect())}),T}u.useLayoutEffect(()=>{const T=te.current;if(te.current=null,!!T)for(const[V,ve]of T){const he=document.querySelector(`[data-card-id="${V}"]`);if(!he)continue;const Le=he.getBoundingClientRect(),ge=ve.left-Le.left,ct=ve.top-Le.top;!ge&&!ct||(he.style.transition="none",he.style.transform=`translate(${ge}px, ${ct}px)`,he.getBoundingClientRect(),he.style.transition="transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",he.style.transform="")}}),u.useLayoutEffect(()=>{const T=ze.current;T&&(kx(T),!Je.current&&typeof ResizeObserver<"u"&&(Je.current=new ResizeObserver(()=>{ze.current&&kx(ze.current)}),Je.current.observe(T)))}),u.useEffect(()=>()=>{var T;(T=Je.current)==null||T.disconnect(),Je.current=null},[]);const rt=Be.find(T=>T.id===l)||null,$t=T=>((s==null?void 0:s.comments)||[]).filter(V=>V.card_id===T);function it(T,V,ve,he){const Le=T.find(lt=>lt.id===V);if(!Le)return T;const ge=T.filter(lt=>lt.id!==V),ct=ge.filter(lt=>lt.column===ve),dt=ct[Math.min(Math.max(he,0),ct.length)],Qt={...Le,column:ve};if(!dt)return[...ge,Qt];const W=ge.findIndex(lt=>lt.id===dt.id);return[...ge.slice(0,W),Qt,...ge.slice(W)]}function Q(T,V,ve=1/0){o(he=>he&&{...he,cards:it(he.cards,T.id,V,ve)})}async function He(T,V,ve,he=null,Le=!1){try{const ge=await Ee.moveCard(t,T.id,V,ve,he,Le);if(ge.blocked==="parent-not-done"){await Fe(),b({cardId:T.id,action:"move",column:V});return}if(ge.merge_pending){await Fe(),D({card:T,info:ge.merge_pending});return}await Fe()}catch(ge){M(ge.message),await Fe()}}async function ce(T,V){try{await Ee.reorderCard(t,T,V),await Fe()}catch(ve){M(ve.message),await Fe()}}async function Dt(T,V,ve,he=!1){te.current=Ke(),Q(T,V),await He(T,V,ve,null,he)}async function Gt(T){if(T.worktree){let V=null;try{V=await Ee.worktreePreview(t,T.id)}catch{V=null}if(V&&V.merge&&V.merge.ahead>0){D({card:T,info:V.merge});return}}await Dt(T,"done")}async function un(){const T=P;if(T){L(!0);try{await Ee.mergeWorktree(t,T.card.id),D(null),M("已交给 agent 合并:卡片回到开发队列排队,完成后自动回「待审核」"),await Fe()}catch(V){M(V.message)}finally{L(!1)}}}async function dn(){const T=P;T&&(D(null),await Dt(T.card,"done",void 0,!0))}async function kr(T,V){try{await Ee.updateSettings(t,{sort:{[T]:V}}),await Fe()}catch(ve){M(ve.message)}}async function fn(T,V,ve,he){var Le;try{const ge=await Ee.startCard(t,T.id,V,ve,he);if(ge.blocked==="parent-not-done"){b({cardId:T.id,action:"start",worktree:!!he});return}he?M("已在独立 worktree 中开始"):((Le=ge.card)==null?void 0:Le.column)==="blocked"&&M("已加入统一队列排队"),await Fe()}catch(ge){M(ge.message)}}async function Ps(T){let V;try{V=await Ee.worktreePreview(t,T)}catch{V={supported:!1,reason:"无法获取 worktree 预览(后端未重启或接口不可用)"}}return O.current={...O.current,[T]:V},N(O.current),V}function R(T){if(T.session_id)return"该卡片已有主会话,不能切换到独立 worktree";const V=S[T.id];return V&&V.supported===!1?V.reason||"当前项目不支持独立 worktree":""}async function F(T){C({card:T,preview:O.current[T.id]||null});const V=await Ps(T.id);V&&C(ve=>ve&&ve.card.id===T.id?{...ve,preview:V}:ve)}async function ne(T){try{await Ee.deliverAnswer(t,T.id),M("已送达答案"),await Fe()}catch(V){M(V.message)}}async function ae(T){try{await Ee.stopCard(t,T.id),await Fe()}catch(V){M(V.message)}}async function ie(T){try{await Ee.removeCard(t,T.id),a(null),M("已移入回收站(可从回收站还原)"),await Fe()}catch(V){M(V.message)}}const de=u.useRef(fn);de.current=fn;function Re(T){ke.current=T.id,me(T.id),Te(T.title)}function Ve(){ke.current=null,me(null)}async function tt(T){if(ke.current!==T.id)return;const V=Z.trim();if(ke.current=null,me(null),!(!V||V===T.title))try{const ve=await Ee.updateCard(t,T.id,{title:V}),he=jj(ve);he&&M(he),await Fe()}catch(ve){M(ve.message)}}const ot=u.useRef(ns);ot.current=ns;const tn=u.useRef(xs);tn.current=xs;const Tn=u.useRef(ss);Tn.current=ss;const Nt=u.useRef(mo);Nt.current=mo;const nt=u.useRef(He);nt.current=He;const Kt=u.useRef(ce);Kt.current=ce;const Yt=u.useRef(nn);Yt.current=nn;const zt=u.useRef(null),mt=u.useCallback((T,V)=>{T.button===0&&(T.target.closest("button, a, input, textarea, select")||($e.current={id:V.id,sx:T.clientX,sy:T.clientY,on:!1},ue.current=!1,window.addEventListener("pointermove",vs),window.addEventListener("pointerup",Zo)))},[]);function Ct(T,V,ve){var dt,Qt;const he=(Qt=(dt=document.elementFromPoint(T,V))==null?void 0:dt.closest)==null?void 0:Qt.call(dt,".board-col");if(!he)return null;const Le=he.dataset.col,ge=[...he.querySelectorAll(".board-card")].filter(W=>W.dataset.cardId!==String(ve));let ct=ge.length;for(let W=0;W<ge.length;W++){const lt=ge[W].getBoundingClientRect();if(V<lt.top+lt.height/2){ct=W;break}}return{col:Le,index:ct,domIds:ge.map(W=>W.dataset.cardId)}}function nn(T){var V,ve,he;return((he=(ve=(V=Se.current)==null?void 0:V.settings)==null?void 0:ve.sort)==null?void 0:he[T])||(T==="done"?"entered_desc":"manual")}function ts(T,V){const ve=nn(V);if(ve==="manual")return T;const he=[...T];return ve==="created_desc"?he.sort((Le,ge)=>(ge.created_at||"").localeCompare(Le.created_at||"")):ve==="updated_desc"?he.sort((Le,ge)=>(ge.updated_at||"").localeCompare(Le.updated_at||"")):ve==="title"?he.sort((Le,ge)=>(Le.title||"").localeCompare(ge.title||"","zh")):ve==="entered_desc"&&he.sort((Le,ge)=>(ge.done_at||"").localeCompare(Le.done_at||"")),he}function _r(T){const V=d.trim().toLowerCase();return V?(T.title||"").toLowerCase().includes(V)||(T.description||"").toLowerCase().includes(V)||(T.jira_key||"").toLowerCase().includes(V):!0}function ns(T,V){var ct;const ve=fe.current.find(dt=>dt.id===T);oe.current=(ve==null?void 0:ve.column)||null,U.current=((ct=Se.current)==null?void 0:ct.cards)||null,A.current=null;const he=document.querySelector(`[data-card-id="${T}"]`);if(!he)return;const Le=he.getBoundingClientRect(),ge=he.cloneNode(!0);ge.className=ge.className.replace(" drag-gap","")+" board-ghost",Object.assign(ge.style,{position:"fixed",left:Le.left+"px",top:Le.top+"px",width:Le.width+"px",margin:"0",zIndex:999,pointerEvents:"none",opacity:"0.95",transform:"scale(1.04) rotate(1.5deg)",boxShadow:"var(--shadow-ghost)",transition:"none"}),document.body.appendChild(ge),se.current={el:ge,dx:V.clientX-Le.left,dy:V.clientY-Le.top},zt.current=dt=>{dt.key==="Escape"&&(ue.current=!0,$e.current=null,Nt.current(T,-1,-1))},window.addEventListener("keydown",zt.current)}function xs(T){const V=se.current;V&&(V.el.style.left=T.clientX-V.dx+"px",V.el.style.top=T.clientY-V.dy+"px")}function ss(T,V){const ve=A.current;if(ve&&ve.col===V.col&&ve.index===V.index)return;const he=V.col===T.column;he&&V.col!=="doing"&&nn(V.col)!=="manual"||(A.current=V,c(V.col),te.current=Ke(),Q(T,V.col,!he&&nn(V.col)!=="manual"?1/0:V.index))}const vs=u.useRef(T=>{const V=$e.current;if(!V)return;if(!V.on){if(Math.hypot(T.clientX-V.sx,T.clientY-V.sy)<NT)return;V.on=!0,ot.current(V.id,T),Ce(V.id)}tn.current(T);const ve=fe.current.find(Le=>Le.id===V.id);if(!ve)return;const he=Ct(T.clientX,T.clientY,V.id);he&&Tn.current(ve,he)}).current;function mo(T,V,ve){var $n,os,Sn,go,xo,vo;const he=se.current;se.current=null;const Le=he?he.el.getBoundingClientRect():null;he==null||he.el.remove();const ge=Ct(V,ve,T),ct=Ke();Le&&ct.set(String(T),Le),te.current=ct;const dt=U.current;U.current=null,A.current=null,Ce(null),c(null);const Qt=((($n=Se.current)==null?void 0:$n.cards)||[]).find(k=>k.id===T);if(!Qt){Fe();return}const W=oe.current;if(oe.current=null,!ge){dt&&o(k=>k&&{...k,cards:dt});return}if(ge.col==="doing"&&W!=="doing"){dt&&o(k=>k&&{...k,cards:dt}),de.current(Qt);return}if(ge.col===W){if(ge.col==="doing"){const le=new Map((((os=Se.current)==null?void 0:os.cards)||[]).map(ht=>[String(ht.id),ht])),be=(ge.domIds||[]).map(ht=>le.get(ht)).filter(Boolean),Pe=be[ge.index]??null,We=Pe?Nx(Pe)?"prefix":Gi(Pe)?"waiting":"none":"waiting";let Me=null;if(Gi(Qt)&&We==="prefix"?Me="force":Nx(Qt)&&We==="waiting"&&be.slice(0,ge.index).filter(Gi).length>0?Me="stop":Gi(Qt)&&We==="waiting"&&(Me="reorder"),Me==="force"&&!window.confirm("强制运行:立即启动该卡片(落哪算哪)?")&&(Me=null),Me==="stop"&&!window.confirm("停止当前任务?停止后卡片进入待审核。")&&(Me=null),!Me){dt&&o(ht=>ht&&{...ht,cards:dt});return}nt.current(Qt,"doing",void 0,(Pe==null?void 0:Pe.id)??null);return}if(Yt.current(ge.col)!=="manual")return;const k=(((Sn=Se.current)==null?void 0:Sn.cards)||[]).filter(le=>le.column===ge.col&&le.id!==T);Kt.current(T,((go=k[ge.index])==null?void 0:go.id)??null);return}let lt=null;Yt.current(ge.col)==="manual"&&(lt=((vo=(((xo=Se.current)==null?void 0:xo.cards)||[]).filter(le=>le.column===ge.col&&le.id!==T)[ge.index])==null?void 0:vo.id)??null),nt.current(Qt,ge.col,void 0,lt)}const Zo=u.useRef(T=>{const V=$e.current;$e.current=null,window.removeEventListener("pointermove",vs),window.removeEventListener("pointerup",Zo),zt.current&&(window.removeEventListener("keydown",zt.current),zt.current=null),!(!V||!V.on)&&(ue.current=!0,Nt.current(V.id,T.clientX,T.clientY))}).current;function Ms(T){if(ue.current){ue.current=!1;return}Sr(T)}function Et(T){T.unread&&(o(V=>V&&{...V,cards:V.cards.map(ve=>ve.id===T.id?{...ve,unread:!1}:ve)}),Ee.markViewed(t,T.id).catch(()=>{}))}function Sr(T){a(T.id),Et(T)}if(!t)return null;const rs=!!(e!=null&&e.archived),sn=!(e!=null&&e.agent_path);return r.jsxs("div",{className:"board-tab",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-1.5",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"开发看板"}),r.jsx("span",{className:"bug-status pending",children:IT[(ho=s==null?void 0:s.settings)==null?void 0:ho.mode]||"串行"}),r.jsx("span",{className:"flex-1"}),r.jsx(Ae,{className:"board-search",placeholder:"搜索卡片(标题/描述/Jira)",value:d,onChange:T=>f(T.target.value)}),r.jsxs(H,{size:"sm",variant:"outline",onClick:()=>q(!0),children:[r.jsx(W0,{})," 设置"]}),r.jsxs(H,{size:"sm",variant:"outline",title:"回收站(删除的卡片可还原)",onClick:()=>G(!0),children:[r.jsx(Gs,{})," 回收站"]})]}),r.jsx("div",{className:"board-cols",ref:ze,children:TT.map(T=>{const V=m[T.key]||"all",ve=RT.has(T.key)&&V!=="dev"?((s==null?void 0:s.active_tasks)||[]).filter(W=>(W.column||"doing")===T.key):[],he=V!=="test"?Be.filter(W=>W.column===T.key&&_r(W)):[],Le=T.key==="doing"?he:ts(he,T.key),ge=T.key==="doing"?Le.filter(Sx):[],ct=T.key==="doing"?Le.filter(W=>!Sx(W)):[],dt=T.key==="doing"?[...ge,...ct]:Le,Qt=ge.length>0&&ct.length>0?ge.length:-1;return r.jsxs("div",{"data-col":T.key,className:"board-col"+(i===T.key?" dragover":""),children:[r.jsxs("div",{className:"board-col-head",children:[r.jsx("span",{className:"board-col-label",children:T.label}),r.jsx("span",{className:"board-col-count",children:Le.length}),r.jsx("select",{className:"board-col-sort",title:"列表过滤:开发任务=卡片,测试任务=平台测试任务",value:V,onChange:W=>et(T.key,W.target.value),children:MT.map(([W,lt])=>r.jsx("option",{value:W,children:lt},W))}),T.key!=="doing"&&r.jsx("select",{className:"board-col-sort",title:"列内排序方案",value:nn(T.key),onChange:W=>kr(T.key,W.target.value),children:$T(T.key).map(([W,lt])=>r.jsx("option",{value:W,children:lt},W))})]}),r.jsxs("div",{className:"board-col-body",children:[ve.map(W=>r.jsxs("div",{className:"board-task"+(W.session_id?" has-session":""),title:W.session_id?"测试任务 · 点击查看会话":"测试任务(尚无会话)",onClick:()=>{W.session_id&&x(W)},children:[r.jsx("div",{className:"board-card-title",style:{cursor:"default"},onClick:lt=>lt.stopPropagation(),children:W.name}),r.jsxs("div",{className:"board-card-badges",children:[r.jsxs("span",{className:"board-card-id",title:"测试任务 id",children:["任务 #",W.id]}),r.jsxs("span",{className:"bug-status "+(PT[W.status]||"retest"),children:["测试·",ur[W.status]||W.status]}),r.jsx("span",{className:"bug-status pending",children:ET[W.task_type]||W.task_type}),W.current_round>0&&r.jsxs("span",{className:"bug-status pending",children:["轮 ",W.current_round]})]}),W.error&&r.jsx("div",{className:"board-card-err",children:W.error})]},"task-"+W.id)),dt.map((W,lt)=>r.jsxs(u.Fragment,{children:[lt===Qt&&r.jsx("div",{className:"board-runzone",children:r.jsx("span",{children:"等待区 · 按队列顺序"})}),r.jsxs("div",{"data-card-id":W.id,className:`board-card col-${W.column}`+(_e===W.id?" drag-gap":""),onPointerDown:$n=>mt($n,W),onClick:()=>Ms(W),children:[r.jsx(DT,{card:W,editing:B===W.id,editTitle:Z,onStartEdit:Re,onSaveTitle:tt,onEditChange:Te,onCancelEdit:Ve}),r.jsxs("div",{className:"board-card-badges",children:[pT(W)&&r.jsx("span",{className:"board-card-new",title:"状态有更新,打开卡片或点卡片上的按钮后标记消失",children:"有更新"}),r.jsxs("span",{className:"board-card-id",title:"卡片 id",children:["#",W.id]}),!!Ef[W.queue_state]&&r.jsx("span",{className:G0(W.queue_state),children:Ef[W.queue_state]}),W.worktree?r.jsx("span",{className:"bug-status pending",title:W.worktree,children:"🌿 worktree"}):null,W.scheduled_at?r.jsxs("span",{className:"bug-status pending",children:["⏰ ",new Date(W.scheduled_at).toLocaleString()]}):null,W.parent_card_id?r.jsxs("span",{className:"bug-status pending",children:["🔗 依赖 #",W.parent_card_id]}):null,W.block_kind==="interaction"&&r.jsxs("span",{className:"bug-status interaction",title:"agent 等待用户回答,回复后自动恢复",children:["🤔 ",W.block_text||"等待回答"]}),W.block_kind==="manual"&&r.jsx("span",{className:"bug-status retest",children:W.block_text||"手动阻塞"}),W.origin==="sync"&&r.jsx("span",{className:"bug-status pending",children:"同步"}),W.jira_key&&r.jsx("span",{className:"bug-status pending",children:W.jira_key}),r.jsx(LT,{card:W})]}),W.last_error&&r.jsx("div",{className:"board-card-err",children:W.last_error}),r.jsxs("div",{className:"board-card-ops",onClick:$n=>{$n.target.closest("button")&&($n.stopPropagation(),Et(W))},children:[W.column==="todo"&&r.jsxs("div",{className:"board-split",children:[r.jsx(er,{icon:va,iconNarrow:va,label:"开始",variant:"outline",disabled:rs||sn,title:rs?"项目已归档":sn?"未配置智能体":"开始",onClick:()=>fn(W)}),r.jsx(ST,{align:"end",trigger:r.jsx(da,{variant:"outline",disabled:rs||sn,title:rs?"项目已归档":sn?"未配置智能体":"更多开始方式",onClick:()=>Ps(W.id)}),items:[{key:"queue",label:"开始(入队排队)",onSelect:()=>fn(W)},{key:"worktree",label:"🌿 在新 worktree 中开始",disabled:!!R(W),title:R(W)||void 0,onSelect:()=>F(W)}]})]}),W.column==="doing"&&!W.running&&W.block_kind!=="queue"&&r.jsx(er,{icon:Tg,iconNarrow:Tg,label:"待审核",variant:"outline",onClick:()=>Dt(W,"review")}),W.column==="blocked"&&r.jsx(er,{icon:va,iconNarrow:va,label:"重试",variant:"outline",disabled:rs||sn,onClick:()=>fn(W)}),W.answer_pending&&r.jsx(er,{icon:jl,iconNarrow:jl,label:"送达",variant:"ghost",title:"不等项目空闲,立即把答案送达等待中的会话",onClick:()=>ne(W)}),W.block_kind==="queue"&&!W.answer_pending&&r.jsx(er,{icon:jl,iconNarrow:jl,label:"强制",variant:"ghost",title:"跳过队列立即开始(用户自担风险)",disabled:rs||sn,onClick:async()=>{window.confirm("强制开始将跳过队列立即执行,可能与在跑任务冲突,继续?")&&await fn(W,void 0,!0)}}),W.block_kind==="queue"&&r.jsx(er,{icon:vr,iconNarrow:vr,label:"停止",variant:"ghost",title:"取消排队并移入待审核",onClick:()=>ae(W)}),W.column==="review"&&r.jsxs(r.Fragment,{children:[r.jsx(er,{icon:lr,iconNarrow:lr,label:"通过",variant:"outline",onClick:()=>Gt(W)}),r.jsx(er,{icon:wl,iconNarrow:wl,label:"打回",variant:"outline",onClick:()=>{j(W),g("")}})]}),W.column==="done"&&r.jsx(er,{icon:wl,iconNarrow:wl,label:"重开",variant:"outline",onClick:()=>Dt(W,"todo")}),r.jsx(da,{variant:"ghost",title:"打开卡片详情",onClick:()=>Sr(W),children:r.jsx(aC,{})}),r.jsx(da,{variant:"ghost",title:W.session_id?"进入主会话":"尚无会话",disabled:!W.session_id,onClick:()=>Y({sid:W.session_id,cid:W.id,column:W.column,title:W.title||"未命名"}),children:r.jsx(dC,{})}),!!(n!=null&&n.openSession)&&r.jsx(da,{variant:"ghost",title:W.session_id?"在 dsh 界面打开该卡片主会话":"尚无会话",disabled:!W.session_id,onClick:()=>xj(W.session_id),children:r.jsx(om,{})}),r.jsx(da,{variant:"ghost",title:"删除卡片",onClick:()=>ie(W),children:r.jsx(Gs,{})})]})]})]},W.id))]}),T.key==="todo"&&r.jsx(zT,{disabled:rs,project:e,onAdd:async(W,lt,$n)=>{let os=null;try{os=await Ee.createCard(t,{title:W,description:lt})}catch(Sn){M(Sn.message);return}if($n&&(os!=null&&os.id))try{await Ee.startCard(t,os.id),M("已进入开发队列排队")}catch(Sn){M(Sn.message)}await Fe()}})]},T.key)})}),rt&&r.jsx(jT,{project:e,card:rt,comments:$t(rt.id),onClose:()=>a(null),reload:Fe}),z&&r.jsx(Wc,{board:{projectId:t,...z},onClose:()=>Y(null),onSwitchSession:T=>Y(V=>V&&{...V,sid:T})}),h&&r.jsx(Wc,{task:h,onClose:()=>x(null)}),r.jsx(en,{open:!!y,onOpenChange:T=>!T&&j(null),children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{children:r.jsxs(Wt,{children:["打回「",y==null?void 0:y.title,"」"]})}),r.jsx(ps,{rows:4,placeholder:"修改意见(将随会话续发改进)",value:v,onChange:T=>g(T.target.value)}),r.jsx(jn,{children:r.jsx(H,{onClick:async()=>{const T=y;j(null),await fn(T,v)},children:"确认打回"})})]})}),r.jsx(en,{open:!!w,onOpenChange:T=>!T&&b(null),children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{children:r.jsx(Wt,{children:"父任务尚未完成"})}),r.jsx("p",{className:"hint",children:"该卡片有未完成的父任务依赖。建议先完成父任务,或在详情面板解除依赖后再开始。"}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>b(null),children:"取消"}),(w==null?void 0:w.action)==="start"&&r.jsx(H,{onClick:async()=>{const T=w;b(null),await fn(Be.find(V=>V.id===T.cardId),void 0,!0,T.worktree)},children:"强制开始(自担风险)"})]})]})}),r.jsx(en,{open:!!_,onOpenChange:T=>!T&&C(null),children:r.jsxs(Ut,{className:"modal",children:[r.jsx(Vt,{children:r.jsx(Wt,{children:"在新 worktree 中开始"})}),r.jsx("p",{className:"hint",children:"将为该卡片新建独立 git worktree,会话在独立工作树中执行,主仓库不受影响。"}),((Xs=_==null?void 0:_.preview)==null?void 0:Xs.path)&&r.jsxs("p",{className:"hint break-all",children:["路径:",r.jsx("span",{className:"font-mono",children:_.preview.path})]}),((Nr=_==null?void 0:_.preview)==null?void 0:Nr.branch)&&r.jsxs("p",{className:"hint",children:["分支:",r.jsx("span",{className:"font-mono",children:_.preview.branch})]}),r.jsx("p",{className:"hint font-semibold",children:"该卡将立即执行,不与项目队列互斥,可能与项目内其他任务并发。"}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>C(null),children:"取消"}),r.jsx(H,{onClick:async()=>{const T=_;C(null),await fn(T.card,void 0,!1,!0)},children:"开始"})]})]})}),r.jsx(pj,{open:!!P,info:P==null?void 0:P.info,busy:K,disabledReason:(el=P==null?void 0:P.card)!=null&&el.running?"会话运行中:等这一轮跑完,或先点「停止」再交接":"",onHandoff:un,onPass:dn,onClose:()=>!K&&D(null)}),r.jsx(FT,{open:I,onClose:()=>q(!1),projectId:t,settings:s==null?void 0:s.settings,reload:Fe}),ee&&r.jsx(_T,{project:e,onClose:()=>G(!1),onChanged:()=>Fe()})]})}const OT=240;function LT({card:e}){const t=xT(e);return t?r.jsxs("span",{className:"board-card-time",title:vT(e),children:["🕒 ",t]}):null}function DT({card:e,editing:t,editTitle:n,onStartEdit:s,onSaveTitle:o,onEditChange:l,onCancelEdit:a}){const i=u.useRef(null),c=u.useRef(null),[d,f]=u.useState(5);u.useLayoutEffect(()=>{const p=i.current;if(!p)return;const h=()=>{const x=parseFloat(getComputedStyle(p).lineHeight)||19.5;f(Math.max(0,6-Math.round(p.getBoundingClientRect().height/x)))};if(h(),typeof ResizeObserver<"u"){const x=new ResizeObserver(h);return x.observe(p),()=>x.disconnect()}},[e.title,t]);const m=u.useCallback(()=>{const p=c.current;if(!p)return;p.style.height="auto";const h=p.scrollHeight+(p.offsetHeight-p.clientHeight);p.style.height=Math.min(h,OT)+"px"},[]);return u.useLayoutEffect(()=>{t&&m()},[t,m]),t?r.jsxs(r.Fragment,{children:[r.jsx(ps,{ref:c,rows:1,value:n,autoFocus:!0,className:"board-card-title-input min-h-0 resize-none px-1 py-0 text-[calc(13px*var(--fs))] font-semibold leading-[1.5] break-all",onClick:p=>p.stopPropagation(),onChange:p=>{l(p.target.value),m()},onKeyDown:p=>{p.key==="Enter"&&!p.nativeEvent.isComposing?(p.preventDefault(),o(e)):p.key==="Escape"&&a()},onBlur:()=>o(e)}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:i,className:"board-card-title",title:"单击编辑标题",onClick:p=>{p.stopPropagation(),s(e)},children:e.title||r.jsx("span",{className:"board-card-title-empty",children:"未命名"})}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]})}function zT({disabled:e,onAdd:t,project:n}){const[s,o]=u.useState(""),[l,a]=u.useState([]),[i,c]=u.useState(!1),d=u.useRef(null),[f,m]=u.useState(-1),[p,h]=u.useState(!1),[x,y]=u.useState([]);u.useEffect(()=>{if(!(n!=null&&n.agent_path)){y([]);return}let P=!1;return kt.agentSkills(n.agent_path,n.project_dir||n.work_dir||"").then(D=>{if(P)return;const K=Array.isArray(D)?D:(D==null?void 0:D.skills)||[];y(K.map(L=>({key:L.name||L.id,label:L.name||L.id,desc:(L.description||L.summary||"").slice(0,40),type:"skill"})))}).catch(()=>{}),()=>{P=!0}},[n==null?void 0:n.id,n==null?void 0:n.agent_path,n==null?void 0:n.project_dir,n==null?void 0:n.work_dir]);function j(){const P=d.current;P&&(P.style.height="auto",P.style.height=Math.min(P.scrollHeight,120)+"px")}async function v(P){const D=Array.from(P||[]);if(!D.length||i)return;const K=n==null?void 0:n.id;if(K)for(const L of D){if(L.size>CT){M(`附件过大(>10MB):${L.name}`);continue}if(await pm(L)){M(`已跳过占位图(极小尺寸):${L.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}c(!0);try{const I=await new Promise((G,z)=>{const Y=new FileReader;Y.onload=()=>G(String(Y.result||"").split(",")[1]||""),Y.onerror=()=>z(new Error("文件读取失败")),Y.readAsDataURL(L)}),q=await Ee.uploadMedia(K,{name:L.name,mime:L.type||"application/octet-stream",data:I}),ee=(L.type||"").startsWith("image/")?``:`[${L.name}](${q.abs||q.url})`;a(G=>[...G,{md:ee,url:fm(q.url),name:L.name,mime:L.type}]),M(`已添加附件:${L.name}`)}catch(I){M(I.message||"附件上传失败")}finally{c(!1)}}}function g(P){var K;const D=Array.from(((K=P.clipboardData)==null?void 0:K.items)||[]).filter(L=>L.kind==="file").map(L=>L.getAsFile()).filter(Boolean);D.length&&(P.preventDefault(),v(D))}function w(P){var K;const D=Array.from(((K=P.dataTransfer)==null?void 0:K.files)||[]);D.length&&(P.preventDefault(),v(D))}function b(P){a(D=>D.filter(K=>K.md!==P))}u.useEffect(()=>{const P=d.current;if(!P)return;const D=()=>m(P.selectionStart??0),K=()=>{m(P.selectionStart??0),h(!1)};return P.addEventListener("keyup",D),P.addEventListener("click",K),()=>{P.removeEventListener("keyup",D),P.removeEventListener("click",K)}},[]);const S=u.useMemo(()=>mj(s,f>=0?f:s.length),[s,f]),N=S!=null&&!p,_=S?S.text.slice(1):"";function C(P){if(!S)return;const D=`使用 skill「${P.label}」`;h(!0),o(L=>L.slice(0,S.start)+D+L.slice(S.start+S.text.length));const K=S.start+D.length;m(K),requestAnimationFrame(()=>{const L=d.current;L&&(L.selectionStart=L.selectionEnd=K),j()})}async function O(P=!1){if(i)return;const D=s.indexOf(`
|
|
474
|
-
`),K=(D<0?s:s.slice(0,D)).trim(),L=(D<0?"":s.slice(D+1)).trim(),I=l.map(ee=>ee.md).join(`
|
|
475
|
-
|
|
476
|
-
`),q=[L,I].filter(Boolean).join(`
|
|
477
|
-
|
|
478
|
-
`);o(""),a([]),requestAnimationFrame(j),await t(K,q,P)}return r.jsxs("div",{className:"board-add",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[(l.length>0||i)&&r.jsxs("div",{className:"sess-attachrow",children:[i&&r.jsx("span",{className:"sess-chip",children:"附件上传中…"}),l.map((P,D)=>r.jsxs("span",{className:"sess-chip",title:P.name,children:[(P.mime||"").startsWith("image/")&&P.url?r.jsx("img",{src:P.url,alt:P.name}):r.jsx(B0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:P.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>b(P.md),children:r.jsx(vr,{className:"h-3 w-3"})})]},P.md+D))]}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(lj,{open:N,query:_,items:x,onSelect:C,onClose:()=>h(!0)}),r.jsx(ps,{ref:d,rows:1,style:{minHeight:36},className:"resize-none",placeholder:"添加任务…(Enter 落待开发 / Ctrl+Enter 直接排队;可粘贴图片,可留空)",value:s,disabled:e,onChange:P=>{o(P.target.value),m(P.target.selectionStart??P.target.value.length),h(!1),j()},onPaste:g,onDrop:w,onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&!P.nativeEvent.isComposing&&(P.preventDefault(),O(P.ctrlKey))}})]})]}),r.jsx(H,{size:"sm",variant:"outline",disabled:e||i,onClick:()=>O(),children:r.jsx(ai,{})})]})}function FT({open:e,onClose:t,projectId:n,settings:s,reload:o}){const[l,a]=u.useState("serial"),[i,c]=u.useState({url:"",user:"",token:""}),[d,f]=u.useState(!1),[m,p]=u.useState(!1),h=u.useRef(!1);u.useEffect(()=>{e&&!h.current&&s&&(h.current=!0,a(s.mode||"serial"),c(s.jira||{url:"",user:"",token:""})),e||(h.current=!1)},[e]);async function x(g){a(g);try{await Ee.updateSettings(n,{mode:g}),await o()}catch(w){M(w.message)}}async function y(){try{await Ee.updateSettings(n,{jira:i}),M("Jira 配置已保存"),await o()}catch(g){M(g.message)}}async function j(){f(!0);try{const g=await Ee.jiraTest(n,i);M(g.ok?`连接成功:${g.name}`:`连接失败:${g.error}`)}catch(g){M(g.message)}finally{f(!1)}}async function v(){p(!0);try{const g=await Ee.jiraImport(n);M(`导入完成:新增 ${g.added},跳过 ${g.skipped}`),await o()}catch(g){M(g.message)}finally{p(!1)}}return r.jsx(en,{open:e,onOpenChange:g=>!g&&t(),children:r.jsxs(Ut,{className:"modal w-[560px] sm:max-w-[92vw]",children:[r.jsx(Vt,{children:r.jsx(Wt,{children:"看板设置"})}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"ℹ 并行模式"}),[["serial","串行:同时只跑一个任务"],["parallel","并行:最多 5 个并行(队列窗口)"]].map(([g,w])=>r.jsxs("label",{className:"flex items-center gap-2 py-1 text-sm",children:[r.jsx("input",{type:"radio",name:"board-mode",checked:l===g,onChange:()=>x(g)}),w]},g))]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🐛 Jira"}),r.jsxs("div",{className:"form-col gap-2",children:[r.jsx(Ae,{placeholder:"Jira 地址(如 https://xx.atlassian.net)",value:i.url,onChange:g=>c({...i,url:g.target.value})}),r.jsx(Ae,{placeholder:"用户名(邮箱)",value:i.user,onChange:g=>c({...i,user:g.target.value})}),r.jsx(Ae,{placeholder:"API token",type:"password",value:i.token,onChange:g=>c({...i,token:g.target.value})})]}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[r.jsx(H,{size:"sm",variant:"outline",onClick:y,children:"保存配置"}),r.jsx(H,{size:"sm",variant:"outline",disabled:d,onClick:j,children:"测试连接"}),r.jsx(H,{size:"sm",disabled:m,onClick:v,children:"导入我的待办"})]}),r.jsx("div",{className:"hint mt-1",children:"导入 = 拉取「指派给我且未解决」的前 50 条建卡(按 key 去重);凭据存服务端"})]})]})})}const BT=/^(\d{1,2}(?:\.\d{1,2})*)[.)、]?\s+/,HT=/^([^::]{1,24})[::]\s*(.*)$/;function bj(e){return e.ownerDocument.createTreeWalker(e,4).nextNode()}function UT(e){const t=e.querySelector("h1");if(!t)return{title:"",meta:[]};const n=t.textContent.trim();t.remove();const s=e.firstElementChild;if(!s||s.tagName!=="UL")return{title:n,meta:[]};const o=[];for(const a of[...s.children]){const i=bj(a);if(!i)return{title:n,meta:[]};const c=i.data.match(HT);if(!c)return{title:n,meta:[]};o.push([i,c])}if(o.length<2)return{title:n,meta:[]};const l=o.map(([a,i])=>(a.data=i[2],{k:i[1].trim(),v:a.parentElement.innerHTML}));return s.remove(),{title:n,meta:l}}function kj(e,t){const n=t||{},s=String(e||""),o=Fo(s);if(typeof DOMParser>"u")return{html:o,title:"",meta:[],outline:[]};const l=new DOMParser().parseFromString("<body>"+o+"</body>","text/html"),a=l.body;for(const f of[...a.querySelectorAll("table")]){const m=l.createElement("div");m.className="md-table-wrap",f.replaceWith(m),m.appendChild(f)}let i="",c=[];if(n.extractHeader){const f=UT(a);i=f.title,c=f.meta}const d=[];return a.querySelectorAll("h1, h2, h3, h4").forEach((f,m)=>{const p="md-h-"+m;f.id=p;let h="";const x=bj(f);if(x){const j=x.data.match(BT);j&&(h=j[1],x.data=x.data.slice(j[0].length))}const y=f.textContent.trim();if(h){const j=l.createElement("span");j.className="md-sec-no",j.textContent=h,f.insertBefore(j,f.firstChild)}d.push({id:p,level:Number(f.tagName.slice(1)),no:h,text:y})}),{html:a.innerHTML,title:i,meta:c,outline:d}}const VT={script:"自定义脚本(run.py)",scenario:"声明式场景(scenario.json)",legacy_scenario:"存量场景(旧布局 load/scenario_<id>.json)"};function kd({title:e,note:t,children:n}){return r.jsxs("details",{className:"lp-fold",children:[r.jsxs("summary",{children:[r.jsx("span",{className:"lp-fold-t",children:e}),t&&r.jsx("span",{className:"lp-fold-n",children:t})]}),r.jsx("div",{className:"lp-fold-body",children:n})]})}function WT({task:e}){var x,y;const[t,n]=u.useState(null),[s,o]=u.useState(""),[l,a]=u.useState(""),i=u.useRef(null);u.useEffect(()=>{if(!(e!=null&&e.id))return;let j=!1;return o(""),Ue.loadCase(e.id).then(v=>{j||n(v)}).catch(v=>{j||o(v.message)}),()=>{j=!0}},[e==null?void 0:e.id,e==null?void 0:e.status]);const c=u.useMemo(()=>kj((t==null?void 0:t.plan_md)||"",{extractHeader:!0}),[t==null?void 0:t.plan_md]);u.useEffect(()=>{const j=i.current,v=c.outline;if(!j||!v.length){a("");return}const g=v.map(C=>j.querySelector("#"+C.id)).filter(Boolean);if(!g.length){a("");return}let w=j.parentElement;for(;w&&w!==document.body&&!(/(auto|scroll)/.test(getComputedStyle(w).overflowY)&&w.scrollHeight>w.clientHeight+20);)w=w.parentElement;let b=0;const S=()=>{b=0;const C=(w?w.getBoundingClientRect().top:0)+120;let O=g[0];for(const P of g)if(P.getBoundingClientRect().top<=C)O=P;else break;a(O.id)},N=()=>{b||(b=requestAnimationFrame(S))};S();const _=w||window;return _.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N),()=>{b&&cancelAnimationFrame(b),_.removeEventListener("scroll",N),window.removeEventListener("resize",N)}},[c]);function d(j){var w,b,S;const v=(w=i.current)==null?void 0:w.querySelector("#"+j);if(!v)return;const g=(S=(b=window.matchMedia)==null?void 0:b.call(window,"(prefers-reduced-motion: reduce)"))==null?void 0:S.matches;v.scrollIntoView({block:"start",behavior:g?"auto":"smooth"}),a(j)}if(s)return r.jsxs("div",{className:"hint",children:["方案读取失败:",s]});if(!t)return r.jsx("div",{className:"hint",children:"正在读取方案包…"});const f=t.charts?JSON.stringify(t.charts,null,2):"",m=(c.outline||[]).filter(j=>j.level>=2&&j.level<=3),p=c.title||(e==null?void 0:e.name)||`任务 #${e==null?void 0:e.id}`,h=t.plan_found&&(t.plan_md||"").length>400&&!c.outline.length&&!/<(ul|ol|table)[ >]/.test(c.html);return r.jsxs("div",{className:"lp-plan",children:[h&&r.jsx("div",{className:"hint lp-warn",children:"这份方案正文没有 markdown 结构(无标题 / 列表 / 表格)——页面只渲染 Markdown, 纯文本方案会挤成一整段;建议让 agent 按《方案文档模板》重写 plan.md。"}),r.jsxs("div",{className:"lp-doc"+(m.length>=3?" has-rail":""),children:[m.length>=3&&r.jsxs("nav",{className:"lp-doc-rail","aria-label":"方案目录",children:[r.jsx("div",{className:"lp-doc-rail-t",children:"目录"}),r.jsx("ol",{children:m.map(j=>r.jsx("li",{className:j.level>2?"sub":"",children:r.jsxs("a",{href:"#"+j.id,className:l===j.id?"on":"",onClick:v=>{v.preventDefault(),d(j.id)},children:[r.jsx("span",{className:"no",children:j.no||"·"}),r.jsx("span",{className:"t",children:j.text})]})},j.id))})]}),r.jsxs("article",{className:"lp-doc-main",children:[r.jsxs("header",{className:"lp-doc-head",children:[r.jsxs("div",{className:"lp-doc-eyebrow",children:[r.jsxs("span",{className:"lp-doc-kind",children:["压测方案 · #",e==null?void 0:e.id]}),r.jsxs("span",{className:"lp-doc-chips",children:[r.jsx("span",{className:"lp-chip"+(t.found?" on":" off"),children:t.found?VT[t.driver]||t.driver:"未找到执行载体"}),r.jsx("span",{className:"lp-chip",children:(y=(x=t.charts)==null?void 0:x.panels)!=null&&y.length?`面板 ${t.charts.panels.length} 个`:"默认面板"}),t.has_html&&r.jsx("span",{className:"lp-chip",children:"自定义视图 ✓"})]})]}),r.jsx("h1",{className:"lp-doc-title",children:p}),c.meta.length>0&&r.jsx("dl",{className:"lp-doc-meta",children:c.meta.map((j,v)=>r.jsxs("div",{className:"lp-doc-meta-row",children:[r.jsx("dt",{children:j.k}),r.jsx("dd",{dangerouslySetInnerHTML:{__html:j.v}})]},v))})]}),t.plan_found?r.jsx("div",{className:"lp-doc-body md-body",ref:i,dangerouslySetInnerHTML:{__html:c.html}}):r.jsx("div",{className:"lp-doc-body",ref:i,children:r.jsxs("div",{className:"lp-empty-state",children:[r.jsx("div",{className:"lp-empty-t",children:"本任务未生成方案文档"}),r.jsxs("p",{children:[r.jsx("code",{children:"plan.md"})," 由压测第 1 轮的 agent 产出,用来回答「压谁、压多狠、 看什么、怎么算通过」。它缺失不影响发压执行,但发压前就没有可复核的书面方案—— 可在方案包目录 ",r.jsxs("code",{children:["load/task_",e==null?void 0:e.id,"/"]})," 下补一份 Markdown 方案。"]})]})})]})]}),!t.found&&r.jsxs("div",{className:"hint lp-warn",children:["本任务的方案包缺失(需在 <案例库根>/load/task_",e==null?void 0:e.id,"/ 下生成 run.py 或 scenario.json);发压轮会因此失败。"]}),t.charts_error&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,面板已回退默认:",t.charts_error]}),r.jsxs("div",{className:"lp-doc-appendix",children:[t.script_text&&r.jsx(kd,{title:"执行载体源码",note:t.script_name,children:r.jsx("pre",{className:"lp-code",children:t.script_text})}),f&&r.jsx(kd,{title:"图表声明",note:"charts.json",children:r.jsx("pre",{className:"lp-code",children:f})}),r.jsx(kd,{title:"指标口径速查",note:"写脚本 / 声明图表时对照",children:r.jsxs("ul",{className:"lp-tips",children:[r.jsxs("li",{children:[r.jsx("code",{children:"gauge"}),":瞬时值(rps / lat.p50·p90·p95·p99 / err.rate / conc)"]}),r.jsxs("li",{children:[r.jsx("code",{children:"counter"}),":单调递增累计值(req.total / 业务计数),面板按窗口增量或速率画"]}),r.jsxs("li",{children:[r.jsx("code",{children:"labels"}),":维度字典(如 ",r.jsx("code",{children:'{"status":"已成交"}'}),"), 同一 metric 靠它区分序列;",r.jsx("code",{children:"groupBy"})," 指定的就是这里的键"]}),r.jsxs("li",{children:[r.jsx("code",{children:"summary"}),":收尾 KPI 行,供单值卡与报告使用"]})]})})]})]})}const qT={running:"进行中",done:"成功",failed:"失败",stopped:"已停止",interrupted:"被中断",unknown:"历史(未登记)"};function GT(e,t){const n=((e==null?void 0:e.started_at)||"").slice(5,16)||((e==null?void 0:e.run_key)||"").replace("_"," ");return`${e!=null&&e.registered?`运行 #${t+1}`:"历史报告"} · ${n} · ${qT[e==null?void 0:e.status]||(e==null?void 0:e.status)||"未知"}`}const KT=1200;function YT(e,t){const n=Object.keys(t||{}).sort();return e+"|"+n.map(s=>`${s}=${t[s]}`).join(",")}function Cx(e=KT){const t=new Map;return{add(n){if(!n||typeof n.metric!="string")return!1;const s=Number(n.value);if(!Number.isFinite(s))return!1;const o=Number(n.ts),l=YT(n.metric,n.labels);let a=t.get(l);return a||(a={key:l,metric:n.metric,labels:n.labels||{},type:n.type==="counter"?"counter":"gauge",points:[]},t.set(l,a)),a.points.push([Number.isFinite(o)?o:Date.now()/1e3,s]),a.points.length>e&&a.points.shift(),!0},list(){return[...t.values()]},size(){return t.size},clear(){t.clear()}}}function QT(e,t){if(!t)return!0;const n=e||{};return Object.entries(t).every(([s,o])=>String(n[s])===String(o))}function Am(e,t,n){const s=e.list().filter(l=>l.metric===t);if(!s.length)return null;if(n)return s.find(l=>QT(l.labels,n))||null;const o=s.find(l=>!Object.keys(l.labels).length);return o||s.sort((l,a)=>l.key.localeCompare(a.key))[0]}function XT(e,t){return e.list().filter(n=>n.metric===t&&Object.keys(n.labels).length)}function Su(e,t={}){const n=Number(t.scale)||1,s=e.points;if(e.type!=="counter")return s.map(([l,a])=>[l,a*n]);const o=[];for(let l=1;l<s.length;l+=1){const a=s[l][0]-s[l-1][0];if(a<=0)continue;const i=s[l][1]-s[l-1][1];o.push([s[l][0],(t.rate?i/a:i)*n])}return o}function Om(e,t,n="last"){if(!e.length||t<=0)return e.slice();const s=new Map;return e.forEach(([o,l])=>{const a=Math.floor(o/t)*t,i=s.get(a);i?(i.sum+=l,i.n+=1,i.last=l):s.set(a,{t:a,sum:l,n:1,last:l})}),[...s.entries()].sort((o,l)=>o[0]-l[0]).map(([o,l])=>n==="avg"?[o,l.sum/l.n]:n==="sum"?[o,l.sum]:[o,l.last])}function JT(e,t=600){if(e.length<=t)return e;const n=e.length/t,s=[];for(let l=0;l<t;l+=1)s.push(e[Math.floor(l*n)]);const o=e[e.length-1];return s[s.length-1]!==o&&s.push(o),s}function _j(e,t,n){const s=[];return e.list().filter(o=>o.metric===t).forEach(o=>{var a;if(!o.points.length)return;const l=n?(a=o.labels)==null?void 0:a[n]:Object.values(o.labels||{})[0]??"全部";s.push({label:String(l??"全部"),value:o.points[o.points.length-1][1],labels:o.labels||{}})}),s.sort((o,l)=>l.value-o.value)}function ZT(e,t="last",n=1){if(!e||!e.points.length)return null;const s=e.points.map(([,l])=>l);let o;return t==="avg"?o=s.reduce((l,a)=>l+a,0)/s.length:t==="max"?o=Math.max(...s):t==="min"?o=Math.min(...s):t==="sum"?o=s.reduce((l,a)=>l+a,0):o=s[s.length-1],o*(Number(n)||1)}function Vo(e,t){if(e==null||!Number.isFinite(e))return"—";if(t!=null&&t!=="")return Number(e).toFixed(Number(t));const n=Math.abs(e);return n>=1e3?Math.round(e).toLocaleString("en-US"):n>=10?e.toFixed(1):n>=1?e.toFixed(2):n===0?"0":e.toFixed(3)}function Lm(e){let t=1/0,n=-1/0;return e.forEach(s=>s.forEach(([o])=>{o<t&&(t=o),o>n&&(n=o)})),n>t?n-t:0}function Dm(e,t=600){return!e||e<=0?1:Math.max(1,Math.ceil(e/t))}const Yn=["var(--run)","var(--retest)","var(--fail)","var(--pass)","var(--fix)","var(--seq-4)","var(--seq-5)","var(--seq-6)"],Jr=640,Zr=150,Bt={l:48,r:10,t:10,b:18},ep=600,e$=40;function eo({text:e="暂无数据(本轮尚未产生该指标)"}){return r.jsx("div",{className:"lp-empty hint",children:e})}function Sj(e,t,n,s){const o=t-e,l=s-n;return{x:a=>Bt.l+(o>0?(a-e)/o:.5)*(Jr-Bt.l-Bt.r),y:a=>Zr-Bt.b-(l>0?(a-n)/l:.5)*(Zr-Bt.t-Bt.b)}}function zm({scale:e,vmin:t,vmax:n}){const s=[t,(t+n)/2,n];return r.jsx("g",{children:s.map((o,l)=>r.jsxs("g",{children:[r.jsx("line",{x1:Bt.l,x2:Jr-Bt.r,y1:e.y(o),y2:e.y(o),stroke:"var(--border)",strokeWidth:"0.5",strokeDasharray:"3 3"}),r.jsx("text",{x:Bt.l-4,y:e.y(o)+3,textAnchor:"end",style:{fontSize:9,fill:"var(--dim)"},children:Vo(o)})]},l))})}function t$({panel:e,store:t}){const n=(e.series||[]).map((m,p)=>{const h=Am(t,m.metric,m.match),x=h?Su(h,{scale:m.scale,rate:h.type==="counter"}):[],y=Dm(Lm([x]),ep);return{label:m.label||m.metric,color:Yn[p%Yn.length],points:JT(Om(x,y,h&&h.type==="gauge"?"last":"sum"),ep),suffix:h&&h.type==="counter"?"/s":""}}),s=n.flatMap(m=>m.points);if(!s.length)return r.jsx(eo,{});const o=s.map(m=>m[0]),l=s.map(m=>m[1]),[a,i]=[Math.min(...o),Math.max(...o)],c=Math.max(...l,0),d=Math.min(...l,0),f=Sj(a,i,d,c);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Jr} ${Zr}`,className:"lp-svg",children:[r.jsx(zm,{scale:f,vmin:d,vmax:c}),n.map(m=>r.jsx("polyline",{fill:"none",strokeWidth:"1.6",stroke:m.color,points:m.points.map(([p,h])=>`${f.x(p)},${f.y(h)}`).join(" ")},m.label))]}),r.jsx("div",{className:"lp-legend",children:n.map(m=>r.jsxs("span",{children:[r.jsx("i",{style:{background:m.color}}),m.label,m.suffix]},m.label))})]})}function n$({panel:e,store:t}){if(e.by==="label"||!e.by&&e.groupBy){const m=_j(t,e.metric,e.groupBy);if(!m.length)return r.jsx(eo,{});const p=Math.max(...m.map(h=>h.value),1);return r.jsx("div",{className:"lp-bars",children:m.map((h,x)=>r.jsxs("div",{className:"lp-bar-row",children:[r.jsx("span",{className:"lb",title:h.label,children:h.label}),r.jsx("span",{className:"lt",children:r.jsx("i",{style:{width:`${h.value/p*100}%`,background:Yn[x%Yn.length]}})}),r.jsx("span",{className:"lv",children:Vo(h.value,e.precision)})]},h.label))})}const n=Am(t,e.metric);if(!n)return r.jsx(eo,{});const s=n.type==="counter",o=Su(n,{scale:e.scale,rate:s}),l=Dm(Lm([o]),ep/4),a=Om(o,l,s?"sum":"avg");if(!a.length)return r.jsx(eo,{});const i=a.map(m=>m[0]),c=a.map(m=>m[1]),d=Sj(Math.min(...i),Math.max(...i),0,Math.max(...c,1)),f=Math.max(1,(Jr-Bt.l-Bt.r)/a.length*.7);return r.jsxs("svg",{viewBox:`0 0 ${Jr} ${Zr}`,className:"lp-svg",children:[r.jsx(zm,{scale:d,vmin:0,vmax:Math.max(...c,1)}),a.map(([m,p])=>r.jsx("rect",{x:d.x(m)-f/2,y:d.y(p),width:f,height:Zr-Bt.b-d.y(p),fill:Yn[0],opacity:"0.85"},m))]})}function s$({panel:e,store:t}){const s=XT(t,e.metric).map(x=>{var y;return{label:String(((y=x.labels)==null?void 0:y[e.groupBy])??Object.values(x.labels)[0]??"?"),type:x.type,points:Su(x,{rate:!1})}}).filter(x=>x.points.length);if(!s.length)return r.jsx(eo,{});const o=Lm(s.map(x=>x.points)),l=Math.max(Dm(o,e$),1),a=new Map;s.forEach(x=>{Om(x.points,l,x.type==="counter"?"sum":"avg").forEach(([y,j])=>{a.has(y)||a.set(y,{}),a.get(y)[x.label]=j})});const i=[...a.keys()].sort((x,y)=>x-y),c=i.map(x=>Object.values(a.get(x)).reduce((y,j)=>y+j,0)),d=Math.max(...c,1),f=s.map(x=>x.label),m=Math.max(1,(Jr-Bt.l-Bt.r)/i.length*.7),p=x=>Bt.l+(x-i[0])/Math.max(i[i.length-1]-i[0],1)*(Jr-Bt.l-Bt.r),h=x=>Zr-Bt.b-x/d*(Zr-Bt.t-Bt.b);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Jr} ${Zr}`,className:"lp-svg",children:[r.jsx(zm,{scale:{x:p,y:h},vmin:0,vmax:d}),i.map(x=>{let y=0;return r.jsx("g",{children:f.map((j,v)=>{const g=a.get(x)[j]||0,w=h(y);y+=g;const b=h(y);return g>0?r.jsx("rect",{x:p(x)-m/2,y:b,width:m,height:w-b,fill:Yn[v%Yn.length],opacity:"0.9"},j):null})},x)})]}),r.jsx("div",{className:"lp-legend",children:f.map((x,y)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Yn[y%Yn.length]}}),x]},x))})]})}function r$({panel:e,store:t}){const n=_j(t,e.metric,e.groupBy),s=n.reduce((i,c)=>i+Math.max(c.value,0),0);if(!n.length||s<=0)return r.jsx(eo,{});const o=52,l=2*Math.PI*o;let a=0;return r.jsxs("div",{className:"lp-donut",children:[r.jsxs("svg",{viewBox:"0 0 140 140",className:"lp-donut-svg",children:[r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:"var(--border)",strokeWidth:"18"}),n.map((i,c)=>{const d=Math.max(i.value,0)/s,f=`${d*l} ${l}`,m=-a*l;return a+=d,r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:Yn[c%Yn.length],strokeWidth:"18",strokeDasharray:f,strokeDashoffset:m,transform:"rotate(-90 70 70)"},i.label)}),r.jsx("text",{x:"70",y:"74",textAnchor:"middle",style:{fontSize:15,fill:"var(--foreground)"},children:Vo(s)})]}),r.jsx("div",{className:"lp-legend col",children:n.map((i,c)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Yn[c%Yn.length]}}),i.label," ",r.jsx("b",{children:Vo(i.value)}),r.jsxs("em",{children:[(i.value/s*100).toFixed(1),"%"]})]},i.label))})]})}function o$({panel:e,store:t}){const n=(e.stats||[]).map(s=>{const o=Am(t,s.metric,s.match);return{...s,value:ZT(o,s.agg,s.scale)}});return r.jsx("div",{className:"lp-stats",children:n.map(s=>r.jsxs("div",{className:"lp-stat",children:[r.jsx("div",{className:"k",children:s.label||s.metric}),r.jsxs("div",{className:"v",children:[Vo(s.value,s.precision),s.unit?r.jsx("span",{className:"u",children:s.unit}):null]})]},s.metric+(s.label||"")))})}function l$({panel:e,store:t}){const n=t.list().filter(a=>a.metric===e.metric);if(!n.length)return r.jsx(eo,{});const s=e.groupBy||null,o=n.map(a=>{var m;const i=a.points.length?a.points[a.points.length-1][1]:null,c=Su(a,{rate:a.type==="counter"}),d=c.length?c[c.length-1][1]:null,f=s?(m=a.labels)==null?void 0:m[s]:Object.values(a.labels||{}).join(" / ")||"全部";return{dim:String(f??"全部"),labels:a.labels||{},last:i,rate:d,type:a.type}}),l=o.some(a=>a.type==="counter");return r.jsx("div",{className:"lp-table-wrap",children:r.jsxs("table",{className:"lp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:s||"维度"}),r.jsx("th",{style:{textAlign:"right"},children:"最新值"}),l&&r.jsx("th",{style:{textAlign:"right"},children:"速率 /s"})]})}),r.jsx("tbody",{children:o.map(a=>r.jsxs("tr",{children:[r.jsx("td",{title:JSON.stringify(a.labels),children:a.dim}),r.jsx("td",{style:{textAlign:"right"},children:Vo(a.last)}),l&&r.jsx("td",{style:{textAlign:"right"},children:Vo(a.rate)})]},a.dim+JSON.stringify(a.labels)))})]})})}function a$({panel:e,store:t}){const n={panel:e,store:t};return e.type==="line"?r.jsx(t$,{...n}):e.type==="bar"?r.jsx(n$,{...n}):e.type==="stacked_bar"?r.jsx(s$,{...n}):e.type==="donut"?r.jsx(r$,{...n}):e.type==="stat"?r.jsx(o$,{...n}):e.type==="table"?r.jsx(l$,{...n}):r.jsx(eo,{text:`未支持的面板类型:${e.type}`})}const i$=2e3,c$=40;function u$({task:e,store:t}){const n=u.useRef(null),s=e==null?void 0:e.id;function o(){const l=n.current&&n.current.contentWindow;if(!l)return;const a=t.list().slice(0,c$).map(i=>({metric:i.metric,labels:i.labels,type:i.type,points:i.points.slice(-300)}));l.postMessage({type:"ts.metrics",task:s,series:a},"*")}return u.useEffect(()=>{if(!s)return;const l=setInterval(o,i$);return()=>clearInterval(l)},[s,t]),s?r.jsxs("section",{className:"lp-panel full lp-hatch",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"自定义视图(panel.html)"}),r.jsx("span",{className:"hint",children:"沙箱 iframe:读不到站点数据,只能消费 postMessage 推入的指标"})]}),r.jsx("iframe",{ref:n,sandbox:"allow-scripts",title:"自定义压测视图",className:"lp-hatch-frame",src:Ue.loadCustomHtmlUrl(s),onLoad:o})]}):null}const d$=1e3,f$=2e4,p$=20;function Nj({task:e,run:t="",live:n}){const[s,o]=u.useState(null),[l,a]=u.useState(""),[i,c]=u.useState(!1),[d,f]=u.useState(!0),[m,p]=u.useState(""),[,h]=u.useState(0),x=u.useRef(Cx()),y=e==null?void 0:e.id,j=n===void 0?(e==null?void 0:e.status)==="running"&&!t:!!n;u.useEffect(()=>{if(!y)return;let g=!1;return f(!0),p(""),Ue.loadCase(y).then(w=>{g||(o(w.charts||null),a(w.charts_error||""),c(!!w.has_html),f(!1))}).catch(w=>{g||(p(w.message),f(!1))}),()=>{g=!0}},[y,j]),u.useEffect(()=>{if(!y||!s)return;x.current=Cx(),h(b=>b+1);let g=!1;const w=()=>{g||h(b=>b+1)};if(j){const b=Ue.loadStream(y,t),S=setInterval(w,d$);return b.onmessage=N=>{try{const _=JSON.parse(N.data);if(_.done){b.close(),clearInterval(S),w();return}x.current.add(_)}catch{}},()=>{g=!0,b.close(),clearInterval(S)}}return(async()=>{let b=0;for(let S=0;S<p$;S+=1){const N=await Ue.loadMetrics(y,b,f$,t);if(g)return;const _=N.samples||[];if(_.forEach(C=>x.current.add(C)),!_.length||N.next<=b)break;b=N.next}w()})().catch(b=>{g||p(b.message)}),()=>{g=!0}},[y,j,s,t]);const v=(s==null?void 0:s.panels)||[];return r.jsxs("div",{className:"lp-dash",children:[l&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,已回退默认面板:",l]}),m&&r.jsxs("div",{className:"hint lp-warn",children:["指标加载失败:",m]}),d&&!v.length?r.jsx("div",{className:"hint",children:"正在读取方案包…"}):r.jsx("div",{className:"lp-grid",children:v.map(g=>r.jsxs("section",{className:"lp-panel "+(g.width==="full"?"full":"half"),children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:g.title}),g.hint&&r.jsx("span",{className:"hint",children:g.hint})]}),r.jsx(a$,{panel:g,store:x.current})]},g.id))}),i&&r.jsx(u$,{task:e,store:x.current})]})}const m$=5e3,h$=2e3;function g$(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/STRESS_DONE|ROUND_DONE|LOAD 总请求/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}function x$({task:e}){const[t,n]=u.useState([]),[s,o]=u.useState(""),[l,a]=u.useState(0),[i,c]=u.useState(""),[d,f]=u.useState(null),m=u.useRef(null),p=u.useRef(!0),h=e==null?void 0:e.id,x=(e==null?void 0:e.status)==="running",y=e==null?void 0:e.ended_at;u.useEffect(()=>{if(!h)return;let _=!1;return Ue.loadRuns(h).then(C=>{if(_)return;const O=C.runs||[];n(O),o(P=>O.some(D=>D.run_key===P)?P:O.length?O[0].run_key:"")}).catch(()=>{_||n([])}),()=>{_=!0}},[h,x,y,l]);const j=t.findIndex(_=>_.run_key===s),v=j>=0?t[j]:t[0]||null,g=(v==null?void 0:v.run_key)||"",w=(v==null?void 0:v.status)==="running",b=(v==null?void 0:v.round_no)||0;u.useEffect(()=>{if(!h||!b){c("");return}let _=!1;const C=async()=>{const P=m.current;p.current=P?P.scrollHeight-P.scrollTop-P.clientHeight<60:!0;try{const D=await Ue.log(h,b,m$);_||c(K=>K===D.log?K:D.log)}catch{_||c("")}};C();const O=setInterval(C,h$);return()=>{_=!0,clearInterval(O)}},[h,b,l]),u.useEffect(()=>{const _=m.current;_&&p.current&&(_.scrollTop=_.scrollHeight)},[i]),u.useEffect(()=>{if(!h||w){f(null);return}let _=!1;return Ue.loadReport(h,g).then(C=>{_||f(C)}).catch(()=>{_||f(null)}),()=>{_=!0}},[h,g,w,y,l]);const S=u.useMemo(()=>i?i.split(`
|
|
479
|
-
`):[],[i]),N=u.useMemo(()=>d!=null&&d.found?kj(d.md).html:"",[d]);return r.jsxs("div",{className:"lp-log",children:[r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行"}),r.jsx("span",{className:"hint",children:"每次发压是一次运行(报告 / 曲线 / 日志都按运行切分)"}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"lp-chip",title:"刷新运行列表",onClick:()=>a(_=>_+1),children:"↻ 刷新"}),t.length>0&&r.jsxs(At,{value:g,onValueChange:o,children:[r.jsx(Mt,{size:"sm",className:"h-7 min-w-[220px] text-xs",children:r.jsx(Pt,{})}),r.jsx(Tt,{children:t.map((_,C)=>r.jsx(Oe,{value:_.run_key,children:GT(_,C)},_.run_key))})]})]})]}),!t.length&&r.jsx("div",{className:"hint",children:x?"发压中…(运行列表稍后自动刷新)":"暂无运行记录(发压结束后生成报告与曲线)"}),v&&!v.has_metrics&&r.jsx("div",{className:"hint lp-warn",children:"该运行为存量报告(无曲线数据);可查看下方报告。"})]}),(!v||v.has_metrics)&&r.jsx(Nj,{task:e,run:g,live:w}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行日志"}),v&&r.jsx("span",{className:"hint",children:v.registered?`第 ${v.round_no} 轮(发压)`:"存量运行无独立日志"})]}),r.jsx("div",{className:"log lp-logbox",ref:m,children:S.length?S.map((_,C)=>r.jsx("div",{className:"log-line "+g$(_),children:_||" "},C)):r.jsx("div",{className:"hint",children:b?"该运行暂无日志":"该运行没有独立日志文件"})})]}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"压测报告"}),(d==null?void 0:d.found)&&r.jsxs("span",{className:"hint",children:[d.file,d.run_key?`(运行键 ${d.run_key})`:""]}),(d==null?void 0:d.found)&&r.jsx("button",{type:"button",className:"lp-chip ml-auto",title:"复制报告文件名",onClick:()=>{var _;(_=navigator.clipboard)==null||_.writeText(d.file||""),M("已复制报告文件名")},children:"复制文件名"})]}),d!=null&&d.found?r.jsx("div",{className:"lp-report",children:r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:N}})}):r.jsx("div",{className:"hint",children:w?"发压中,结束后生成报告":v?"该运行暂无报告":"暂无压测报告(发压结束或被停止后生成)"})]})]})}var v$=Object.defineProperty,Fm=(e,t)=>v$(e,"name",{value:t,configurable:!0}),_d=!1;function Cj(){const[e,t]=u.useState(_d);return u.useEffect(()=>{_d||(_d=!0,t(!0))},[]),e}Fm(Cj,"useIsHydrated");var Ej=Wo[" useSyncExternalStore ".trim().toString()];function Rj(){return()=>{}}Fm(Rj,"subscribe");function Pj(){return Ej(Rj,()=>!0,()=>!1)}Fm(Pj,"useIsHydratedModern");var y$=typeof Ej=="function"?Pj:Cj,w$=Object.defineProperty,Jo=(e,t)=>w$(e,"name",{value:t,configurable:!0}),Sd="rovingFocusGroup.onEntryFocus",j$={bubbles:!1,cancelable:!0},Nu="RovingFocusGroup",[tp,Mj,b$]=mm(Nu),[k$,Tj]=uo(Nu,[b$]),[_$,S$]=k$(Nu),N$=u.forwardRef(Jo(function(t,n){return r.jsx(tp.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(tp.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(C$,{...t,ref:n})})})},"RovingFocusGroup")),C$=u.forwardRef(Jo(function(t,n){const{__scopeRovingFocusGroup:s,orientation:o,loop:l=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=t,h=u.useRef(null),x=wt(n,h),y=mu(a),[j,v]=Hl({prop:i,defaultProp:c??null,onChange:d,caller:Nu}),[g,w]=u.useState(!1),b=Es(f),S=Mj(s),N=u.useRef(!1),[_,C]=u.useState(0);return u.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(Sd,b),()=>O.removeEventListener(Sd,b)},[b]),r.jsx(_$,{scope:s,orientation:o,dir:y,loop:l,currentTabStopId:j,onItemFocus:u.useCallback(O=>v(O),[v]),onItemShiftTab:u.useCallback(()=>w(!0),[]),onFocusableItemAdd:u.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:u.useCallback(()=>C(O=>O-1),[]),children:r.jsx(ut.div,{tabIndex:g||_===0?-1:0,"data-orientation":o,...p,ref:x,style:{outline:"none",...t.style},onMouseDown:Xe(t.onMouseDown,()=>{N.current=!0}),onFocus:Xe(t.onFocus,O=>{const P=!N.current;if(O.target===O.currentTarget&&P&&!g){const D=new CustomEvent(Sd,j$);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const K=S().filter(G=>G.focusable),L=K.find(G=>G.active),I=K.find(G=>G.id===j),ee=[L,I,...K].filter(Boolean).map(G=>G.ref.current);Bm(ee,m)}}N.current=!1}),onBlur:Xe(t.onBlur,()=>w(!1))})})},"RovingFocusGroupImpl")),E$="RovingFocusGroupItem",R$=u.forwardRef(Jo(function(t,n){const{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:a,children:i,...c}=t,d=Qr(),f=a||d,m=S$(E$,s),p=m.currentTabStopId===f,h=Mj(s),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:j}=m,v=y$();return Lt(()=>{if(!(!v||!o))return x(),()=>y()},[v,o,x,y]),u.useEffect(()=>{if(!(v||!o))return x(),()=>y()},[v,o,x,y]),r.jsx(tp.ItemSlot,{scope:s,id:f,focusable:o,active:l,children:r.jsx(ut.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:n,onMouseDown:Xe(t.onMouseDown,g=>{o?m.onItemFocus(f):g.preventDefault()}),onFocus:Xe(t.onFocus,()=>m.onItemFocus(f)),onKeyDown:Xe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){m.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=Ij(g,m.orientation,m.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let S=h().filter(N=>N.focusable).map(N=>N.ref.current);if(w==="last")S.reverse();else if(w==="prev"||w==="next"){w==="prev"&&S.reverse();const N=S.indexOf(g.currentTarget);S=m.loop?Aj(S,N+1):S.slice(N+1)}setTimeout(()=>Bm(S))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:j!=null}):i})})},"RovingFocusGroupItem")),P$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $j(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Jo($j,"getDirectionAwareKey");function Ij(e,t,n){const s=$j(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return P$[s]}Jo(Ij,"getFocusIntent");function Bm(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}Jo(Bm,"focusFirst");function Aj(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Jo(Aj,"wrapArray");var M$=N$,T$=R$,$$=Object.defineProperty,Zl=(e,t)=>$$(e,"name",{value:t,configurable:!0}),Hm="Tabs",[I$,YI]=uo(Hm,[Tj]),Oj=Tj(),[A$,Um]=I$(Hm),O$=u.forwardRef(Zl(function(t,n){const{__scopeTabs:s,value:o,onValueChange:l,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=t,m=mu(c),[p,h]=Hl({prop:o,onChange:l,defaultProp:a??"",caller:Hm});return r.jsx(A$,{scope:s,baseId:Qr(),value:p,onValueChange:h,orientation:i,dir:m,activationMode:d,children:r.jsx(ut.div,{dir:m,"data-orientation":i,...f,ref:n})})},"Tabs")),L$="TabsList",D$=u.forwardRef(Zl(function(t,n){const{__scopeTabs:s,loop:o=!0,...l}=t,a=Um(L$,s),i=Oj(s);return r.jsx(M$,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:r.jsx(ut.div,{role:"tablist","aria-orientation":a.orientation,...l,ref:n})})},"TabsList")),z$="TabsTrigger",F$=u.forwardRef(Zl(function(t,n){const{__scopeTabs:s,value:o,disabled:l=!1,...a}=t,i=Um(z$,s),c=Oj(s),d=Vm(i.baseId,o),f=Wm(i.baseId,o),m=o===i.value;return r.jsx(T$,{asChild:!0,...c,focusable:!l,active:m,children:r.jsx(ut.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...a,ref:n,onMouseDown:Xe(t.onMouseDown,p=>{!l&&p.button===0&&p.ctrlKey===!1?i.onValueChange(o):p.preventDefault()}),onKeyDown:Xe(t.onKeyDown,p=>{l||p.target!==p.currentTarget||[" ","Enter"].includes(p.key)&&i.onValueChange(o)}),onFocus:Xe(t.onFocus,()=>{const p=i.activationMode!=="manual";!m&&!l&&p&&i.onValueChange(o)})})})},"TabsTrigger")),B$="TabsContent",H$=u.forwardRef(Zl(function(t,n){const{__scopeTabs:s,value:o,forceMount:l,children:a,...i}=t,c=Um(B$,s),d=Vm(c.baseId,o),f=Wm(c.baseId,o),m=o===c.value,p=u.useRef(m);return u.useEffect(()=>{const h=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(h)},[]),r.jsx(ii,{present:l||m,children:({present:h})=>r.jsx(ut.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!h,id:f,tabIndex:0,...i,ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0},children:h&&a})})},"TabsContent"));function Vm(e,t){return`${e}-trigger-${t}`}Zl(Vm,"makeTriggerId");function Wm(e,t){return`${e}-content-${t}`}Zl(Wm,"makeContentId");var U$=O$,V$=D$,W$=F$,q$=H$;const Lj=U$,qm=u.forwardRef(({className:e,...t},n)=>r.jsx(V$,{ref:n,"data-slot":"tabs-list",className:Ge("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t}));qm.displayName="TabsList";const Gc=u.forwardRef(({className:e,...t},n)=>r.jsx(W$,{ref:n,"data-slot":"tabs-trigger",className:Ge("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t}));Gc.displayName="TabsTrigger";const Lr=u.forwardRef(({className:e,...t},n)=>r.jsx(q$,{ref:n,"data-slot":"tabs-content",className:Ge("flex-1 outline-none",e),...t}));Lr.displayName="TabsContent";const G$=["done","failed","stopped","interrupted"];function K$(){const e=On(),t=e.currentProject,n=u.useMemo(()=>e.tasks.filter(N=>N.project_id===(t==null?void 0:t.id)&&N.task_type==="stress").sort((N,_)=>(_.created_at||"").localeCompare(N.created_at||"")),[e.tasks,t==null?void 0:t.id]),[s,o]=u.useState(null),[l,a]=u.useState("plan"),[i,c]=u.useState({}),d=u.useRef({}),[f,m]=u.useState([]),[p,h]=u.useState(""),x=n.find(N=>N.id===s)||null,y=x==null?void 0:x.status,j=G$.includes(y),v=y==="running"||y==="queued",g=f.filter(N=>N.registered).length;u.useEffect(()=>{if(!s){m([]);return}let N=!1;return Ue.loadRuns(s).then(_=>{N||m(_.runs||[])}).catch(()=>{N||m([])}),()=>{N=!0}},[s,y,p]);async function w(N){if(x){h(N);try{N==="rerun"?await Ue.loadRerun(x.id):N==="stop"?await Ue.stop(x.id):N==="diagnose"?await Ue.loadDiagnose(x.id):N==="restart"&&await Ue.restart(x.id),M({rerun:"已入队复压(同一方案再压一次),等待执行",stop:"已请求停止",diagnose:"已把运行现场发给 agent(项目忙时排队)",restart:"已清空运行记录并重启(从第 1 轮重跑)"}[N])}catch(_){M(_.message)}finally{h("")}}}function b(){window.confirm(`用现有方案包再压一次「${x.name}」?
|
|
480
|
-
(跳过 agent 出方案,直接发压并生成新一份报告/曲线)`)&&w("rerun")}function S(){window.confirm(`重启「${x.name}」将清空全部运行记录,从第 1 轮重跑(agent 重新出方案)。
|
|
481
|
-
历史报告文件仍留在 load/report/ 目录。继续?`)&&w("restart")}return u.useEffect(()=>{if(!n.length){o(null);return}n.some(N=>N.id===s)||o(n[0].id)},[n,s]),u.useEffect(()=>{const N=n.filter(_=>{const C=`${_.id}:${_.status}`;return!d.current[C]});N.length&&(N.forEach(_=>{d.current[`${_.id}:${_.status}`]=!0}),Promise.all(N.map(_=>Ue.loadCaseMeta(_.id).then(C=>[_.id,C]).catch(()=>[_.id,null]))).then(_=>{c(C=>{const O={...C};return _.forEach(([P,D])=>{D&&(O[P]=D)}),O})}))},[n]),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("aside",{className:"flex w-[300px] flex-none flex-col border-r border-border",children:[r.jsxs("div",{className:"flex-none px-3 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:["压测任务(",n.length,")"]}),r.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2",children:[n.map(N=>{const _=i[N.id];return r.jsxs("button",{type:"button",className:"load-item"+(s===N.id?" on":""),onClick:()=>o(N.id),children:[r.jsx("div",{className:"truncate text-[calc(13px*var(--fs))] font-semibold",title:N.name,children:N.name}),r.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[calc(11px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{className:"badge st-"+N.status,children:[r.jsx("span",{className:"dot"}),ur[N.status]||N.status]}),r.jsxs("span",{children:["轮 ",N.current_round]}),r.jsx("span",{className:"ml-auto",children:ls(N.created_at)})]}),_&&r.jsxs("div",{className:"lp-marks",children:[_.plan_found&&r.jsx("span",{className:"lp-chip sm",children:"方案 ✓"}),_.driver==="script"&&r.jsx("span",{className:"lp-chip sm",children:"脚本"}),_.driver==="scenario"&&r.jsx("span",{className:"lp-chip sm",children:"场景"}),_.driver==="legacy_scenario"&&r.jsx("span",{className:"lp-chip sm",children:"存量场景"}),!_.found&&r.jsx("span",{className:"lp-chip sm off",children:"无方案"}),_.has_html&&r.jsx("span",{className:"lp-chip sm",children:"自定义视图"})]}),N.error&&r.jsx("div",{className:"mt-1 truncate text-[calc(11px*var(--fs))]",style:{color:"var(--fail)"},title:N.error,children:N.error})]},N.id)}),!n.length&&r.jsx("div",{className:"p-2 text-xs leading-relaxed text-muted-foreground",children:"暂无压测任务。在「测试任务」页新建类型为「压力测试」的任务(填写压测说明)后,会自动显示在这里。"})]})]}),r.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:x?r.jsxs(Lj,{value:l,onValueChange:a,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-3",children:[r.jsx("h3",{className:"m-0 font-serif text-[calc(15px*var(--fs))] font-semibold",children:x.name}),r.jsxs("span",{className:"badge st-"+x.status,children:[r.jsx("span",{className:"dot"}),ur[x.status]||x.status]}),r.jsxs("span",{className:"lp-chip sm",children:["已跑 ",g," 次"]}),r.jsxs(qm,{className:"ml-2 h-8",children:[r.jsx(Gc,{value:"plan",className:"px-3",children:"压测方案"}),r.jsx(Gc,{value:"log",className:"px-3",children:"压测日志"})]}),r.jsxs("span",{className:"ml-auto font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:["创建 ",ls(x.created_at),x.started_at?` · 开始 ${ls(x.started_at)}`:"",x.ended_at?` · 结束 ${ls(x.ended_at)}`:""]})]}),r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-2",children:[r.jsx(H,{size:"sm",variant:"outline",disabled:!j||!!p,title:"跳过 agent,用现有方案包再压一次(生成新一份报告与曲线)",onClick:b,children:"复压"}),v&&r.jsx(H,{size:"sm",variant:"outline",disabled:!!p,title:"停止当前运行(先落 stop 文件,宽限 10s 后杀进程树)",onClick:()=>w("stop"),children:"停止"}),r.jsx(H,{size:"sm",variant:"outline",disabled:!x.session_id||v||!!p,title:x.session_id?"把最近一次运行的现场(退出码/指标摘要/日志尾)发给该任务的 agent 会话":"会话尚未生成(首轮执行后才有)",onClick:()=>w("diagnose"),children:"诊断"}),r.jsx(H,{size:"sm",variant:"outline",disabled:!j||!!p,title:"清空运行记录,从第 1 轮重跑(agent 重新出方案)——与「复压」不同",onClick:S,children:"重启(换方案)"}),p&&r.jsx("span",{className:"hint",children:"处理中…"}),!j&&v&&r.jsx("span",{className:"hint",children:"运行中:结束后可复压 / 诊断 / 重启"})]}),x.error&&r.jsxs("div",{className:"px-4 pt-1 text-xs",style:{color:"var(--fail)"},children:["错误:",x.error]}),r.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[r.jsx(Lr,{value:"plan",children:r.jsx(WT,{task:x})}),r.jsx(Lr,{value:"log",children:r.jsx(x$,{task:x})})]})]}):r.jsx("div",{className:"mt-16 text-center text-sm text-muted-foreground",children:"← 从左侧选择一个压测任务查看方案与指标"})})]})}const Y$={project_dir:"项目目录",work_dir:"工作目录"},Dj=[{key:"board",label:"开发看板"},{key:"tasks",label:"测试任务"},{key:"stress",label:"压测面板"},{key:"monitor",label:"监控面板"},{key:"bugs",label:"Bug 报告"}],fc=Dj.map(e=>e.key),Ex=Object.fromEntries(Dj.map(e=>[e.key,e.label]));function ol(e){const t=(Array.isArray(e==null?void 0:e.order)?e.order:[]).filter(s=>fc.includes(s));for(const s of fc)t.includes(s)||t.push(s);const n=(Array.isArray(e==null?void 0:e.hidden)?e.hidden:[]).filter(s=>fc.includes(s));return{order:t,hidden:n}}function Rx(e){const t=(e||"").split(/[\\/]+/).filter(Boolean);for(let n=t.length-1;n>=0;n--)if(!/^[A-Za-z]:$/.test(t[n]))return t[n];return""}const np="ts.sidebarW",zj=180,Fj=480,Bj=230;function Q$(){const e=parseInt(localStorage.getItem(np),10);return Number.isFinite(e)?Math.min(Fj,Math.max(zj,e)):Bj}function Px(){var go,xo,vo;const e=Yl(),t=Xn(),n=On(),[s,o]=u.useState(localStorage.getItem("ts_cur_tab")||"board"),[l,a]=u.useState(null),[i,c]=u.useState(!1),[d,f]=u.useState(null),m=u.useRef(null);m.current=l;const p=u.useRef(!1),h=u.useRef(null),[x,y]=u.useState(!1),[j,v]=u.useState(null),[g,w]=u.useState([]),[b,S]=u.useState(!1),[N,_]=u.useState([]),[C,O]=u.useState(null),[P,D]=u.useState(!1),[K,L]=u.useState(!1),[I,q]=u.useState({name:"",project_dir:"",agent_path:"",work_dir:"",env_label:"",guide_text:"",model:"",reasoning_effort:"",permission_mode:"",skill_understand:"",skill_deploy:"",skill_commit:"",skill_test:"",skill_cases:""}),[ee,G]=u.useState({models:[],default:""}),[z,Y]=u.useState([]),[B,me]=u.useState(!1),[Z,Te]=u.useState(null),[ke,_e]=u.useState(!1),[Ce,$e]=u.useState("project_dir"),[ue,fe]=u.useState(!1),[Se,te]=u.useState(""),[E,U]=u.useState(!1),[A,se]=u.useState(null),[oe,ze]=u.useState(""),{rzOn:Je,rzStyle:Fe,rzStart:et,rzDragStart:Be,rzReset:Ke}=ar(),{rzOn:rt,rzStyle:$t,rzDragStart:it}=ar(),{rzOn:Q,rzStyle:He,rzDragStart:ce,rzReset:Dt}=ar(),{rzOn:Gt,rzStyle:un,rzDragStart:dn,rzReset:kr}=ar(),fn=u.useRef(null),[Ps,R]=u.useState([]),F=u.useRef([]);F.current=Ps;const[ne,ae]=u.useState(null),ie=u.useRef(!1),de=u.useRef(null),[Re,Ve]=u.useState(Q$),tt=u.useRef(Re);tt.current=Re;function ot(k){const le=F.current;if(!le.length)return k;const be=new Map(le.map((Pe,We)=>[Pe,We]));return[...k].sort((Pe,We)=>(be.has(Pe.id)?be.get(Pe.id):1/0)-(be.has(We.id)?be.get(We.id):1/0))}function tn(k){const le=On.getState().projects.map(It=>It.id),be=F.current.filter(It=>le.includes(It)),Pe=[...be,...le.filter(It=>!be.includes(It))],We=new Set(k),Me=[];let ht=0;for(const It of Pe)Me.push(We.has(It)?k[ht++]:It);return F.current=Me,R(Me),Me}function Tn(k,le){if(k.button!==0||k.target.closest("button"))return;const be={id:le,sx:k.clientX,sy:k.clientY,on:!1};de.current=be;const Pe=Me=>{var Ts,In,Cr,ys;if(!de.current)return;if(!be.on){if(Math.hypot(Me.clientX-be.sx,Me.clientY-be.sy)<6)return;be.on=!0,ie.current=!0,ae(be.id),document.body.classList.add("projlist-dragging")}const ht=+((ys=(Cr=(In=(Ts=document.elementFromPoint(Me.clientX,Me.clientY))==null?void 0:Ts.closest)==null?void 0:In.call(Ts,"[data-proj-id]"))==null?void 0:Cr.dataset)==null?void 0:ys.projId);if(!ht||ht===be.id)return;const It=ot(On.getState().projects).filter(Js=>!!Js.archived===P).map(Js=>Js.id),yo=It.indexOf(be.id),wo=It.indexOf(ht);yo<0||wo<0||(It.splice(wo,0,...It.splice(yo,1)),tn(It))},We=()=>{window.removeEventListener("pointermove",Pe),window.removeEventListener("pointerup",We),document.body.classList.remove("projlist-dragging"),de.current=null,ae(null),be.on&&yl.set(0,"proj_order",{order:F.current}).catch(()=>{})};window.addEventListener("pointermove",Pe),window.addEventListener("pointerup",We)}u.useEffect(()=>{let k=!1;return yl.get(0).then(le=>{var Pe,We;if(k)return;const be=(Array.isArray((We=(Pe=le.prefs)==null?void 0:Pe.proj_order)==null?void 0:We.order)?le.prefs.proj_order.order:[]).map(Number).filter(Number.isFinite);be.length&&R(be)}).catch(()=>{}),()=>{k=!0}},[]);function Nt(k){if(k.button!==0)return;k.preventDefault();const le=k.clientX,be=tt.current;document.body.classList.add("resizing-x");const Pe=Me=>Ve(Math.min(Fj,Math.max(zj,be+Me.clientX-le))),We=()=>{window.removeEventListener("mousemove",Pe),window.removeEventListener("mouseup",We),document.body.classList.remove("resizing-x");try{localStorage.setItem(np,String(tt.current))}catch{}};window.addEventListener("mousemove",Pe),window.addEventListener("mouseup",We)}function nt(){Ve(Bj);try{localStorage.removeItem(np)}catch{}}function Kt(k){if(p.current){p.current=!1;return}o(k),localStorage.setItem("ts_cur_tab",k)}function Yt(k){return k.order.filter(le=>!k.hidden.includes(le))}function zt(k){var be;a(k);const le=(be=n.currentProject)==null?void 0:be.id;le&&yl.set(le,"tabs",k).catch(()=>{})}u.useEffect(()=>{var be;const k=(be=n.currentProject)==null?void 0:be.id;if(!k)return;let le=!1;return yl.get(k).then(Pe=>{var We;le||a(ol((We=Pe.prefs)==null?void 0:We.tabs))}).catch(()=>{}),c(!1),()=>{le=!0}},[(go=n.currentProject)==null?void 0:go.id]);const mt=l||ol(null),Ct=Yt(mt);u.useEffect(()=>{Ct.length&&!Ct.includes(s)&&(o(Ct[0]),localStorage.setItem("ts_cur_tab",Ct[0]))},[l]);function nn(k,le){if(k.button!==0)return;const be={key:le,sx:k.clientX,on:!1};h.current=be;const Pe=Me=>{var It,yo,wo,Ts;if(!h.current)return;if(!be.on){if(Math.hypot(Me.clientX-be.sx,Me.clientY)<6)return;be.on=!0,p.current=!0,f(be.key),document.body.classList.add("tabbar-dragging")}const ht=(Ts=(wo=(yo=(It=document.elementFromPoint(Me.clientX,Me.clientY))==null?void 0:It.closest)==null?void 0:yo.call(It,"[data-tab-key]"))==null?void 0:wo.dataset)==null?void 0:Ts.tabKey;!ht||ht===be.key||a(In=>{const Cr=ol(In),ys=[...Cr.order],Js=ys.indexOf(be.key),ea=ys.indexOf(ht);return Js<0||ea<0?In:(ys.splice(ea,0,...ys.splice(Js,1)),{...Cr,order:ys})})},We=()=>{if(window.removeEventListener("pointermove",Pe),window.removeEventListener("pointerup",We),document.body.classList.remove("tabbar-dragging"),h.current=null,f(null),be.on){const Me=ol(m.current);zt(Me)}};window.addEventListener("pointermove",Pe),window.addEventListener("pointerup",We)}function ts(k){const le=ol(l),be={...le,hidden:[...le.hidden,k]};zt(be);const Pe=Yt(be);(s===k||!Pe.includes(s))&&Pe.length&&(o(Pe[0]),localStorage.setItem("ts_cur_tab",Pe[0]))}function _r(k){const le=ol(l);zt({...le,hidden:le.hidden.filter(be=>be!==k)}),o(k),localStorage.setItem("ts_cur_tab",k)}function ns(k){n.selectProject(k),localStorage.setItem("ts_cur_project",k)}async function xs(){try{w(await kt.agents())}catch{w([])}}async function ss(k){try{const le=await kt.agentModels(k);G(le);const be=new Set((le.models||[]).map(Pe=>Pe.name));be.size&&q(Pe=>Pe.model&&!be.has(Pe.model)?{...Pe,model:""}:Pe)}catch{G({models:[],default:""})}}async function vs(k,le){try{const Pe=(await kt.agentSkills(k,le)).skills||[];if(Y(Pe),Pe.length){const We=new Set(Pe.map(Me=>Me.name));q(Me=>({...Me,skill_understand:We.has(Me.skill_understand)?Me.skill_understand:"",skill_deploy:We.has(Me.skill_deploy)?Me.skill_deploy:"",skill_commit:We.has(Me.skill_commit)?Me.skill_commit:"",skill_test:We.has(Me.skill_test)?Me.skill_test:"",skill_cases:We.has(Me.skill_cases)?Me.skill_cases:""}))}}catch{Y([])}}function mo(k){v(k?k.id:null),q({name:(k==null?void 0:k.name)||"",project_dir:(k==null?void 0:k.project_dir)||"",agent_path:(k==null?void 0:k.agent_path)||"",work_dir:(k==null?void 0:k.work_dir)||"",env_label:(k==null?void 0:k.env_label)||"",guide_text:(k==null?void 0:k.guide_text)||"",model:(k==null?void 0:k.model)||"",reasoning_effort:(k==null?void 0:k.reasoning_effort)||"",permission_mode:(k==null?void 0:k.permission_mode)||"",skill_understand:(k==null?void 0:k.skill_understand)||"",skill_deploy:(k==null?void 0:k.skill_deploy)||"",skill_commit:(k==null?void 0:k.skill_commit)||"",skill_test:(k==null?void 0:k.skill_test)||"",skill_cases:(k==null?void 0:k.skill_cases)||""}),Ke(),y(!0),xs(),ss((k==null?void 0:k.agent_path)||""),vs((k==null?void 0:k.agent_path)||"",(k==null?void 0:k.project_dir)||"")}async function Zo(){const k={...I};if(k.name||(k.name=Rx(k.project_dir)),!k.name){M("请填写项目名称");return}try{const le=await kt.dupCheck({project_dir:k.project_dir||"",work_dir:k.work_dir||"",exclude:j});if(le.length){_(le),O(k),S(!0);return}await Et(k)}catch(le){M(le.message)}}async function Ms(){if(S(!1),C){const k=C;O(null),await Et(k)}}async function Et(k){try{const le=On.getState();if(j)await le.updateProject(j,k);else{const be=await le.createProject(k);await On.getState().selectProject(be.id)}y(!1),M(j?"已保存":"项目已创建")}catch(le){M(le.message)}}async function Sr(k,le){try{await On.getState().archiveProject(k.id,le),M(le?"项目已归档":"项目已恢复")}catch(be){M(be.message)}}function rs(k){const le={...I,project_dir:k};I.name.trim()||(le.name=Rx(k)),q(le)}function sn(k){$e(k),me(!0),fe(!1),te(""),ho(I[k])}async function ho(k){_e(!0);try{Te(await kt.fsBrowse(k))}catch(le){M(le.message)}finally{_e(!1)}}function Xs(k){fe(!1),te(""),ho(k)}async function Nr(){const k=Se.trim();if(k){U(!0);try{const le=await kt.fsMkdir((Z==null?void 0:Z.path)||"",k);M(`已新建文件夹:${(le==null?void 0:le.name)||k}`),Xs((le==null?void 0:le.path)||(Z==null?void 0:Z.path)||"")}catch(le){M(le.message)}finally{U(!1)}}}function el(){Z!=null&&Z.path&&(Ce==="project_dir"&&rs(Z.path),Ce==="project_dir"?vs(I.agent_path,Z.path):q({...I,[Ce]:Z.path}),me(!1))}function T(k){se(k),ze(""),kr()}async function V(){if(A)try{await On.getState().deleteProject(A.id,{confirm_name:oe}),M("项目已删除;案例文件与 bug 报告文件已保留,请自行手动清理"),se(null)}catch(k){M(k.message)}}async function ve(){await t.logout(),e("/login")}u.useEffect(()=>(n.loadProjects(),fn.current=setInterval(()=>{const k=On.getState();k.loadProjects().catch(()=>{}),k.currentProject&&(k.loadTasks().catch(()=>{}),k.loadBugs().catch(()=>{}))},5e3),()=>clearInterval(fn.current)),[]);const he=On(k=>k.projects),Le=u.useRef(!1);u.useEffect(()=>{if(Le.current||!he.length)return;Le.current=!0;const k=On.getState(),le=+localStorage.getItem("ts_cur_project")||0,be=k.projects.find(Me=>!Me.archived)||k.projects[0],Pe=k.projects.find(Me=>Me.id===le)?le:be.id;k.selectProject(Pe);const We=localStorage.getItem("ts_cur_tab");fc.includes(We)&&o(We)},[he]);const ge=ot(n.projects).filter(k=>!!k.archived===P),ct=ee.models||[],dt=!!I.model&&ct.some(k=>k.name===I.model),Qt=ct.length?ee.default?"__default__":ct[0].name:"__default__",W=dt?I.model:Qt,lt=ct.find(k=>k.name===ee.default),$n=lt?lt.display_name||lt.name:ee.default||"智能体默认",os=dt?I.model:W==="__default__"?ee.default:W,Sn=aj(ee,os);return r.jsxs("div",{className:"flex h-svh",children:[r.jsxs("aside",{style:{width:Re+"px"},className:"flex flex-none flex-col border-r border-border bg-card",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-3 font-serif font-semibold",children:[r.jsx(pu,{size:22}),r.jsx("span",{children:"Touchstone"})]}),r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:[r.jsx("span",{children:P?"已归档项目":"项目列表"}),r.jsx("button",{type:"button",title:P?"返回项目列表":"查看已归档项目",className:"rounded p-0.5 hover:text-foreground",onClick:()=>D(k=>!k),children:P?r.jsx(ld,{size:13}):r.jsx(ad,{size:13})})]}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto p-2",children:[ge.map(k=>{var le,be,Pe,We,Me;return r.jsxs("div",{"data-proj-id":k.id,className:"proj-item cursor-pointer select-none rounded-lg border px-2.5 py-2 transition-colors "+(((le=n.currentProject)==null?void 0:le.id)===k.id?"border-primary/60 bg-accent":"border-transparent hover:bg-accent/60")+(k.archived?" opacity-60":"")+(ne===k.id?" proj-dragging":""),onPointerDown:ht=>Tn(ht,k.id),onClick:()=>{if(ie.current){ie.current=!1;return}ns(k.id)},children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"flex-1 truncate text-sm font-semibold "+(((be=n.currentProject)==null?void 0:be.id)===k.id?"text-[var(--tab-active)]":""),children:k.name}),r.jsx("button",{type:"button",title:k.archived?"恢复项目":"归档项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-foreground",onClick:ht=>{ht.stopPropagation(),Sr(k,!k.archived)},children:k.archived?r.jsx(ld,{size:13}):r.jsx(ad,{size:13})}),k.archived&&r.jsx("button",{type:"button",title:"删除项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-[var(--fail, #dc2626)]",onClick:ht=>{ht.stopPropagation(),T(k)},children:r.jsx(Gs,{size:13})})]}),r.jsx("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:k.project_dir}),r.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 font-mono text-[calc(10px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{children:["正在开发 ",r.jsx("b",{className:"font-semibold text-[var(--run)]",children:((Pe=k.board_counts)==null?void 0:Pe.doing)??0})]}),r.jsxs("span",{children:["阻塞 ",r.jsx("b",{className:"font-semibold text-[var(--fail)]",children:((We=k.board_counts)==null?void 0:We.blocked)??0})]}),r.jsxs("span",{children:["待审核 ",r.jsx("b",{className:"font-semibold text-[var(--retest)]",children:((Me=k.board_counts)==null?void 0:Me.review)??0})]})]})]},k.id)}),!ge.length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:P?"暂无已归档项目":"暂无项目"})]}),r.jsxs("div",{className:"flex items-center gap-1 border-t border-border px-2.5 py-2",children:[r.jsx("span",{className:"mr-auto truncate text-xs text-muted-foreground",children:t.username}),r.jsxs(H,{variant:"ghost",size:"sm",title:"站点设置",onClick:()=>e("/settings"),children:[r.jsx(W0,{})," 设置"]}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>L(k=>!k),children:[r.jsx(cC,{})," 菜单"]}),K&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>L(!1)}),r.jsxs("div",{className:"sets-menu",children:[t.isAdmin&&r.jsxs("button",{type:"button",onClick:()=>{L(!1),e("/admin")},children:[r.jsx(CC,{})," 管理"]}),r.jsxs("button",{type:"button",className:"danger",onClick:ve,children:[r.jsx(am,{})," 登出"]})]})]})]})]})]}),r.jsx("div",{className:"vsplit side-split",title:"拖动调整侧栏宽度,双击复位",onMouseDown:Nt,onDoubleClick:nt}),r.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-4 py-2",children:[r.jsx("h2",{className:"m-0 truncate font-serif text-[calc(15px*var(--fs))] font-semibold",children:((xo=n.currentProject)==null?void 0:xo.name)||"— 未选择项目"}),((vo=n.currentProject)==null?void 0:vo.archived)&&r.jsx("span",{className:"flex-none rounded-full border border-border px-2 py-0.5 text-[calc(10px*var(--fs))] text-muted-foreground",children:"已归档"}),r.jsx("div",{className:"flex-1"}),r.jsxs(H,{size:"sm",onClick:()=>mo(),children:[r.jsx(ai,{})," 添加项目"]}),n.currentProject&&r.jsxs(H,{size:"sm",variant:"outline",onClick:()=>mo(n.currentProject),children:[r.jsx(im,{})," 编辑项目"]}),n.currentProject&&r.jsxs(H,{size:"sm",variant:"outline",title:"归档后从项目列表默认隐藏,可在侧栏「已归档项目」视图中恢复",onClick:()=>Sr(n.currentProject,!n.currentProject.archived),children:[n.currentProject.archived?r.jsx(ld,{}):r.jsx(ad,{}),n.currentProject.archived?"恢复项目":"归档项目"]})]}),r.jsx("hr",{className:"aurora-line"}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.currentProject?r.jsxs(Lj,{value:s,onValueChange:Kt,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center border-b border-border pr-2",children:[r.jsxs(qm,{className:"w-fit justify-start rounded-none border-none bg-transparent px-2 py-0",children:[Ct.map(k=>r.jsxs(Gc,{value:k,"data-tab-key":k,className:"tabbar-trigger pr-5 data-[state=active]:text-[var(--tab-active)]"+(d===k?" tabbar-dragging":""),onPointerDown:le=>nn(le,k),children:[Ex[k],r.jsx("span",{className:"tabbar-hide",title:"隐藏此标签页(可点右侧按钮恢复)",onClick:le=>{le.stopPropagation(),ts(k)},onPointerDown:le=>le.stopPropagation(),children:r.jsx(vr,{className:"size-2.5"})})]},k)),!Ct.length&&r.jsx("span",{className:"px-3 py-2 text-xs text-muted-foreground",children:"标签页已全部隐藏"})]}),r.jsx("div",{className:"ml-auto"}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(H,{variant:"ghost",size:"sm",title:"显示/恢复隐藏的标签页",onClick:()=>c(k=>!k),children:[r.jsx($g,{}),mt.hidden.length?`隐藏 ${mt.hidden.length}`:"标签页"]}),i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>c(!1)}),r.jsxs("div",{className:"sets-menu drop-down",children:[!mt.hidden.length&&r.jsxs("div",{className:"px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:["没有隐藏的标签页。",r.jsx("br",{}),"把鼠标悬停到标签上点 × 即可隐藏。"]}),mt.hidden.map(k=>r.jsxs("button",{type:"button",onClick:()=>_r(k),children:[r.jsx($g,{})," ",Ex[k]]},k))]})]})]})]}),r.jsx(Lr,{value:"board",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(AT,{project:n.currentProject})}),r.jsx(Lr,{value:"tasks",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(QM,{onCreated:k=>{k==="stress"&&Kt("stress")}})}),r.jsx(Lr,{value:"stress",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(K$,{})}),r.jsx(Lr,{value:"monitor",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(lT,{project:n.currentProject})}),r.jsx(Lr,{value:"bugs",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(dT,{project:n.currentProject})})]}):r.jsx("div",{className:"mt-20 text-center text-sm text-muted-foreground",children:'← 选择一个项目,或点击"添加项目"创建'})})]}),r.jsx(en,{open:x,onOpenChange:y,children:r.jsxs(Ut,{className:"modal modal-rz"+(Je?" rz-drag":""),style:{...Fe,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:et,reset:Ke}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:Be,children:j?"编辑项目":"添加项目"})}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目名称"}),r.jsx(Ae,{value:I.name,onChange:k=>q({...I,name:k.target.value.trim()}),placeholder:"如 my-project"})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目目录"}),r.jsx(Ae,{value:I.project_dir,onChange:k=>rs(k.target.value.trim()),onBlur:()=>vs(I.agent_path,I.project_dir),placeholder:"/path/to/your/project"}),r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>sn("project_dir"),title:"浏览服务端目录并选择",children:[r.jsx(Ig,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"智能体"}),r.jsxs(At,{value:I.agent_path||"__manual__",onValueChange:k=>{const le=k==="__manual__"||k==="__missing__"?"":k;q({...I,agent_path:le}),ss(le),vs(le,I.project_dir)},children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"手动填写路径"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__manual__",children:"手动填写路径"}),g.map(k=>r.jsx(Oe,{value:k.found?k.path:"__missing__",children:k.found?`${k.name} · ${k.version||k.path}`:`${k.name} 未找到`},k.path||k.name)),(()=>{const k=(I.agent_path||"").trim();return!k||g.some(le=>le.found&&le.path===k)?null:r.jsx(Oe,{value:k,children:k.startsWith("dsh-plugin:")?`dsh(插件·进程内) ${k.slice(11)}`:`${k}(当前绑定)`})})()]})]}),r.jsxs(H,{variant:"outline",size:"sm",onClick:xs,title:"重新扫描本机 CLI",children:[r.jsx(Ka,{})," 扫描"]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"智能体只有「dsh(插件·进程内)」一个入口:无需额外参数,模型取自宿主 ~/.dsh/settings.yaml(也可在此显式指定);kimi/opencode/claude/hermes 旧族与 dsh CLI(裸 dsh 可执行)均已退场,存量旧绑定起跑会报「该智能体族已下线」,请改绑本入口"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"当前智能体已配置的模型;保存后新创建的任务(含修复/复测)默认使用该模型,已建任务不受影响",children:"模型"}),ct.length?r.jsxs(At,{value:W,onValueChange:k=>q({...I,model:k==="__default__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1"+(dt?"":" text-muted-foreground"),title:dt?"":"尚未显式选择:暗色显示的是当前智能体的默认模型(留空即用默认)",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__default__",children:ee.default?`默认(${$n})`:"默认(智能体默认)"}),ct.map(k=>r.jsx(Oe,{value:k.name,children:k.display_name||k.name},k.name))]})]}):r.jsx(Ae,{className:"max-w-[240px]",placeholder:ee.default?`默认(${$n})`:"默认(智能体默认)",value:I.model,onChange:k=>q({...I,model:k.target.value.trim()})})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"留空用智能体默认模型;设置后从下一条任务开始生效"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内会话的默认思考等级(dsh reasoningEffort);留空用智能体默认档",children:"思考等级"}),r.jsxs(At,{value:I.reasoning_effort||"__default__",onValueChange:k=>q({...I,reasoning_effort:k==="__default__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1"+(I.reasoning_effort?"":" text-muted-foreground"),title:I.reasoning_effort?"":"尚未显式选择:暗色显示的是智能体默认档(留空即用默认)",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__default__",children:Sn.defaultEffort?`默认(${(Sn.options.find(k=>k.value===Sn.defaultEffort)||{}).label||Sn.defaultEffort})`:"默认(智能体默认)"}),I.reasoning_effort&&!Sn.options.some(k=>k.value===I.reasoning_effort)&&r.jsx(Oe,{value:I.reasoning_effort,children:I.reasoning_effort}),Sn.options.map(k=>r.jsx(Oe,{value:k.value,title:k.title,children:k.label},k.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"思考等级:列表来自当前模型的可用档位;留空用智能体默认;设置后新起的会话(含任务与看板卡)按此档运行"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内看板卡片会话的默认权限档;留空用宿主默认(完全访问)",children:"权限"}),r.jsxs(At,{value:I.permission_mode||"__default__",onValueChange:k=>q({...I,permission_mode:k==="__default__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1"+(I.permission_mode?"":" text-muted-foreground"),title:I.permission_mode?"":"尚未显式选择:暗色显示的是宿主默认档(留空即用默认)",children:r.jsx(Pt,{})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__default__",children:"默认(宿主默认)"}),Uc.map(k=>r.jsx(Oe,{value:k.value,title:k.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:k.label}),r.jsx("span",{className:"sess-perm-desc",children:k.desc})]})},k.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"权限:项目内新起的看板卡片会话按此档运行(逐条确认=平台接管审批代答);任务会话暂不支持权限档"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"理解/分析项目时优先使用的 skill,注入每类任务首轮提示词",children:"理解项目"}),r.jsxs(At,{value:I.skill_understand||"__none__",onValueChange:k=>q({...I,skill_understand:k==="__none__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"不指定"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__none__",children:"不指定"}),z.map(k=>r.jsxs(Oe,{value:k.name,title:k.description,children:[k.name,k.description?` — ${k.description.slice(0,60)}`:""]},`u-${k.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动部署=开时使用的 skill",children:"部署项目"}),r.jsxs(At,{value:I.skill_deploy||"__none__",onValueChange:k=>q({...I,skill_deploy:k==="__none__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"不指定"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__none__",children:"不指定"}),z.map(k=>r.jsxs(Oe,{value:k.name,title:k.description,children:[k.name,k.description?` — ${k.description.slice(0,60)}`:""]},`d-${k.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动提交=开时使用的 skill",children:"提交项目"}),r.jsxs(At,{value:I.skill_commit||"__none__",onValueChange:k=>q({...I,skill_commit:k==="__none__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"不指定"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__none__",children:"不指定"}),z.map(k=>r.jsxs(Oe,{value:k.name,title:k.description,children:[k.name,k.description?` — ${k.description.slice(0,60)}`:""]},`c-${k.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试本项目时优先使用的 skill,注入每类任务首轮提示词",children:"测试项目"}),r.jsxs(At,{value:I.skill_test||"__none__",onValueChange:k=>q({...I,skill_test:k==="__none__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"不指定"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__none__",children:"不指定"}),z.map(k=>r.jsxs(Oe,{value:k.name,title:k.description,children:[k.name,k.description?` — ${k.description.slice(0,60)}`:""]},`t-${k.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"生成用例时遵循的命名/结构/登记规范 skill,注入每类任务首轮提示词",children:"用例规范"}),r.jsxs(At,{value:I.skill_cases||"__none__",onValueChange:k=>q({...I,skill_cases:k==="__none__"?"":k}),children:[r.jsx(Mt,{className:"min-w-[200px] flex-1",children:r.jsx(Pt,{placeholder:"不指定"})}),r.jsxs(Tt,{children:[r.jsx(Oe,{value:"__none__",children:"不指定"}),z.map(k=>r.jsxs(Oe,{value:k.name,title:k.description,children:[k.name,k.description?` — ${k.description.slice(0,60)}`:""]},`cs-${k.name}`))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"选项来自当前智能体可用的 skill(dsh 无 skill 机制恒为空);理解/测试项目/用例规范项注入每类任务首轮,部署/提交项仅注入修复任务的对应条款(自动提交/部署=开时)"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"工作目录"}),r.jsx(Ae,{value:I.work_dir,onChange:k=>q({...I,work_dir:k.target.value.trim()}),placeholder:"默认 <项目目录>/.touchstone;其下自动生成案例库 free_style 与 bug 报告 bug_report"}),r.jsxs(H,{variant:"outline",size:"sm",onClick:()=>sn("work_dir"),title:"浏览服务端目录并选择",children:[r.jsx(Ig,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"环境标签"}),r.jsx(Ae,{value:I.env_label,onChange:k=>q({...I,env_label:k.target.value.trim()}),placeholder:"如 test4 / sitA1,测试、修复、部署针对的环境"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"项目附加提示词"}),r.jsx(ps,{value:I.guide_text,onChange:k=>q({...I,guide_text:k.target.value}),rows:3,className:"min-h-0",placeholder:"填写如何理解项目 / 如何写 git commit message / 如何部署项目 等信息;内容会加入每个任务的提示词"})]})]}),r.jsxs(jn,{className:"flex-none",children:[r.jsx(H,{variant:"outline",onClick:()=>y(!1),children:"取消"}),r.jsx(H,{onClick:Zo,children:"保存"})]})]})}),r.jsx(en,{open:b,onOpenChange:S,children:r.jsxs(Ut,{className:"modal modal-rz"+(rt?" rz-drag":""),style:{...$t,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:et,reset:Ke}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:it,children:"目录重复提醒"})}),N.map((k,le)=>r.jsxs("div",{className:"dup-item",children:[r.jsx("b",{children:Y$[k.field]||k.field})," ",k.value,r.jsxs("span",{className:"dup-owner",children:["被「",k.username," / ",k.project_name,"」使用"]})]},le)),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"6px 0 0"},children:"重复的目录可能与其他项目的案例库/报告互相干扰,确认仍要保存?"}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>S(!1),children:"返回修改"}),r.jsx(H,{onClick:Ms,children:"仍然保存"})]})]})}),r.jsx(en,{open:B,onOpenChange:me,children:r.jsxs(Ut,{className:"modal modal-rz modal-dir"+(Q?" rz-drag":""),style:{...He,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:et,reset:Dt}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:ce,children:"选择目录"})}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:(Z==null?void 0:Z.path)||"",children:(Z==null?void 0:Z.path)||"(选择根目录)"}),r.jsxs(H,{variant:"outline",size:"sm",disabled:ke||!(Z!=null&&Z.parent),onClick:()=>Xs(Z.parent),children:[r.jsx(SN,{})," 上级"]}),r.jsxs(H,{variant:"outline",size:"sm",disabled:ke,onClick:()=>Xs((Z==null?void 0:Z.path)||""),children:[r.jsx(Ka,{})," 刷新"]}),r.jsxs(H,{variant:"outline",size:"sm",disabled:ke||!(Z!=null&&Z.path),onClick:()=>{fe(!ue),te("")},title:Z!=null&&Z.path?`在 ${Z.path} 下新建文件夹`:"请先进入一个目录",children:[r.jsx(XN,{})," 新建文件夹"]})]}),ue&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ae,{autoFocus:!0,value:Se,disabled:E,onChange:k=>te(k.target.value),onKeyDown:k=>{k.key==="Enter"&&Nr()},placeholder:"新文件夹名称(在当前目录下创建)"}),r.jsx(H,{size:"sm",disabled:E||!Se.trim(),onClick:Nr,children:E?"创建中…":"创建"}),r.jsx(H,{variant:"outline",size:"sm",disabled:E,onClick:()=>{fe(!1),te("")},children:"取消"})]}),r.jsxs("div",{className:"modal-scroll max-h-[50vh] min-h-[120px] overflow-y-auto rounded-md border border-border p-1",children:[ke&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"加载中…"}),!ke&&!((Z==null?void 0:Z.dirs)||[]).length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"无子目录"}),!ke&&((Z==null?void 0:Z.dirs)||[]).map(k=>r.jsx("button",{type:"button",className:"block w-full truncate rounded px-2 py-1 text-left font-mono text-sm hover:bg-accent",title:k.path,onClick:()=>Xs(k.path),children:k.name},k.path))]}),r.jsxs(jn,{className:"flex-none",children:[r.jsx(H,{variant:"outline",onClick:()=>me(!1),children:"取消"}),r.jsx(H,{disabled:ke||!(Z!=null&&Z.path),onClick:el,children:"选择此目录"})]})]})}),r.jsx(en,{open:!!A,onOpenChange:k=>{k||se(null)},children:r.jsxs(Ut,{className:"modal modal-rz"+(Gt?" rz-drag":""),style:{...un,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:et,reset:kr}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:dn,children:"删除项目"})}),A&&r.jsxs("div",{className:"space-y-1 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"项目名称:"}),r.jsx("b",{children:A.name})]}),r.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:A.project_dir}),r.jsxs("div",{className:"truncate font-mono text-xs text-muted-foreground",children:["工作目录:",A.work_dir]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"输入项目名称确认"}),r.jsx(Ae,{value:oe,onChange:k=>ze(k.target.value),placeholder:(A==null?void 0:A.name)||""})]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"将删除项目及其全部任务与轮次记录,不可恢复。磁盘上的案例文件与 bug 报告文件不会删除,请自行手动清理。"}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>se(null),children:"取消"}),r.jsx(H,{variant:"destructive",disabled:!A||oe!==A.name,onClick:V,children:"确定删除"})]})]})})]})}const X$=w0("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Vl({className:e,variant:t,...n}){return r.jsx("span",{"data-slot":"badge",className:Ge(X$({variant:t}),e),...n})}function J$(){const e=Yl(),t=Xn(),[n,s]=u.useState([]),[o,l]=u.useState(!1),[a,i]=u.useState({username:"",password:"",password2:""}),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState({id:null,username:"",password:""}),[x,y]=u.useState(""),{rzOn:j,rzStyle:v,rzStart:g,rzDragStart:w,rzReset:b}=ar(),{rzOn:S,rzStyle:N,rzStart:_,rzDragStart:C,rzReset:O}=ar();async function P(){try{s(await Br.users())}catch(G){M(G.message)}}u.useEffect(()=>{if(!t.isAdmin){e("/app");return}P()},[]);function D(){i({username:"",password:"",password2:""}),d(""),O(),l(!0)}async function K(){if(d(""),a.password!==a.password2){d("两次输入的密码不一致");return}try{await Br.createUser({username:a.username,password:a.password}),l(!1),M("新增成功"),await P()}catch(G){d(G.message)}}function L(G){h({id:G.id,username:G.username,password:""}),y(""),m(!0)}async function I(){y("");try{const G={username:p.username};p.password&&(G.password=p.password),await Br.updateUser(p.id,G),m(!1),await P()}catch(G){y(G.message)}}async function q(G){if(window.confirm(`确认删除用户「${G.username}」?该操作不可恢复`))try{await Br.deleteUser(G.id),await P()}catch(z){M(z.message)}}async function ee(){await t.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"后台管理 · 用户"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:t.username}),r.jsxs(H,{variant:"ghost",size:"sm",onClick:ee,children:[r.jsx(am,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("div",{className:"sets-page-nav"}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(sm,{})," 返回项目"]})})]}),r.jsx("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:r.jsxs(bn,{className:"gap-0 py-0",children:[r.jsx(Vn,{className:"border-b border-border/60 px-5 py-4",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(zC,{className:"size-4 text-[var(--star-text)]"})," 用户列表",r.jsxs("span",{className:"font-normal text-muted-foreground",children:[n.length," 人"]}),r.jsxs(H,{variant:"outline",size:"sm",className:"ml-auto",onClick:D,children:[r.jsx(ai,{})," 新增用户"]})]})}),r.jsx(kn,{className:"px-3 pb-3",children:n.length?r.jsxs(Tm,{children:[r.jsx($m,{children:r.jsxs(Io,{className:"hover:bg-transparent",children:[r.jsx(Cn,{className:"px-3",children:"ID"}),r.jsx(Cn,{className:"px-3",children:"用户名"}),r.jsx(Cn,{className:"px-3",children:"创建时间"}),r.jsx(Cn,{className:"px-3",children:"角色"}),r.jsx(Cn,{className:"px-3 text-right",children:"操作"})]})}),r.jsx(Im,{children:n.map(G=>r.jsxs(Io,{children:[r.jsx(yn,{className:"px-3 text-muted-foreground",children:G.id}),r.jsx(yn,{className:"px-3 font-medium",children:G.username}),r.jsx(yn,{className:"px-3 font-mono text-xs text-muted-foreground",children:G.created_at}),r.jsx(yn,{className:"px-3",children:G.is_admin?r.jsx(Vl,{variant:"outline",className:"border-[var(--admin-badge)] text-[var(--admin-badge)]",children:"管理员"}):r.jsx(Vl,{variant:"secondary",children:"普通用户"})}),r.jsx(yn,{className:"px-3",children:r.jsxs("div",{className:"flex justify-end gap-1.5",children:[r.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>L(G),children:[r.jsx(im,{})," 编辑"]}),!G.is_admin&&r.jsxs(H,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>q(G),children:[r.jsx(Gs,{})," 删除"]})]})})]},G.id))})]}):r.jsx("div",{className:"px-2 py-6 text-sm text-muted-foreground",children:"暂无用户"})})]})})]}),r.jsx(en,{open:o,onOpenChange:l,children:r.jsxs(Ut,{className:"modal modal-rz"+(S?" rz-drag":""),style:{...N,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:_,reset:O}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:C,children:"新增用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ae,{value:a.username,onChange:G=>{i({...a,username:G.target.value.trim()}),d("")},placeholder:"2-32 位字母数字或 _ . -"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ae,{value:a.password,onChange:G=>i({...a,password:G.target.value}),type:"password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"确认"}),r.jsx(Ae,{value:a.password2,onChange:G=>i({...a,password2:G.target.value}),type:"password",placeholder:"至少 6 位"})]})]}),c&&r.jsx("div",{className:"text-sm text-destructive",children:c})]}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>l(!1),children:"取消"}),r.jsx(H,{onClick:K,children:"新增用户"})]})]})}),r.jsx(en,{open:f,onOpenChange:m,children:r.jsxs(Ut,{className:"modal modal-rz"+(j?" rz-drag":""),style:{...v,marginTop:0},showCloseButton:!1,children:[r.jsx(ir,{start:g,reset:b}),r.jsx(Vt,{className:"text-left",children:r.jsx(Wt,{className:"cursor-move select-none text-sm",onMouseDown:w,children:"编辑用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ae,{value:p.username,onChange:G=>{h({...p,username:G.target.value.trim()}),y("")}})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"重置密码"}),r.jsx(Ae,{value:p.password,onChange:G=>h({...p,password:G.target.value}),type:"password",placeholder:"留空则不修改"})]}),x&&r.jsx("div",{className:"text-sm text-destructive",children:x})]}),r.jsxs(jn,{children:[r.jsx(H,{variant:"outline",onClick:()=>m(!1),children:"取消"}),r.jsx(H,{onClick:I,children:"保存"})]})]})})]})}const Hj="data-ds-dark-theme",Uj="(prefers-color-scheme: dark)";function Vj(e=window){try{const t=e==null?void 0:e.parent;return!t||t===e?null:t.document||null}catch{return null}}function Wj(e){try{return!e||!e.body?null:e.body.hasAttribute(Hj)}catch{return null}}function Z$(e=window){var t,n;try{return!!((n=(t=e==null?void 0:e.matchMedia)==null?void 0:t.call(e,Uj))!=null&&n.matches)}catch{return!1}}function qj(e=Vj(),t=window){const n=Wj(e);return n===null?Z$(t):n}function eI(e,t=Vj(),n=window){var a;const s=[],o=()=>{try{e(qj(t,n))}catch{}},l=t==null?void 0:t.body;if(l&&typeof MutationObserver<"u")try{const i=new MutationObserver(o);i.observe(l,{attributes:!0,attributeFilter:[Hj]}),s.push(()=>i.disconnect())}catch{}if(Wj(t)===null)try{const i=(a=n==null?void 0:n.matchMedia)==null?void 0:a.call(n,Uj);if(i!=null&&i.addEventListener){const c=()=>o();i.addEventListener("change",c),s.push(()=>i.removeEventListener("change",c))}}catch{}return()=>{for(const i of s)try{i()}catch{}s.length=0}}const Gj="ts_skin",Vs="auto",tI="dsh-dark",Gm=[{id:"dsh-dark",label:"DSH 深色",preview:["#1b1b1c","#f9fafb"]},{id:"dsh-light",label:"DSH 浅色",preview:["#f9fafb","#0f1115"]},{id:"starlight",label:"星夜金",preview:["#141E36","#E8B86D"]},{id:"classic",label:"经典蓝",preview:["#151b23","#58a6ff"]}],nI=["#f9fafb","#151517"];function sI(){try{return window.self!==window.top}catch{return!0}}function Kj(){return sI()?Vs:tI}function Yj(e){return e===Vs||Gm.some(t=>t.id===e)}function rI(){const e=localStorage.getItem(Gj);return Yj(e)?e:Kj()}function Qj(e,t=qj()){return e!==Vs?e:t?"dsh-dark":"dsh-light"}let fa=null;function Xj(e){document.documentElement.dataset.skin=Qj(e)}function oI(e){if(e===Vs){if(fa)return;fa=eI(()=>Xj(Vs));return}fa&&(fa(),fa=null)}function Jj(e){const t=Yj(e)?e:Kj();Xj(t);try{localStorage.setItem(Gj,t)}catch{}oI(t)}function Zj(){return rI()}function lI(){Jj(Zj())}function aI(e){var t;return e===Vs?"跟随 DSH":((t=Gm.find(n=>n.id===e))==null?void 0:t.label)||e}const e1="ts_fs",t1=[{value:.9,label:"小"},{value:1,label:"标准"},{value:1.15,label:"大"},{value:1.3,label:"特大"}];function n1(){const e=parseFloat(localStorage.getItem(e1));return t1.some(t=>t.value===e)?e:1}function s1(e){document.documentElement.style.setProperty("--fs",String(e));try{localStorage.setItem(e1,String(e))}catch{}}function iI(){s1(n1())}const r1="ts_bright",Km=[{id:"normal",label:"原样",hint:"出厂取值"},{id:"dim",label:"偏暗",hint:"压一档(默认)"},{id:"dimmer",label:"更暗",hint:"再压一档"}],o1="dim";function l1(){const e=localStorage.getItem(r1);return Km.some(t=>t.id===e)?e:o1}function a1(e){const t=Km.some(n=>n.id===e)?e:o1;document.documentElement.dataset.bright=t;try{localStorage.setItem(r1,t)}catch{}}function cI(){a1(l1())}function uI(){const[e,t]=u.useState(null),[n,s]=u.useState({api_base:"",model:"",api_key:"",timeout_s:"",batch_size:""}),[o,l]=u.useState(null),[a,i]=u.useState(!1);async function c(){try{const h=await Br.ragGet();t(h),s({api_base:h.api_base||"",model:h.model||"",api_key:"",timeout_s:h.timeout_s!=null?String(h.timeout_s):"",batch_size:h.batch_size!=null?String(h.batch_size):""})}catch(h){M(h.message)}}u.useEffect(()=>{c()},[]);function d(){const h={api_base:n.api_base.trim(),model:n.model.trim()};return n.api_key&&(h.api_key=n.api_key),n.timeout_s.trim()&&(h.timeout_s=n.timeout_s.trim()),n.batch_size.trim()&&(h.batch_size=n.batch_size.trim()),h}async function f(){i(!0);try{await Br.ragSet(d()),M("RAG 配置已保存,立即生效"),await c()}catch(h){M(h.message)}finally{i(!1)}}async function m(){l(null),i(!0);try{l(await Br.ragTest(d()))}catch(h){M(h.message)}finally{i(!1)}}async function p(){if(window.confirm("确认停用 RAG 语义检索?将删除配置文件,检索回到纯词面模式"))try{await Br.ragSet({clear:!0}),M("已停用 RAG"),l(null),await c()}catch(h){M(h.message)}}return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(F0,{className:"size-4 text-[var(--star-text)]"})," 案例库语义检索(RAG)",e&&(e.configured?r.jsx(Vl,{children:"已启用"}):r.jsx(Vl,{variant:"secondary",children:"未启用"}))]})}),r.jsxs(kn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"走 OpenAI 兼容 /v1/embeddings 接口做嵌入,与内置 BM25 混合检索案例库; 未配置或调用失败时自动回落纯词面检索,不影响任务运行。保存后立即生效(无需重启); 更换模型后下次索引刷新自动全量重建。"}),r.jsxs("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",title:(e==null?void 0:e.config_path)||"",children:["配置文件:",(e==null?void 0:e.config_path)||"…"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"API 地址(api_base,含 /v1,不含 /embeddings)"}),r.jsx(Ae,{value:n.api_base,onChange:h=>s({...n,api_base:h.target.value.trim()}),placeholder:"https://api.openai.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"嵌入模型(model,非对话模型)"}),r.jsx(Ae,{value:n.model,onChange:h=>s({...n,model:h.target.value.trim()}),placeholder:"text-embedding-3-small"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"API Key(仅存服务端配置文件,不回显明文)"}),r.jsx(Ae,{type:"password",value:n.api_key,onChange:h=>s({...n,api_key:h.target.value}),placeholder:e!=null&&e.has_api_key?`已设置(${e.api_key_masked},留空保持不变)`:"sk-…"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"请求超时(秒)"}),r.jsx(Ae,{value:n.timeout_s,onChange:h=>s({...n,timeout_s:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.timeout_s)??30}`})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"嵌入批量大小"}),r.jsx(Ae,{value:n.batch_size,onChange:h=>s({...n,batch_size:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.batch_size)??16}`})]})]}),o&&(o.ok?r.jsxs("div",{className:"text-sm text-[var(--ok-text)]",children:["连接成功:嵌入向量维度 ",o.dim]}):r.jsxs("div",{className:"text-sm text-destructive",children:["连接失败:",o.error]})),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(H,{variant:"outline",disabled:a,onClick:f,children:"保存配置"}),r.jsxs(H,{variant:"ghost",disabled:a,onClick:m,children:[r.jsx(vC,{})," 测试连接"]}),(e==null?void 0:e.configured)&&r.jsxs(H,{variant:"ghost",className:"text-destructive hover:text-destructive",disabled:a,onClick:p,children:[r.jsx(Gs,{})," 停用"]})]})]})]})}function dI(e,t={}){const n={enabled:!!(e&&e.enabled),events:e&&e.events||[]},s=(t&&t.webhook_url||"").trim();return s&&(n.webhook_url=s),t&&t.webhook_secret&&(n.webhook_secret=t.webhook_secret),n}function fI(e,t,n,s={}){const o=dI(n,s);return e?{kind:"all",body:o}:{kind:"one",pid:t,body:o}}function pI(e){const t=Number(e&&e.updated)||0,n=Number(e&&e.archived_skipped)||0;return n>0?`已应用到 ${t} 个项目(跳过 ${n} 个已归档)`:`已应用到 ${t} 个项目`}function Kc(e){const t=e&&e.push_enabled;return!(t===0||t===!1)}function mI(e,t){return{...e||{},push_enabled:t?1:0}}const hI=["base_url","app_id"];function gI(e){const t=e||{},n={enabled:!!t.enabled,push_enabled:Kc(t)};for(const s of hI)n[s]=(t[s]||"").trim();return n}function xI(e){return Kc(e)?"当前:推送中(自动推送按各项目的推送绑定与事件勾选送达)":"当前:已停止(飞书不再收到自动推送;你在飞书发指令的查询与对话答复不受影响)"}function i1(e){const t=!!(e!=null&&e.supported),n=!!(e!=null&&e.enabled);return{supported:t,enabled:n,scanDisabled:!t||!n,writeDisabled:!n,refreshDisabled:!1}}function vI(e){const t=e==null?void 0:e.url;return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.url=="string"?t.url:""}function yI(e){const{supported:t,enabled:n}=i1(e),s=[];return t||s.push({key:"unsupported",tone:"warn",text:n?"本机后端不具备「扫码创建应用」能力:扫码按钮不可用(这与「配置自动化被关掉」不是一回事)。仍可用「补齐应用配置」为已有应用补齐权限、事件订阅与回调,App ID / Secret 可在上方手工填写;或升级后端依赖后刷新本页重试扫码。":"本机后端不具备「扫码创建应用」能力:扫码按钮不可用(这与「配置自动化被关掉」不是一回事)。升级后端依赖后刷新本页可重试扫码。"}),n||s.push({key:"disabled",tone:"closed",text:"配置自动化已被 TS_FEISHU_PROVISION=0 关闭:可只跑自检,写操作不可用。"}),s}const wI=[["blocked_interaction","交互等待"],["task_failed","任务失败"],["card_review","卡片待审核"]];function jI(){var S,N;const[e,t]=u.useState(null),[n,s]=u.useState({webhook_url:"",secret:"",app_secret:""}),[o,l]=u.useState(!1),[a,i]=u.useState(null),[c,d]=u.useState([]),[f,m]=u.useState(!1);u.useEffect(()=>{p(),j()},[]);async function p(){try{t(await Ln.feishuCfgGet())}catch(_){M(_.message)}}async function h(){var _;l(!0);try{const C=gI(e);n.webhook_url.trim()&&(C.default_webhook=n.webhook_url.trim()),n.secret&&(C.default_secret=n.secret),n.app_secret&&(C.app_secret=n.app_secret);const O=await Ln.feishuCfgSet(C);s({webhook_url:"",secret:"",app_secret:""});const P=O!=null&&O.inbound_started?"飞书配置已保存,入站消息长连接已启动":"飞书配置已保存(应用凭据变更需重启站点生效)";O!=null&&O.verify&&!O.verify.ok?M(`${P};但凭据快检未通过:${O.verify.detail}`):(_=O==null?void 0:O.verify)!=null&&_.ok?M(`${P};${O.verify.detail}`):M(P),await p()}catch(C){M(C.message)}finally{l(!1)}}async function x(){try{await Ln.feishuCfgSet({default_webhook:"",default_secret:""}),M("已清除默认 Webhook 与签名密钥"),await p()}catch(_){M(_.message)}}async function y(){const _=!f;if(m(_),_)try{d(await Ln.feishuOutbox())}catch(C){M(C.message)}}async function j(){try{i(await Ln.feishuGet())}catch(_){M(_.message)}}async function v(){try{const _=await Ln.feishuBindcode();i(C=>({...C,code:_.code}))}catch(_){M(_.message)}}async function g(){try{const _=await Ln.feishuGet();i(_),M(_.bound?"飞书账号已绑定":"尚未检测到绑定:确认已在飞书私聊机器人发送「绑定 <码>」,且本应用凭据已配置")}catch(_){M(_.message)}}async function w(){try{await Ln.feishuUnbind(),M("已解绑飞书账号"),j()}catch(_){M(_.message)}}const b=!(e!=null&&e.app_id&&(e!=null&&e.has_app_secret));return r.jsxs(r.Fragment,{children:[r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(RN,{className:"size-4 text-[var(--star-text)]"})," 飞书机器人配置"]})}),r.jsxs(kn,{className:"space-y-4 px-5",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",className:"mt-0.5",checked:Kc(e),onChange:_=>t(mI(e,_.target.checked))}),r.jsxs("span",{children:["推送总控:允许飞书接收自动推送",r.jsx("span",{className:"text-xs text-muted-foreground",children:"(关掉后飞书不再收到自动推送;你在飞书发指令的查询、会话对话的答复不受影响)"})]})]}),r.jsx("div",{className:"text-xs "+(Kc(e)?"text-muted-foreground":"text-[var(--star-text)]"),children:xI(e)})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!(e!=null&&e.enabled),onChange:_=>t({...e,enabled:_.target.checked})}),"启用飞书推送(默认 webhook 回落)"]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:0},children:"只管「未单独设置推送绑定」的项目:它们回落下方默认 Webhook 并按默认事件推送; 已单独设置推送绑定的项目由那张卡里的开关说了算,不受本项影响。"})]}),r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个用户配置自己的飞书机器人:入站长连接按用户各自拉起,推送未绑定项目时 回落项目所有者的默认 webhook。凭据(App Secret/签名密钥)仅存服务端,不回显。"}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"应用 App ID(入站指令用)"}),r.jsx(Ae,{value:(e==null?void 0:e.app_id)||"",onChange:_=>t({...e,app_id:_.target.value.trim()}),placeholder:"cli_xxxx"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"App Secret"}),r.jsx(Ae,{type:"password",value:n.app_secret,onChange:_=>s({...n,app_secret:_.target.value}),placeholder:e!=null&&e.has_app_secret?"已设置(留空保持不变)":"凭证与基础信息页复制"})]})]}),r.jsxs("div",{className:"text-xs",title:"凭据齐全且连接线程已启动时,机器人才能接收飞书消息;连接失败细节看 server.log",children:["入站长连接:",(S=e==null?void 0:e.inbound)!=null&&S.thread?r.jsx("span",{className:"text-[var(--star-text)]",children:"运行中"}):(N=e==null?void 0:e.inbound)!=null&&N.configured?"已配置,待启动(重启站点生效)":"未配置(填写并保存后自动连接)"]}),r.jsx("div",{className:"hint",children:"入站指令需:应用开通「机器人」能力 + 权限 im:message.p2p_msg:readonly / im:message.group_at_msg:readonly / im:message:send_as_bot(斜杠指令另需 application:app_slash_command:read|write)+ 事件订阅选「长连接」并添加 im.message.receive_v1、回调 card.action.trigger + 应用发布生效。**下方「飞书接入」卡可扫码建应用并自动配好这些**;Secret 保存后不回显(留空=保持现有值),首次配置保存后自动建立长连接,变更凭据需重启站点。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"默认推送 Webhook(未绑定项目的回落目标)"}),r.jsx(Ae,{value:n.webhook_url,onChange:_=>s({...n,webhook_url:_.target.value}),placeholder:e!=null&&e.default_webhook?`已配置:${e.default_webhook}(留空保持不变)`:"https://open.feishu.cn/open-apis/bot/v2/hook/…"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ae,{type:"password",value:n.secret,onChange:_=>s({...n,secret:_.target.value}),placeholder:e!=null&&e.has_default_secret?"已设置(留空保持不变)":"可空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"站点访问地址(通知里附「详情」链接,可空)"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Ae,{value:(e==null?void 0:e.base_url)||"",onChange:_=>t({...e,base_url:_.target.value}),placeholder:"http://192.0.2.10:4601"}),r.jsx(H,{variant:"ghost",type:"button",onClick:()=>t({...e,base_url:window.location.origin}),children:"用当前站点"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(H,{variant:"outline",disabled:o,onClick:h,children:"保存配置"}),r.jsx(H,{variant:"ghost",onClick:x,children:"清除默认 Webhook/密钥"}),r.jsx(H,{variant:"ghost",onClick:y,children:f?"收起投递记录":"投递记录"})]}),f&&r.jsx("div",{className:"max-h-60 overflow-y-auto rounded border border-border/60 text-xs",children:c.length?c.map(_=>r.jsxs("div",{className:"border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Vl,{variant:_.status==="sent"?"secondary":_.status==="pending"?"outline":"destructive",children:_.status}),r.jsxs("span",{className:"text-muted-foreground",children:["重试×",_.retries]}),r.jsx("span",{className:"truncate font-mono",children:_.target}),r.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:_.created_at})]}),_.last_error&&r.jsx("div",{className:"truncate text-destructive",title:_.last_error,children:_.last_error})]},_.id)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无投递记录"})})]})]}),r.jsx(kI,{onCfgChanged:p}),r.jsx(SI,{}),r.jsx(bI,{}),r.jsx(NI,{}),r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(H0,{className:"size-4 text-[var(--star-text)]"})," 飞书账号绑定"]})}),r.jsxs(kn,{className:"space-y-3 px-5",children:[a?a.bound?r.jsxs("div",{className:"space-y-1.5 text-sm",children:[r.jsxs("div",{children:["已绑定飞书账号 ",r.jsx("span",{className:"font-mono text-xs",children:a.open_id})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["默认项目:",a.default_project||"未设置(指令未指名项目时机器人会列出可选项目)"]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"在飞书私聊机器人发「帮助」可查看支持的指令。"})]}):r.jsxs("div",{className:"space-y-2 text-sm",children:[b&&r.jsx("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-xs",children:"注意:上方机器人应用凭据(App ID / App Secret)尚未配置,此刻飞书消息无法送达平台,绑定不会生效。 请先填写并保存,再生成绑定码。"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"绑定后可在飞书私聊机器人执行看板指令(开始卡片 / 审核通过 / 驳回 / 作答提问等)。"}),a.code?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-center",children:[r.jsx("div",{className:"font-mono text-2xl font-bold tracking-[0.3em]",children:a.code}),r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"10 分钟内有效;重新生成会作废旧码"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["打开飞书 → 私聊你配置的机器人 → 发送「绑定 ",a.code,"」→ 回来点「刷新状态」确认。"]})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"尚未绑定,点击下方「生成绑定码」开始。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}),r.jsx("div",{className:"flex gap-2",children:a!=null&&a.bound?r.jsx(H,{variant:"destructive",onClick:w,children:"解绑"}):a!=null&&a.code?r.jsxs(r.Fragment,{children:[r.jsx(H,{variant:"outline",onClick:v,children:"重新生成"}),r.jsxs(H,{variant:"outline",onClick:g,children:[r.jsx(Ka,{})," 刷新状态"]})]}):a&&r.jsx(H,{onClick:v,disabled:b,title:b?"先配置应用凭据,否则机器人收不到消息":void 0,children:"生成绑定码"})})]})]})]})}function bI(){const[e,t]=u.useState([]),[n,s]=u.useState(null),[o,l]=u.useState(null),[a,i]=u.useState({webhook_url:"",webhook_secret:""}),[c,d]=u.useState(!1),[f,m]=u.useState(!1);u.useEffect(()=>{let y=!0;return kt.list().then(j=>{if(!y)return;t(j);const v=j.find(g=>!g.archived)||j[0];v&&s(v.id)}).catch(j=>M(j.message)),()=>{y=!1}},[]),u.useEffect(()=>{if(i({webhook_url:"",webhook_secret:""}),!n){l(null);return}let y=!0;return kt.feishuHookGet(n).then(j=>{y&&l(j)}).catch(()=>{y&&l(null)}),()=>{y=!1}},[n]);async function p(){if(!(!n||!o)){m(!0);try{const y=fI(c,n,o,a);if(y.kind==="all"){const j=await kt.feishuHookApplyAll(y.body);i({webhook_url:"",webhook_secret:""}),M(pI(j))}else await kt.feishuHookSet(y.pid,y.body),i({webhook_url:"",webhook_secret:""}),M("项目飞书推送配置已保存");kt.feishuHookGet(n).then(l).catch(()=>{})}catch(y){M(y.message)}finally{m(!1)}}}const h=e.map(y=>({value:y.id,label:y.name+(y.archived?"(已归档)":""),search:y.project_dir||""})),x=e.filter(y=>!y.archived).length;return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(UC,{className:"size-4 text-[var(--star-text)]"})," 项目推送绑定"]})}),r.jsxs(kn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个项目可单独绑定推送群与事件开关;未绑定或未启用时回落上方的默认推送 Webhook。 群 Webhook 消息与飞书单聊交互卡片共用这里的开关。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"项目"}),r.jsx(qc,{options:h,value:n,onChange:s,placeholder:e.length?"选择项目…":"暂无项目",emptyHint:"无匹配项目"})]}),e.length?o?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!o.enabled,onChange:y=>l({...o,enabled:y.target.checked})}),"启用推送"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"群机器人 Webhook"}),r.jsx(Ae,{value:a.webhook_url,onChange:y=>i({...a,webhook_url:y.target.value}),placeholder:o.webhook_url?`已绑定:${o.webhook_url}(留空保持)`:"飞书群自定义机器人 Webhook URL"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ae,{type:"password",value:a.webhook_secret,onChange:y=>i({...a,webhook_secret:y.target.value}),placeholder:o.has_webhook_secret?"已设置(留空保持不变)":"可空"})]}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm",children:wI.map(([y,j])=>r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",checked:o.events.includes(y),onChange:v=>l({...o,events:v.target.checked?[...o.events,y]:o.events.filter(g=>g!==y)})}),j]},y))}),r.jsx("div",{className:"hint",children:"交互等待 / 任务失败默认推送;卡片待审核默认关。Webhook 与签名密钥留空保存时不下发(保持现有值)。"}),r.jsx("div",{className:"hint",children:"以上开关同时管「群 Webhook 消息」与「飞书单聊交互卡片」:取消勾选「启用推送」后该项目不再推送,事件不勾的也不会推。"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:c,onChange:y=>d(y.target.checked)}),"同时应用到我的全部项目(",x," 个未归档项目;已归档项目不动)"]}),r.jsx("div",{children:r.jsx(H,{variant:"outline",disabled:f,onClick:p,children:c?"保存并应用到全部项目":"保存项目推送"})})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}):null]})]})}function kI({onCfgChanged:e}){const[t,n]=u.useState(null),[s,o]=u.useState(null),[l,a]=u.useState(!1);async function i(){try{n(await Ln.feishuProvisionGet())}catch(h){M(h.message)}}u.useEffect(()=>{i()},[]),u.useEffect(()=>{if((t==null?void 0:t.state)!=="waiting")return;const h=setInterval(async()=>{try{const x=await Ln.feishuProvisionGet();n(x),x.state==="success"?(M(`应用已创建:${x.app_id}`),e==null||e()):x.state==="failed"&&M(x.error||"扫码创建失败")}catch{}},3e3);return()=>clearInterval(h)},[t==null?void 0:t.state]);async function c(h,x,y){a(!0);try{const j=await Ln.feishuProvisionSet(h,x||{});h==="start"?(n(v=>({...v||{},state:j.state,url:j.url,error:j.error})),j.ok||M(j.error||"发起失败")):(o({action:h,...j}),j.ok?M(y):M(j.error||"操作失败"),await i())}catch(j){M(j.message)}finally{a(!1)}}const d=(t==null?void 0:t.state)||"idle",f=i1(t),m=yI(t),p=vI(t);return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(BC,{className:"size-4 text-[var(--star-text)]"})," 飞书接入(扫码一键配置)"]})}),r.jsx(kn,{className:"space-y-3 px-5",children:t?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"没有应用也能开始:点「扫码创建飞书应用」→ 用手机飞书打开链接确认 → 平台自动拿到 App ID / Secret、建长连接,并自动开通所需权限、订阅事件与卡片回调。 发布新版本仍需企业管理员审批(或请管理员对该应用开「免审」)。"}),m.map(h=>r.jsx("div",{className:h.tone==="closed"?"text-xs text-[var(--star-text)]":"text-xs text-destructive",children:h.text},h.key)),d==="waiting"&&r.jsxs("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-xs",children:[r.jsx("div",{children:"等待你在飞书里确认(链接 10 分钟内有效):"}),p?r.jsx("div",{className:"mt-1 break-all font-mono text-[11px]",children:p}):r.jsx("div",{className:"mt-1 text-muted-foreground",children:"正在获取确认链接…"}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[p&&r.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{var h;(h=navigator.clipboard)==null||h.writeText(p),M("链接已复制")},children:"复制链接"}),r.jsx(H,{variant:"ghost",size:"sm",disabled:l,onClick:()=>c("cancel"),children:"取消"})]})]}),d==="failed"&&t.error&&r.jsx("div",{className:"text-xs text-destructive",children:t.error}),d==="success"&&r.jsxs("div",{className:"text-xs",children:["已接入应用 ",r.jsx("span",{className:"font-mono",children:t.app_id}),t.error?r.jsx("div",{className:"text-destructive",children:t.error}):null]}),!!(t.steps||[]).length&&r.jsx("div",{className:"rounded border border-border/60 text-xs",children:t.steps.map(h=>r.jsxs("div",{className:"flex items-start gap-2 border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsx("span",{children:h.ok?"✅":"❌"}),r.jsx("span",{className:"shrink-0",children:h.label}),r.jsx("span",{className:"truncate text-muted-foreground",title:h.detail,children:h.detail})]},h.key))}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(H,{variant:"outline",disabled:l||f.scanDisabled||d==="waiting",onClick:()=>{t.app_id&&!window.confirm(`当前已接入应用 ${t.app_id},重新扫码会换成新应用,继续?`)||c("start",{force:!!t.app_id})},children:"扫码创建飞书应用"}),r.jsx(H,{variant:"ghost",disabled:l||f.writeDisabled,onClick:()=>c("apply",{},"应用配置已补齐(发布后线上生效)"),children:"补齐应用配置"}),r.jsx(H,{variant:"ghost",disabled:l||f.writeDisabled,onClick:()=>{window.confirm("把当前改动作为新版本提交给企业管理员审批?(发布后需管理员同意才线上生效)")&&c("publish",{},"已提交发布,等管理员审批")},children:"提交发布"}),r.jsx(H,{variant:"ghost",disabled:l||f.refreshDisabled,onClick:i,children:"刷新状态"})]}),(s==null?void 0:s.action)==="publish"&&s.ok&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:["已提交版本 ",s.version,"(version_id=",s.version_id||"-","); 企业管理员审批通过后线上生效。"]}),r.jsx("div",{className:"hint",children:"「补齐应用配置」会写你飞书应用的权限/事件订阅/回调(需 application:application:patch 权限, 缺权限会给出开通指引);一键接入不需要它——扫码创建时已按平台清单预置。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"})})]})}const _I={ok:"✅",warn:"⚠️",fail:"❌",skip:"➖"};function SI(){const[e,t]=u.useState(null),[n,s]=u.useState(null),[o,l]=u.useState(!1),[a,i]=u.useState(!1);async function c(){i(!0);try{const d=await Ln.feishuDoctor(o);t(d.items||[]),s(d.summary||null)}catch(d){M(d.message)}finally{i(!1)}}return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(IC,{className:"size-4 text-[var(--star-text)]"})," 配置自检"]})}),r.jsxs(kn,{className:"space-y-3 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"逐项检查「凭据/机器人能力/长连接/事件订阅/权限」,红色项按提示修即可。"}),r.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[r.jsx("input",{type:"checkbox",checked:o,onChange:d=>l(d.target.checked)}),"发送测试消息(验证「发消息」权限,会给你已绑定的飞书账号发一条 DM)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(H,{variant:"outline",disabled:a,onClick:c,children:"运行自检"}),!e&&r.jsx("span",{className:"self-center text-xs text-muted-foreground",children:"点「运行自检」开始(会读取你应用的凭据与权限状态)"})]}),e&&r.jsx("div",{className:"rounded border border-border/60 text-xs",children:e.map(d=>r.jsxs("div",{className:"border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"shrink-0",children:_I[d.state]||"•"}),r.jsx("span",{className:"shrink-0",children:d.label}),r.jsx("span",{className:"text-muted-foreground",children:d.detail})]}),d.hint?r.jsxs("div",{className:"mt-0.5 pl-6 text-muted-foreground",children:["提示:",d.hint]}):null]},d.key))}),n&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:["汇总:通过 ",n.ok,"、待修 ",n.fail,"、提醒 ",n.warn,"、跳过 ",n.skip]})]})]})}function NI(){var p,h,x,y,j,v;const[e,t]=u.useState(null),[n,s]=u.useState(!1),[o,l]=u.useState(null);async function a(){try{t(await Ln.feishuSlashGet())}catch(g){M(g.message)}}u.useEffect(()=>{a()},[]);async function i(g){s(!0);try{const w=await Ln.feishuSlashSet(g);l({action:g,...w}),g==="notify"?w.ok?M("权限引导卡片已发到你的飞书私聊,点卡片上的按钮即可重试注册"):M(w.error||"卡片发送失败"):w.ok?M(g==="sync"?`同步完成:新增 ${w.created.length}、更新 ${w.updated.length}、已最新 ${w.kept.length}`:`已清除 ${w.deleted.length} 条 TS 指令`):M(w.card_sent?"需要先开通权限:已把引导卡片发到你的飞书私聊":w.error||"操作失败,请看卡片上的提示"),await a()}catch(w){M(w.message)}finally{s(!1)}}const c=(e==null?void 0:e.remote)||[],d=(e==null?void 0:e.desired)||[],f=new Set(c.map(g=>g.command)),m=d.filter(g=>{const w=c.find(b=>b.command===g.command);return!w||w.description!==g.description||w.icon!==g.icon});return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(DN,{className:"size-4 text-[var(--star-text)]"})," 快捷指令(输入框打「/」)"]})}),r.jsxs(kn,{className:"space-y-3 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"把平台指令注册成飞书斜杠指令:机器人私聊里输入「/」即可从指令面板选 /status、/cards、 /approve 等(选中后以「/名称 [参数]」发给机器人,用法与中文指令一致)。 同步只增改本平台的指令,不影响你应用里的其他指令。"}),e?r.jsxs(r.Fragment,{children:[e.error&&r.jsx("div",{className:"text-xs text-destructive",children:e.error}),e.need_scope&&r.jsx("div",{className:"text-xs text-[var(--star-text)]",children:"缺「应用指令」权限:点「发飞书权限卡片」→ 你的飞书私聊会收到一张引导卡片, 在上面点「我已开通,重试注册」即由后端重试(无需回站点手动重试)。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(H,{variant:"outline",disabled:n,onClick:()=>i("sync"),children:"注册 / 同步到飞书"}),r.jsx(H,{variant:"ghost",disabled:n,onClick:()=>i("notify"),children:"发飞书权限卡片"}),r.jsx(H,{variant:"ghost",disabled:n,onClick:a,children:"刷新状态"}),r.jsx(H,{variant:"ghost",disabled:n||!f.size,onClick:()=>{window.confirm("删除飞书侧本平台的斜杠指令?(你应用里的其他指令不受影响)")&&i("clear")},children:"清除 TS 指令"})]}),r.jsxs("div",{className:"text-xs",children:["已注册 ",f.size," / ",d.length," 条",m.length?`,待同步 ${m.length} 条`:",均已与平台一致",(p=e.extra)!=null&&p.length?`;另有 ${e.extra.length} 条非 TS 指令(不会改动)`:""]}),r.jsx("div",{className:"max-h-52 overflow-y-auto rounded border border-border/60 text-xs",children:d.length?d.map(g=>r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsx(Vl,{variant:f.has(g.command)?"secondary":"outline",children:f.has(g.command)?"已注册":"未注册"}),r.jsxs("span",{className:"shrink-0 font-mono",children:["/",g.command]}),r.jsx("span",{className:"truncate text-muted-foreground",title:g.description,children:g.description})]},g.command)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无可注册指令"})}),o&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.action==="sync"?`上次同步:新增 ${((h=o.created)==null?void 0:h.length)||0}、更新 ${((x=o.updated)==null?void 0:x.length)||0}、已最新 ${((y=o.kept)==null?void 0:y.length)||0}`:o.action==="notify"?"权限引导卡片已发送(去飞书私聊查看)":`上次清除:删除 ${((j=o.deleted)==null?void 0:j.length)||0} 条`,o.card_sent?r.jsx("div",{className:"text-[var(--star-text)]",children:"已把权限引导卡片发到你的飞书私聊,点卡片上的「我已开通,重试注册」即自动重试"}):null,o.card_error?r.jsx("div",{className:"text-destructive",children:o.card_error}):null,(v=o.failed)!=null&&v.length?r.jsx("div",{className:"text-destructive",title:o.failed.join(`
|
|
482
|
-
`),children:o.failed[0]}):null]}),r.jsx("div",{className:"hint",children:"权限:应用需开通 application:app_slash_command:read / write 并**创建版本发布**才可用; 缺权限时可点「发飞书权限卡片」,在飞书卡片上确认后自动重试。 注册结果约 5 分钟同步到客户端(客户端另有约 3 分钟缓存,重启飞书客户端可加速); PC 飞书需 7.70+、移动端 7.71+。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"})]})]})}const sp={absent:{label:"未安装",cls:"none",action:"安装"},installed:{label:"已安装",cls:"ok",action:"重新安装"},outdated:{label:"可更新",cls:"warn",action:"更新"},partial:{label:"需修复",cls:"bad",action:"修复"}},CI={marked:"平台注册(可整块卸载)",canonical:"手工注册(文本规范,平台可代管)",foreign:"自定义写法(平台只报告、不改动)","":"未注册"};function EI(){const e=Xn(),[t,n]=u.useState("user"),[s,o]=u.useState([]),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),m=u.useRef(0);u.useEffect(()=>{let x=!0;return kt.list().then(y=>{if(!x)return;o(y);const j=y.find(v=>!v.archived)||y[0];j&&a(j.id)}).catch(y=>M(y.message)),()=>{x=!1}},[]);async function p(){const x=++m.current;try{const y=await sd.list(t,l);x===m.current&&c(y)}catch(y){x===m.current&&M(y.message)}}u.useEffect(()=>{c(null),!(t==="project"&&!l)&&p()},[t,l]);async function h(x,y){f(`${x.id}:${y}`);try{const j=y==="install"?await sd.install(x.id,t,l):await sd.uninstall(x.id,t,l);y==="uninstall"?M(`已卸载「${x.name}」`):j.state==="installed"?M(j.restart_required?`已安装「${x.name}」,需重启 dsh 生效`:x.type==="dsh_plugin"?`已安装「${x.name}」,注册行已写入(热生效)`:`已安装「${x.name}」,对之后新起的 agent 会话生效`):M(`「${x.name}」安装后状态:${(sp[j.state]||{}).label||j.state}`),await p()}catch(j){M(j.message)}finally{f("")}}return r.jsxs(r.Fragment,{children:[r.jsxs(bn,{className:"max-w-2xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(z0,{className:"size-4 text-[var(--star-text)]"})," 内置资产"]})}),r.jsxs(kn,{className:"space-y-3 px-5",children:[r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:["安装平台内置资产(清单 = 仓库 ",r.jsx("span",{className:"font-mono",children:"extensions/*/asset.json"}),"), 两类:",r.jsx("span",{className:"font-mono",children:"skill"}),"(技能文件)与",r.jsx("span",{className:"font-mono",children:"dsh_plugin"}),"(dsh 原生插件:拷进 dsh profile 的 node_modules 并写入 ",r.jsx("span",{className:"font-mono",children:"cordis.patch.yml"})," 注册行,仅用户级)。 用户级写服务进程 HOME(如 ",r.jsx("span",{className:"font-mono",children:"~/.dsh/skills"}),"、",r.jsx("span",{className:"font-mono",children:"~/.dsh/profiles"}),"),影响本机所有项目、仅管理员可操作; 项目级写所选项目目录(如 ",r.jsx("span",{className:"font-mono",children:"<项目>/.dsh/skills"}),"),仅项目所有者可操作。 安装 = 收敛到清单期望状态(已装的会按内容更新)。"]}),r.jsxs("div",{className:"ext-seg",children:[r.jsx("button",{type:"button",className:t==="user"?"active":"",onClick:()=>n("user"),children:"用户级(本机)"}),r.jsx("button",{type:"button",className:t==="project"?"active":"",onClick:()=>n("project"),children:"项目级(所选项目)"})]}),t==="project"&&(s.length>0?r.jsx("div",{style:{maxWidth:320},children:r.jsx(qc,{options:s.map(x=>({value:x.id,label:x.name+(x.archived?"(已归档)":""),search:x.project_dir})),value:l,onChange:a,placeholder:"选择项目"})}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"还没有项目:先在项目页创建项目,再回来装项目级资产。"})),t==="user"&&!e.isAdmin&&r.jsx("div",{className:"text-xs text-destructive",children:"用户级安装会写入本机 agent 配置、影响所有项目,仅管理员可操作——此处对你只读。"})]})]}),i&&i.assets.map(x=>r.jsx(RI,{a:x,target:t,canInstall:i.can_install,busy:d,onAct:h},x.id)),i&&i.assets.length===0&&r.jsx(bn,{className:"max-w-2xl py-4",children:r.jsx(kn,{className:"px-5 text-xs text-muted-foreground",children:"该目标下暂无可安装的内置资产。"})}),!i&&r.jsx(bn,{className:"max-w-2xl py-4",children:r.jsx(kn,{className:"px-5 text-xs text-muted-foreground",children:t==="project"&&!l?"请先选择项目。":"加载中…"})})]})}function RI({a:e,target:t,canInstall:n,busy:s,onAct:o}){const l=sp[e.state]||sp.absent,a=!e.supported||!n,i=s===`${e.id}:install`,c=s===`${e.id}:uninstall`;function d(){const f=e.type==="dsh_plugin"?"会删除插件包文件与平台写的注册行(用户自定义写法的注册行一律不动,遇到会拒绝并说明)。":"会删除平台安装进技能目录的文件(用户手工放的同名文件不动)。";window.confirm(`确认卸载「${e.name}」?
|
|
483
|
-
${f}`)&&o(e,"uninstall")}return r.jsxs(bn,{className:"max-w-2xl gap-3 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.name,r.jsx("span",{className:"ext-kind",children:e.type_label||e.type}),e.family_label&&e.family_label!==(e.type_label||e.type)&&r.jsx("span",{className:"ext-kind",children:e.family_label}),r.jsx("span",{className:"ext-state "+l.cls,children:l.label})]})}),r.jsxs(kn,{className:"space-y-2 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:e.description}),e.files.map(f=>r.jsxs("div",{className:"ext-path",children:[f.path,f.exists?f.same?"":"(内容与仓库不一致)":"(尚未安装)"]},f.to)),e.plugin&&r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"ext-path",children:[e.plugin.patch_path," —— 注册行:",CI[e.plugin.patch_mode]||e.plugin.patch_mode,e.plugin.disabled?"(已被 dsh 面板停用,安装会重新启用)":""]}),r.jsxs("div",{children:["插件包 ",r.jsx("span",{className:"font-mono",children:e.plugin.package})," · profile"," ",r.jsx("span",{className:"font-mono",children:e.plugin.profile}),e.plugin.restart_required?" · 该 profile 未开 patchReload,装完需重启 dsh 生效":" · 改注册行即热生效"]}),!e.plugin.requires_ok&&r.jsxs("div",{className:"text-destructive",children:["依赖解析不到:",(e.plugin.requires||[]).filter(f=>!f.ok).map(f=>f.spec).join("、"),"——dsh 自带包需在 profile 的 node_modules 里有对应链接(同目录软链),否则插件加载即报模块缺失。"]})]}),!e.supported&&r.jsx("div",{className:"text-xs text-destructive",children:e.reason}),e.state==="outdated"&&r.jsx("div",{className:"text-xs text-destructive",children:"已装文件与仓库版本不一致(可能被本地改过):更新会用仓库版本覆盖,需要保留本地改动请先另存。"}),e.supported&&!n&&r.jsx("div",{className:"text-xs text-destructive",children:t==="user"?"用户级安装仅管理员可操作,此处只读。":"你没有该项目的操作权限。"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[r.jsxs(H,{size:"sm",disabled:a||!!s,onClick:()=>o(e,"install"),children:[r.jsx(UN,{})," ",i?"处理中…":l.action]}),r.jsxs(H,{size:"sm",variant:"ghost",disabled:a||!!s||e.state==="absent",onClick:d,title:e.state==="absent"?"尚未安装":void 0,children:[r.jsx(Gs,{})," ",c?"卸载中…":"卸载"]})]})]})]})}const PI=[{key:"appearance",label:"外观主题",icon:V0,admin:!1},{key:"password",label:"修改密码",icon:lm,admin:!1},{key:"feishu",label:"飞书设置",icon:H0,admin:!1},{key:"assets",label:"内置资产",icon:z0,admin:!1},{key:"rag",label:"RAG 检索配置",icon:F0,admin:!0}];function Mx(){const e=Yl(),t=d_(),n=Xn(),s=PI.filter(a=>!a.admin||n.isAdmin),o=s.find(a=>a.key===t.section)||s[0];u.useEffect(()=>{t.section!==o.key&&e(`/settings/${o.key}`,{replace:!0})},[t.section,o.key]);async function l(){await n.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"设置"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:n.username}),r.jsxs(H,{variant:"ghost",size:"sm",onClick:l,children:[r.jsx(am,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("nav",{className:"sets-page-nav",children:s.map(a=>r.jsxs("button",{type:"button",className:a.key===o.key?"active":"",onClick:()=>e(`/settings/${a.key}`),children:[r.jsx(a.icon,{})," ",a.label]},a.key))}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(sm,{})," 返回项目"]})})]}),r.jsxs("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[o.key==="appearance"&&r.jsx(MI,{}),o.key==="password"&&r.jsx(TI,{}),o.key==="feishu"&&r.jsx(jI,{}),o.key==="assets"&&r.jsx(EI,{}),o.key==="rag"&&r.jsx(uI,{})]})]})]})}function MI(){const[e,t]=u.useState(Zj()),[n,s]=u.useState(n1()),[o,l]=u.useState(l1()),a=Qj(e);function i(c){Jj(c),t(c)}return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(V0,{className:"size-4 text-[var(--star-text)]"})," 外观主题"]})}),r.jsxs(kn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"选择界面配色、文字亮度与字体大小,点选即生效,记录在本浏览器(localStorage),不影响其他用户。 「DSH 深色 / DSH 浅色」对齐 dsh 自身外观;「跟随 DSH」按 dsh 宿主的明暗自动切换。 文字亮度只压文字色梯(正文/次级/强调文字及日志、气泡、菜单文字),不动状态色、背景与按钮填充; 浅色皮肤(DSH 浅色)下不生效——与 dsh 宿主 dim-text 插件的口径一致。"}),r.jsxs("button",{type:"button",className:"skin-pick skin-pick-wide"+(e===Vs?" active":""),onClick:()=>i(Vs),children:[r.jsx("span",{className:"sw",children:nI.map(c=>r.jsx("i",{style:{background:c}},c))}),r.jsxs("span",{className:"skin-pick-txt",children:[r.jsx("span",{children:"跟随 DSH"}),r.jsx("span",{className:"sub",children:e===Vs?`当前生效:${aI(a)}`:"按 dsh 宿主的明暗外观自动切换"})]}),e===Vs&&r.jsx(lr,{className:"ml-auto size-3.5 text-[var(--star)]"})]}),r.jsx("div",{className:"grid grid-cols-2 gap-3",children:Gm.map(c=>r.jsxs("button",{type:"button",className:"skin-pick"+(e===c.id?" active":""),onClick:()=>i(c.id),children:[r.jsx("span",{className:"sw",children:c.preview.map(d=>r.jsx("i",{style:{background:d}},d))}),r.jsx("span",{children:c.label}),e===c.id&&r.jsx(lr,{className:"ml-auto size-3.5 text-[var(--star)]"})]},c.id))}),r.jsx("div",{className:"grid grid-cols-4 gap-3",children:t1.map(c=>r.jsxs("button",{type:"button",className:"fs-pick"+(n===c.value?" active":""),onClick:()=>{s1(c.value),s(c.value)},children:[r.jsx("span",{className:"sample",style:{fontSize:`calc(13px * ${c.value})`},children:"字A"}),r.jsx("span",{children:c.label}),n===c.value&&r.jsx(lr,{className:"ml-auto size-3.5 text-[var(--star)]"})]},c.value))}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:Km.map(c=>r.jsxs("button",{type:"button","data-br":c.id,title:c.hint,className:"br-pick"+(o===c.id?" active":""),onClick:()=>{a1(c.id),l(c.id)},children:[r.jsx("span",{className:"sample",children:"文A"}),r.jsxs("span",{className:"br-pick-txt",children:[r.jsx("span",{children:c.label}),r.jsx("span",{className:"sub",children:c.hint})]}),o===c.id&&r.jsx(lr,{className:"ml-auto size-3.5 text-[var(--star)]"})]},c.id))})]})]})}function TI(){const[e,t]=u.useState({old:"",new:""}),[n,s]=u.useState(!1);async function o(){s(!0);try{await El.changePassword(e.old,e.new),M("密码已修改"),t({old:"",new:""})}catch(l){M(l.message)}finally{s(!1)}}return r.jsxs(bn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(Vn,{className:"px-5 pb-0",children:r.jsxs(Wn,{className:"flex items-center gap-2 text-sm",children:[r.jsx(lm,{className:"size-4 text-[var(--star-text)]"})," 修改密码"]})}),r.jsxs(kn,{className:"space-y-4 px-5",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"原密码"}),r.jsx(Ae,{type:"password",value:e.old,onChange:l=>t({...e,old:l.target.value})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ae,{type:"password",value:e.new,onChange:l=>t({...e,new:l.target.value})})]}),r.jsx(H,{variant:"outline",disabled:n,onClick:o,children:"保存"})]})]})}function $I(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":e.startsWith("### COMPACT")?"lp-compact":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/ROUND_DONE|FIX_DONE|RETEST_SUMMARY|STRESS_DONE/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}const II=5e3;function AI(){const[e,t]=T_(),n=+(e.get("task")||0),s=+(e.get("round")||0),[o,l]=u.useState(null),[a,i]=u.useState([]),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState(""),x=u.useRef(null),y=u.useRef(!0),j=u.useMemo(()=>c?c.split(`
|
|
484
|
-
`):[],[c]);u.useEffect(()=>{if(!n){h("缺少 task 参数");return}let g=!1;return(async()=>{try{const[w,b]=await Promise.all([Ue.get(n),Ue.rounds(n)]);if(g)return;l(w),i(b),b.length&&!b.some(S=>S.round_no===s)&&t({task:String(n),round:String(b[b.length-1].round_no)},{replace:!0})}catch(w){g||h(w.message)}})(),()=>{g=!0}},[n,s]),u.useEffect(()=>(document.title=o?`日志 · ${o.name}`:"任务日志",()=>{document.title="Touchstone"}),[o]),u.useEffect(()=>{if(!n||!s)return;let g=null,w=!1;const b=async()=>{const S=x.current;y.current=S?S.scrollHeight-S.scrollTop-S.clientHeight<60:!0;try{const N=await Ue.log(n,s,II);if(w)return;m(!1),d(_=>_===N.log?_:N.log)}catch{w||(m(!0),d(""))}};return b(),g=setInterval(b,2e3),()=>{w=!0,clearInterval(g)}},[n,s]),u.useEffect(()=>{const g=x.current;g&&y.current&&(g.scrollTop=g.scrollHeight)},[c]);function v(){y.current=!0;const g=x.current;g&&(g.scrollTop=g.scrollHeight)}return r.jsxs("div",{className:"log-page",children:[r.jsxs("div",{className:"log-page-head",children:[r.jsx(pu,{size:20}),r.jsx("span",{className:"t",children:"任务日志"}),o&&r.jsxs("span",{className:"dim",children:["「",o.name,"」"]}),o&&r.jsxs("span",{className:"badge st-"+o.status,children:[r.jsx("span",{className:"dot"}),ur[o.status]||o.status]}),r.jsx("span",{className:"spacer"}),a.length>0&&r.jsxs(At,{value:String(s),onValueChange:g=>t({task:String(n),round:g}),children:[r.jsx(Mt,{size:"sm",className:"h-7 min-w-[90px] text-xs",children:r.jsx(Pt,{})}),r.jsx(Tt,{children:a.map(g=>r.jsxs(Oe,{value:String(g.round_no),children:["第 ",g.round_no," 轮"]},g.round_no))})]}),r.jsxs("span",{className:"hint",children:[j.length," 行 · 2s 自动刷新 · 在底部时自动跟随"]}),r.jsxs(H,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",title:"回到底部并恢复自动跟随",onClick:v,children:[r.jsx(jN,{})," 底部"]})]}),(o==null?void 0:o.task_type)==="stress"&&r.jsx(Nj,{task:o}),r.jsx("div",{className:"log-page-body",children:p?r.jsxs("div",{className:"hint",style:{margin:"auto"},children:["加载失败:",p]}):f?r.jsx("div",{className:"hint",style:{margin:"auto"},children:"该轮暂无日志"}):r.jsx("div",{className:"log",ref:x,children:j.map((g,w)=>r.jsx("div",{className:"log-line "+$I(g),children:g||" "},w))})})]})}function c1(){const e=Xn(),[t,n]=u.useState(""),[s,o]=u.useState(""),[l,a]=u.useState(""),[i,c]=u.useState(""),[d,f]=u.useState(!1);async function m(){if(!d){if(c(""),s.length<6){c("新密码至少 6 位");return}if(s!==l){c("两次输入的新密码不一致");return}f(!0);try{await El.changePassword(t,s),await e.load(),M("密码已修改")}catch(p){c(p.message||"修改失败")}finally{f(!1)}}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(bn,{className:"w-[380px] shadow-xl",children:[r.jsxs(Vn,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(pu,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsxs(Wn,{className:"flex items-center justify-center gap-2 font-serif text-lg",children:[r.jsx(lm,{className:"size-4 text-[var(--star-text)]"})," 首次登录须修改密码"]}),r.jsxs(O0,{className:"mt-1",children:["账号 ",e.username," 仍在使用一次性初始口令"]})]})]}),r.jsxs(kn,{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"force-old-pw",className:"text-xs text-muted-foreground",children:"当前口令(启动横幅里的一次性口令)"}),r.jsx(Ae,{id:"force-old-pw",value:t,type:"password",onChange:p=>n(p.target.value),autoComplete:"current-password",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"force-new-pw",className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ae,{id:"force-new-pw",value:s,type:"password",onChange:p=>o(p.target.value),autoComplete:"new-password"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(st,{htmlFor:"force-new-pw2",className:"text-xs text-muted-foreground",children:"确认新密码"}),r.jsx(Ae,{id:"force-new-pw2",value:l,type:"password",onChange:p=>a(p.target.value),autoComplete:"new-password",onKeyUp:p=>{p.key==="Enter"&&m()}})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:i}),r.jsxs(H,{size:"lg",className:"w-full",disabled:d,onClick:m,children:[d&&r.jsx(U0,{className:"size-4 animate-spin"}),"修改并进入"]})]}),r.jsx(L0,{className:"flex-col items-center pt-0",children:r.jsx("button",{type:"button",className:"text-sm text-[var(--run)] underline-offset-4 hover:underline",onClick:()=>e.logout(),children:"退出登录"})})]})})}const u1="ts.last_route",OI=["","app","monitor","admin","settings"];function Cu(){return"/touchstone/".replace(/\/+$/,"")}function d1(e){const t=Cu();return t&&e.startsWith(t+"/")?e.slice(t.length):t&&e===t?"/":e}function LI(e,t){const n=Cu();return(n?[n+"/",n+"/app"]:["/","/app"]).includes(e)&&!t}function DI(e,t=""){try{if(!e)return;const n=d1(e);if(n==="/login"||n==="/log")return;localStorage.setItem(u1,Cu()+n+(t||""))}catch{}}function zI(){try{const e=localStorage.getItem(u1)||"";if(!e.startsWith("/"))return"";const t=Cu();if(t&&!(e===t||e.startsWith(t+"/")))return"";const[n,s=""]=e.split("?"),o=d1(n).split("/")[1]||"";return OI.includes(o)?e:""}catch{return""}}function FI(){const e=zI();if(!e)return"";const{pathname:t,search:n}=window.location;return t+n===e||!LI(t,n)?"":(window.history.replaceState(null,"",e),e)}function pa({children:e}){const t=Xn(s=>s.username),n=Xn(s=>s.mustChangePassword);return t?n?r.jsx(c1,{}):e:r.jsx(zl,{to:"/login",replace:!0})}function BI({children:e}){const t=Xn(o=>o.username),n=Xn(o=>o.isAdmin),s=Xn(o=>o.mustChangePassword);return t?s?r.jsx(c1,{}):n?e:r.jsx(zl,{to:"/app",replace:!0}):r.jsx(zl,{to:"/login",replace:!0})}function HI({children:e}){return Xn(n=>n.username)?r.jsx(zl,{to:"/app",replace:!0}):e}function UI(){const e=li();return u.useEffect(()=>{DI(e.pathname,e.search)},[e.pathname,e.search]),r.jsxs(C_,{children:[r.jsx(Ds,{path:"/login",element:r.jsx(HI,{children:r.jsx(GC,{})})}),r.jsx(Ds,{path:"/",element:r.jsx(zl,{to:"/app",replace:!0})}),r.jsx(Ds,{path:"/app",element:r.jsx(pa,{children:r.jsx(Px,{})})}),r.jsx(Ds,{path:"/monitor",element:r.jsx(pa,{children:r.jsx(Px,{})})}),r.jsx(Ds,{path:"/admin",element:r.jsx(BI,{children:r.jsx(J$,{})})}),r.jsx(Ds,{path:"/settings",element:r.jsx(pa,{children:r.jsx(Mx,{})})}),r.jsx(Ds,{path:"/settings/:section",element:r.jsx(pa,{children:r.jsx(Mx,{})})}),r.jsx(Ds,{path:"/log",element:r.jsx(pa,{children:r.jsx(AI,{})})}),r.jsx(Ds,{path:"*",element:r.jsx(zl,{to:"/app",replace:!0})})]})}lI();iI();cI();EM();Xn.getState().load().finally(()=>{FI(),qy(document.getElementById("app")).render(r.jsx(M_,{basename:"/touchstone/".replace(/\/+$/,"")||"/",children:r.jsx(UI,{})}))});
|