dwf-ai-connector 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +361 -0
  2. package/apps/web/dist/assets/index-L2NhFFUX.css +1 -0
  3. package/apps/web/dist/assets/index-LF6I_yRI.js +412 -0
  4. package/apps/web/dist/index.html +13 -0
  5. package/bin/dwf-ai-connector.js +130 -0
  6. package/package.json +61 -0
  7. package/packages/shared/dist/index.d.ts +262 -0
  8. package/packages/shared/dist/index.js +1 -0
  9. package/services/agent-gateway/dist/backend-client.d.ts +3 -0
  10. package/services/agent-gateway/dist/backend-client.js +49 -0
  11. package/services/agent-gateway/dist/backend-mcp-url.d.ts +2 -0
  12. package/services/agent-gateway/dist/backend-mcp-url.js +8 -0
  13. package/services/agent-gateway/dist/crypto.d.ts +3 -0
  14. package/services/agent-gateway/dist/crypto.js +30 -0
  15. package/services/agent-gateway/dist/db.d.ts +6 -0
  16. package/services/agent-gateway/dist/db.js +305 -0
  17. package/services/agent-gateway/dist/logger.d.ts +2 -0
  18. package/services/agent-gateway/dist/logger.js +12 -0
  19. package/services/agent-gateway/dist/model-catalog.d.ts +2 -0
  20. package/services/agent-gateway/dist/model-catalog.js +95 -0
  21. package/services/agent-gateway/dist/runtime-manager.d.ts +17 -0
  22. package/services/agent-gateway/dist/runtime-manager.js +121 -0
  23. package/services/agent-gateway/dist/schema.d.ts +1435 -0
  24. package/services/agent-gateway/dist/schema.js +103 -0
  25. package/services/agent-gateway/dist/schema.pg.d.ts +1311 -0
  26. package/services/agent-gateway/dist/schema.pg.js +103 -0
  27. package/services/agent-gateway/dist/server.d.ts +1 -0
  28. package/services/agent-gateway/dist/server.js +864 -0
  29. package/services/agent-gateway/dist/skills.d.ts +14 -0
  30. package/services/agent-gateway/dist/skills.js +312 -0
  31. package/services/agent-gateway/dist/store.d.ts +148 -0
  32. package/services/agent-gateway/dist/store.js +610 -0
  33. package/services/agent-runtime/dist/dwf-cli-tool.d.ts +10 -0
  34. package/services/agent-runtime/dist/dwf-cli-tool.js +146 -0
  35. package/services/agent-runtime/dist/logger.d.ts +2 -0
  36. package/services/agent-runtime/dist/logger.js +12 -0
  37. package/services/agent-runtime/dist/mcp-client.d.ts +25 -0
  38. package/services/agent-runtime/dist/mcp-client.js +189 -0
  39. package/services/agent-runtime/dist/pi-agent-brain.d.ts +36 -0
  40. package/services/agent-runtime/dist/pi-agent-brain.js +61 -0
  41. package/services/agent-runtime/dist/prompt-builder.d.ts +2 -0
  42. package/services/agent-runtime/dist/prompt-builder.js +197 -0
  43. package/services/agent-runtime/dist/server.d.ts +1 -0
  44. package/services/agent-runtime/dist/server.js +335 -0
  45. package/services/agent-runtime/dist/session-factory.d.ts +31 -0
  46. package/services/agent-runtime/dist/session-factory.js +220 -0
  47. package/services/agent-runtime/dist/session-guards.d.ts +11 -0
  48. package/services/agent-runtime/dist/session-guards.js +169 -0
  49. package/services/agent-runtime/dist/skill-tools.d.ts +2 -0
  50. package/services/agent-runtime/dist/skill-tools.js +140 -0
  51. package/services/agent-runtime/dist/sub-agent-tool.d.ts +30 -0
  52. package/services/agent-runtime/dist/sub-agent-tool.js +392 -0
  53. package/services/agent-runtime/dist/tool.d.ts +3 -0
  54. package/services/agent-runtime/dist/tool.js +100 -0
  55. package/services/agent-runtime/skills/builtin/.gitkeep +1 -0
  56. package/services/agent-runtime/skills/builtin/demo-skill/SKILL.md +12 -0
  57. package/services/agent-runtime/skills/builtin/dwf-application-modeling/SKILL.md +166 -0
  58. package/services/agent-runtime/skills/builtin/dwf-cli-command-line/SKILL.md +292 -0
  59. package/services/agent-runtime/skills/builtin/dwf-entity-modeling/SKILL.md +190 -0
  60. package/services/agent-runtime/skills/builtin/dwf-view-template-modeling/SKILL.md +139 -0
  61. package/services/dwf-backend/dist/db.d.ts +7 -0
  62. package/services/dwf-backend/dist/db.js +239 -0
  63. package/services/dwf-backend/dist/errors.d.ts +24 -0
  64. package/services/dwf-backend/dist/errors.js +48 -0
  65. package/services/dwf-backend/dist/index.d.ts +1 -0
  66. package/services/dwf-backend/dist/index.js +84 -0
  67. package/services/dwf-backend/dist/routes/apisix.d.ts +2 -0
  68. package/services/dwf-backend/dist/routes/apisix.js +90 -0
  69. package/services/dwf-backend/dist/routes/dwf-api.d.ts +2 -0
  70. package/services/dwf-backend/dist/routes/dwf-api.js +59 -0
  71. package/services/dwf-backend/dist/routes/dwf-instance.d.ts +2 -0
  72. package/services/dwf-backend/dist/routes/dwf-instance.js +160 -0
  73. package/services/dwf-backend/dist/routes/mcp-instance.d.ts +2 -0
  74. package/services/dwf-backend/dist/routes/mcp-instance.js +204 -0
  75. package/services/dwf-backend/dist/routes/tool-evolution.d.ts +2 -0
  76. package/services/dwf-backend/dist/routes/tool-evolution.js +98 -0
  77. package/services/dwf-backend/dist/schema.d.ts +730 -0
  78. package/services/dwf-backend/dist/schema.js +54 -0
  79. package/services/dwf-backend/dist/schema.pg.d.ts +670 -0
  80. package/services/dwf-backend/dist/schema.pg.js +53 -0
  81. package/services/dwf-backend/dist/services/apisix.d.ts +10 -0
  82. package/services/dwf-backend/dist/services/apisix.js +171 -0
  83. package/services/dwf-backend/dist/services/dwf-api.d.ts +14 -0
  84. package/services/dwf-backend/dist/services/dwf-api.js +118 -0
  85. package/services/dwf-backend/dist/services/dwf-instance.d.ts +79 -0
  86. package/services/dwf-backend/dist/services/dwf-instance.js +304 -0
  87. package/services/dwf-backend/dist/services/evolution-agent.d.ts +10 -0
  88. package/services/dwf-backend/dist/services/evolution-agent.js +224 -0
  89. package/services/dwf-backend/dist/services/evolution-manager.d.ts +9 -0
  90. package/services/dwf-backend/dist/services/evolution-manager.js +64 -0
  91. package/services/dwf-backend/dist/services/mcp-instance.d.ts +65 -0
  92. package/services/dwf-backend/dist/services/mcp-instance.js +359 -0
  93. package/services/dwf-backend/dist/services/mcp-manager.d.ts +51 -0
  94. package/services/dwf-backend/dist/services/mcp-manager.js +435 -0
  95. package/services/dwf-backend/dist/services/tool-evolution.d.ts +47 -0
  96. package/services/dwf-backend/dist/services/tool-evolution.js +204 -0
  97. package/services/dwf-backend/dist/utils.d.ts +10 -0
  98. package/services/dwf-backend/dist/utils.js +94 -0
  99. package/services/dwf-cli/config/tool_registry.json +285 -0
  100. package/services/dwf-cli/dist/arguments.d.ts +1 -0
  101. package/services/dwf-cli/dist/arguments.js +85 -0
  102. package/services/dwf-cli/dist/cli/auth.d.ts +6 -0
  103. package/services/dwf-cli/dist/cli/auth.js +238 -0
  104. package/services/dwf-cli/dist/cli/datamodel.d.ts +7 -0
  105. package/services/dwf-cli/dist/cli/datamodel.js +1751 -0
  106. package/services/dwf-cli/dist/cli/root.d.ts +53 -0
  107. package/services/dwf-cli/dist/cli/root.js +722 -0
  108. package/services/dwf-cli/dist/cli/schema.d.ts +6 -0
  109. package/services/dwf-cli/dist/cli/schema.js +93 -0
  110. package/services/dwf-cli/dist/config.d.ts +23 -0
  111. package/services/dwf-cli/dist/config.js +121 -0
  112. package/services/dwf-cli/dist/index.d.ts +2 -0
  113. package/services/dwf-cli/dist/index.js +8 -0
  114. package/services/dwf-cli/dist/mcp-client.d.ts +20 -0
  115. package/services/dwf-cli/dist/mcp-client.js +74 -0
  116. package/services/dwf-cli/dist/registry.d.ts +27 -0
  117. package/services/dwf-cli/dist/registry.js +154 -0
  118. package/services/dwf-mcp-server/config/dwf-apis.json +2316 -0
  119. package/services/dwf-mcp-server/config/tool-config-example.json +104 -0
  120. package/services/dwf-mcp-server/dist/api-types.d.ts +65 -0
  121. package/services/dwf-mcp-server/dist/api-types.js +157 -0
  122. package/services/dwf-mcp-server/dist/config-schema.d.ts +28 -0
  123. package/services/dwf-mcp-server/dist/config-schema.js +132 -0
  124. package/services/dwf-mcp-server/dist/dwf-client.d.ts +25 -0
  125. package/services/dwf-mcp-server/dist/dwf-client.js +152 -0
  126. package/services/dwf-mcp-server/dist/evolution-callback.d.ts +7 -0
  127. package/services/dwf-mcp-server/dist/evolution-callback.js +28 -0
  128. package/services/dwf-mcp-server/dist/form-templates.d.ts +8 -0
  129. package/services/dwf-mcp-server/dist/form-templates.js +345 -0
  130. package/services/dwf-mcp-server/dist/index.d.ts +1 -0
  131. package/services/dwf-mcp-server/dist/index.js +179 -0
  132. package/services/dwf-mcp-server/dist/server.d.ts +22 -0
  133. package/services/dwf-mcp-server/dist/server.js +63 -0
  134. package/services/dwf-mcp-server/dist/system-tools/application.d.ts +1 -0
  135. package/services/dwf-mcp-server/dist/system-tools/application.js +376 -0
  136. package/services/dwf-mcp-server/dist/system-tools/basic.d.ts +1 -0
  137. package/services/dwf-mcp-server/dist/system-tools/basic.js +29 -0
  138. package/services/dwf-mcp-server/dist/system-tools/class-management.d.ts +1 -0
  139. package/services/dwf-mcp-server/dist/system-tools/class-management.js +248 -0
  140. package/services/dwf-mcp-server/dist/system-tools/entity-query.d.ts +1 -0
  141. package/services/dwf-mcp-server/dist/system-tools/entity-query.js +206 -0
  142. package/services/dwf-mcp-server/dist/system-tools/index.d.ts +12 -0
  143. package/services/dwf-mcp-server/dist/system-tools/index.js +14 -0
  144. package/services/dwf-mcp-server/dist/system-tools/view-template.d.ts +1 -0
  145. package/services/dwf-mcp-server/dist/system-tools/view-template.js +407 -0
  146. package/services/dwf-mcp-server/dist/tool-generator.d.ts +28 -0
  147. package/services/dwf-mcp-server/dist/tool-generator.js +270 -0
@@ -0,0 +1,412 @@
1
+ var Kh=Object.defineProperty;var Gh=(e,t,n)=>t in e?Kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pe=(e,t,n)=>Gh(e,typeof t!="symbol"?t+"":t,n);function Zh(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const i=Object.getOwnPropertyDescriptor(r,l);i&&Object.defineProperty(e,l,i.get?i:{enumerable:!0,get:()=>r[l]})}}}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 l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function Jh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ad={exports:{}},si={},Ld={exports:{}},ne={};/**
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 Ls=Symbol.for("react.element"),Xh=Symbol.for("react.portal"),Yh=Symbol.for("react.fragment"),em=Symbol.for("react.strict_mode"),tm=Symbol.for("react.profiler"),nm=Symbol.for("react.provider"),rm=Symbol.for("react.context"),sm=Symbol.for("react.forward_ref"),lm=Symbol.for("react.suspense"),im=Symbol.for("react.memo"),am=Symbol.for("react.lazy"),Dc=Symbol.iterator;function om(e){return e===null||typeof e!="object"?null:(e=Dc&&e[Dc]||e["@@iterator"],typeof e=="function"?e:null)}var Id={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zd=Object.assign,$d={};function Ar(e,t,n){this.props=e,this.context=t,this.refs=$d,this.updater=n||Id}Ar.prototype.isReactComponent={};Ar.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")};Ar.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dd(){}Dd.prototype=Ar.prototype;function xo(e,t,n){this.props=e,this.context=t,this.refs=$d,this.updater=n||Id}var go=xo.prototype=new Dd;go.constructor=xo;zd(go,Ar.prototype);go.isPureReactComponent=!0;var Oc=Array.isArray,Od=Object.prototype.hasOwnProperty,vo={current:null},Fd={key:!0,ref:!0,__self:!0,__source:!0};function Bd(e,t,n){var r,l={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Od.call(t,r)&&!Fd.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];l.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:Ls,type:e,key:i,ref:a,props:l,_owner:vo.current}}function cm(e,t){return{$$typeof:Ls,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ls}function um(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fc=/\/+/g;function Ti(e,t){return typeof e=="object"&&e!==null&&e.key!=null?um(""+e.key):t.toString(36)}function fl(e,t,n,r,l){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ls:case Xh:a=!0}}if(a)return a=e,l=l(a),e=r===""?"."+Ti(a,0):r,Oc(l)?(n="",e!=null&&(n=e.replace(Fc,"$&/")+"/"),fl(l,t,n,"",function(u){return u})):l!=null&&(yo(l)&&(l=cm(l,n+(!l.key||a&&a.key===l.key?"":(""+l.key).replace(Fc,"$&/")+"/")+e)),t.push(l)),1;if(a=0,r=r===""?".":r+":",Oc(e))for(var o=0;o<e.length;o++){i=e[o];var c=r+Ti(i,o);a+=fl(i,t,n,c,l)}else if(c=om(e),typeof c=="function")for(e=c.call(e),o=0;!(i=e.next()).done;)i=i.value,c=r+Ti(i,o++),a+=fl(i,t,n,c,l);else if(i==="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 Us(e,t,n){if(e==null)return e;var r=[],l=0;return fl(e,r,"","",function(i){return t.call(n,i,l++)}),r}function dm(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 tt={current:null},pl={transition:null},fm={ReactCurrentDispatcher:tt,ReactCurrentBatchConfig:pl,ReactCurrentOwner:vo};function Ud(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Us,forEach:function(e,t,n){Us(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Us(e,function(){t++}),t},toArray:function(e){return Us(e,function(t){return t})||[]},only:function(e){if(!yo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Ar;ne.Fragment=Yh;ne.Profiler=tm;ne.PureComponent=xo;ne.StrictMode=em;ne.Suspense=lm;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fm;ne.act=Ud;ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=zd({},e.props),l=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=vo.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Od.call(t,c)&&!Fd.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:Ls,type:e.type,key:l,ref:i,props:r,_owner:a}};ne.createContext=function(e){return e={$$typeof:rm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:nm,_context:e},e.Consumer=e};ne.createElement=Bd;ne.createFactory=function(e){var t=Bd.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:sm,render:e}};ne.isValidElement=yo;ne.lazy=function(e){return{$$typeof:am,_payload:{_status:-1,_result:e},_init:dm}};ne.memo=function(e,t){return{$$typeof:im,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=pl.transition;pl.transition={};try{e()}finally{pl.transition=t}};ne.unstable_act=Ud;ne.useCallback=function(e,t){return tt.current.useCallback(e,t)};ne.useContext=function(e){return tt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return tt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return tt.current.useEffect(e,t)};ne.useId=function(){return tt.current.useId()};ne.useImperativeHandle=function(e,t,n){return tt.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return tt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return tt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return tt.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return tt.current.useReducer(e,t,n)};ne.useRef=function(e){return tt.current.useRef(e)};ne.useState=function(e){return tt.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return tt.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return tt.current.useTransition()};ne.version="18.3.1";Ld.exports=ne;var p=Ld.exports;const pm=Jh(p),hm=Zh({__proto__:null,default:pm},[p]);/**
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 mm=p,xm=Symbol.for("react.element"),gm=Symbol.for("react.fragment"),vm=Object.prototype.hasOwnProperty,ym=mm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,wm={key:!0,ref:!0,__self:!0,__source:!0};function Wd(e,t,n){var r,l={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)vm.call(t,r)&&!wm.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:xm,type:e,key:i,ref:a,props:l,_owner:ym.current}}si.Fragment=gm;si.jsx=Wd;si.jsxs=Wd;Ad.exports=si;var s=Ad.exports,da={},Hd={exports:{}},vt={},Vd={exports:{}},Qd={};/**
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(C,D){var U=C.length;C.push(D);e:for(;0<U;){var F=U-1>>>1,G=C[F];if(0<l(G,D))C[F]=D,C[U]=G,U=F;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var D=C[0],U=C.pop();if(U!==D){C[0]=U;e:for(var F=0,G=C.length,z=G>>>1;F<z;){var _=2*(F+1)-1,le=C[_],ie=_+1,Re=C[ie];if(0>l(le,U))ie<G&&0>l(Re,le)?(C[F]=Re,C[ie]=U,F=ie):(C[F]=le,C[_]=U,F=_);else if(ie<G&&0>l(Re,U))C[F]=Re,C[ie]=U,F=ie;else break e}}return D}function l(C,D){var U=C.sortIndex-D.sortIndex;return U!==0?U:C.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,f=null,h=3,x=!1,v=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,m=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 y(C){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=C)r(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function k(C){if(w=!1,y(C),!v)if(n(c)!==null)v=!0,K(N);else{var D=n(u);D!==null&&R(k,D.startTime-C)}}function N(C,D){v=!1,w&&(w=!1,m(M),M=-1),x=!0;var U=h;try{for(y(D),f=n(c);f!==null&&(!(f.expirationTime>D)||C&&!E());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var G=F(f.expirationTime<=D);D=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),y(D)}else r(c);f=n(c)}if(f!==null)var z=!0;else{var _=n(u);_!==null&&R(k,_.startTime-D),z=!1}return z}finally{f=null,h=U,x=!1}}var S=!1,b=null,M=-1,B=5,T=-1;function E(){return!(e.unstable_now()-T<B)}function I(){if(b!==null){var C=e.unstable_now();T=C;var D=!0;try{D=b(!0,C)}finally{D?O():(S=!1,b=null)}}else S=!1}var O;if(typeof g=="function")O=function(){g(I)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,Q=L.port2;L.port1.onmessage=I,O=function(){Q.postMessage(null)}}else O=function(){j(I,0)};function K(C){b=C,S||(S=!0,O())}function R(C,D){M=j(function(){C(e.unstable_now())},D)}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(C){C.callback=null},e.unstable_continueExecution=function(){v||x||(v=!0,K(N))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var D=3;break;default:D=h}var U=h;h=D;try{return C()}finally{h=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,D){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var U=h;h=C;try{return D()}finally{h=U}},e.unstable_scheduleCallback=function(C,D,U){var F=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?F+U:F):U=F,C){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,C={id:d++,callback:D,priorityLevel:C,startTime:U,expirationTime:G,sortIndex:-1},U>F?(C.sortIndex=U,t(u,C),n(c)===null&&C===n(u)&&(w?(m(M),M=-1):w=!0,R(k,U-F))):(C.sortIndex=G,t(c,C),v||x||(v=!0,K(N))),C},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(C){var D=h;return function(){var U=h;h=D;try{return C.apply(this,arguments)}finally{h=U}}}})(Qd);Vd.exports=Qd;var jm=Vd.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 km=p,xt=jm;function $(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 qd=new Set,hs={};function tr(e,t){Sr(e,t),Sr(e+"Capture",t)}function Sr(e,t){for(hs[e]=t,e=0;e<t.length;e++)qd.add(t[e])}var an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fa=Object.prototype.hasOwnProperty,Nm=/^[: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]*$/,Bc={},Uc={};function bm(e){return fa.call(Uc,e)?!0:fa.call(Bc,e)?!1:Nm.test(e)?Uc[e]=!0:(Bc[e]=!0,!1)}function Sm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _m(e,t,n,r){if(t===null||typeof t>"u"||Sm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nt(e,t,n,r,l,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new nt(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){He[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wo=/[\-:]([a-z])/g;function jo(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(wo,jo);He[t]=new nt(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(wo,jo);He[t]=new nt(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(wo,jo);He[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ko(e,t,n,r){var l=He.hasOwnProperty(t)?He[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_m(t,n,l,r)&&(n=null),r||l===null?bm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var dn=km.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ws=Symbol.for("react.element"),ar=Symbol.for("react.portal"),or=Symbol.for("react.fragment"),No=Symbol.for("react.strict_mode"),pa=Symbol.for("react.profiler"),Kd=Symbol.for("react.provider"),Gd=Symbol.for("react.context"),bo=Symbol.for("react.forward_ref"),ha=Symbol.for("react.suspense"),ma=Symbol.for("react.suspense_list"),So=Symbol.for("react.memo"),gn=Symbol.for("react.lazy"),Zd=Symbol.for("react.offscreen"),Wc=Symbol.iterator;function Br(e){return e===null||typeof e!="object"?null:(e=Wc&&e[Wc]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Object.assign,Mi;function Yr(e){if(Mi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Mi=t&&t[1]||""}return`
34
+ `+Mi+e}var Ri=!1;function Ai(e,t){if(!e||Ri)return"";Ri=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var l=u.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),a=l.length-1,o=i.length-1;1<=a&&0<=o&&l[a]!==i[o];)o--;for(;1<=a&&0<=o;a--,o--)if(l[a]!==i[o]){if(a!==1||o!==1)do if(a--,o--,0>o||l[a]!==i[o]){var c=`
37
+ `+l[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{Ri=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yr(e):""}function Cm(e){switch(e.tag){case 5:return Yr(e.type);case 16:return Yr("Lazy");case 13:return Yr("Suspense");case 19:return Yr("SuspenseList");case 0:case 2:case 15:return e=Ai(e.type,!1),e;case 11:return e=Ai(e.type.render,!1),e;case 1:return e=Ai(e.type,!0),e;default:return""}}function xa(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 or:return"Fragment";case ar:return"Portal";case pa:return"Profiler";case No:return"StrictMode";case ha:return"Suspense";case ma:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gd:return(e.displayName||"Context")+".Consumer";case Kd:return(e._context.displayName||"Context")+".Provider";case bo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case So:return t=e.displayName||null,t!==null?t:xa(e.type)||"Memo";case gn:t=e._payload,e=e._init;try{return xa(e(t))}catch{}}return null}function Em(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 xa(t);case 8:return t===No?"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 An(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Pm(e){var t=Jd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hs(e){e._valueTracker||(e._valueTracker=Pm(e))}function Xd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Jd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cl(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 ga(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=An(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Yd(e,t){t=t.checked,t!=null&&ko(e,"checked",t,!1)}function va(e,t){Yd(e,t);var n=An(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ya(e,t.type,n):t.hasOwnProperty("defaultValue")&&ya(e,t.type,An(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ya(e,t,n){(t!=="number"||Cl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var es=Array.isArray;function yr(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+An(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function wa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error($(91));return Ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error($(92));if(es(n)){if(1<n.length)throw Error($(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:An(n)}}function ef(e,t){var n=An(t.value),r=An(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function qc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tf(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 ja(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Vs,nf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Vs=Vs||document.createElement("div"),Vs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Vs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ms(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rs={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},Tm=["Webkit","ms","Moz","O"];Object.keys(rs).forEach(function(e){Tm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rs[t]=rs[e]})});function rf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||rs.hasOwnProperty(e)&&rs[e]?(""+t).trim():t+"px"}function sf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=rf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Mm=Ne({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 ka(e,t){if(t){if(Mm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function Na(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 ba=null;function _o(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sa=null,wr=null,jr=null;function Kc(e){if(e=$s(e)){if(typeof Sa!="function")throw Error($(280));var t=e.stateNode;t&&(t=ci(t),Sa(e.stateNode,e.type,t))}}function lf(e){wr?jr?jr.push(e):jr=[e]:wr=e}function af(){if(wr){var e=wr,t=jr;if(jr=wr=null,Kc(e),t)for(e=0;e<t.length;e++)Kc(t[e])}}function of(e,t){return e(t)}function cf(){}var Li=!1;function uf(e,t,n){if(Li)return e(t,n);Li=!0;try{return of(e,t,n)}finally{Li=!1,(wr!==null||jr!==null)&&(cf(),af())}}function xs(e,t){var n=e.stateNode;if(n===null)return null;var r=ci(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error($(231,t,typeof n));return n}var _a=!1;if(an)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){_a=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{_a=!1}function Rm(e,t,n,r,l,i,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ss=!1,El=null,Pl=!1,Ca=null,Am={onError:function(e){ss=!0,El=e}};function Lm(e,t,n,r,l,i,a,o,c){ss=!1,El=null,Rm.apply(Am,arguments)}function Im(e,t,n,r,l,i,a,o,c){if(Lm.apply(this,arguments),ss){if(ss){var u=El;ss=!1,El=null}else throw Error($(198));Pl||(Pl=!0,Ca=u)}}function nr(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 df(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 Gc(e){if(nr(e)!==e)throw Error($(188))}function zm(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error($(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var i=l.alternate;if(i===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===n)return Gc(l),e;if(i===r)return Gc(l),t;i=i.sibling}throw Error($(188))}if(n.return!==r.return)n=l,r=i;else{for(var a=!1,o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a){for(o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a)throw Error($(189))}}if(n.alternate!==r)throw Error($(190))}if(n.tag!==3)throw Error($(188));return n.stateNode.current===n?e:t}function ff(e){return e=zm(e),e!==null?pf(e):null}function pf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pf(e);if(t!==null)return t;e=e.sibling}return null}var hf=xt.unstable_scheduleCallback,Zc=xt.unstable_cancelCallback,$m=xt.unstable_shouldYield,Dm=xt.unstable_requestPaint,Ee=xt.unstable_now,Om=xt.unstable_getCurrentPriorityLevel,Co=xt.unstable_ImmediatePriority,mf=xt.unstable_UserBlockingPriority,Tl=xt.unstable_NormalPriority,Fm=xt.unstable_LowPriority,xf=xt.unstable_IdlePriority,li=null,Kt=null;function Bm(e){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(li,e,void 0,(e.current.flags&128)===128)}catch{}}var $t=Math.clz32?Math.clz32:Hm,Um=Math.log,Wm=Math.LN2;function Hm(e){return e>>>=0,e===0?32:31-(Um(e)/Wm|0)|0}var Qs=64,qs=4194304;function ts(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 Ml(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~l;o!==0?r=ts(o):(i&=a,i!==0&&(r=ts(i)))}else a=n&~l,a!==0?r=ts(a):i!==0&&(r=ts(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-$t(t),l=1<<n,r|=e[n],t&=~l;return r}function Vm(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 Qm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-$t(i),o=1<<a,c=l[a];c===-1?(!(o&n)||o&r)&&(l[a]=Vm(o,t)):c<=t&&(e.expiredLanes|=o),i&=~o}}function Ea(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gf(){var e=Qs;return Qs<<=1,!(Qs&4194240)&&(Qs=64),e}function Ii(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Is(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function qm(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-$t(n),i=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~i}}function Eo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$t(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var de=0;function vf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yf,Po,wf,jf,kf,Pa=!1,Ks=[],bn=null,Sn=null,_n=null,gs=new Map,vs=new Map,yn=[],Km="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 Jc(e,t){switch(e){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(t.pointerId)}}function Wr(e,t,n,r,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[l]},t!==null&&(t=$s(t),t!==null&&Po(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Gm(e,t,n,r,l){switch(t){case"focusin":return bn=Wr(bn,e,t,n,r,l),!0;case"dragenter":return Sn=Wr(Sn,e,t,n,r,l),!0;case"mouseover":return _n=Wr(_n,e,t,n,r,l),!0;case"pointerover":var i=l.pointerId;return gs.set(i,Wr(gs.get(i)||null,e,t,n,r,l)),!0;case"gotpointercapture":return i=l.pointerId,vs.set(i,Wr(vs.get(i)||null,e,t,n,r,l)),!0}return!1}function Nf(e){var t=Hn(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=df(n),t!==null){e.blockedOn=t,kf(e.priority,function(){wf(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 hl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ta(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ba=r,n.target.dispatchEvent(r),ba=null}else return t=$s(n),t!==null&&Po(t),e.blockedOn=n,!1;t.shift()}return!0}function Xc(e,t,n){hl(e)&&n.delete(t)}function Zm(){Pa=!1,bn!==null&&hl(bn)&&(bn=null),Sn!==null&&hl(Sn)&&(Sn=null),_n!==null&&hl(_n)&&(_n=null),gs.forEach(Xc),vs.forEach(Xc)}function Hr(e,t){e.blockedOn===t&&(e.blockedOn=null,Pa||(Pa=!0,xt.unstable_scheduleCallback(xt.unstable_NormalPriority,Zm)))}function ys(e){function t(l){return Hr(l,e)}if(0<Ks.length){Hr(Ks[0],e);for(var n=1;n<Ks.length;n++){var r=Ks[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bn!==null&&Hr(bn,e),Sn!==null&&Hr(Sn,e),_n!==null&&Hr(_n,e),gs.forEach(t),vs.forEach(t),n=0;n<yn.length;n++)r=yn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<yn.length&&(n=yn[0],n.blockedOn===null);)Nf(n),n.blockedOn===null&&yn.shift()}var kr=dn.ReactCurrentBatchConfig,Rl=!0;function Jm(e,t,n,r){var l=de,i=kr.transition;kr.transition=null;try{de=1,To(e,t,n,r)}finally{de=l,kr.transition=i}}function Xm(e,t,n,r){var l=de,i=kr.transition;kr.transition=null;try{de=4,To(e,t,n,r)}finally{de=l,kr.transition=i}}function To(e,t,n,r){if(Rl){var l=Ta(e,t,n,r);if(l===null)Vi(e,t,r,Al,n),Jc(e,r);else if(Gm(l,e,t,n,r))r.stopPropagation();else if(Jc(e,r),t&4&&-1<Km.indexOf(e)){for(;l!==null;){var i=$s(l);if(i!==null&&yf(i),i=Ta(e,t,n,r),i===null&&Vi(e,t,r,Al,n),i===l)break;l=i}l!==null&&r.stopPropagation()}else Vi(e,t,r,null,n)}}var Al=null;function Ta(e,t,n,r){if(Al=null,e=_o(r),e=Hn(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=df(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 Al=e,null}function bf(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(Om()){case Co:return 1;case mf:return 4;case Tl:case Fm:return 16;case xf:return 536870912;default:return 16}default:return 16}}var jn=null,Mo=null,ml=null;function Sf(){if(ml)return ml;var e,t=Mo,n=t.length,r,l="value"in jn?jn.value:jn.textContent,i=l.length;for(e=0;e<n&&t[e]===l[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===l[i-r];r++);return ml=l.slice(e,1<r?1-r:void 0)}function xl(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 Gs(){return!0}function Yc(){return!1}function yt(e){function t(n,r,l,i,a){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Gs:Yc,this.isPropagationStopped=Yc,this}return Ne(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=Gs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gs)},persist:function(){},isPersistent:Gs}),t}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ro=yt(Lr),zs=Ne({},Lr,{view:0,detail:0}),Ym=yt(zs),zi,$i,Vr,ii=Ne({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ao,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!==Vr&&(Vr&&e.type==="mousemove"?(zi=e.screenX-Vr.screenX,$i=e.screenY-Vr.screenY):$i=zi=0,Vr=e),zi)},movementY:function(e){return"movementY"in e?e.movementY:$i}}),eu=yt(ii),ex=Ne({},ii,{dataTransfer:0}),tx=yt(ex),nx=Ne({},zs,{relatedTarget:0}),Di=yt(nx),rx=Ne({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),sx=yt(rx),lx=Ne({},Lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ix=yt(lx),ax=Ne({},Lr,{data:0}),tu=yt(ax),ox={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={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"},ux={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ux[e])?!!t[e]:!1}function Ao(){return dx}var fx=Ne({},zs,{key:function(e){if(e.key){var t=ox[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ao,charCode:function(e){return e.type==="keypress"?xl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),px=yt(fx),hx=Ne({},ii,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nu=yt(hx),mx=Ne({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ao}),xx=yt(mx),gx=Ne({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),vx=yt(gx),yx=Ne({},ii,{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}),wx=yt(yx),jx=[9,13,27,32],Lo=an&&"CompositionEvent"in window,ls=null;an&&"documentMode"in document&&(ls=document.documentMode);var kx=an&&"TextEvent"in window&&!ls,_f=an&&(!Lo||ls&&8<ls&&11>=ls),ru=" ",su=!1;function Cf(e,t){switch(e){case"keyup":return jx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ef(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cr=!1;function Nx(e,t){switch(e){case"compositionend":return Ef(t);case"keypress":return t.which!==32?null:(su=!0,ru);case"textInput":return e=t.data,e===ru&&su?null:e;default:return null}}function bx(e,t){if(cr)return e==="compositionend"||!Lo&&Cf(e,t)?(e=Sf(),ml=Mo=jn=null,cr=!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 _f&&t.locale!=="ko"?null:t.data;default:return null}}var Sx={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 lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sx[e.type]:t==="textarea"}function Pf(e,t,n,r){lf(r),t=Ll(t,"onChange"),0<t.length&&(n=new Ro("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var is=null,ws=null;function _x(e){Ff(e,0)}function ai(e){var t=fr(e);if(Xd(t))return e}function Cx(e,t){if(e==="change")return t}var Tf=!1;if(an){var Oi;if(an){var Fi="oninput"in document;if(!Fi){var iu=document.createElement("div");iu.setAttribute("oninput","return;"),Fi=typeof iu.oninput=="function"}Oi=Fi}else Oi=!1;Tf=Oi&&(!document.documentMode||9<document.documentMode)}function au(){is&&(is.detachEvent("onpropertychange",Mf),ws=is=null)}function Mf(e){if(e.propertyName==="value"&&ai(ws)){var t=[];Pf(t,ws,e,_o(e)),uf(_x,t)}}function Ex(e,t,n){e==="focusin"?(au(),is=t,ws=n,is.attachEvent("onpropertychange",Mf)):e==="focusout"&&au()}function Px(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ai(ws)}function Tx(e,t){if(e==="click")return ai(t)}function Mx(e,t){if(e==="input"||e==="change")return ai(t)}function Rx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:Rx;function js(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!fa.call(t,l)||!Ot(e[l],t[l]))return!1}return!0}function ou(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var n=ou(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ou(n)}}function Rf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Af(){for(var e=window,t=Cl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cl(e.document)}return t}function Io(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 Ax(e){var t=Af(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rf(n.ownerDocument.documentElement,n)){if(r!==null&&Io(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=cu(n,i);var a=cu(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Lx=an&&"documentMode"in document&&11>=document.documentMode,ur=null,Ma=null,as=null,Ra=!1;function uu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ra||ur==null||ur!==Cl(r)||(r=ur,"selectionStart"in r&&Io(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),as&&js(as,r)||(as=r,r=Ll(Ma,"onSelect"),0<r.length&&(t=new Ro("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ur)))}function Zs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var dr={animationend:Zs("Animation","AnimationEnd"),animationiteration:Zs("Animation","AnimationIteration"),animationstart:Zs("Animation","AnimationStart"),transitionend:Zs("Transition","TransitionEnd")},Bi={},Lf={};an&&(Lf=document.createElement("div").style,"AnimationEvent"in window||(delete dr.animationend.animation,delete dr.animationiteration.animation,delete dr.animationstart.animation),"TransitionEvent"in window||delete dr.transitionend.transition);function oi(e){if(Bi[e])return Bi[e];if(!dr[e])return e;var t=dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lf)return Bi[e]=t[n];return e}var If=oi("animationend"),zf=oi("animationiteration"),$f=oi("animationstart"),Df=oi("transitionend"),Of=new Map,du="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 zn(e,t){Of.set(e,t),tr(t,[e])}for(var Ui=0;Ui<du.length;Ui++){var Wi=du[Ui],Ix=Wi.toLowerCase(),zx=Wi[0].toUpperCase()+Wi.slice(1);zn(Ix,"on"+zx)}zn(If,"onAnimationEnd");zn(zf,"onAnimationIteration");zn($f,"onAnimationStart");zn("dblclick","onDoubleClick");zn("focusin","onFocus");zn("focusout","onBlur");zn(Df,"onTransitionEnd");Sr("onMouseEnter",["mouseout","mouseover"]);Sr("onMouseLeave",["mouseout","mouseover"]);Sr("onPointerEnter",["pointerout","pointerover"]);Sr("onPointerLeave",["pointerout","pointerover"]);tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tr("onBeforeInput",["compositionend","keypress","textInput","paste"]);tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ns="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(" "),$x=new Set("cancel close invalid load scroll toggle".split(" ").concat(ns));function fu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Im(r,t,void 0,e),e.currentTarget=null}function Ff(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==i&&l.isPropagationStopped())break e;fu(l,o,u),i=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==i&&l.isPropagationStopped())break e;fu(l,o,u),i=c}}}if(Pl)throw e=Ca,Pl=!1,Ca=null,e}function me(e,t){var n=t[$a];n===void 0&&(n=t[$a]=new Set);var r=e+"__bubble";n.has(r)||(Bf(t,e,2,!1),n.add(r))}function Hi(e,t,n){var r=0;t&&(r|=4),Bf(n,e,r,t)}var Js="_reactListening"+Math.random().toString(36).slice(2);function ks(e){if(!e[Js]){e[Js]=!0,qd.forEach(function(n){n!=="selectionchange"&&($x.has(n)||Hi(n,!1,e),Hi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Js]||(t[Js]=!0,Hi("selectionchange",!1,t))}}function Bf(e,t,n,r){switch(bf(t)){case 1:var l=Jm;break;case 4:l=Xm;break;default:l=To}n=l.bind(null,t,n,e),l=void 0,!_a||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Vi(e,t,n,r,l){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===l||c.nodeType===8&&c.parentNode===l))return;a=a.return}for(;o!==null;){if(a=Hn(o),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}o=o.parentNode}}r=r.return}uf(function(){var u=i,d=_o(n),f=[];e:{var h=Of.get(e);if(h!==void 0){var x=Ro,v=e;switch(e){case"keypress":if(xl(n)===0)break e;case"keydown":case"keyup":x=px;break;case"focusin":v="focus",x=Di;break;case"focusout":v="blur",x=Di;break;case"beforeblur":case"afterblur":x=Di;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":x=eu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=xx;break;case If:case zf:case $f:x=sx;break;case Df:x=vx;break;case"scroll":x=Ym;break;case"wheel":x=wx;break;case"copy":case"cut":case"paste":x=ix;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=nu}var w=(t&4)!==0,j=!w&&e==="scroll",m=w?h!==null?h+"Capture":null:h;w=[];for(var g=u,y;g!==null;){y=g;var k=y.stateNode;if(y.tag===5&&k!==null&&(y=k,m!==null&&(k=xs(g,m),k!=null&&w.push(Ns(g,k,y)))),j)break;g=g.return}0<w.length&&(h=new x(h,v,null,n,d),f.push({event:h,listeners:w}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",h&&n!==ba&&(v=n.relatedTarget||n.fromElement)&&(Hn(v)||v[on]))break e;if((x||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,x?(v=n.relatedTarget||n.toElement,x=u,v=v?Hn(v):null,v!==null&&(j=nr(v),v!==j||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=u),x!==v)){if(w=eu,k="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=nu,k="onPointerLeave",m="onPointerEnter",g="pointer"),j=x==null?h:fr(x),y=v==null?h:fr(v),h=new w(k,g+"leave",x,n,d),h.target=j,h.relatedTarget=y,k=null,Hn(d)===u&&(w=new w(m,g+"enter",v,n,d),w.target=y,w.relatedTarget=j,k=w),j=k,x&&v)t:{for(w=x,m=v,g=0,y=w;y;y=ir(y))g++;for(y=0,k=m;k;k=ir(k))y++;for(;0<g-y;)w=ir(w),g--;for(;0<y-g;)m=ir(m),y--;for(;g--;){if(w===m||m!==null&&w===m.alternate)break t;w=ir(w),m=ir(m)}w=null}else w=null;x!==null&&pu(f,h,x,w,!1),v!==null&&j!==null&&pu(f,j,v,w,!0)}}e:{if(h=u?fr(u):window,x=h.nodeName&&h.nodeName.toLowerCase(),x==="select"||x==="input"&&h.type==="file")var N=Cx;else if(lu(h))if(Tf)N=Mx;else{N=Px;var S=Ex}else(x=h.nodeName)&&x.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=Tx);if(N&&(N=N(e,u))){Pf(f,N,n,d);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&ya(h,"number",h.value)}switch(S=u?fr(u):window,e){case"focusin":(lu(S)||S.contentEditable==="true")&&(ur=S,Ma=u,as=null);break;case"focusout":as=Ma=ur=null;break;case"mousedown":Ra=!0;break;case"contextmenu":case"mouseup":case"dragend":Ra=!1,uu(f,n,d);break;case"selectionchange":if(Lx)break;case"keydown":case"keyup":uu(f,n,d)}var b;if(Lo)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else cr?Cf(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(_f&&n.locale!=="ko"&&(cr||M!=="onCompositionStart"?M==="onCompositionEnd"&&cr&&(b=Sf()):(jn=d,Mo="value"in jn?jn.value:jn.textContent,cr=!0)),S=Ll(u,M),0<S.length&&(M=new tu(M,e,null,n,d),f.push({event:M,listeners:S}),b?M.data=b:(b=Ef(n),b!==null&&(M.data=b)))),(b=kx?Nx(e,n):bx(e,n))&&(u=Ll(u,"onBeforeInput"),0<u.length&&(d=new tu("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=b))}Ff(f,t)})}function Ns(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ll(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,i=l.stateNode;l.tag===5&&i!==null&&(l=i,i=xs(e,n),i!=null&&r.unshift(Ns(e,i,l)),i=xs(e,t),i!=null&&r.push(Ns(e,i,l))),e=e.return}return r}function ir(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function pu(e,t,n,r,l){for(var i=t._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,l?(c=xs(n,i),c!=null&&a.unshift(Ns(n,c,o))):l||(c=xs(n,i),c!=null&&a.push(Ns(n,c,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Dx=/\r\n?/g,Ox=/\u0000|\uFFFD/g;function hu(e){return(typeof e=="string"?e:""+e).replace(Dx,`
38
+ `).replace(Ox,"")}function Xs(e,t,n){if(t=hu(t),hu(e)!==t&&n)throw Error($(425))}function Il(){}var Aa=null,La=null;function Ia(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 za=typeof setTimeout=="function"?setTimeout:void 0,Fx=typeof clearTimeout=="function"?clearTimeout:void 0,mu=typeof Promise=="function"?Promise:void 0,Bx=typeof queueMicrotask=="function"?queueMicrotask:typeof mu<"u"?function(e){return mu.resolve(null).then(e).catch(Ux)}:za;function Ux(e){setTimeout(function(){throw e})}function Qi(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ys(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ys(t)}function Cn(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 xu(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 Ir=Math.random().toString(36).slice(2),qt="__reactFiber$"+Ir,bs="__reactProps$"+Ir,on="__reactContainer$"+Ir,$a="__reactEvents$"+Ir,Wx="__reactListeners$"+Ir,Hx="__reactHandles$"+Ir;function Hn(e){var t=e[qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xu(e);e!==null;){if(n=e[qt])return n;e=xu(e)}return t}e=n,n=e.parentNode}return null}function $s(e){return e=e[qt]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function fr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error($(33))}function ci(e){return e[bs]||null}var Da=[],pr=-1;function $n(e){return{current:e}}function xe(e){0>pr||(e.current=Da[pr],Da[pr]=null,pr--)}function he(e,t){pr++,Da[pr]=e.current,e.current=t}var Ln={},Ge=$n(Ln),it=$n(!1),Gn=Ln;function _r(e,t){var n=e.type.contextTypes;if(!n)return Ln;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function at(e){return e=e.childContextTypes,e!=null}function zl(){xe(it),xe(Ge)}function gu(e,t,n){if(Ge.current!==Ln)throw Error($(168));he(Ge,t),he(it,n)}function Uf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error($(108,Em(e)||"Unknown",l));return Ne({},n,r)}function $l(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ln,Gn=Ge.current,he(Ge,e),he(it,it.current),!0}function vu(e,t,n){var r=e.stateNode;if(!r)throw Error($(169));n?(e=Uf(e,t,Gn),r.__reactInternalMemoizedMergedChildContext=e,xe(it),xe(Ge),he(Ge,e)):xe(it),he(it,n)}var Yt=null,ui=!1,qi=!1;function Wf(e){Yt===null?Yt=[e]:Yt.push(e)}function Vx(e){ui=!0,Wf(e)}function Dn(){if(!qi&&Yt!==null){qi=!0;var e=0,t=de;try{var n=Yt;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Yt=null,ui=!1}catch(l){throw Yt!==null&&(Yt=Yt.slice(e+1)),hf(Co,Dn),l}finally{de=t,qi=!1}}return null}var hr=[],mr=0,Dl=null,Ol=0,jt=[],kt=0,Zn=null,en=1,tn="";function Un(e,t){hr[mr++]=Ol,hr[mr++]=Dl,Dl=e,Ol=t}function Hf(e,t,n){jt[kt++]=en,jt[kt++]=tn,jt[kt++]=Zn,Zn=e;var r=en;e=tn;var l=32-$t(r)-1;r&=~(1<<l),n+=1;var i=32-$t(t)+l;if(30<i){var a=l-l%5;i=(r&(1<<a)-1).toString(32),r>>=a,l-=a,en=1<<32-$t(t)+l|n<<l|r,tn=i+e}else en=1<<i|n<<l|r,tn=e}function zo(e){e.return!==null&&(Un(e,1),Hf(e,1,0))}function $o(e){for(;e===Dl;)Dl=hr[--mr],hr[mr]=null,Ol=hr[--mr],hr[mr]=null;for(;e===Zn;)Zn=jt[--kt],jt[kt]=null,tn=jt[--kt],jt[kt]=null,en=jt[--kt],jt[kt]=null}var ht=null,pt=null,ge=!1,zt=null;function Vf(e,t){var n=Nt(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 yu(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,ht=e,pt=Cn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,pt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zn!==null?{id:en,overflow:tn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,pt=null,!0):!1;default:return!1}}function Oa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fa(e){if(ge){var t=pt;if(t){var n=t;if(!yu(e,t)){if(Oa(e))throw Error($(418));t=Cn(n.nextSibling);var r=ht;t&&yu(e,t)?Vf(r,n):(e.flags=e.flags&-4097|2,ge=!1,ht=e)}}else{if(Oa(e))throw Error($(418));e.flags=e.flags&-4097|2,ge=!1,ht=e}}}function wu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function Ys(e){if(e!==ht)return!1;if(!ge)return wu(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ia(e.type,e.memoizedProps)),t&&(t=pt)){if(Oa(e))throw Qf(),Error($(418));for(;t;)Vf(e,t),t=Cn(t.nextSibling)}if(wu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){pt=Cn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}pt=null}}else pt=ht?Cn(e.stateNode.nextSibling):null;return!0}function Qf(){for(var e=pt;e;)e=Cn(e.nextSibling)}function Cr(){pt=ht=null,ge=!1}function Do(e){zt===null?zt=[e]:zt.push(e)}var Qx=dn.ReactCurrentBatchConfig;function Qr(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($(309));var r=n.stateNode}if(!r)throw Error($(147,e));var l=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var o=l.refs;a===null?delete o[i]:o[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error($(284));if(!n._owner)throw Error($(290,e))}return e}function el(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ju(e){var t=e._init;return t(e._payload)}function qf(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function l(m,g){return m=Mn(m,g),m.index=0,m.sibling=null,m}function i(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function a(m){return e&&m.alternate===null&&(m.flags|=2),m}function o(m,g,y,k){return g===null||g.tag!==6?(g=ea(y,m.mode,k),g.return=m,g):(g=l(g,y),g.return=m,g)}function c(m,g,y,k){var N=y.type;return N===or?d(m,g,y.props.children,k,y.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===gn&&ju(N)===g.type)?(k=l(g,y.props),k.ref=Qr(m,g,y),k.return=m,k):(k=Nl(y.type,y.key,y.props,null,m.mode,k),k.ref=Qr(m,g,y),k.return=m,k)}function u(m,g,y,k){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=ta(y,m.mode,k),g.return=m,g):(g=l(g,y.children||[]),g.return=m,g)}function d(m,g,y,k,N){return g===null||g.tag!==7?(g=Kn(y,m.mode,k,N),g.return=m,g):(g=l(g,y),g.return=m,g)}function f(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=ea(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ws:return y=Nl(g.type,g.key,g.props,null,m.mode,y),y.ref=Qr(m,null,g),y.return=m,y;case ar:return g=ta(g,m.mode,y),g.return=m,g;case gn:var k=g._init;return f(m,k(g._payload),y)}if(es(g)||Br(g))return g=Kn(g,m.mode,y,null),g.return=m,g;el(m,g)}return null}function h(m,g,y,k){var N=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:o(m,g,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ws:return y.key===N?c(m,g,y,k):null;case ar:return y.key===N?u(m,g,y,k):null;case gn:return N=y._init,h(m,g,N(y._payload),k)}if(es(y)||Br(y))return N!==null?null:d(m,g,y,k,null);el(m,y)}return null}function x(m,g,y,k,N){if(typeof k=="string"&&k!==""||typeof k=="number")return m=m.get(y)||null,o(g,m,""+k,N);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Ws:return m=m.get(k.key===null?y:k.key)||null,c(g,m,k,N);case ar:return m=m.get(k.key===null?y:k.key)||null,u(g,m,k,N);case gn:var S=k._init;return x(m,g,y,S(k._payload),N)}if(es(k)||Br(k))return m=m.get(y)||null,d(g,m,k,N,null);el(g,k)}return null}function v(m,g,y,k){for(var N=null,S=null,b=g,M=g=0,B=null;b!==null&&M<y.length;M++){b.index>M?(B=b,b=null):B=b.sibling;var T=h(m,b,y[M],k);if(T===null){b===null&&(b=B);break}e&&b&&T.alternate===null&&t(m,b),g=i(T,g,M),S===null?N=T:S.sibling=T,S=T,b=B}if(M===y.length)return n(m,b),ge&&Un(m,M),N;if(b===null){for(;M<y.length;M++)b=f(m,y[M],k),b!==null&&(g=i(b,g,M),S===null?N=b:S.sibling=b,S=b);return ge&&Un(m,M),N}for(b=r(m,b);M<y.length;M++)B=x(b,m,M,y[M],k),B!==null&&(e&&B.alternate!==null&&b.delete(B.key===null?M:B.key),g=i(B,g,M),S===null?N=B:S.sibling=B,S=B);return e&&b.forEach(function(E){return t(m,E)}),ge&&Un(m,M),N}function w(m,g,y,k){var N=Br(y);if(typeof N!="function")throw Error($(150));if(y=N.call(y),y==null)throw Error($(151));for(var S=N=null,b=g,M=g=0,B=null,T=y.next();b!==null&&!T.done;M++,T=y.next()){b.index>M?(B=b,b=null):B=b.sibling;var E=h(m,b,T.value,k);if(E===null){b===null&&(b=B);break}e&&b&&E.alternate===null&&t(m,b),g=i(E,g,M),S===null?N=E:S.sibling=E,S=E,b=B}if(T.done)return n(m,b),ge&&Un(m,M),N;if(b===null){for(;!T.done;M++,T=y.next())T=f(m,T.value,k),T!==null&&(g=i(T,g,M),S===null?N=T:S.sibling=T,S=T);return ge&&Un(m,M),N}for(b=r(m,b);!T.done;M++,T=y.next())T=x(b,m,M,T.value,k),T!==null&&(e&&T.alternate!==null&&b.delete(T.key===null?M:T.key),g=i(T,g,M),S===null?N=T:S.sibling=T,S=T);return e&&b.forEach(function(I){return t(m,I)}),ge&&Un(m,M),N}function j(m,g,y,k){if(typeof y=="object"&&y!==null&&y.type===or&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ws:e:{for(var N=y.key,S=g;S!==null;){if(S.key===N){if(N=y.type,N===or){if(S.tag===7){n(m,S.sibling),g=l(S,y.props.children),g.return=m,m=g;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===gn&&ju(N)===S.type){n(m,S.sibling),g=l(S,y.props),g.ref=Qr(m,S,y),g.return=m,m=g;break e}n(m,S);break}else t(m,S);S=S.sibling}y.type===or?(g=Kn(y.props.children,m.mode,k,y.key),g.return=m,m=g):(k=Nl(y.type,y.key,y.props,null,m.mode,k),k.ref=Qr(m,g,y),k.return=m,m=k)}return a(m);case ar:e:{for(S=y.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(m,g.sibling),g=l(g,y.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=ta(y,m.mode,k),g.return=m,m=g}return a(m);case gn:return S=y._init,j(m,g,S(y._payload),k)}if(es(y))return v(m,g,y,k);if(Br(y))return w(m,g,y,k);el(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(m,g.sibling),g=l(g,y),g.return=m,m=g):(n(m,g),g=ea(y,m.mode,k),g.return=m,m=g),a(m)):n(m,g)}return j}var Er=qf(!0),Kf=qf(!1),Fl=$n(null),Bl=null,xr=null,Oo=null;function Fo(){Oo=xr=Bl=null}function Bo(e){var t=Fl.current;xe(Fl),e._currentValue=t}function Ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nr(e,t){Bl=e,Oo=xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function Ct(e){var t=e._currentValue;if(Oo!==e)if(e={context:e,memoizedValue:t,next:null},xr===null){if(Bl===null)throw Error($(308));xr=e,Bl.dependencies={lanes:0,firstContext:e}}else xr=xr.next=e;return t}var Vn=null;function Uo(e){Vn===null?Vn=[e]:Vn.push(e)}function Gf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Uo(t)):(n.next=l.next,l.next=n),t.interleaved=n,cn(e,r)}function cn(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 vn=!1;function Wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zf(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 sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function En(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,cn(e,n)}return l=r.interleaved,l===null?(t.next=t,Uo(r)):(t.next=l.next,l.next=t),r.interleaved=t,cn(e,n)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Eo(e,n)}}function ku(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ul(e,t,n,r){var l=e.updateQueue;vn=!1;var i=l.firstBaseUpdate,a=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=l.baseState;a=0,d=u=c=null,o=i;do{var h=o.lane,x=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:x,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,w=o;switch(h=t,x=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){f=v.call(x,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,h=typeof v=="function"?v.call(x,f,h):v,h==null)break e;f=Ne({},f,h);break e;case 2:vn=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[o]:h.push(o))}else x={eventTime:x,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=x,c=f):d=d.next=x,a|=h;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;h=o,o=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(d===null&&(c=f),l.baseState=c,l.firstBaseUpdate=u,l.lastBaseUpdate=d,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Xn|=a,e.lanes=a,e.memoizedState=f}}function Nu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error($(191,l));l.call(r)}}}var Ds={},Gt=$n(Ds),Ss=$n(Ds),_s=$n(Ds);function Qn(e){if(e===Ds)throw Error($(174));return e}function Ho(e,t){switch(he(_s,t),he(Ss,e),he(Gt,Ds),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ja(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ja(t,e)}xe(Gt),he(Gt,t)}function Pr(){xe(Gt),xe(Ss),xe(_s)}function Jf(e){Qn(_s.current);var t=Qn(Gt.current),n=ja(t,e.type);t!==n&&(he(Ss,e),he(Gt,n))}function Vo(e){Ss.current===e&&(xe(Gt),xe(Ss))}var we=$n(0);function Wl(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 Ki=[];function Qo(){for(var e=0;e<Ki.length;e++)Ki[e]._workInProgressVersionPrimary=null;Ki.length=0}var vl=dn.ReactCurrentDispatcher,Gi=dn.ReactCurrentBatchConfig,Jn=0,je=null,Ae=null,$e=null,Hl=!1,os=!1,Cs=0,qx=0;function Ve(){throw Error($(321))}function qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,l,i){if(Jn=i,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vl.current=e===null||e.memoizedState===null?Jx:Xx,e=n(r,l),os){i=0;do{if(os=!1,Cs=0,25<=i)throw Error($(301));i+=1,$e=Ae=null,t.updateQueue=null,vl.current=Yx,e=n(r,l)}while(os)}if(vl.current=Vl,t=Ae!==null&&Ae.next!==null,Jn=0,$e=Ae=je=null,Hl=!1,t)throw Error($(300));return e}function Go(){var e=Cs!==0;return Cs=0,e}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?je.memoizedState=$e=e:$e=$e.next=e,$e}function Et(){if(Ae===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=$e===null?je.memoizedState:$e.next;if(t!==null)$e=t,Ae=e;else{if(e===null)throw Error($(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},$e===null?je.memoizedState=$e=e:$e=$e.next=e}return $e}function Es(e,t){return typeof t=="function"?t(e):t}function Zi(e){var t=Et(),n=t.queue;if(n===null)throw Error($(311));n.lastRenderedReducer=e;var r=Ae,l=r.baseQueue,i=n.pending;if(i!==null){if(l!==null){var a=l.next;l.next=i.next,i.next=a}r.baseQueue=l=i,n.pending=null}if(l!==null){i=l.next,r=r.baseState;var o=a=null,c=null,u=i;do{var d=u.lane;if((Jn&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,a=r):c=c.next=f,je.lanes|=d,Xn|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=o,Ot(r,t.memoizedState)||(lt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do i=l.lane,je.lanes|=i,Xn|=i,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ji(e){var t=Et(),n=t.queue;if(n===null)throw Error($(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,i=t.memoizedState;if(l!==null){n.pending=null;var a=l=l.next;do i=e(i,a.action),a=a.next;while(a!==l);Ot(i,t.memoizedState)||(lt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Xf(){}function Yf(e,t){var n=je,r=Et(),l=t(),i=!Ot(r.memoizedState,l);if(i&&(r.memoizedState=l,lt=!0),r=r.queue,Zo(np.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||$e!==null&&$e.memoizedState.tag&1){if(n.flags|=2048,Ps(9,tp.bind(null,n,r,l,t),void 0,null),De===null)throw Error($(349));Jn&30||ep(n,t,l)}return l}function ep(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tp(e,t,n,r){t.value=n,t.getSnapshot=r,rp(t)&&sp(e)}function np(e,t,n){return n(function(){rp(t)&&sp(e)})}function rp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function sp(e){var t=cn(e,1);t!==null&&Dt(t,e,1,-1)}function bu(e){var t=Qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:e},t.queue=e,e=e.dispatch=Zx.bind(null,je,e),[t.memoizedState,e]}function Ps(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function lp(){return Et().memoizedState}function yl(e,t,n,r){var l=Qt();je.flags|=e,l.memoizedState=Ps(1|t,n,void 0,r===void 0?null:r)}function di(e,t,n,r){var l=Et();r=r===void 0?null:r;var i=void 0;if(Ae!==null){var a=Ae.memoizedState;if(i=a.destroy,r!==null&&qo(r,a.deps)){l.memoizedState=Ps(t,n,i,r);return}}je.flags|=e,l.memoizedState=Ps(1|t,n,i,r)}function Su(e,t){return yl(8390656,8,e,t)}function Zo(e,t){return di(2048,8,e,t)}function ip(e,t){return di(4,2,e,t)}function ap(e,t){return di(4,4,e,t)}function op(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 cp(e,t,n){return n=n!=null?n.concat([e]):null,di(4,4,op.bind(null,t,e),n)}function Jo(){}function up(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dp(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function fp(e,t,n){return Jn&21?(Ot(n,t)||(n=gf(),je.lanes|=n,Xn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=n)}function Kx(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Gi.transition;Gi.transition={};try{e(!1),t()}finally{de=n,Gi.transition=r}}function pp(){return Et().memoizedState}function Gx(e,t,n){var r=Tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hp(e))mp(t,n);else if(n=Gf(e,t,n,r),n!==null){var l=et();Dt(n,e,r,l),xp(n,t,r)}}function Zx(e,t,n){var r=Tn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hp(e))mp(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,o=i(a,n);if(l.hasEagerState=!0,l.eagerState=o,Ot(o,a)){var c=t.interleaved;c===null?(l.next=l,Uo(t)):(l.next=c.next,c.next=l),t.interleaved=l;return}}catch{}finally{}n=Gf(e,t,l,r),n!==null&&(l=et(),Dt(n,e,r,l),xp(n,t,r))}}function hp(e){var t=e.alternate;return e===je||t!==null&&t===je}function mp(e,t){os=Hl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Eo(e,n)}}var Vl={readContext:Ct,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},Jx={readContext:Ct,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Su,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,yl(4194308,4,op.bind(null,t,e),n)},useLayoutEffect:function(e,t){return yl(4194308,4,e,t)},useInsertionEffect:function(e,t){return yl(4,2,e,t)},useMemo:function(e,t){var n=Qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Gx.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:bu,useDebugValue:Jo,useDeferredValue:function(e){return Qt().memoizedState=e},useTransition:function(){var e=bu(!1),t=e[0];return e=Kx.bind(null,e[1]),Qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,l=Qt();if(ge){if(n===void 0)throw Error($(407));n=n()}else{if(n=t(),De===null)throw Error($(349));Jn&30||ep(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Su(np.bind(null,r,i,e),[e]),r.flags|=2048,Ps(9,tp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qt(),t=De.identifierPrefix;if(ge){var n=tn,r=en;n=(r&~(1<<32-$t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Cs++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=qx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Xx={readContext:Ct,useCallback:up,useContext:Ct,useEffect:Zo,useImperativeHandle:cp,useInsertionEffect:ip,useLayoutEffect:ap,useMemo:dp,useReducer:Zi,useRef:lp,useState:function(){return Zi(Es)},useDebugValue:Jo,useDeferredValue:function(e){var t=Et();return fp(t,Ae.memoizedState,e)},useTransition:function(){var e=Zi(Es)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Xf,useSyncExternalStore:Yf,useId:pp,unstable_isNewReconciler:!1},Yx={readContext:Ct,useCallback:up,useContext:Ct,useEffect:Zo,useImperativeHandle:cp,useInsertionEffect:ip,useLayoutEffect:ap,useMemo:dp,useReducer:Ji,useRef:lp,useState:function(){return Ji(Es)},useDebugValue:Jo,useDeferredValue:function(e){var t=Et();return Ae===null?t.memoizedState=e:fp(t,Ae.memoizedState,e)},useTransition:function(){var e=Ji(Es)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Xf,useSyncExternalStore:Yf,useId:pp,unstable_isNewReconciler:!1};function Lt(e,t){if(e&&e.defaultProps){t=Ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ua(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fi={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=et(),l=Tn(e),i=sn(r,l);i.payload=t,n!=null&&(i.callback=n),t=En(e,i,l),t!==null&&(Dt(t,e,l,r),gl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=et(),l=Tn(e),i=sn(r,l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=En(e,i,l),t!==null&&(Dt(t,e,l,r),gl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=et(),r=Tn(e),l=sn(n,r);l.tag=2,t!=null&&(l.callback=t),t=En(e,l,r),t!==null&&(Dt(t,e,r,n),gl(t,e,r))}};function _u(e,t,n,r,l,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!js(n,r)||!js(l,i):!0}function gp(e,t,n){var r=!1,l=Ln,i=t.contextType;return typeof i=="object"&&i!==null?i=Ct(i):(l=at(t)?Gn:Ge.current,r=t.contextTypes,i=(r=r!=null)?_r(e,l):Ln),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function Cu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fi.enqueueReplaceState(t,t.state,null)}function Wa(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Wo(e);var i=t.contextType;typeof i=="object"&&i!==null?l.context=Ct(i):(i=at(t)?Gn:Ge.current,l.context=_r(e,i)),l.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ua(e,t,i,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&fi.enqueueReplaceState(l,l.state,null),Ul(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Tr(e,t){try{var n="",r=t;do n+=Cm(r),r=r.return;while(r);var l=n}catch(i){l=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:l,digest:null}}function Xi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ha(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var e0=typeof WeakMap=="function"?WeakMap:Map;function vp(e,t,n){n=sn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ql||(ql=!0,eo=r),Ha(e,t)},n}function yp(e,t,n){n=sn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Ha(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ha(e,t),typeof r!="function"&&(Pn===null?Pn=new Set([this]):Pn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Eu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new e0;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=h0.bind(null,e,t,n),t.then(e,e))}function Pu(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 Tu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,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=sn(-1,1),t.tag=2,En(n,t,1))),n.lanes|=1),e)}var t0=dn.ReactCurrentOwner,lt=!1;function Xe(e,t,n,r){t.child=e===null?Kf(t,null,n,r):Er(t,e.child,n,r)}function Mu(e,t,n,r,l){n=n.render;var i=t.ref;return Nr(t,l),r=Ko(e,t,n,r,i,l),n=Go(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,un(e,t,l)):(ge&&n&&zo(t),t.flags|=1,Xe(e,t,r,l),t.child)}function Ru(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!lc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wp(e,t,i,r,l)):(e=Nl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:js,n(a,r)&&e.ref===t.ref)return un(e,t,l)}return t.flags|=1,e=Mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function wp(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(js(i,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(lt=!0);else return t.lanes=e.lanes,un(e,t,l)}return Va(e,t,n,r,l)}function jp(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(vr,ft),ft|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(vr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,he(vr,ft),ft|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,he(vr,ft),ft|=r;return Xe(e,t,l,n),t.child}function kp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Va(e,t,n,r,l){var i=at(n)?Gn:Ge.current;return i=_r(t,i),Nr(t,l),n=Ko(e,t,n,r,i,l),r=Go(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,un(e,t,l)):(ge&&r&&zo(t),t.flags|=1,Xe(e,t,n,l),t.child)}function Au(e,t,n,r,l){if(at(n)){var i=!0;$l(t)}else i=!1;if(Nr(t,l),t.stateNode===null)wl(e,t),gp(t,n,r),Wa(t,n,r,l),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ct(u):(u=at(n)?Gn:Ge.current,u=_r(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&Cu(t,a,r,u),vn=!1;var h=t.memoizedState;a.state=h,Ul(t,r,a,l),c=t.memoizedState,o!==r||h!==c||it.current||vn?(typeof d=="function"&&(Ua(t,n,d,r),c=t.memoizedState),(o=vn||_u(t,n,o,r,h,c,u))?(f||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=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zf(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Lt(t.type,o),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Ct(c):(c=at(n)?Gn:Ge.current,c=_r(t,c));var x=n.getDerivedStateFromProps;(d=typeof x=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==c)&&Cu(t,a,r,c),vn=!1,h=t.memoizedState,a.state=h,Ul(t,r,a,l);var v=t.memoizedState;o!==f||h!==v||it.current||vn?(typeof x=="function"&&(Ua(t,n,x,r),v=t.memoizedState),(u=vn||_u(t,n,u,r,h,v,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),a.props=r,a.state=v,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Qa(e,t,n,r,i,l)}function Qa(e,t,n,r,l,i){kp(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return l&&vu(t,n,!1),un(e,t,i);r=t.stateNode,t0.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Er(t,e.child,null,i),t.child=Er(t,null,o,i)):Xe(e,t,o,i),t.memoizedState=r.state,l&&vu(t,n,!0),t.child}function Np(e){var t=e.stateNode;t.pendingContext?gu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gu(e,t.context,!1),Ho(e,t.containerInfo)}function Lu(e,t,n,r,l){return Cr(),Do(l),t.flags|=256,Xe(e,t,n,r),t.child}var qa={dehydrated:null,treeContext:null,retryLane:0};function Ka(e){return{baseLanes:e,cachePool:null,transitions:null}}function bp(e,t,n){var r=t.pendingProps,l=we.current,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),he(we,l&1),e===null)return Fa(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=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=mi(a,r,0,null),e=Kn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ka(n),t.memoizedState=qa,e):Xo(t,a));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return n0(e,t,a,r,o,l,n);if(i){i=r.fallback,a=t.mode,l=e.child,o=l.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Mn(l,c),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?i=Mn(o,i):(i=Kn(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Ka(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=qa,r}return i=e.child,e=i.sibling,r=Mn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xo(e,t){return t=mi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function tl(e,t,n,r){return r!==null&&Do(r),Er(t,e.child,null,n),e=Xo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function n0(e,t,n,r,l,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Xi(Error($(422))),tl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=mi({mode:"visible",children:r.children},l,0,null),i=Kn(i,l,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Er(t,e.child,null,a),t.child.memoizedState=Ka(a),t.memoizedState=qa,i);if(!(t.mode&1))return tl(e,t,a,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error($(419)),r=Xi(i,r,void 0),tl(e,t,a,r)}if(o=(a&e.childLanes)!==0,lt||o){if(r=De,r!==null){switch(a&-a){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|a)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,cn(e,l),Dt(r,e,l,-1))}return sc(),r=Xi(Error($(421))),tl(e,t,a,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=m0.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,pt=Cn(l.nextSibling),ht=t,ge=!0,zt=null,e!==null&&(jt[kt++]=en,jt[kt++]=tn,jt[kt++]=Zn,en=e.id,tn=e.overflow,Zn=t),t=Xo(t,r.children),t.flags|=4096,t)}function Iu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ba(e.return,t,n)}function Yi(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Sp(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(Xe(e,t,r.children,n),r=we.current,r&2)r=r&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&&Iu(e,n,t);else if(e.tag===19)Iu(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}r&=1}if(he(we,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Wl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Yi(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Wl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Yi(t,!0,n,null,i);break;case"together":Yi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error($(153));if(t.child!==null){for(e=t.child,n=Mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function r0(e,t,n){switch(t.tag){case 3:Np(t),Cr();break;case 5:Jf(t);break;case 1:at(t.type)&&$l(t);break;case 4:Ho(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;he(Fl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(we,we.current&1),t.flags|=128,null):n&t.child.childLanes?bp(e,t,n):(he(we,we.current&1),e=un(e,t,n),e!==null?e.sibling:null);he(we,we.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Sp(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),he(we,we.current),r)break;return null;case 22:case 23:return t.lanes=0,jp(e,t,n)}return un(e,t,n)}var _p,Ga,Cp,Ep;_p=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}};Ga=function(){};Cp=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Qn(Gt.current);var i=null;switch(n){case"input":l=ga(e,l),r=ga(e,r),i=[];break;case"select":l=Ne({},l,{value:void 0}),r=Ne({},r,{value:void 0}),i=[];break;case"textarea":l=wa(e,l),r=wa(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Il)}ka(n,r);var a;n=null;for(u in l)if(!r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&l[u]!=null)if(u==="style"){var o=l[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(hs.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(o=l!=null?l[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(hs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&me("scroll",e),i||o===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Ep=function(e,t,n,r){n!==r&&(t.flags|=4)};function qr(e,t){if(!ge)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function s0(e,t,n){var r=t.pendingProps;switch($o(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(t),null;case 1:return at(t.type)&&zl(),Qe(t),null;case 3:return r=t.stateNode,Pr(),xe(it),xe(Ge),Qo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ys(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zt!==null&&(ro(zt),zt=null))),Ga(e,t),Qe(t),null;case 5:Vo(t);var l=Qn(_s.current);if(n=t.type,e!==null&&t.stateNode!=null)Cp(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error($(166));return Qe(t),null}if(e=Qn(Gt.current),Ys(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[qt]=t,r[bs]=i,e=(t.mode&1)!==0,n){case"dialog":me("cancel",r),me("close",r);break;case"iframe":case"object":case"embed":me("load",r);break;case"video":case"audio":for(l=0;l<ns.length;l++)me(ns[l],r);break;case"source":me("error",r);break;case"img":case"image":case"link":me("error",r),me("load",r);break;case"details":me("toggle",r);break;case"input":Hc(r,i),me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},me("invalid",r);break;case"textarea":Qc(r,i),me("invalid",r)}ka(n,i),l=null;for(var a in i)if(i.hasOwnProperty(a)){var o=i[a];a==="children"?typeof o=="string"?r.textContent!==o&&(i.suppressHydrationWarning!==!0&&Xs(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Xs(r.textContent,o,e),l=["children",""+o]):hs.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&me("scroll",r)}switch(n){case"input":Hs(r),Vc(r,i,!0);break;case"textarea":Hs(r),qc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Il)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[qt]=t,e[bs]=r,_p(e,t,!1,!1),t.stateNode=e;e:{switch(a=Na(n,r),n){case"dialog":me("cancel",e),me("close",e),l=r;break;case"iframe":case"object":case"embed":me("load",e),l=r;break;case"video":case"audio":for(l=0;l<ns.length;l++)me(ns[l],e);l=r;break;case"source":me("error",e),l=r;break;case"img":case"image":case"link":me("error",e),me("load",e),l=r;break;case"details":me("toggle",e),l=r;break;case"input":Hc(e,r),l=ga(e,r),me("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=Ne({},r,{value:void 0}),me("invalid",e);break;case"textarea":Qc(e,r),l=wa(e,r),me("invalid",e);break;default:l=r}ka(n,l),o=l;for(i in o)if(o.hasOwnProperty(i)){var c=o[i];i==="style"?sf(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&nf(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ms(e,c):typeof c=="number"&&ms(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(hs.hasOwnProperty(i)?c!=null&&i==="onScroll"&&me("scroll",e):c!=null&&ko(e,i,c,a))}switch(n){case"input":Hs(e),Vc(e,r,!1);break;case"textarea":Hs(e),qc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+An(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?yr(e,!!r.multiple,i,!1):r.defaultValue!=null&&yr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Il)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Qe(t),null;case 6:if(e&&t.stateNode!=null)Ep(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error($(166));if(n=Qn(_s.current),Qn(Gt.current),Ys(t)){if(r=t.stateNode,n=t.memoizedProps,r[qt]=t,(i=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:Xs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xs(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[qt]=t,t.stateNode=r}return Qe(t),null;case 13:if(xe(we),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&pt!==null&&t.mode&1&&!(t.flags&128))Qf(),Cr(),t.flags|=98560,i=!1;else if(i=Ys(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error($(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error($(317));i[qt]=t}else Cr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qe(t),i=!1}else zt!==null&&(ro(zt),zt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||we.current&1?Le===0&&(Le=3):sc())),t.updateQueue!==null&&(t.flags|=4),Qe(t),null);case 4:return Pr(),Ga(e,t),e===null&&ks(t.stateNode.containerInfo),Qe(t),null;case 10:return Bo(t.type._context),Qe(t),null;case 17:return at(t.type)&&zl(),Qe(t),null;case 19:if(xe(we),i=t.memoizedState,i===null)return Qe(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)qr(i,!1);else{if(Le!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Wl(e),a!==null){for(t.flags|=128,qr(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(we,we.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ee()>Mr&&(t.flags|=128,r=!0,qr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Wl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ge)return Qe(t),null}else 2*Ee()-i.renderingStartTime>Mr&&n!==1073741824&&(t.flags|=128,r=!0,qr(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=we.current,he(we,r?n&1|2:n&1),t):(Qe(t),null);case 22:case 23:return rc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function l0(e,t){switch($o(t),t.tag){case 1:return at(t.type)&&zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pr(),xe(it),xe(Ge),Qo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vo(t),null;case 13:if(xe(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));Cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(we),null;case 4:return Pr(),null;case 10:return Bo(t.type._context),null;case 22:case 23:return rc(),null;case 24:return null;default:return null}}var nl=!1,Ke=!1,i0=typeof WeakSet=="function"?WeakSet:Set,H=null;function gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Za(e,t,n){try{n()}catch(r){Se(e,t,r)}}var zu=!1;function a0(e,t){if(Aa=Rl,e=Af(),Io(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var x;f!==n||l!==0&&f.nodeType!==3||(o=a+l),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(x=f.firstChild)!==null;)h=f,f=x;for(;;){if(f===e)break t;if(h===n&&++u===l&&(o=a),h===i&&++d===r&&(c=a),(x=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=x}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(La={focusedElem:e,selectionRange:n},Rl=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,j=v.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Lt(t.type,w),j);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(k){Se(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return v=zu,zu=!1,v}function cs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Za(t,n,i)}l=l.next}while(l!==r)}}function pi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ja(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 Pp(e){var t=e.alternate;t!==null&&(e.alternate=null,Pp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[bs],delete t[$a],delete t[Wx],delete t[Hx])),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 Tp(e){return e.tag===5||e.tag===3||e.tag===4}function $u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tp(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 Xa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Il));else if(r!==4&&(e=e.child,e!==null))for(Xa(e,t,n),e=e.sibling;e!==null;)Xa(e,t,n),e=e.sibling}function Ya(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ya(e,t,n),e=e.sibling;e!==null;)Ya(e,t,n),e=e.sibling}var Fe=null,It=!1;function xn(e,t,n){for(n=n.child;n!==null;)Mp(e,t,n),n=n.sibling}function Mp(e,t,n){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(li,n)}catch{}switch(n.tag){case 5:Ke||gr(n,t);case 6:var r=Fe,l=It;Fe=null,xn(e,t,n),Fe=r,It=l,Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?Qi(e.parentNode,n):e.nodeType===1&&Qi(e,n),ys(e)):Qi(Fe,n.stateNode));break;case 4:r=Fe,l=It,Fe=n.stateNode.containerInfo,It=!0,xn(e,t,n),Fe=r,It=l;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Za(n,t,a),l=l.next}while(l!==r)}xn(e,t,n);break;case 1:if(!Ke&&(gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Se(n,t,o)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,xn(e,t,n),Ke=r):xn(e,t,n);break;default:xn(e,t,n)}}function Du(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new i0),t.forEach(function(r){var l=x0.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var i=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Fe=o.stateNode,It=!1;break e;case 3:Fe=o.stateNode.containerInfo,It=!0;break e;case 4:Fe=o.stateNode.containerInfo,It=!0;break e}o=o.return}if(Fe===null)throw Error($(160));Mp(i,a,l),Fe=null,It=!1;var c=l.alternate;c!==null&&(c.return=null),l.return=null}catch(u){Se(l,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Rp(t,e),t=t.sibling}function Rp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(At(t,e),Ht(e),r&4){try{cs(3,e,e.return),pi(3,e)}catch(w){Se(e,e.return,w)}try{cs(5,e,e.return)}catch(w){Se(e,e.return,w)}}break;case 1:At(t,e),Ht(e),r&512&&n!==null&&gr(n,n.return);break;case 5:if(At(t,e),Ht(e),r&512&&n!==null&&gr(n,n.return),e.flags&32){var l=e.stateNode;try{ms(l,"")}catch(w){Se(e,e.return,w)}}if(r&4&&(l=e.stateNode,l!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&Yd(l,i),Na(o,a);var u=Na(o,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?sf(l,f):d==="dangerouslySetInnerHTML"?nf(l,f):d==="children"?ms(l,f):ko(l,d,f,u)}switch(o){case"input":va(l,i);break;case"textarea":ef(l,i);break;case"select":var h=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!i.multiple;var x=i.value;x!=null?yr(l,!!i.multiple,x,!1):h!==!!i.multiple&&(i.defaultValue!=null?yr(l,!!i.multiple,i.defaultValue,!0):yr(l,!!i.multiple,i.multiple?[]:"",!1))}l[bs]=i}catch(w){Se(e,e.return,w)}}break;case 6:if(At(t,e),Ht(e),r&4){if(e.stateNode===null)throw Error($(162));l=e.stateNode,i=e.memoizedProps;try{l.nodeValue=i}catch(w){Se(e,e.return,w)}}break;case 3:if(At(t,e),Ht(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ys(t.containerInfo)}catch(w){Se(e,e.return,w)}break;case 4:At(t,e),Ht(e);break;case 13:At(t,e),Ht(e),l=e.child,l.flags&8192&&(i=l.memoizedState!==null,l.stateNode.isHidden=i,!i||l.alternate!==null&&l.alternate.memoizedState!==null||(tc=Ee())),r&4&&Du(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ke=(u=Ke)||d,At(t,e),Ke=u):At(t,e),Ht(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(H=e,d=e.child;d!==null;){for(f=H=d;H!==null;){switch(h=H,x=h.child,h.tag){case 0:case 11:case 14:case 15:cs(4,h,h.return);break;case 1:gr(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){Se(r,n,w)}}break;case 5:gr(h,h.return);break;case 22:if(h.memoizedState!==null){Fu(f);continue}}x!==null?(x.return=h,H=x):Fu(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{l=f.stateNode,u?(i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=rf("display",a))}catch(w){Se(e,e.return,w)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(w){Se(e,e.return,w)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:At(t,e),Ht(e),r&4&&Du(e);break;case 21:break;default:At(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Tp(n)){var r=n;break e}n=n.return}throw Error($(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(ms(l,""),r.flags&=-33);var i=$u(e);Ya(e,i,l);break;case 3:case 4:var a=r.stateNode.containerInfo,o=$u(e);Xa(e,o,a);break;default:throw Error($(161))}}catch(c){Se(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function o0(e,t,n){H=e,Ap(e)}function Ap(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var l=H,i=l.child;if(l.tag===22&&r){var a=l.memoizedState!==null||nl;if(!a){var o=l.alternate,c=o!==null&&o.memoizedState!==null||Ke;o=nl;var u=Ke;if(nl=a,(Ke=c)&&!u)for(H=l;H!==null;)a=H,c=a.child,a.tag===22&&a.memoizedState!==null?Bu(l):c!==null?(c.return=a,H=c):Bu(l);for(;i!==null;)H=i,Ap(i),i=i.sibling;H=l,nl=o,Ke=u}Ou(e)}else l.subtreeFlags&8772&&i!==null?(i.return=l,H=i):Ou(e)}}function Ou(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ke||pi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ke)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:Lt(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Nu(t,i,r);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}Nu(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;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 u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&ys(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error($(163))}Ke||t.flags&512&&Ja(t)}catch(h){Se(t,t.return,h)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Fu(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Bu(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pi(4,t)}catch(c){Se(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(c){Se(t,l,c)}}var i=t.return;try{Ja(t)}catch(c){Se(t,i,c)}break;case 5:var a=t.return;try{Ja(t)}catch(c){Se(t,a,c)}}}catch(c){Se(t,t.return,c)}if(t===e){H=null;break}var o=t.sibling;if(o!==null){o.return=t.return,H=o;break}H=t.return}}var c0=Math.ceil,Ql=dn.ReactCurrentDispatcher,Yo=dn.ReactCurrentOwner,bt=dn.ReactCurrentBatchConfig,oe=0,De=null,Me=null,Be=0,ft=0,vr=$n(0),Le=0,Ts=null,Xn=0,hi=0,ec=0,us=null,st=null,tc=0,Mr=1/0,Xt=null,ql=!1,eo=null,Pn=null,rl=!1,kn=null,Kl=0,ds=0,to=null,jl=-1,kl=0;function et(){return oe&6?Ee():jl!==-1?jl:jl=Ee()}function Tn(e){return e.mode&1?oe&2&&Be!==0?Be&-Be:Qx.transition!==null?(kl===0&&(kl=gf()),kl):(e=de,e!==0||(e=window.event,e=e===void 0?16:bf(e.type)),e):1}function Dt(e,t,n,r){if(50<ds)throw ds=0,to=null,Error($(185));Is(e,n,r),(!(oe&2)||e!==De)&&(e===De&&(!(oe&2)&&(hi|=n),Le===4&&wn(e,Be)),ot(e,r),n===1&&oe===0&&!(t.mode&1)&&(Mr=Ee()+500,ui&&Dn()))}function ot(e,t){var n=e.callbackNode;Qm(e,t);var r=Ml(e,e===De?Be:0);if(r===0)n!==null&&Zc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zc(n),t===1)e.tag===0?Vx(Uu.bind(null,e)):Wf(Uu.bind(null,e)),Bx(function(){!(oe&6)&&Dn()}),n=null;else{switch(vf(r)){case 1:n=Co;break;case 4:n=mf;break;case 16:n=Tl;break;case 536870912:n=xf;break;default:n=Tl}n=Bp(n,Lp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Lp(e,t){if(jl=-1,kl=0,oe&6)throw Error($(327));var n=e.callbackNode;if(br()&&e.callbackNode!==n)return null;var r=Ml(e,e===De?Be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Gl(e,r);else{t=r;var l=oe;oe|=2;var i=zp();(De!==e||Be!==t)&&(Xt=null,Mr=Ee()+500,qn(e,t));do try{f0();break}catch(o){Ip(e,o)}while(!0);Fo(),Ql.current=i,oe=l,Me!==null?t=0:(De=null,Be=0,t=Le)}if(t!==0){if(t===2&&(l=Ea(e),l!==0&&(r=l,t=no(e,l))),t===1)throw n=Ts,qn(e,0),wn(e,r),ot(e,Ee()),n;if(t===6)wn(e,r);else{if(l=e.current.alternate,!(r&30)&&!u0(l)&&(t=Gl(e,r),t===2&&(i=Ea(e),i!==0&&(r=i,t=no(e,i))),t===1))throw n=Ts,qn(e,0),wn(e,r),ot(e,Ee()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error($(345));case 2:Wn(e,st,Xt);break;case 3:if(wn(e,r),(r&130023424)===r&&(t=tc+500-Ee(),10<t)){if(Ml(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){et(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=za(Wn.bind(null,e,st,Xt),t);break}Wn(e,st,Xt);break;case 4:if(wn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var a=31-$t(r);i=1<<a,a=t[a],a>l&&(l=a),r&=~i}if(r=l,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*c0(r/1960))-r,10<r){e.timeoutHandle=za(Wn.bind(null,e,st,Xt),r);break}Wn(e,st,Xt);break;case 5:Wn(e,st,Xt);break;default:throw Error($(329))}}}return ot(e,Ee()),e.callbackNode===n?Lp.bind(null,e):null}function no(e,t){var n=us;return e.current.memoizedState.isDehydrated&&(qn(e,t).flags|=256),e=Gl(e,t),e!==2&&(t=st,st=n,t!==null&&ro(t)),e}function ro(e){st===null?st=e:st.push.apply(st,e)}function u0(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],i=l.getSnapshot;l=l.value;try{if(!Ot(i(),l))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 wn(e,t){for(t&=~ec,t&=~hi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$t(t),r=1<<n;e[n]=-1,t&=~r}}function Uu(e){if(oe&6)throw Error($(327));br();var t=Ml(e,0);if(!(t&1))return ot(e,Ee()),null;var n=Gl(e,t);if(e.tag!==0&&n===2){var r=Ea(e);r!==0&&(t=r,n=no(e,r))}if(n===1)throw n=Ts,qn(e,0),wn(e,t),ot(e,Ee()),n;if(n===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wn(e,st,Xt),ot(e,Ee()),null}function nc(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Mr=Ee()+500,ui&&Dn())}}function Yn(e){kn!==null&&kn.tag===0&&!(oe&6)&&br();var t=oe;oe|=1;var n=bt.transition,r=de;try{if(bt.transition=null,de=1,e)return e()}finally{de=r,bt.transition=n,oe=t,!(oe&6)&&Dn()}}function rc(){ft=vr.current,xe(vr)}function qn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Fx(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch($o(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zl();break;case 3:Pr(),xe(it),xe(Ge),Qo();break;case 5:Vo(r);break;case 4:Pr();break;case 13:xe(we);break;case 19:xe(we);break;case 10:Bo(r.type._context);break;case 22:case 23:rc()}n=n.return}if(De=e,Me=e=Mn(e.current,null),Be=ft=t,Le=0,Ts=null,ec=hi=Xn=0,st=us=null,Vn!==null){for(t=0;t<Vn.length;t++)if(n=Vn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=l,r.next=a}n.pending=r}Vn=null}return e}function Ip(e,t){do{var n=Me;try{if(Fo(),vl.current=Vl,Hl){for(var r=je.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Hl=!1}if(Jn=0,$e=Ae=je=null,os=!1,Cs=0,Yo.current=null,n===null||n.return===null){Le=1,Ts=t,Me=null;break}e:{var i=e,a=n.return,o=n,c=t;if(t=Be,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var x=Pu(a);if(x!==null){x.flags&=-257,Tu(x,a,o,i,t),x.mode&1&&Eu(i,u,t),t=x,c=u;var v=t.updateQueue;if(v===null){var w=new Set;w.add(c),t.updateQueue=w}else v.add(c);break e}else{if(!(t&1)){Eu(i,u,t),sc();break e}c=Error($(426))}}else if(ge&&o.mode&1){var j=Pu(a);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Tu(j,a,o,i,t),Do(Tr(c,o));break e}}i=c=Tr(c,o),Le!==4&&(Le=2),us===null?us=[i]:us.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=vp(i,c,t);ku(i,m);break e;case 1:o=c;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Pn===null||!Pn.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=yp(i,o,t);ku(i,k);break e}}i=i.return}while(i!==null)}Dp(n)}catch(N){t=N,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function zp(){var e=Ql.current;return Ql.current=Vl,e===null?Vl:e}function sc(){(Le===0||Le===3||Le===2)&&(Le=4),De===null||!(Xn&268435455)&&!(hi&268435455)||wn(De,Be)}function Gl(e,t){var n=oe;oe|=2;var r=zp();(De!==e||Be!==t)&&(Xt=null,qn(e,t));do try{d0();break}catch(l){Ip(e,l)}while(!0);if(Fo(),oe=n,Ql.current=r,Me!==null)throw Error($(261));return De=null,Be=0,Le}function d0(){for(;Me!==null;)$p(Me)}function f0(){for(;Me!==null&&!$m();)$p(Me)}function $p(e){var t=Fp(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Dp(e):Me=t,Yo.current=null}function Dp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=l0(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Le=6,Me=null;return}}else if(n=s0(n,t,ft),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Le===0&&(Le=5)}function Wn(e,t,n){var r=de,l=bt.transition;try{bt.transition=null,de=1,p0(e,t,n,r)}finally{bt.transition=l,de=r}return null}function p0(e,t,n,r){do br();while(kn!==null);if(oe&6)throw Error($(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error($(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(qm(e,i),e===De&&(Me=De=null,Be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||rl||(rl=!0,Bp(Tl,function(){return br(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=bt.transition,bt.transition=null;var a=de;de=1;var o=oe;oe|=4,Yo.current=null,a0(e,n),Rp(n,e),Ax(La),Rl=!!Aa,La=Aa=null,e.current=n,o0(n),Dm(),oe=o,de=a,bt.transition=i}else e.current=n;if(rl&&(rl=!1,kn=e,Kl=l),i=e.pendingLanes,i===0&&(Pn=null),Bm(n.stateNode),ot(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(ql)throw ql=!1,e=eo,eo=null,e;return Kl&1&&e.tag!==0&&br(),i=e.pendingLanes,i&1?e===to?ds++:(ds=0,to=e):ds=0,Dn(),null}function br(){if(kn!==null){var e=vf(Kl),t=bt.transition,n=de;try{if(bt.transition=null,de=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,Kl=0,oe&6)throw Error($(331));var l=oe;for(oe|=4,H=e.current;H!==null;){var i=H,a=i.child;if(H.flags&16){var o=i.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(H=u;H!==null;){var d=H;switch(d.tag){case 0:case 11:case 15:cs(8,d,i)}var f=d.child;if(f!==null)f.return=d,H=f;else for(;H!==null;){d=H;var h=d.sibling,x=d.return;if(Pp(d),d===u){H=null;break}if(h!==null){h.return=x,H=h;break}H=x}}}var v=i.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var j=w.sibling;w.sibling=null,w=j}while(w!==null)}}H=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,H=a;else e:for(;H!==null;){if(i=H,i.flags&2048)switch(i.tag){case 0:case 11:case 15:cs(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,H=m;break e}H=i.return}}var g=e.current;for(H=g;H!==null;){a=H;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,H=y;else e:for(a=g;H!==null;){if(o=H,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:pi(9,o)}}catch(N){Se(o,o.return,N)}if(o===a){H=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,H=k;break e}H=o.return}}if(oe=l,Dn(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(li,e)}catch{}r=!0}return r}finally{de=n,bt.transition=t}}return!1}function Wu(e,t,n){t=Tr(n,t),t=vp(e,t,1),e=En(e,t,1),t=et(),e!==null&&(Is(e,1,t),ot(e,t))}function Se(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Pn===null||!Pn.has(r))){e=Tr(n,e),e=yp(t,e,1),t=En(t,e,1),e=et(),t!==null&&(Is(t,1,e),ot(t,e));break}}t=t.return}}function h0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=et(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(Be&n)===n&&(Le===4||Le===3&&(Be&130023424)===Be&&500>Ee()-tc?qn(e,0):ec|=n),ot(e,t)}function Op(e,t){t===0&&(e.mode&1?(t=qs,qs<<=1,!(qs&130023424)&&(qs=4194304)):t=1);var n=et();e=cn(e,t),e!==null&&(Is(e,t,n),ot(e,n))}function m0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Op(e,n)}function x0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error($(314))}r!==null&&r.delete(t),Op(e,n)}var Fp;Fp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,r0(e,t,n);lt=!!(e.flags&131072)}else lt=!1,ge&&t.flags&1048576&&Hf(t,Ol,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wl(e,t),e=t.pendingProps;var l=_r(t,Ge.current);Nr(t,n),l=Ko(null,t,r,e,l,n);var i=Go();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(r)?(i=!0,$l(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Wo(t),l.updater=fi,t.stateNode=l,l._reactInternals=t,Wa(t,r,e,n),t=Qa(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&zo(t),Xe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=v0(r),e=Lt(r,e),l){case 0:t=Va(null,t,r,e,n);break e;case 1:t=Au(null,t,r,e,n);break e;case 11:t=Mu(null,t,r,e,n);break e;case 14:t=Ru(null,t,r,Lt(r.type,e),n);break e}throw Error($(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Lt(r,l),Va(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Lt(r,l),Au(e,t,r,l,n);case 3:e:{if(Np(t),e===null)throw Error($(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Zf(e,t),Ul(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Tr(Error($(423)),t),t=Lu(e,t,r,n,l);break e}else if(r!==l){l=Tr(Error($(424)),t),t=Lu(e,t,r,n,l);break e}else for(pt=Cn(t.stateNode.containerInfo.firstChild),ht=t,ge=!0,zt=null,n=Kf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cr(),r===l){t=un(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return Jf(t),e===null&&Fa(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,Ia(r,l)?a=null:i!==null&&Ia(r,i)&&(t.flags|=32),kp(e,t),Xe(e,t,a,n),t.child;case 6:return e===null&&Fa(t),null;case 13:return bp(e,t,n);case 4:return Ho(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Er(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Lt(r,l),Mu(e,t,r,l,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,a=l.value,he(Fl,r._currentValue),r._currentValue=a,i!==null)if(Ot(i.value,a)){if(i.children===l.children&&!it.current){t=un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=sn(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Ba(i.return,n,t),o.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error($(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ba(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Xe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nr(t,n),l=Ct(l),r=r(l),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,l=Lt(r,t.pendingProps),l=Lt(r.type,l),Ru(e,t,r,l,n);case 15:return wp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Lt(r,l),wl(e,t),t.tag=1,at(r)?(e=!0,$l(t)):e=!1,Nr(t,n),gp(t,r,l),Wa(t,r,l,n),Qa(null,t,r,!0,e,n);case 19:return Sp(e,t,n);case 22:return jp(e,t,n)}throw Error($(156,t.tag))};function Bp(e,t){return hf(e,t)}function g0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new g0(e,t,n,r)}function lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function v0(e){if(typeof e=="function")return lc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bo)return 11;if(e===So)return 14}return 2}function Mn(e,t){var n=e.alternate;return n===null?(n=Nt(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 Nl(e,t,n,r,l,i){var a=2;if(r=e,typeof e=="function")lc(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case or:return Kn(n.children,l,i,t);case No:a=8,l|=8;break;case pa:return e=Nt(12,n,t,l|2),e.elementType=pa,e.lanes=i,e;case ha:return e=Nt(13,n,t,l),e.elementType=ha,e.lanes=i,e;case ma:return e=Nt(19,n,t,l),e.elementType=ma,e.lanes=i,e;case Zd:return mi(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kd:a=10;break e;case Gd:a=9;break e;case bo:a=11;break e;case So:a=14;break e;case gn:a=16,r=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=Nt(a,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Kn(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function mi(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=Zd,e.lanes=n,e.stateNode={isHidden:!1},e}function ea(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function ta(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function y0(e,t,n,r,l){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=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ic(e,t,n,r,l,i,a,o,c){return e=new y0(e,t,n,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Nt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wo(i),e}function w0(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ar,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Up(e){if(!e)return Ln;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error($(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(at(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error($(171))}if(e.tag===1){var n=e.type;if(at(n))return Uf(e,n,t)}return t}function Wp(e,t,n,r,l,i,a,o,c){return e=ic(n,r,!0,e,l,i,a,o,c),e.context=Up(null),n=e.current,r=et(),l=Tn(n),i=sn(r,l),i.callback=t??null,En(n,i,l),e.current.lanes=l,Is(e,l,r),ot(e,r),e}function xi(e,t,n,r){var l=t.current,i=et(),a=Tn(l);return n=Up(n),t.context===null?t.context=n:t.pendingContext=n,t=sn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=En(l,t,a),e!==null&&(Dt(e,l,a,i),gl(e,l,a)),a}function Zl(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 Hu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ac(e,t){Hu(e,t),(e=e.alternate)&&Hu(e,t)}function j0(){return null}var Hp=typeof reportError=="function"?reportError:function(e){console.error(e)};function oc(e){this._internalRoot=e}gi.prototype.render=oc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));xi(e,t,null,null)};gi.prototype.unmount=oc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yn(function(){xi(null,e,null,null)}),t[on]=null}};function gi(e){this._internalRoot=e}gi.prototype.unstable_scheduleHydration=function(e){if(e){var t=jf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<yn.length&&t!==0&&t<yn[n].priority;n++);yn.splice(n,0,e),n===0&&Nf(e)}};function cc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vu(){}function k0(e,t,n,r,l){if(l){if(typeof r=="function"){var i=r;r=function(){var u=Zl(a);i.call(u)}}var a=Wp(t,r,e,0,null,!1,!1,"",Vu);return e._reactRootContainer=a,e[on]=a.current,ks(e.nodeType===8?e.parentNode:e),Yn(),a}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var u=Zl(c);o.call(u)}}var c=ic(e,0,!1,null,null,!1,!1,"",Vu);return e._reactRootContainer=c,e[on]=c.current,ks(e.nodeType===8?e.parentNode:e),Yn(function(){xi(t,c,n,r)}),c}function yi(e,t,n,r,l){var i=n._reactRootContainer;if(i){var a=i;if(typeof l=="function"){var o=l;l=function(){var c=Zl(a);o.call(c)}}xi(t,a,e,l)}else a=k0(n,t,e,l,r);return Zl(a)}yf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ts(t.pendingLanes);n!==0&&(Eo(t,n|1),ot(t,Ee()),!(oe&6)&&(Mr=Ee()+500,Dn()))}break;case 13:Yn(function(){var r=cn(e,1);if(r!==null){var l=et();Dt(r,e,1,l)}}),ac(e,1)}};Po=function(e){if(e.tag===13){var t=cn(e,134217728);if(t!==null){var n=et();Dt(t,e,134217728,n)}ac(e,134217728)}};wf=function(e){if(e.tag===13){var t=Tn(e),n=cn(e,t);if(n!==null){var r=et();Dt(n,e,t,r)}ac(e,t)}};jf=function(){return de};kf=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Sa=function(e,t,n){switch(t){case"input":if(va(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 r=n[t];if(r!==e&&r.form===e.form){var l=ci(r);if(!l)throw Error($(90));Xd(r),va(r,l)}}}break;case"textarea":ef(e,n);break;case"select":t=n.value,t!=null&&yr(e,!!n.multiple,t,!1)}};of=nc;cf=Yn;var N0={usingClientEntryPoint:!1,Events:[$s,fr,ci,lf,af,nc]},Kr={findFiberByHostInstance:Hn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},b0={bundleType:Kr.bundleType,version:Kr.version,rendererPackageName:Kr.rendererPackageName,rendererConfig:Kr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:dn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ff(e),e===null?null:e.stateNode},findFiberByHostInstance:Kr.findFiberByHostInstance||j0,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 sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sl.isDisabled&&sl.supportsFiber)try{li=sl.inject(b0),Kt=sl}catch{}}vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N0;vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cc(t))throw Error($(200));return w0(e,t,null,n)};vt.createRoot=function(e,t){if(!cc(e))throw Error($(299));var n=!1,r="",l=Hp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=ic(e,1,!1,null,null,n,!1,r,l),e[on]=t.current,ks(e.nodeType===8?e.parentNode:e),new oc(t)};vt.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($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=ff(t),e=e===null?null:e.stateNode,e};vt.flushSync=function(e){return Yn(e)};vt.hydrate=function(e,t,n){if(!vi(t))throw Error($(200));return yi(null,e,t,!0,n)};vt.hydrateRoot=function(e,t,n){if(!cc(e))throw Error($(405));var r=n!=null&&n.hydratedSources||null,l=!1,i="",a=Hp;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Wp(t,null,e,1,n??null,l,!1,i,a),e[on]=t.current,ks(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new gi(t)};vt.render=function(e,t,n){if(!vi(t))throw Error($(200));return yi(null,e,t,!1,n)};vt.unmountComponentAtNode=function(e){if(!vi(e))throw Error($(40));return e._reactRootContainer?(Yn(function(){yi(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};vt.unstable_batchedUpdates=nc;vt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vi(n))throw Error($(200));if(e==null||e._reactInternals===void 0)throw Error($(38));return yi(e,t,n,!1,r)};vt.version="18.3.1-next-f1338f8080-20240426";function Vp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vp)}catch(e){console.error(e)}}Vp(),Hd.exports=vt;var S0=Hd.exports,Qu=S0;da.createRoot=Qu.createRoot,da.hydrateRoot=Qu.hydrateRoot;/**
41
+ * @remix-run/router v1.23.3
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 Ms(){return Ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ms.apply(null,arguments)}var Nn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Nn||(Nn={}));const qu="popstate";function _0(e){e===void 0&&(e={});function t(r,l){let{pathname:i,search:a,hash:o}=r.location;return so("",{pathname:i,search:a,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Jl(l)}return E0(t,n,null,e)}function ke(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function uc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function C0(){return Math.random().toString(36).substr(2,8)}function Ku(e,t){return{usr:e.state,key:e.key,idx:t}}function so(e,t,n,r){return n===void 0&&(n=null),Ms({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?zr(t):t,{state:n,key:t&&t.key||r||C0()})}function Jl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function zr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function E0(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:i=!1}=r,a=l.history,o=Nn.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Ms({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){o=Nn.Pop;let j=d(),m=j==null?null:j-u;u=j,c&&c({action:o,location:w.location,delta:m})}function h(j,m){o=Nn.Push;let g=so(w.location,j,m);u=d()+1;let y=Ku(g,u),k=w.createHref(g);try{a.pushState(y,"",k)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;l.location.assign(k)}i&&c&&c({action:o,location:w.location,delta:1})}function x(j,m){o=Nn.Replace;let g=so(w.location,j,m);u=d();let y=Ku(g,u),k=w.createHref(g);a.replaceState(y,"",k),i&&c&&c({action:o,location:w.location,delta:0})}function v(j){let m=l.location.origin!=="null"?l.location.origin:l.location.href,g=typeof j=="string"?j:Jl(j);return g=g.replace(/ $/,"%20"),ke(m,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,m)}let w={get action(){return o},get location(){return e(l,a)},listen(j){if(c)throw new Error("A history only accepts one active listener");return l.addEventListener(qu,f),c=j,()=>{l.removeEventListener(qu,f),c=null}},createHref(j){return t(l,j)},createURL:v,encodeLocation(j){let m=v(j);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:x,go(j){return a.go(j)}};return w}var Gu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gu||(Gu={}));function P0(e,t,n){return n===void 0&&(n="/"),T0(e,t,n)}function T0(e,t,n,r){let l=typeof t=="string"?zr(t):t,i=Rr(l.pathname||"/",n);if(i==null)return null;let a=Qp(e);M0(a);let o=null,c=U0(i);for(let u=0;o==null&&u<a.length;++u)o=F0(a[u],c);return o}function Qp(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(i,a,o)=>{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(ke(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Rn([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(ke(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Qp(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:D0(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))l(i,a);else for(let c of qp(i.path))l(i,a,c)}),t}function qp(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return l?[i,""]:[i];let a=qp(r.join("/")),o=[];return o.push(...a.map(c=>c===""?i:[i,c].join("/"))),l&&o.push(...a),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function M0(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:O0(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const R0=/^:[\w-]+$/,A0=3,L0=2,I0=1,z0=10,$0=-2,Zu=e=>e==="*";function D0(e,t){let n=e.split("/"),r=n.length;return n.some(Zu)&&(r+=$0),t&&(r+=L0),n.filter(l=>!Zu(l)).reduce((l,i)=>l+(R0.test(i)?A0:i===""?I0:z0),r)}function O0(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function F0(e,t,n){let{routesMeta:r}=e,l={},i="/",a=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=lo({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(l,f.params),a.push({params:l,pathname:Rn([i,f.pathname]),pathnameBase:q0(Rn([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Rn([i,f.pathnameBase]))}return a}function lo(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=B0(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let i=l[0],a=i.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:x}=d;if(h==="*"){let w=o[f]||"";a=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const v=o[f];return x&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function B0(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uc(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 r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function U0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return uc(!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 Rr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const W0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,H0=e=>W0.test(e);function V0(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?zr(e):e,i;if(n)if(H0(n))i=n;else{if(n.includes("//")){let a=n;n=Kp(n),uc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?i=Ju(n.substring(1),"/"):i=Ju(n,t)}else i=t;return{pathname:i,search:K0(r),hash:G0(l)}}function Ju(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function na(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. 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 Q0(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dc(e,t){let n=Q0(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function fc(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=zr(e):(l=Ms({},e),ke(!l.pathname||!l.pathname.includes("?"),na("?","pathname","search",l)),ke(!l.pathname||!l.pathname.includes("#"),na("#","pathname","hash",l)),ke(!l.search||!l.search.includes("#"),na("#","search","hash",l)));let i=e===""||l.pathname==="",a=i?"/":l.pathname,o;if(a==null)o=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;l.pathname=h.join("/")}o=f>=0?t[f]:"/"}let c=V0(l,o),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Kp=e=>e.replace(/\/\/+/g,"/"),Rn=e=>Kp(e.join("/")),q0=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K0=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,G0=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Z0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Gp=["post","put","patch","delete"];new Set(Gp);const J0=["get",...Gp];new Set(J0);/**
50
+ * React Router v6.30.4
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 Rs(){return Rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rs.apply(null,arguments)}const wi=p.createContext(null),Zp=p.createContext(null),fn=p.createContext(null),ji=p.createContext(null),pn=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Jp=p.createContext(null);function X0(e,t){let{relative:n}=t===void 0?{}:t;$r()||ke(!1);let{basename:r,navigator:l}=p.useContext(fn),{hash:i,pathname:a,search:o}=ki(e,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:Rn([r,a])),l.createHref({pathname:c,search:o,hash:i})}function $r(){return p.useContext(ji)!=null}function On(){return $r()||ke(!1),p.useContext(ji).location}function Xp(e){p.useContext(fn).static||p.useLayoutEffect(e)}function Os(){let{isDataRoute:e}=p.useContext(pn);return e?pg():Y0()}function Y0(){$r()||ke(!1);let e=p.useContext(wi),{basename:t,future:n,navigator:r}=p.useContext(fn),{matches:l}=p.useContext(pn),{pathname:i}=On(),a=JSON.stringify(dc(l,n.v7_relativeSplatPath)),o=p.useRef(!1);return Xp(()=>{o.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let f=fc(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Rn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const eg=p.createContext(null);function tg(e){let t=p.useContext(pn).outlet;return t&&p.createElement(eg.Provider,{value:e},t)}function ki(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(fn),{matches:l}=p.useContext(pn),{pathname:i}=On(),a=JSON.stringify(dc(l,r.v7_relativeSplatPath));return p.useMemo(()=>fc(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function ng(e,t){return rg(e,t)}function rg(e,t,n,r){$r()||ke(!1);let{navigator:l}=p.useContext(fn),{matches:i}=p.useContext(pn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=On(),d;if(t){var f;let j=typeof t=="string"?zr(t):t;c==="/"||(f=j.pathname)!=null&&f.startsWith(c)||ke(!1),d=j}else d=u;let h=d.pathname||"/",x=h;if(c!=="/"){let j=c.replace(/^\//,"").split("/");x="/"+h.replace(/^\//,"").split("/").slice(j.length).join("/")}let v=P0(e,{pathname:x}),w=og(v&&v.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:Rn([c,l.encodeLocation?l.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:Rn([c,l.encodeLocation?l.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),i,n,r);return t&&w?p.createElement(ji.Provider,{value:{location:Rs({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Nn.Pop}},w):w}function sg(){let e=fg(),t=Z0(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:l},n):null,null)}const lg=p.createElement(sg,null);class ig extends p.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?p.createElement(pn.Provider,{value:this.props.routeContext},p.createElement(Jp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ag(e){let{routeContext:t,match:n,children:r}=e,l=p.useContext(wi);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(pn.Provider,{value:t},r)}function og(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(l=n)==null?void 0:l.errors;if(o!=null){let d=a.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||ke(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:x}=n,v=f.route.loader&&h[f.route.id]===void 0&&(!x||x[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let x,v=!1,w=null,j=null;n&&(x=o&&f.route.id?o[f.route.id]:void 0,w=f.route.errorElement||lg,c&&(u<0&&h===0?(hg("route-fallback"),v=!0,j=null):u===h&&(v=!0,j=f.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,h+1)),g=()=>{let y;return x?y=w:v?y=j:f.route.Component?y=p.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,p.createElement(ag,{match:f,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(ig,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var Yp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Yp||{}),eh=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}(eh||{});function cg(e){let t=p.useContext(wi);return t||ke(!1),t}function ug(e){let t=p.useContext(Zp);return t||ke(!1),t}function dg(e){let t=p.useContext(pn);return t||ke(!1),t}function th(e){let t=dg(),n=t.matches[t.matches.length-1];return n.route.id||ke(!1),n.route.id}function fg(){var e;let t=p.useContext(Jp),n=ug(),r=th();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function pg(){let{router:e}=cg(Yp.UseNavigateStable),t=th(eh.UseNavigateStable),n=p.useRef(!1);return Xp(()=>{n.current=!0}),p.useCallback(function(l,i){i===void 0&&(i={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Rs({fromRouteId:t},i)))},[e,t])}const Xu={};function hg(e,t,n){Xu[e]||(Xu[e]=!0)}function mg(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ll(e){let{to:t,replace:n,state:r,relative:l}=e;$r()||ke(!1);let{future:i,static:a}=p.useContext(fn),{matches:o}=p.useContext(pn),{pathname:c}=On(),u=Os(),d=fc(t,dc(o,i.v7_relativeSplatPath),c,l==="path"),f=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:l}),[u,f,l,n,r]),null}function nh(e){return tg(e.context)}function qe(e){ke(!1)}function xg(e){let{basename:t="/",children:n=null,location:r,navigationType:l=Nn.Pop,navigator:i,static:a=!1,future:o}=e;$r()&&ke(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:a,future:Rs({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=zr(r));let{pathname:d="/",search:f="",hash:h="",state:x=null,key:v="default"}=r,w=p.useMemo(()=>{let j=Rr(d,c);return j==null?null:{location:{pathname:j,search:f,hash:h,state:x,key:v},navigationType:l}},[c,d,f,h,x,v,l]);return w==null?null:p.createElement(fn.Provider,{value:u},p.createElement(ji.Provider,{children:n,value:w}))}function gg(e){let{children:t,location:n}=e;return ng(io(t),n)}new Promise(()=>{});function io(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,l)=>{if(!p.isValidElement(r))return;let i=[...t,l];if(r.type===p.Fragment){n.push.apply(n,io(r.props.children,i));return}r.type!==qe&&ke(!1),!r.props.index||!r.props.children||ke(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=io(r.props.children,i)),n.push(a)}),n}/**
59
+ * React Router DOM v6.30.4
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 Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xl.apply(null,arguments)}function rh(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function vg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yg(e,t){return e.button===0&&(!t||t==="_self")&&!vg(e)}const wg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jg=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],kg="6";try{window.__reactRouterVersion=kg}catch{}const Ng=p.createContext({isTransitioning:!1}),bg="startTransition",Yu=hm[bg];function Sg(e){let{basename:t,children:n,future:r,window:l}=e,i=p.useRef();i.current==null&&(i.current=_0({window:l,v5Compat:!0}));let a=i.current,[o,c]=p.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=p.useCallback(f=>{u&&Yu?Yu(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>a.listen(d),[a,d]),p.useEffect(()=>mg(r),[r]),p.createElement(xg,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const _g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Cg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Eg=p.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:a,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=rh(t,wg),{basename:x}=p.useContext(fn),v,w=!1;if(typeof u=="string"&&Cg.test(u)&&(v=u,_g))try{let y=new URL(window.location.href),k=u.startsWith("//")?new URL(y.protocol+u):new URL(u),N=Rr(k.pathname,x);k.origin===y.origin&&N!=null?u=N+k.search+k.hash:w=!0}catch{}let j=X0(u,{relative:l}),m=Tg(u,{replace:a,state:o,target:c,preventScrollReset:d,relative:l,viewTransition:f});function g(y){r&&r(y),y.defaultPrevented||m(y)}return p.createElement("a",Xl({},h,{href:v||j,onClick:w||i?r:g,ref:n,target:c}))}),ed=p.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:a=!1,style:o,to:c,viewTransition:u,children:d}=t,f=rh(t,jg),h=ki(c,{relative:f.relative}),x=On(),v=p.useContext(Zp),{navigator:w,basename:j}=p.useContext(fn),m=v!=null&&Mg(h)&&u===!0,g=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,y=x.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;l||(y=y.toLowerCase(),k=k?k.toLowerCase():null,g=g.toLowerCase()),k&&j&&(k=Rr(k,j)||k);const N=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let S=y===g||!a&&y.startsWith(g)&&y.charAt(N)==="/",b=k!=null&&(k===g||!a&&k.startsWith(g)&&k.charAt(g.length)==="/"),M={isActive:S,isPending:b,isTransitioning:m},B=S?r:void 0,T;typeof i=="function"?T=i(M):T=[i,S?"active":null,b?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let E=typeof o=="function"?o(M):o;return p.createElement(Eg,Xl({},f,{"aria-current":B,className:T,ref:n,style:E,to:c,viewTransition:u}),typeof d=="function"?d(M):d)});var ao;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ao||(ao={}));var td;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(td||(td={}));function Pg(e){let t=p.useContext(wi);return t||ke(!1),t}function Tg(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:a,viewTransition:o}=t===void 0?{}:t,c=Os(),u=On(),d=ki(e,{relative:a});return p.useCallback(f=>{if(yg(f,n)){f.preventDefault();let h=r!==void 0?r:Jl(u)===Jl(d);c(e,{replace:h,state:l,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,d,r,l,n,e,i,a,o])}function Mg(e,t){t===void 0&&(t={});let n=p.useContext(Ng);n==null&&ke(!1);let{basename:r}=Pg(ao.useViewTransitionState),l=ki(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Rr(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Rr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lo(l.pathname,a)!=null||lo(l.pathname,i)!=null}/**
68
+ * @license lucide-react v0.469.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const Rg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
73
+ * @license lucide-react v0.469.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */var Ag={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"};/**
78
+ * @license lucide-react v0.469.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const Lg=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:i,iconNode:a,...o},c)=>p.createElement("svg",{ref:c,...Ag,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:sh("lucide",l),...o},[...a.map(([u,d])=>p.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
83
+ * @license lucide-react v0.469.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const X=(e,t)=>{const n=p.forwardRef(({className:r,...l},i)=>p.createElement(Lg,{ref:i,iconNode:t,className:sh(`lucide-${Rg(e)}`,r),...l}));return n.displayName=`${e}`,n};/**
88
+ * @license lucide-react v0.469.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Ig=X("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
93
+ * @license lucide-react v0.469.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const zg=X("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
98
+ * @license lucide-react v0.469.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const $g=X("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
103
+ * @license lucide-react v0.469.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Dg=X("BotMessageSquare",[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z",key:"w2lp3e"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M9 11v2",key:"1ueba0"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);/**
108
+ * @license lucide-react v0.469.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const In=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
113
+ * @license lucide-react v0.469.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const lh=X("Boxes",[["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"}]]);/**
118
+ * @license lucide-react v0.469.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const As=X("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
123
+ * @license lucide-react v0.469.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const Fn=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
128
+ * @license lucide-react v0.469.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Og=X("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
133
+ * @license lucide-react v0.469.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const ih=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
138
+ * @license lucide-react v0.469.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const Fg=X("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
143
+ * @license lucide-react v0.469.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const ah=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
148
+ * @license lucide-react v0.469.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const Bg=X("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
153
+ * @license lucide-react v0.469.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const Ug=X("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
158
+ * @license lucide-react v0.469.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const Wg=X("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
163
+ * @license lucide-react v0.469.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const Hg=X("Copy",[["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"}]]);/**
168
+ * @license lucide-react v0.469.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const Vg=X("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
173
+ * @license lucide-react v0.469.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const Qg=X("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
178
+ * @license lucide-react v0.469.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const oh=X("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
183
+ * @license lucide-react v0.469.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const nd=X("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
188
+ * @license lucide-react v0.469.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const qg=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
193
+ * @license lucide-react v0.469.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const ch=X("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
198
+ * @license lucide-react v0.469.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const uh=X("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
203
+ * @license lucide-react v0.469.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const Kg=X("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
208
+ * @license lucide-react v0.469.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const dh=X("KeyRound",[["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"}]]);/**
213
+ * @license lucide-react v0.469.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const Gg=X("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
218
+ * @license lucide-react v0.469.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const Zg=X("Link2",[["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"}]]);/**
223
+ * @license lucide-react v0.469.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const Pt=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
228
+ * @license lucide-react v0.469.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const rr=X("Pencil",[["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"}]]);/**
233
+ * @license lucide-react v0.469.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const Jg=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
238
+ * @license lucide-react v0.469.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const Pe=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
243
+ * @license lucide-react v0.469.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const Ut=X("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
248
+ * @license lucide-react v0.469.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const Xg=X("RefreshCw",[["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"}]]);/**
253
+ * @license lucide-react v0.469.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const St=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
258
+ * @license lucide-react v0.469.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const Yg=X("Send",[["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"}]]);/**
263
+ * @license lucide-react v0.469.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const Yl=X("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
268
+ * @license lucide-react v0.469.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const ei=X("ShieldCheck",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
273
+ * @license lucide-react v0.469.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const pc=X("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
278
+ * @license lucide-react v0.469.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const fh=X("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
283
+ * @license lucide-react v0.469.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const ev=X("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
288
+ * @license lucide-react v0.469.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const tv=X("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
293
+ * @license lucide-react v0.469.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const Ft=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
298
+ * @license lucide-react v0.469.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const hc=X("TriangleAlert",[["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"}]]);/**
303
+ * @license lucide-react v0.469.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const nv=X("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
308
+ * @license lucide-react v0.469.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const rv=X("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
313
+ * @license lucide-react v0.469.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const sv=X("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
318
+ * @license lucide-react v0.469.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const lv=X("WrapText",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]]);/**
323
+ * @license lucide-react v0.469.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const ph=X("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
328
+ * @license lucide-react v0.469.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const Ni=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
333
+ * @license lucide-react v0.469.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const iv=X("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ra=new Map;async function be(e,t,n={}){const r=new URL(`${e}${t}`);Object.entries(n.query??{}).forEach(([u,d])=>{d!=null&&d!==""&&r.searchParams.set(u,String(d))});const l=(n.method??"GET").toUpperCase(),i=`${l}:${r.toString()}`,a=async()=>{const u=await fetch(r.toString(),{...n,method:l,headers:{"Content-Type":"application/json",...n.headers??{}}});if(!u.ok){const d=await u.json().catch(()=>null);throw new Error((d==null?void 0:d.detail)??`${u.status} ${u.statusText}`)}if(u.status!==204)return u.json()};if(l!=="GET")return a();const o=ra.get(i);if(o)return o;const c=a().finally(()=>{ra.delete(i)});return ra.set(i,c),c}async function mc(e,t={}){return be(e,"/dwf-instance/",{query:t})}async function av(e,t){return be(e,"/dwf-instance/",{method:"POST",body:JSON.stringify(t)})}async function ov(e,t,n){return be(e,`/dwf-instance/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function cv(e,t){return be(e,`/dwf-instance/${t}`,{method:"DELETE"})}async function uv(e,t){return be(e,`/dwf-instance/test-connection/${t}`,{method:"POST"})}async function dv(e,t){return be(e,"/dwf-instance/detect",{method:"POST",body:JSON.stringify({host:t})})}async function xc(e,t,n,r){return be(e,`/dwf-instance/entities/${t}`,{query:{dwf_instance_id:n,keyword:r}})}const fv=(e,t,n)=>xc(e,"internal",t,n),pv=(e,t,n)=>xc(e,"relations",t,n),hv=(e,t,n)=>xc(e,"external",t,n);async function rd(e,t={}){return be(e,"/mcp-instance/",{query:t})}async function mv(e,t){return be(e,"/mcp-instance/",{method:"POST",body:JSON.stringify(t)})}async function xv(e,t,n){return be(e,`/mcp-instance/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function gv(e,t){return be(e,`/mcp-instance/${t}`,{method:"DELETE"})}async function vv(e,t){return be(e,"/mcp-instance/start-server",{method:"POST",body:JSON.stringify({mcp_instance_id:t})})}async function yv(e,t){return be(e,"/mcp-instance/stop-server",{method:"POST",body:JSON.stringify({mcp_instance_id:t})})}async function wv(e){return be(e,"/dwf-api/enums")}async function gc(e,t={}){return be(e,"/dwf-api/",{query:t})}async function jv(e,t){return be(e,"/dwf-api/",{method:"POST",body:JSON.stringify(t)})}async function kv(e,t){return be(e,"/dwf-api/",{method:"PUT",body:JSON.stringify(t)})}async function Nv(e,t){return be(e,`/dwf-api/${encodeURIComponent(t)}`,{method:"DELETE"})}async function bv(e,t={}){return be(e,"/tool-evolution/tasks",{query:t})}async function Sv(e,t){return be(e,`/tool-evolution/tasks/${t}`)}async function _v(e,t,n){return be(e,`/tool-evolution/tasks/${t}/adopt`,{method:"POST",body:JSON.stringify({suggestion_indices:n})})}async function Cv(e,t){return be(e,`/tool-evolution/tasks/${t}/reject`,{method:"POST"})}async function Ev(e,t){return be(e,`/tool-evolution/tasks/${t}`,{method:"DELETE"})}function se(...e){return e.filter(Boolean).join(" ")}function Ie({className:e,children:t,...n}){return s.jsxs("div",{className:"relative",children:[s.jsx("select",{className:se("h-10 w-full appearance-none rounded-xl border border-slate-200 bg-white px-3 pr-9 text-sm text-slate-900 focus:border-indigo-500 focus:ring-4 focus:ring-indigo-100",e),...n,children:t}),s.jsx(Fn,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"})]})}const sa="dwf-ai-connector.default-environment-id";function Pv(){const{protocol:e,hostname:t}=window.location;return`${e}//${t}:9088/api/v1`}function Tv(){const{origin:e,protocol:t,hostname:n,port:r}=window.location;return r==="5174"?`${t}//${n}:5180/agent-api`:`${e}/agent-api`}const hh=p.createContext(null);function Mv({children:e}){const[t,n]=p.useState(()=>window.localStorage.getItem(sa)??""),r=p.useMemo(()=>({apiBaseUrl:Pv(),agentApiBaseUrl:Tv(),defaultEnvironmentId:t,setDefaultEnvironmentId:l=>{n(l),l?window.localStorage.setItem(sa,l):window.localStorage.removeItem(sa)}}),[t]);return s.jsx(hh.Provider,{value:r,children:e})}function Tt(){const e=p.useContext(hh);if(!e)throw new Error("useAppConfig must be used within AppConfigProvider");return e}const Rv=[{to:"/agent/chat",label:"聊天",icon:Dg},{to:"/agent/configs",label:"Agent配置",icon:lh},{to:"/agent/providers",label:"Model提供商",icon:dh},{to:"/agent/skills",label:"Skills管理",icon:iv},{to:"/agent/mcp",label:"MCP管理",icon:As}],Av=[{label:"DWF环境",description:"环境与连接",to:"/environments",icon:Yl},{label:"MCP实例",description:"运行实例",to:"/mcp-instances",icon:As},{label:"工具定义",description:"工具行为与配置",to:"/tools",icon:ph},{label:"工具进化",description:"建议与采纳",to:"/tool-evolution",icon:ch},{label:"DWF Agent",description:"对话与智能体配置",to:"/agent/chat",icon:In,children:Rv}];function Lv(){const e=Os(),t=On(),{apiBaseUrl:n,defaultEnvironmentId:r,setDefaultEnvironmentId:l}=Tt(),[i,a]=p.useState([]),[o,c]=p.useState(!0),u=p.useMemo(()=>t.pathname.startsWith("/agent"),[t.pathname]);return p.useEffect(()=>{async function d(){try{const f=await mc(n,{page_size:100});a(f.items)}catch{a([])}}return d(),window.addEventListener("dwf-environments-updated",d),()=>window.removeEventListener("dwf-environments-updated",d)},[n]),p.useEffect(()=>{u&&c(!0)},[u]),s.jsxs("aside",{className:"flex h-screen w-[280px] shrink-0 flex-col border-r border-slate-200 bg-slate-50/90",children:[s.jsx("div",{className:"border-b border-slate-200 bg-white px-5 py-5",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-2xl bg-indigo-600 text-white shadow-sm",children:s.jsx(In,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-bold tracking-tight text-slate-950",children:"DWF AI Connector"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"MCP 管理工作台"})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"DWF工作台"}),s.jsx("div",{className:"mt-3",children:s.jsxs(Ie,{value:r,onChange:d=>l(d.target.value),children:[s.jsx("option",{value:"",children:"未选择工作区"}),i.map(d=>s.jsx("option",{value:d.id,children:d.name},d.id))]})})]})]})}),s.jsxs("nav",{className:"scrollbar-subtle flex-1 overflow-y-auto px-4 py-5",children:[s.jsx("div",{className:"mb-3 px-2 text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"控制台"}),s.jsx("div",{className:"space-y-1.5",children:Av.map(d=>s.jsx("div",{children:d.children?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("button",{type:"button",onClick:()=>{if(!u){e("/agent/chat"),c(!0);return}c(f=>!f)},className:se("flex w-full items-center justify-between rounded-2xl px-3 py-3 text-left transition-colors",u?"text-slate-900":"text-slate-600 hover:bg-white hover:text-slate-900"),children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(d.icon,{className:"mt-0.5 h-[18px] w-[18px] shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:d.label}),s.jsx("div",{className:"mt-1 text-xs text-slate-500",children:d.description})]})]}),s.jsx(Fn,{className:se("mt-0.5 h-4 w-4 shrink-0 text-slate-400 transition-transform",o&&"rotate-180")})]}),o?s.jsx("div",{className:"space-y-1",children:d.children.map(f=>{const h=t.pathname===f.to,x=f.icon;return s.jsxs(ed,{to:f.to,className:se("flex w-full items-center gap-3 rounded-2xl px-3 py-3 text-sm transition-colors",h?"bg-white font-semibold text-slate-950 shadow-sm":"text-slate-500 hover:bg-white hover:text-slate-900"),children:[s.jsx(x,{className:"ml-6 h-4 w-4 shrink-0"}),s.jsx("span",{children:f.label})]},f.to)})}):null]}):s.jsxs(ed,{to:d.to,className:({isActive:f})=>se("group flex items-start gap-3 rounded-2xl px-3 py-3 transition-colors",f?"bg-indigo-50 text-indigo-700":"text-slate-600 hover:bg-white hover:text-slate-900"),children:[s.jsx(d.icon,{className:"mt-0.5 h-[18px] w-[18px] shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:d.label}),s.jsx("div",{className:"mt-1 text-xs text-slate-500 group-hover:text-slate-500",children:d.description})]})]})},d.to))})]})]})}function Iv(){const e=On(),t=e.pathname==="/agent/chat",n=e.pathname.startsWith("/agent");return s.jsxs("div",{className:"flex h-screen overflow-hidden",children:[s.jsx(Lv,{}),s.jsx("main",{className:se("min-w-0 flex-1",t?"bg-white":"",t?"overflow-hidden":"overflow-y-auto"),children:s.jsx("div",{className:se(t?"flex h-full min-h-0 w-full flex-col overflow-hidden p-0":"mx-auto flex min-h-full w-full max-w-[1600px] flex-col gap-6 px-6 py-6 lg:px-8",n&&!t&&"max-w-[1600px]"),children:s.jsx(nh,{})})})]})}const zv={success:ah,error:hc,info:Kg},$v={success:"border-emerald-200 bg-white text-emerald-700",error:"border-rose-200 bg-white text-rose-700",info:"border-indigo-200 bg-white text-indigo-700"};function Dv({toasts:e,onDismiss:t}){return s.jsx("div",{className:"pointer-events-none fixed right-5 top-5 z-[70] flex w-full max-w-sm flex-col gap-3",children:e.map(n=>{const r=zv[n.tone];return s.jsx("div",{className:`pointer-events-auto animate-slide-up overflow-hidden rounded-2xl border px-4 py-3 shadow-panel ${$v[n.tone]}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(r,{className:"mt-0.5 h-5 w-5 shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-semibold",children:n.title}),n.description?s.jsx("p",{className:"mt-1 break-all text-sm text-slate-500",children:n.description}):null]}),s.jsx("button",{className:"shrink-0 self-start rounded-lg p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700",onClick:()=>t(n.id),children:s.jsx(Ni,{className:"h-4 w-4"})})]})},n.id)})})}const mh=p.createContext(null);function Ov({children:e}){const[t,n]=p.useState([]),r=p.useCallback(a=>{n(o=>o.filter(c=>c.id!==a))},[]),l=p.useCallback(a=>{const o=`${Date.now()}-${Math.random().toString(36).slice(2)}`;n(c=>[...c,{...a,id:o}]),window.setTimeout(()=>{r(o)},3200)},[r]),i=p.useMemo(()=>({pushToast:l,removeToast:r}),[l,r]);return s.jsxs(mh.Provider,{value:i,children:[e,s.jsx(Dv,{toasts:t,onDismiss:r})]})}function ct(){const e=p.useContext(mh);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function mt(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function vc(e){if(e==null)return"(空)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Fv(e){return e?e==="********"?e:"********":"-"}function Y(e){return e instanceof Error?e.message:"发生未知错误"}function Dr(e,t=300){const[n,r]=p.useState(e);return p.useEffect(()=>{const l=window.setTimeout(()=>{r(e)},t);return()=>window.clearTimeout(l)},[e,t]),n}function xh({enabled:e,hasMore:t,onLoadMore:n,rootMargin:r="320px"}){const l=p.useRef(null),i=p.useRef(n),a=p.useRef(!1);return p.useEffect(()=>{i.current=n},[n]),p.useEffect(()=>{const o=l.current;if(!o||!e||!t)return;const c=new IntersectionObserver(u=>{!u.some(f=>f.isIntersecting)||a.current||(a.current=!0,Promise.resolve(i.current()).finally(()=>{a.current=!1}))},{rootMargin:r});return c.observe(o),()=>c.disconnect()},[e,t,r]),l}const Bv={slate:"bg-slate-100 text-slate-600",indigo:"bg-indigo-50 text-indigo-700",green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",rose:"bg-rose-50 text-rose-700"};function J({tone:e="slate",children:t,className:n}){return s.jsx("span",{className:se("inline-flex shrink-0 items-center whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-semibold",Bv[e],n),children:t})}const Uv={primary:"bg-indigo-600 text-white hover:bg-indigo-700 focus-visible:ring-indigo-200",secondary:"bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 focus-visible:ring-slate-200",ghost:"bg-transparent text-slate-600 hover:bg-slate-100 hover:text-slate-900 focus-visible:ring-slate-200",danger:"bg-rose-600 text-white hover:bg-rose-700 focus-visible:ring-rose-200"},Wv={sm:"h-9 px-3 text-sm",md:"h-10 px-4 text-sm"};function V({variant:e="primary",size:t="md",loading:n,icon:r,className:l,disabled:i,children:a,...o}){return s.jsxs("button",{className:se("inline-flex items-center justify-center gap-2 rounded-xl font-medium shadow-sm transition-colors focus-visible:ring-4 disabled:cursor-not-allowed disabled:opacity-60",Uv[e],Wv[t],l),disabled:i||n,...o,children:[n?s.jsx(Pt,{className:"h-4 w-4 animate-spin"}):r?s.jsx(r,{className:"h-4 w-4"}):null,a]})}const Hv={primary:{icon:Bg,iconWrap:"bg-indigo-50 text-indigo-600"},danger:{icon:hc,iconWrap:"bg-rose-50 text-rose-600"},warning:{icon:ah,iconWrap:"bg-amber-50 text-amber-600"}};function Bt({open:e,title:t,description:n,confirmText:r="确认",cancelText:l="取消",variant:i="primary",onConfirm:a,onClose:o}){if(!e)return null;const c=Hv[i],u=c.icon;return s.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[s.jsx("button",{className:"absolute inset-0 bg-slate-950/30 backdrop-blur-[1px] animate-fade-in",onClick:o}),s.jsxs("div",{className:"relative w-full max-w-md rounded-3xl border border-slate-200 bg-white p-6 shadow-panel animate-slide-up",children:[s.jsx("button",{className:"absolute right-4 top-4 rounded-xl p-2 text-slate-400 hover:bg-slate-100 hover:text-slate-700",onClick:o,children:s.jsx(Ni,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:se("rounded-2xl p-3",c.iconWrap),children:s.jsx(u,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:t}),s.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-500",children:n})]})]}),s.jsxs("div",{className:"mt-8 flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:o,children:l}),s.jsx(V,{variant:i==="danger"?"danger":"primary",onClick:a,children:r})]})]})]})}function Ue({icon:e,title:t,description:n,action:r}){return s.jsxs("div",{className:"flex min-h-64 flex-col items-center justify-center rounded-2xl border border-dashed border-slate-200 bg-slate-50/80 px-6 py-12 text-center",children:[s.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-indigo-50 text-indigo-600",children:s.jsx(e,{className:"h-6 w-6"})}),s.jsx("h3",{className:"mt-4 text-base font-semibold text-slate-900",children:t}),s.jsx("p",{className:"mt-2 max-w-md text-sm leading-6 text-slate-500",children:n}),r?s.jsx("div",{className:"mt-5",children:r}):null]})}function Mt({title:e="加载失败",description:t,onRetry:n}){return s.jsxs("div",{className:"flex min-h-64 flex-col items-center justify-center rounded-2xl border border-rose-200 bg-rose-50/60 px-6 py-12 text-center",children:[s.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-white text-rose-600",children:s.jsx(hc,{className:"h-6 w-6"})}),s.jsx("h3",{className:"mt-4 text-base font-semibold text-slate-900",children:e}),s.jsx("p",{className:"mt-2 max-w-md text-sm leading-6 text-slate-600",children:t}),n?s.jsx("div",{className:"mt-5",children:s.jsx(V,{variant:"secondary",icon:Ut,onClick:n,children:"重试"})}):null]})}function ae({className:e,...t}){return s.jsx("input",{className:se("h-10 w-full rounded-xl border border-slate-200 bg-white px-3 text-sm text-slate-900 placeholder:text-slate-400 focus:border-indigo-500 focus:ring-4 focus:ring-indigo-100",e),...t})}function gt({label:e="正在加载数据..."}){return s.jsxs("div",{className:"flex min-h-64 flex-col items-center justify-center gap-3 rounded-2xl border border-dashed border-slate-200 bg-slate-50/70 px-6 text-center",children:[s.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-indigo-50 text-indigo-600",children:s.jsx(Pt,{className:"h-5 w-5 animate-spin"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-slate-900",children:e}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"控制台正在同步最新状态。"})]})]})}function Vv({title:e,description:t,aside:n,children:r,className:l,contentClassName:i,...a}){return s.jsxs("section",{className:se("rounded-2xl border border-slate-200 bg-white shadow-sm",l),...a,children:[(e||t||n)&&s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-slate-100 px-5 py-4",children:[s.jsxs("div",{children:[e?s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:e}):null,t?s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:t}):null]}),n]}),s.jsx("div",{className:se("p-5",i),children:r})]})}function bi({children:e}){return s.jsx(Vv,{children:s.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:e})})}function Si({icon:e,title:t,description:n,actions:r,meta:l}){return s.jsxs("header",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-indigo-100 bg-indigo-50 text-indigo-600 shadow-sm",children:s.jsx(e,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight text-slate-950",children:t}),l]}),n?s.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-slate-500",children:n}):null]})]}),r?s.jsx("div",{className:"flex flex-wrap items-center gap-3",children:r}):null]})}const Qv={md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-5xl"};function Zt({open:e,title:t,description:n,footer:r,size:l="lg",onClose:i,children:a}){return e?s.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[s.jsx("button",{className:"absolute inset-0 bg-slate-950/20 backdrop-blur-[1px] animate-fade-in",onClick:i}),s.jsxs("div",{className:se("relative flex h-full w-full flex-col border-l border-slate-200 bg-white shadow-panel animate-slide-in-right",Qv[l]),children:[s.jsxs("div",{className:"flex items-start justify-between border-b border-slate-100 px-6 py-5",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:t}),n?s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:n}):null]}),s.jsx("button",{className:"rounded-xl p-2 text-slate-400 hover:bg-slate-100 hover:text-slate-700",onClick:i,children:s.jsx(Ni,{className:"h-5 w-5"})})]}),s.jsx("div",{className:"scrollbar-subtle flex-1 overflow-y-auto px-6 py-5",children:a}),r?s.jsx("div",{className:"border-t border-slate-100 px-6 py-4",children:r}):null]})]}):null}function _t({className:e,...t}){return s.jsx("textarea",{className:se("w-full rounded-xl border border-slate-200 bg-white px-3 py-2.5 text-sm text-slate-900 placeholder:text-slate-400 focus:border-indigo-500 focus:ring-4 focus:ring-indigo-100",e),...t})}function sd(e){return{name:(e==null?void 0:e.name)??"",description:(e==null?void 0:e.description)??"",host:(e==null?void 0:e.host)??"",modeler_base_url:(e==null?void 0:e.modeler_base_url)??"",app_base_url:(e==null?void 0:e.app_base_url)??"",username:(e==null?void 0:e.username)??"",password:""}}function qv({open:e,environment:t,submitting:n,apiBaseUrl:r,onClose:l,onSubmit:i}){const{pushToast:a}=ct(),[o,c]=p.useState(sd(t)),[u,d]=p.useState({status:"idle"});p.useEffect(()=>{e&&(c(sd(t)),d({status:"idle"}))},[t,e]);const f=!!t;async function h(v){const w=o.host.trim();if(!w||!/^https?:\/\//.test(w)){d({status:"error",message:"请先填写有效的实例地址"});return}d({status:"loading"});try{const j=await dv(r,w);if(!j.success||!j.modeler_base_url||!j.app_base_url){d({status:"error",message:j.message??"未探测到配置"});return}c(m=>({...m,modeler_base_url:j.modeler_base_url??m.modeler_base_url,app_base_url:j.app_base_url??m.app_base_url})),d({status:"success"}),a({tone:"success",title:"探测成功",description:"已自动填充 Modeler 和 App 的 API Base URL。"})}catch(j){const m=j instanceof Error?j.message:String(j);d({status:"error",message:m})}}async function x(){if(!o.name.trim()){a({tone:"error",title:"表单校验未通过",description:"请填写实例名称。"});return}if(!/^https?:\/\//.test(o.host.trim())){a({tone:"error",title:"表单校验未通过",description:"实例地址需要以 http:// 或 https:// 开头。"});return}if(!o.modeler_base_url.trim()||!o.app_base_url.trim()){a({tone:"error",title:"表单校验未通过",description:"Modeler API Base URL 和 App API Base URL 不能为空,请填写实例地址后点击探测。"});return}if(!o.username.trim()){a({tone:"error",title:"表单校验未通过",description:"请填写登录用户名。"});return}if(!f&&!o.password.trim()){a({tone:"error",title:"表单校验未通过",description:"创建环境时必须填写密码。"});return}const v={name:o.name.trim(),description:o.description.trim(),host:o.host.trim(),modeler_base_url:o.modeler_base_url.trim()||void 0,app_base_url:o.app_base_url.trim()||void 0,username:o.username.trim()},w=f?{...v,...o.password.trim()?{password:o.password.trim()}:{}}:{...v,password:o.password.trim()};await i(w)}return s.jsx(Zt,{open:e,title:f?"编辑 DWF 环境":"新增 DWF 环境",description:"统一维护 DWF 实例连接、端口和访问账号。",onClose:l,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:l,children:"取消"}),s.jsx(V,{loading:n,onClick:()=>void x(),children:f?"保存更新":"创建环境"})]}),children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"基本信息"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"配置 DWF 环境的基本信息"})]}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"实例名称"}),s.jsx(ae,{value:o.name,onChange:v=>c(w=>({...w,name:v.target.value})),placeholder:"例如:研发环境 / 演示环境"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"实例地址"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{value:o.host,onChange:v=>c(w=>({...w,host:v.target.value})),onBlur:()=>{!f&&o.host.trim()&&h()},placeholder:"http://172.21.11.113:6060"}),s.jsxs(V,{type:"button",variant:"secondary",onClick:()=>void h(),disabled:u.status==="loading",className:"w-40",children:[u.status==="loading"?s.jsx(Pt,{className:"h-4 w-4 animate-spin"}):s.jsx(Xg,{className:"h-4 w-4"}),s.jsx("span",{className:"ml-2 hidden sm:inline",children:"探测"})]})]}),u.status==="error"?s.jsx("p",{className:"text-xs text-red-600",children:u.message}):u.status==="success"?s.jsx("p",{className:"text-xs text-emerald-600",children:"探测成功,已自动填充 API Base URL。"}):null]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"实例描述"}),s.jsx(_t,{rows:3,value:o.description,onChange:v=>c(w=>({...w,description:v.target.value})),placeholder:"补充用途、团队或约束说明。"})]})]})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"连接配置"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"控制台会通过这里的 Base URL 去连接 DWF 平台。请填写实例地址后点击探测自动获取。"})]}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Modeler API Base URL"}),s.jsx(ae,{value:o.modeler_base_url,onChange:v=>c(w=>({...w,modeler_base_url:v.target.value})),placeholder:"http://172.21.11.113:6060"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"App API Base URL"}),s.jsx(ae,{value:o.app_base_url,onChange:v=>c(w=>({...w,app_base_url:v.target.value})),placeholder:"http://172.21.11.113:9090"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"用户名"}),s.jsx(ae,{value:o.username,onChange:v=>c(w=>({...w,username:v.target.value})),placeholder:"请输入登录用户名"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"密码"}),s.jsx(ae,{type:"password",value:o.password,onChange:v=>c(w=>({...w,password:v.target.value})),placeholder:f?"如需变更再填写":"请输入登录密码"})]})]})]})]})})}const Kv=24,il=0;function al({icon:e,label:t,onClick:n,loading:r,active:l,tone:i="default"}){const a=i==="danger"?"text-rose-400 hover:text-rose-600":l?"text-indigo-600":"text-slate-400 hover:text-slate-700";return s.jsxs("div",{className:"group relative",children:[s.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:`flex items-center justify-center p-1 text-current transition-colors ${a}`,children:r?s.jsx(Pt,{className:"h-4 w-4 animate-spin"}):s.jsx(e,{className:"h-4 w-4"})}),s.jsx("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-slate-950 px-2.5 py-1.5 text-xs font-medium text-white opacity-0 shadow-lg transition-all group-hover:opacity-100",children:t})]})}function Gv(){const{apiBaseUrl:e,defaultEnvironmentId:t,setDefaultEnvironmentId:n}=Tt(),{pushToast:r}=ct(),[l,i]=p.useState([]),[a,o]=p.useState(0),[c,u]=p.useState(il),[d,f]=p.useState(!0),[h,x]=p.useState(!1),[v,w]=p.useState(""),[j,m]=p.useState(null),[g,y]=p.useState(""),[k,N]=p.useState(!1),[S,b]=p.useState(null),[M,B]=p.useState(!1),[T,E]=p.useState(""),[I,O]=p.useState(null),L=Dr(g,300);async function Q({page:F=il,append:G=!1}={}){G?x(!0):(f(!0),w(""));try{const z=await mc(e,{page:F,page_size:Kv,name:L.trim()||void 0});o(z.total_count),u(F),i(_=>{if(!G)return z.items;const le=new Set(_.map(ie=>ie.id));return[..._,...z.items.filter(ie=>!le.has(ie.id))]})}catch(z){const _=Y(z);G?m({tone:"error",title:"环境加载失败",description:_}):w(_)}finally{G?x(!1):f(!1)}}p.useEffect(()=>{Q({page:il})},[e,L]);const K=l.length<a,R=xh({enabled:!d&&!v,hasMore:K,onLoadMore:()=>Q({page:c+1,append:!0})});p.useEffect(()=>{j&&(r({tone:j.tone,title:j.title,description:j.description}),m(null))},[j,r]);async function C(F){B(!0);try{S?(await ov(e,S.id,F),m({tone:"success",title:"环境已更新",description:"新的连接配置已经保存。"})):(await av(e,F),m({tone:"success",title:"环境已创建",description:"你现在可以在 MCP 页面直接把它作为工作台使用。"})),N(!1),b(null),window.dispatchEvent(new Event("dwf-environments-updated")),await Q()}catch(G){m({tone:"error",title:"保存失败",description:Y(G)})}finally{B(!1)}}async function D(){if(I)try{await cv(e,I.id),t===I.id&&n(""),r({tone:"success",title:"环境已删除",description:I.name}),O(null),window.dispatchEvent(new Event("dwf-environments-updated")),await Q()}catch(F){m({tone:"error",title:"删除失败",description:Y(F)})}}async function U(F){E(F.id);try{const G=await uv(e,F.id);m({tone:G.success?"success":"error",title:G.success?"连接测试成功":"连接测试失败",description:G.message})}catch(G){m({tone:"error",title:"连接测试失败",description:Y(G)})}finally{E("")}}return s.jsxs(s.Fragment,{children:[s.jsx(Si,{icon:Yl,title:"DWF 环境管理",description:"维护 DWF 环境连接配置,支持将常用环境设置成侧边栏工作台。",meta:s.jsxs(J,{tone:"indigo",children:[a," 个环境"]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void Q({page:il}),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{b(null),N(!0)},children:"新建环境"})]})}),s.jsx(bi,{description:"搜索环境名称。DWF环境是 MCP 中台的基础挂载对象,先确认连接正常,可以设置为默认工作台。",children:s.jsxs("label",{className:"space-y-2 md:col-span-2 xl:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"搜索环境"}),s.jsxs("div",{className:"relative",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:g,onChange:F=>y(F.target.value),placeholder:"按名称搜索 DWF 环境"})]})]})}),d?s.jsx(gt,{label:"正在同步 DWF 环境..."}):null,!d&&v?s.jsx(Mt,{description:v,onRetry:()=>void Q()}):null,!d&&!v&&l.length===0?s.jsx(Ue,{icon:Yl,title:"未配置 DWF 环境",description:"请先配置 DWF 环境,后续 MCP 实例、工具调试才有挂载目标。",action:s.jsx(V,{icon:Pe,onClick:()=>{b(null),N(!0)},children:"新建首个环境"})}):null,!d&&!v&&l.length>0?s.jsxs(s.Fragment,{children:[s.jsx("section",{className:"grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr))]",children:l.map(F=>s.jsxs("article",{className:"min-w-0 rounded-3xl border border-slate-200 bg-white p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"truncate text-lg font-semibold text-slate-950",children:F.name}),F.id===t?s.jsx(J,{tone:"indigo",children:"默认工作台"}):null]}),s.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-500",children:F.description||"暂无环境描述"})]}),s.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-indigo-50 text-indigo-600",children:s.jsx(Vg,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"mt-5 space-y-3",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"实例地址"}),s.jsx("div",{className:"mt-2 break-all font-mono text-xs text-slate-700",children:F.host})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"服务端口"}),s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(J,{tone:"indigo",children:"App"}),s.jsx("span",{className:"ml-auto text-right font-mono text-sm font-medium tabular-nums text-slate-900",children:F.app_port})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(J,{tone:"green",children:"Modeler"}),s.jsx("span",{className:"ml-auto text-right font-mono text-sm font-medium tabular-nums text-slate-900",children:F.modeler_port})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"授权账号"}),s.jsx("div",{className:"mt-2 text-sm font-medium text-slate-900",children:F.username}),s.jsx("div",{className:"mt-1 font-mono text-xs text-slate-400",children:Fv(F.password)})]})]})]}),s.jsx("div",{className:"mt-5 border-t border-slate-100 pt-4",children:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(al,{icon:sv,label:"测试连接",loading:T===F.id,onClick:()=>void U(F)}),s.jsx(al,{icon:tv,label:F.id===t?"当前工作台":"设为工作台",active:F.id===t,onClick:()=>{n(F.id),r({tone:"info",title:"默认环境已更新",description:F.name})}}),s.jsx(al,{icon:rr,label:"编辑环境",onClick:()=>{b(F),N(!0)}}),s.jsx(al,{icon:Ft,label:"删除环境",tone:"danger",onClick:()=>O(F)})]})})]},F.id))}),K||h?s.jsx("div",{ref:R,className:"flex h-14 items-center justify-center",children:h?s.jsx(Pt,{className:"h-4 w-4 animate-spin text-slate-400"}):null}):null]}):null,s.jsx(qv,{open:k,environment:S,submitting:M,apiBaseUrl:e,onClose:()=>{N(!1),b(null)},onSubmit:C}),s.jsx(Bt,{open:!!I,title:"删除 DWF 环境",description:`环境“${(I==null?void 0:I.name)??""}”删除后将无法再被 MCP 实例引用,请确认没有运行中的依赖。`,confirmText:"确认删除",variant:"danger",onClose:()=>O(null),onConfirm:()=>void D()})]})}function Zv({apiBaseUrl:e,instanceId:t,enabled:n}){const[r,l]=p.useState([]),[i,a]=p.useState(!1),[o,c]=p.useState(null);return p.useEffect(()=>{if(!n||!t)return;const u=new AbortController,d=new TextDecoder;let f="";async function h(){a(!0),c(null),l([]);try{const x=await fetch(`${e}/mcp-instance/${t}/stream-logs`,{signal:u.signal,headers:{Accept:"text/event-stream"}});if(!x.ok||!x.body)throw new Error(`日志流打开失败: ${x.status}`);const v=x.body.getReader();for(;;){const{value:w,done:j}=await v.read();if(j)break;f+=d.decode(w,{stream:!0});const m=f.split(`
338
+
339
+ `);f=m.pop()??"";for(const g of m){const y=g.split(`
340
+ `).filter(k=>k.startsWith("data: ")).map(k=>k.slice(6));for(const k of y)try{const N=JSON.parse(k);l(S=>[...S,N.message??k])}catch{l(N=>[...N,k])}}}}catch(x){u.signal.aborted||c(Y(x))}finally{u.signal.aborted||a(!1)}}return h(),()=>u.abort()},[e,n,t]),{logs:r,loading:i,error:o,clearLogs:()=>l([])}}function gh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jv(e,t,n){if(!t.trim())return e;const r=new RegExp(gh(t),"ig"),l=[];let i=0,a=0,o=r.exec(e);for(;o;){o.index>i&&l.push(s.jsx(p.Fragment,{children:e.slice(i,o.index)},`text-${i}`));const c=o[0],u=a===n;l.push(s.jsx("mark",{className:se("rounded px-1 py-0.5 font-semibold",u?"bg-indigo-300 text-slate-950":"bg-amber-200 text-slate-950"),children:c},`match-${o.index}-${a}`)),i=o.index+c.length,a+=1,c.length===0&&(r.lastIndex+=1),o=r.exec(e)}return i<e.length&&l.push(s.jsx(p.Fragment,{children:e.slice(i)},`text-${i}`)),l.length===0?s.jsx(p.Fragment,{children:e},"plain"):l}function Xv({open:e,apiBaseUrl:t,instance:n,onClose:r}){const[l,i]=p.useState(""),[a,o]=p.useState(-1),[c,u]=p.useState(!0),[d,f]=p.useState(!0),h=Dr(l,150),{logs:x,loading:v,error:w,clearLogs:j}=Zv({apiBaseUrl:t,instanceId:n==null?void 0:n.id,enabled:e&&!!n}),m=p.useRef(null),g=p.useRef({});p.useEffect(()=>{e&&(i(""),o(-1),u(!0),f(!0))},[n==null?void 0:n.id,e]);const y=p.useMemo(()=>{if(!h.trim())return[];const T=gh(h);return x.reduce((E,I,O)=>{const L=new RegExp(T,"ig");let Q=0,K=L.exec(I);for(;K;)E.push({lineIndex:O,occurrenceIndex:Q}),Q+=1,K[0].length===0&&(L.lastIndex+=1),K=L.exec(I);return E},[])},[h,x]),k=a>=0&&a<y.length?y[a]:null,N=p.useMemo(()=>new Set(y.map(T=>T.lineIndex)),[y]);p.useEffect(()=>{if(!h.trim()){o(-1);return}if(y.length===0){o(-1);return}o(T=>T<0||T>=y.length?0:T)},[h,y]),p.useEffect(()=>{if(!h.trim()||!k)return;const T=m.current,E=g.current[k.lineIndex];if(!T||!E)return;const I=Math.max(E.offsetTop-T.clientHeight/2+E.clientHeight/2,0);T.scrollTo({top:I,behavior:"smooth"})},[k,h]),p.useEffect(()=>{if(!c||h.trim())return;const T=m.current;T&&T.scrollTo({top:T.scrollHeight,behavior:"smooth"})},[h,c,x.length]);function S(){const T=m.current;T&&(u(!0),T.scrollTo({top:T.scrollHeight,behavior:"smooth"}))}function b(){if(h.trim())return;const T=m.current;if(!T)return;const E=T.scrollHeight-T.scrollTop-T.clientHeight;u(E<24)}function M(){y.length!==0&&o(T=>(T+1)%y.length)}function B(){y.length!==0&&o(T=>T<=0?y.length-1:T-1)}return s.jsx(Zt,{open:e,size:"xl",title:`运行日志 · ${(n==null?void 0:n.name)??""}`,onClose:r,footer:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(J,{tone:"slate",children:[x.length," 行"]}),h?s.jsx(J,{tone:y.length>0?"indigo":"rose",children:y.length>0?`${a+1} / ${y.length} 命中`:"0 命中"}):null,c&&!h?s.jsx(J,{tone:"green",children:"跟随输出"}):null]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(V,{variant:"secondary",onClick:j,children:"清空缓存"}),s.jsx(V,{variant:"secondary",onClick:r,children:"关闭"})]})]}),children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"sticky top-0 z-10 -mx-2 rounded-2xl bg-white/95 px-2 pb-4 backdrop-blur supports-[backdrop-filter]:bg-white/85",children:s.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:l,onChange:T=>i(T.target.value),placeholder:"按关键词搜索日志"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(V,{size:"sm",variant:"secondary",icon:Fg,onClick:B,disabled:y.length===0,children:"上一个"}),s.jsx(V,{size:"sm",variant:"secondary",icon:Fn,onClick:M,disabled:y.length===0,children:"下一个"}),s.jsx(V,{size:"sm",variant:d?"primary":"secondary",icon:lv,onClick:()=>f(T=>!T),children:d?"自动换行":"单行滚动"}),s.jsx(V,{size:"sm",variant:c?"primary":"secondary",onClick:()=>u(T=>!T),children:c?"跟随中":"跟随输出"}),s.jsx(V,{size:"sm",variant:"secondary",icon:Ig,onClick:S,children:"移到末尾"})]})]})}),v&&x.length===0?s.jsx(gt,{label:"正在连接日志流..."}):null,!v&&w?s.jsx(Mt,{description:w}):null,!v&&!w&&x.length===0?s.jsx(Ue,{icon:fh,title:"当前没有日志输出",description:"实例可能刚启动,或者暂时没有新的 stdout / stderr 内容。"}):null,!w&&x.length>0?s.jsxs("div",{className:"overflow-hidden rounded-2xl border border-slate-200 bg-slate-950",children:[s.jsxs("div",{className:se("border-b border-slate-800 bg-slate-900 px-4 py-2.5 text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",d?"grid grid-cols-[64px_minmax(0,1fr)]":"grid min-w-full w-max grid-cols-[64px_max-content]"),children:[s.jsx("div",{children:"Line"}),s.jsx("div",{children:"Output"})]}),s.jsx("div",{ref:m,onScroll:b,className:"scrollbar-subtle h-[52vh] overflow-auto",children:x.map((T,E)=>{const I=N.has(E),O=(k==null?void 0:k.lineIndex)===E,L=O?k.occurrenceIndex:-1;return s.jsxs("div",{ref:Q=>{g.current[E]=Q},className:se("gap-4 border-b border-slate-900/80 px-4 py-1.5",d?"grid grid-cols-[64px_minmax(0,1fr)]":"grid min-w-full w-max grid-cols-[64px_max-content]",O?"bg-indigo-500/12":I?"bg-amber-500/8":"bg-slate-950"),children:[s.jsx("div",{className:"select-none text-right font-mono text-xs text-slate-500",children:E+1}),s.jsx("div",{className:se("pr-4 font-mono text-xs leading-5 text-slate-100",d?"whitespace-pre-wrap break-all":"min-w-0 whitespace-pre"),children:Jv(T,h,L)})]},`${E}-${T.slice(0,16)}`)})})]}):null]})})}function bl({title:e,value:t}){return s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-950 p-4",children:[s.jsx("div",{className:"mb-3 text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:e}),s.jsx("pre",{className:"scrollbar-subtle max-h-72 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-6 text-slate-100",children:vc(t)})]})}const Yv=[{key:"internal",label:"实体类"},{key:"relations",label:"关联类"},{key:"external",label:"外部实体类"}];function ey({open:e,apiBaseUrl:t,dwfInstanceId:n,initialSelection:r,onClose:l,onApply:i}){const[a,o]=p.useState("internal"),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,x]=p.useState([]),[v,w]=p.useState(!1),[j,m]=p.useState(""),[g,y]=p.useState({internal:[],relations:[],external:[]}),k=Dr(c,250);p.useEffect(()=>{if(!e)return;const b=r.includes("*");f(b),x(b?[]:r),u(""),o("internal")},[r,e]);async function N(){if(!(!e||!n)){w(!0),m("");try{const[b,M,B]=await Promise.all([fv(t,n,k||void 0),pv(t,n,k||void 0),hv(t,n,k||void 0)]);y({internal:b.data,relations:M.data,external:B.data})}catch(b){m(Y(b))}finally{w(!1)}}}p.useEffect(()=>{N()},[t,k,n,e]);const S=g[a];return s.jsx(Zt,{open:e,size:"lg",title:"配置实体可见范围",description:"使用实体白名单控制 MCP 能感知到的 DWF 实体范围。",onClose:l,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:l,children:"取消"}),s.jsx(V,{onClick:()=>i(d?["*"]:h),children:"保存范围"})]}),children:n?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsxs("label",{className:"inline-flex items-center gap-3 text-sm font-medium text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:d,onChange:b=>f(b.target.checked)}),"全部实体类可见"]}),s.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"开启后不再限制实体范围;关闭后将只暴露你手动勾选的实体类。"})]}),d?null:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:h.length>0?h.map(b=>s.jsx("button",{className:"rounded-full border border-indigo-200 bg-indigo-50 px-3 py-1 text-xs font-medium text-indigo-700",onClick:()=>x(M=>M.filter(B=>B!==b)),type:"button",children:b},b)):s.jsx(J,{tone:"slate",children:"尚未选择任何实体"})}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:c,onChange:b=>u(b.target.value),placeholder:"搜索 className 或显示名"})]}),s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void N(),children:"刷新"})]}),s.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Yv.map(b=>s.jsx("button",{className:`rounded-full px-3 py-1.5 text-sm font-medium ${a===b.key?"bg-indigo-50 text-indigo-700":"bg-slate-100 text-slate-500"}`,onClick:()=>o(b.key),type:"button",children:b.label},b.key))}),v?s.jsx(gt,{label:"正在拉取实体目录..."}):null,!v&&j?s.jsx(Mt,{description:j,onRetry:()=>void N()}):null,!v&&!j&&S.length===0?s.jsx(Ue,{icon:St,title:"没有匹配实体",description:"试试更短的关键词,或者切换到其它实体分类。"}):null,!v&&!j&&S.length>0?s.jsx("div",{className:"scrollbar-subtle max-h-[420px] space-y-2 overflow-y-auto rounded-2xl border border-slate-200 bg-slate-50 p-3",children:S.map(b=>{const M=h.includes(b.className);return s.jsxs("label",{className:"flex items-start gap-3 rounded-2xl border border-white bg-white px-4 py-3 text-sm hover:border-slate-200",children:[s.jsx("input",{className:"mt-1",type:"checkbox",checked:M,onChange:B=>x(T=>B.target.checked?[...T,b.className]:T.filter(E=>E!==b.className))}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-slate-900",children:b.className}),s.jsxs("div",{className:"mt-1 text-xs text-slate-500",children:[b.displayName||"暂无显示名",b.classCategory?` · ${b.classCategory}`:""]})]})]},b.id)})}):null]})]})]}):s.jsx(Ue,{icon:St,title:"缺少 DWF 环境",description:"请先在 MCP 表单里选择一个可用的 DWF 环境,再配置实体范围。"})})}const ld={default_language:"zh-CN",default_app_id:"default-app",enable_debug:!1,timeout_seconds:30,entity_whitelist:["*"]};function id(e,t){return{name:(e==null?void 0:e.name)??"",description:(e==null?void 0:e.description)??"",dwf_instance_id:(e==null?void 0:e.dwf_instance_id)??t??"",transport:(e==null?void 0:e.transport)==="sse"?"streamable-http":(e==null?void 0:e.transport)??"streamable-http"}}function ty({open:e,apiBaseUrl:t,environments:n,tools:r,selectedEnvironmentId:l,instance:i,submitting:a,onClose:o,onSubmit:c}){const{pushToast:u}=ct(),[d,f]=p.useState(id(i,l)),[h,x]=p.useState([]),[v,w]=p.useState({}),[j,m]=p.useState(ld),[g,y]=p.useState(""),[k,N]=p.useState(!1),[S,b]=p.useState({}),M=!!i,B=!!(i&&i.status!=="stopped");p.useEffect(()=>{var D,U;if(!e)return;f(id(i,l)),y("");const R=i==null?void 0:i.config,C={...(R==null?void 0:R.tool_configuration)??{}};w(C),x(Object.keys(C)),b(()=>Object.keys(C).reduce((G,z,_)=>(G[z]=_===0,G),{})),m({...ld,...(R==null?void 0:R.global_settings)??{},entity_whitelist:(U=(D=R==null?void 0:R.global_settings)==null?void 0:D.entity_whitelist)!=null&&U.length?R.global_settings.entity_whitelist:["*"]})},[i,e,l]),p.useEffect(()=>{w(R=>{const C={...R};return h.forEach(D=>{C[D]||(C[D]={documentation_override:"",parameter_overrides:{}})}),Object.keys(C).forEach(D=>{h.includes(D)||delete C[D]}),C})},[h]),p.useEffect(()=>{b(R=>{const C={};return h.forEach((D,U)=>{C[D]=R[D]??U===0}),C})},[h]);const T=M?(i==null?void 0:i.dwf_instance_id)??d.dwf_instance_id:d.dwf_instance_id,E=r.filter(R=>{if(!g.trim())return!0;const C=g.toLowerCase();return[R.name,R.group,R.description].join(" ").toLowerCase().includes(C)}),I=E.map(R=>R.name),O=I.length>0&&I.every(R=>h.includes(R)),L={tool_configuration:v,global_settings:j};async function Q(){if(!d.name.trim()){u({tone:"error",title:"表单校验未通过",description:"请填写 MCP 实例名称。"});return}if(!d.dwf_instance_id){u({tone:"error",title:"表单校验未通过",description:"请先选择 DWF 环境。"});return}if(B){u({tone:"info",title:"当前状态不可保存",description:"仅已停止的实例允许保存配置。"});return}const R={name:d.name.trim(),description:d.description.trim(),dwf_instance_id:d.dwf_instance_id,transport:d.transport,config:L};await c(R)}const K=j.entity_whitelist.includes("*")?"全部实体类可见":`已选择 ${j.entity_whitelist.length} 个实体类`;return s.jsxs(s.Fragment,{children:[s.jsx(Zt,{open:e,size:"xl",title:M?"编辑 MCP 实例":"创建 MCP 实例",onClose:o,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:o,children:"取消"}),s.jsx(V,{loading:a,disabled:B,title:B?"仅已停止实例可保存配置":void 0,onClick:()=>void Q(),children:M?"保存配置":"创建实例"})]}),children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"基本信息"}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"实例名称"}),s.jsx(ae,{value:d.name,onChange:R=>f(C=>({...C,name:R.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"传输协议"}),s.jsx(Ie,{value:d.transport,onChange:R=>f(C=>({...C,transport:R.target.value})),children:s.jsx("option",{value:"streamable-http",children:"Streamable HTTP"})})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"DWF 环境"}),s.jsxs(Ie,{disabled:M,value:d.dwf_instance_id,onChange:R=>f(C=>({...C,dwf_instance_id:R.target.value})),children:[s.jsx("option",{value:"",children:"请选择环境"}),n.map(R=>s.jsx("option",{value:R.id,children:R.name},R.id))]})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"实例描述"}),s.jsx(_t,{rows:3,value:d.description,onChange:R=>f(C=>({...C,description:R.target.value})),placeholder:"补充这台 MCP 的用途、服务对象或权限边界。"})]})]})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"工具配置"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{type:"button",className:"text-sm font-medium text-slate-500 transition-colors hover:text-slate-900 disabled:cursor-not-allowed disabled:text-slate-300",disabled:I.length===0,onClick:()=>x(R=>O?R.filter(C=>!I.includes(C)):[...R,...I.filter(C=>!R.includes(C))]),children:O?"取消全选":"全选"}),s.jsxs(J,{tone:"indigo",children:[h.length," 个已选工具"]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:g,onChange:R=>y(R.target.value),placeholder:"搜索工具名称或分组"})]}),s.jsx("div",{className:"scrollbar-subtle grid max-h-72 gap-3 overflow-y-auto rounded-2xl border border-slate-200 bg-slate-50 p-3 md:grid-cols-2",children:E.map(R=>{const C=h.includes(R.name);return s.jsxs("label",{className:"flex min-h-[96px] items-start gap-3 rounded-2xl border border-white bg-white px-4 py-3 text-sm hover:border-slate-200",children:[s.jsx("input",{className:"mt-1",type:"checkbox",checked:C,onChange:D=>x(U=>D.target.checked?[...U,R.name]:U.filter(F=>F!==R.name))}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium text-slate-900",children:R.name}),s.jsx(J,{tone:"slate",children:R.group})]}),s.jsx("p",{title:R.description,className:"mt-1 overflow-hidden text-xs leading-5 text-slate-500",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2},children:R.description})]})]},R.name)})}),h.length>0?s.jsx("div",{className:"space-y-4",children:h.map(R=>{var z;const C=r.find(_=>_.name===R),D=v[R]??{documentation_override:"",parameter_overrides:{}},U=D.parameter_overrides??{},F=Object.keys(U).length,G=!!S[R];return s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-3 text-left",onClick:()=>b(_=>({..._,[R]:!_[R]})),children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h4",{className:"text-sm font-semibold text-slate-900",children:R}),C!=null&&C.method?s.jsx(J,{tone:"green",children:C.method}):null,s.jsxs(J,{tone:"slate",children:[F," 个覆盖"]})]})}),G?s.jsx(Fn,{className:"h-4 w-4 shrink-0 text-slate-400"}):s.jsx(ih,{className:"h-4 w-4 shrink-0 text-slate-400"})]}),G?s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"自定义描述"}),s.jsx(_t,{rows:2,value:D.documentation_override??"",onChange:_=>w(le=>({...le,[R]:{...le[R],documentation_override:_.target.value}})),placeholder:"如有需要,可覆盖默认的工具描述。"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-700",children:[s.jsx(Gg,{className:"h-4 w-4 text-slate-400"}),"参数覆盖"]}),(z=C==null?void 0:C.parameters)!=null&&z.length?C.parameters.map(_=>{var ie,Re;const le=!!U[_.name];return s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsxs("label",{className:"inline-flex items-center gap-3 text-sm font-medium text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:le,onChange:wt=>w(ze=>{var ut;const rt={...ze[R]??{documentation_override:"",parameter_overrides:{}},parameter_overrides:{...((ut=ze[R])==null?void 0:ut.parameter_overrides)??{}}};return wt.target.checked?rt.parameter_overrides[_.name]={default:"",description:_.description??""}:delete rt.parameter_overrides[_.name],{...ze,[R]:rt}})}),_.name,s.jsx(J,{tone:"slate",children:_.type})]}),le?s.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"默认值"}),s.jsx(ae,{value:((ie=U[_.name])==null?void 0:ie.default)??"",onChange:wt=>w(ze=>{var rt,ut,W;return{...ze,[R]:{...ze[R],parameter_overrides:{...((rt=ze[R])==null?void 0:rt.parameter_overrides)??{},[_.name]:{...((W=(ut=ze[R])==null?void 0:ut.parameter_overrides)==null?void 0:W[_.name])??{},default:wt.target.value}}}}}),placeholder:"可选默认值"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"参数说明"}),s.jsx(ae,{value:((Re=U[_.name])==null?void 0:Re.description)??"",onChange:wt=>w(ze=>{var rt,ut,W;return{...ze,[R]:{...ze[R],parameter_overrides:{...((rt=ze[R])==null?void 0:rt.parameter_overrides)??{},[_.name]:{...((W=(ut=ze[R])==null?void 0:ut.parameter_overrides)==null?void 0:W[_.name])??{},description:wt.target.value}}}}}),placeholder:"覆盖默认参数描述"})]})]}):s.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"使用默认值"})]},`${R}-${_.name}`)}):s.jsx("div",{className:"rounded-2xl border border-dashed border-slate-200 bg-slate-50 px-4 py-6 text-sm text-slate-500",children:"这个工具当前没有可覆盖的参数。"})]})]}):null]},R)})}):null]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"全局设置"}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"默认语言"}),s.jsxs(Ie,{value:j.default_language,onChange:R=>m(C=>({...C,default_language:R.target.value})),children:[s.jsx("option",{value:"zh-CN",children:"中文"}),s.jsx("option",{value:"en-US",children:"英文"})]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"默认应用 ID"}),s.jsx(ae,{value:j.default_app_id,onChange:R=>m(C=>({...C,default_app_id:R.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"超时时间(秒)"}),s.jsx(ae,{type:"number",min:1,max:300,value:String(j.timeout_seconds),onChange:R=>m(C=>({...C,timeout_seconds:Number(R.target.value||30)}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"调试模式"}),s.jsxs("label",{className:"flex h-10 items-center gap-3 rounded-xl border border-slate-200 bg-white px-3 text-sm text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:j.enable_debug,onChange:R=>m(C=>({...C,enable_debug:R.target.checked}))}),"启用"]})]}),s.jsx("div",{className:"rounded-2xl border border-slate-200 p-4 md:col-span-2",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-slate-700",children:"实体可见范围"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:K})]}),s.jsx(V,{variant:"secondary",onClick:()=>N(!0),disabled:!T,children:"配置实体范围"})]})})]})]}),s.jsxs("section",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("div",{className:"mb-4",children:s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"配置预览"})}),s.jsx(bl,{title:"MCP Config Preview",value:L})]})]})}),s.jsx(ey,{open:k,apiBaseUrl:t,dwfInstanceId:T,initialSelection:j.entity_whitelist,onClose:()=>N(!1),onApply:R=>{m(C=>({...C,entity_whitelist:R.length?R:["*"]})),N(!1)}})]})}const ad=24,ny=100,la=0,ry={running:"运行中",stopped:"已停止",starting:"启动中",stopping:"停止中",error:"异常"};function sy(e){return e==="running"?"green":e==="error"?"rose":e==="starting"||e==="stopping"?"amber":"slate"}function ly(e){return e==="sse"?"SSE":"Streamable HTTP"}function ol({icon:e,label:t,onClick:n,loading:r,tone:l="default"}){const i=l==="danger"?"text-rose-400 hover:text-rose-600":l==="accent"?"text-indigo-600 hover:text-indigo-700":"text-slate-400 hover:text-slate-700";return s.jsxs("div",{className:"group relative",children:[s.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:`flex items-center justify-center p-1 text-current transition-colors ${i}`,children:r?s.jsx(Pt,{className:"h-4 w-4 animate-spin"}):s.jsx(e,{className:"h-4 w-4"})}),s.jsx("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-slate-950 px-2.5 py-1.5 text-xs font-medium text-white opacity-0 shadow-lg transition-all group-hover:opacity-100",children:t})]})}function iy(){const e=Os(),{apiBaseUrl:t,defaultEnvironmentId:n}=Tt(),{pushToast:r}=ct(),[l,i]=p.useState([]),[a,o]=p.useState([]),[c,u]=p.useState([]),[d,f]=p.useState(0),[h,x]=p.useState(la),[v,w]=p.useState(!0),[j,m]=p.useState(!1),[g,y]=p.useState(""),[k,N]=p.useState(null),[S,b]=p.useState(""),[M,B]=p.useState(""),[T,E]=p.useState(!1),[I,O]=p.useState(null),[L,Q]=p.useState(!1),[K,R]=p.useState(""),[C,D]=p.useState(null),[U,F]=p.useState(null),G=Dr(M,180),z=p.useMemo(()=>l.find(W=>W.id===n)??null,[n,l]);async function _(){w(!0),y("");try{const[W,ve]=await Promise.all([mc(t,{page_size:ny}),gc(t)]),_e=W.items,Rt=_e.find(Wt=>Wt.id===n)??null,Ze=await rd(t,{page:la,page_size:ad,dwf_instance_id:Rt==null?void 0:Rt.id});i(_e),o(ve),u(Ze.items),f(Ze.total_count),x(la)}catch(W){y(Y(W))}finally{w(!1)}}p.useEffect(()=>{_()},[t,n]);const le=c.filter(W=>{if(S&&W.status!==S)return!1;if(!G.trim())return!0;const ve=G.toLowerCase();return[W.name,W.description,W.proxy_endpoint,W.endpoint,W.transport].join(" ").toLowerCase().includes(ve)}),ie=c.length<d,Re=xh({enabled:!v&&!g&&l.length>0,hasMore:ie,onLoadMore:async()=>{const W=h+1;m(!0);try{const ve=await rd(t,{page:W,page_size:ad,dwf_instance_id:z==null?void 0:z.id});u(_e=>{const Rt=new Set(_e.map(Ze=>Ze.id));return[..._e,...ve.items.filter(Ze=>!Rt.has(Ze.id))]}),f(ve.total_count),x(W)}catch(ve){N({tone:"error",title:"实例加载失败",description:Y(ve)})}finally{m(!1)}}});p.useEffect(()=>{k&&(r({tone:k.tone,title:k.title,description:k.description}),N(null))},[k,r]);async function wt(W){var ve;try{if((ve=navigator.clipboard)!=null&&ve.writeText)await navigator.clipboard.writeText(W);else{const _e=document.createElement("textarea");_e.value=W,_e.setAttribute("readonly","true"),_e.style.position="absolute",_e.style.left="-9999px",document.body.appendChild(_e),_e.select(),document.execCommand("copy"),document.body.removeChild(_e)}r({tone:"success",title:"URL 已复制"})}catch(_e){N({tone:"error",title:"复制失败",description:Y(_e)})}}async function ze(W){Q(!0);try{I?(await xv(t,I.id,W),N({tone:"success",title:"MCP 实例已更新",description:`${I.name} 的配置已经保存。`})):(await mv(t,W),N({tone:"success",title:"MCP 实例已创建",description:"新的实例已经加入当前列表。"})),E(!1),O(null),await _()}catch(ve){N({tone:"error",title:"MCP 保存失败",description:Y(ve)})}finally{Q(!1)}}async function rt(){if(C)try{await gv(t,C.id),r({tone:"success",title:"MCP 实例已删除",description:C.name}),D(null),await _()}catch(W){N({tone:"error",title:"实例删除失败",description:Y(W)})}}async function ut(W){R(W.id);try{W.status==="running"?(await yv(t,W.id),r({tone:"info",title:"MCP 已停止",description:W.name})):(await vv(t,W.id),r({tone:"success",title:"MCP 已启动",description:W.name})),await _()}catch(ve){N({tone:"error",title:"状态切换失败",description:Y(ve)})}finally{R("")}}return s.jsxs(s.Fragment,{children:[s.jsx(Si,{icon:As,title:"MCP 实例管理",description:"配置、运行和监控DWF MCP Server服务实例。",meta:s.jsxs(J,{tone:"indigo",children:[d," 个实例"]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void _(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{O(null),E(!0)},children:"新建实例"})]})}),s.jsxs(bi,{children:[s.jsxs("label",{className:"space-y-2 md:col-span-3 xl:col-span-3",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"搜索实例"}),s.jsxs("div",{className:"relative",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:M,onChange:W=>B(W.target.value),placeholder:"按实例名称、描述或代理地址搜索"})]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"运行状态"}),s.jsxs(Ie,{value:S,onChange:W=>b(W.target.value),children:[s.jsx("option",{value:"",children:"全部状态"}),s.jsx("option",{value:"running",children:"运行中"}),s.jsx("option",{value:"stopped",children:"已停止"}),s.jsx("option",{value:"starting",children:"启动中"}),s.jsx("option",{value:"stopping",children:"停止中"}),s.jsx("option",{value:"error",children:"异常"})]})]})]}),v?s.jsx(gt,{label:"正在同步 MCP 实例..."}):null,!v&&g?s.jsx(Mt,{description:g,onRetry:()=>void _()}):null,!v&&!g&&l.length===0?s.jsx(Ue,{icon:Yl,title:"还没有可用的 DWF 环境",description:"请先创建至少一个 DWF 环境,MCP 实例才能绑定到具体工作台。",action:s.jsx(V,{variant:"secondary",onClick:()=>e("/environments"),children:"前往环境管理"})}):null,!v&&!g&&l.length>0&&c.length===0?s.jsx(Ue,{icon:As,title:z?"当前工作台下还没有实例":"当前还没有 MCP 实例",description:z?`工作台“${z.name}”下还没有 MCP 实例,可以直接创建。`:"还没有创建任何 MCP 实例。",action:s.jsx(V,{icon:Pe,onClick:()=>{O(null),E(!0)},children:"新建实例"})}):null,!v&&!g&&c.length>0&&le.length===0?s.jsxs(s.Fragment,{children:[s.jsx(Ue,{icon:St,title:"没有匹配的 MCP 实例",description:"试试调整状态筛选或搜索关键词。"}),ie||j?s.jsx("div",{ref:Re,className:"flex h-14 items-center justify-center",children:j?s.jsx(Pt,{className:"h-4 w-4 animate-spin text-slate-400"}):null}):null]}):null,!v&&!g&&le.length>0?s.jsxs(s.Fragment,{children:[s.jsx("section",{className:"grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr))]",children:le.map(W=>{var dt,hn,Je;const ve=Object.keys(((dt=W.config)==null?void 0:dt.tool_configuration)??{}).length,_e=((Je=(hn=W.config)==null?void 0:hn.global_settings)==null?void 0:Je.entity_whitelist)??["*"],Rt=_e.includes("*")?"全部":`${_e.length} 个`,Ze=W.proxy_endpoint||W.endpoint||"MCP Server服务尚未启动",Wt=!!(W.proxy_endpoint||W.endpoint);return s.jsxs("article",{className:"min-w-0 rounded-3xl border border-slate-200 bg-white p-5 shadow-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"truncate text-lg font-semibold text-slate-950",children:W.name}),s.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-500",children:W.description||"暂无实例描述"}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[s.jsx(J,{tone:sy(W.status),children:ry[W.status]}),s.jsx(J,{tone:"indigo",children:ly(W.transport)})]})]}),s.jsxs("div",{className:"mt-5 space-y-3",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"URL"}),s.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3",children:[s.jsx("div",{title:Ze,className:"min-w-0 truncate font-mono text-xs text-slate-700",children:Ze}),s.jsx("button",{type:"button",title:Wt?"复制 URL":"暂无可复制 URL","aria-label":Wt?"复制 URL":"暂无可复制 URL",disabled:!Wt,onClick:()=>void wt(Ze),className:"shrink-0 text-slate-400 transition-colors hover:text-slate-700 disabled:cursor-not-allowed disabled:text-slate-300",children:s.jsx(Hg,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"工具配置"}),s.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3 text-sm",children:[s.jsx("span",{className:"truncate text-slate-500",children:"工具数量"}),s.jsx("span",{className:"shrink-0 font-medium text-slate-900",children:ve})]})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"访问控制"}),s.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3 text-sm",children:[s.jsx("span",{className:"truncate text-slate-500",children:"实体范围"}),s.jsx("span",{className:"shrink-0 font-medium text-slate-900",children:Rt})]})]})]})]}),s.jsx("div",{className:"mt-5 border-t border-slate-100 pt-4",children:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(ol,{icon:W.status==="running"?Wg:Jg,label:W.status==="running"?"停止实例":"启动实例",tone:W.status==="running"?"danger":"accent",loading:K===W.id,onClick:()=>void ut(W)}),s.jsx(ol,{icon:fh,label:"查看日志",onClick:()=>{if(W.status!=="running"){N({tone:"info",title:"只有运行中的实例可以查看日志",description:"请先启动实例,再打开运行日志。"});return}F(W)}}),s.jsx(ol,{icon:rr,label:"编辑配置",onClick:()=>{O(W),E(!0)}}),s.jsx(ol,{icon:Ft,label:"删除实例",tone:"danger",onClick:()=>D(W)})]})})]},W.id)})}),ie||j?s.jsx("div",{ref:Re,className:"flex h-14 items-center justify-center",children:j?s.jsx(Pt,{className:"h-4 w-4 animate-spin text-slate-400"}):null}):null]}):null,s.jsx(ty,{open:T,apiBaseUrl:t,environments:l,tools:a,selectedEnvironmentId:(z==null?void 0:z.id)??"",instance:I,submitting:L,onClose:()=>{E(!1),O(null)},onSubmit:ze}),s.jsx(Xv,{open:!!U,apiBaseUrl:t,instance:U,onClose:()=>F(null)}),s.jsx(Bt,{open:!!C,title:"删除 MCP 实例",description:`实例“${(C==null?void 0:C.name)??""}”删除后将失去代理入口与日志上下文,请确认已经停止服务。`,confirmText:"确认删除",variant:"danger",onClose:()=>D(null),onConfirm:()=>void rt()})]})}function Or({columns:e,rows:t,rowKey:n}){return s.jsx("div",{className:"overflow-hidden rounded-2xl border border-slate-200",children:s.jsx("div",{className:"min-w-0",children:s.jsxs("table",{className:"w-full table-fixed divide-y divide-slate-200",children:[s.jsx("thead",{className:"bg-slate-50/80",children:s.jsx("tr",{children:e.map(r=>s.jsx("th",{className:se("px-4 py-3 text-left text-xs font-semibold uppercase tracking-[0.14em] text-slate-500",r.className,r.headerClassName),children:r.header},r.key))})}),s.jsx("tbody",{className:"divide-y divide-slate-100 bg-white",children:t.map(r=>s.jsx("tr",{className:"align-top hover:bg-slate-50/60",children:e.map(l=>s.jsx("td",{className:se("px-4 py-4 text-sm text-slate-700",l.className,l.cellClassName),children:l.render(r)},l.key))},n(r)))})]})})})}function We({icon:e,label:t,onClick:n,loading:r,disabled:l,tone:i="default",tooltipAlign:a="center"}){const o=i==="danger"?"text-rose-400 hover:text-rose-600 disabled:text-rose-200":i==="accent"?"text-indigo-600 hover:text-indigo-700 disabled:text-indigo-200":"text-slate-400 hover:text-slate-700 disabled:text-slate-300";return s.jsxs("div",{className:"group relative",children:[s.jsx("button",{type:"button","aria-label":t,disabled:l||r,onClick:n,className:`flex items-center justify-center p-1 text-current transition-colors disabled:cursor-not-allowed ${o}`,children:r?s.jsx(Pt,{className:"h-4 w-4 animate-spin"}):s.jsx(e,{className:"h-4 w-4"})}),s.jsx("div",{className:`pointer-events-none absolute bottom-full z-10 mb-2 whitespace-nowrap rounded-lg bg-slate-950 px-2.5 py-1.5 text-xs font-medium text-white opacity-0 shadow-lg transition-all group-hover:opacity-100 ${a==="end"?"right-0":"left-1/2 -translate-x-1/2"}`,children:t})]})}function ay(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`parameter-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function vh(e){return{name:(e==null?void 0:e.name)??"",type:(e==null?void 0:e.type)??"string",required:(e==null?void 0:e.required)??!0,description:(e==null?void 0:e.description)??"",localId:ay()}}function od(e){return{name:(e==null?void 0:e.name)??"",type:(e==null?void 0:e.type)??"",group:(e==null?void 0:e.group)??"",method:(e==null?void 0:e.method)??"",url_template:(e==null?void 0:e.url_template)??"",description:(e==null?void 0:e.description)??"",parameters:((e==null?void 0:e.parameters)??[]).map(t=>vh(t)),headers:(e==null?void 0:e.headers)??[],query_params:(e==null?void 0:e.query_params)??[],body_params:(e==null?void 0:e.body_params)??[],returns:(e==null?void 0:e.returns)??"",examples:(e==null?void 0:e.examples)??[""],evolution_enabled:(e==null?void 0:e.evolution_enabled)??!1}}function oy(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function cy({open:e,enums:t,tool:n,submitting:r,onClose:l,onSubmit:i}){const{pushToast:a}=ct(),[o,c]=p.useState(od(n));p.useEffect(()=>{e&&c(od(n))},[e,n]);const u=!!n,d=o.parameters.map(x=>x.name.trim()).filter(Boolean),f=[{key:"headers",label:"Headers 参数",values:o.headers},{key:"query_params",label:"Query 参数",values:o.query_params},{key:"body_params",label:"Body 参数",values:o.body_params}];async function h(){if(!o.name.trim()){a({tone:"error",title:"表单校验未通过",description:"请填写工具名称。"});return}if(!o.type.trim()||!o.group.trim()||!o.method.trim()){a({tone:"error",title:"表单校验未通过",description:"请补齐 API 类型、分组与 HTTP 方法。"});return}if(!o.url_template.trim()||!o.description.trim()){a({tone:"error",title:"表单校验未通过",description:"URL 模板和工具描述不能为空。"});return}const x=o.parameters.map(w=>{var j;return{name:w.name.trim(),type:w.type,required:w.required,description:((j=w.description)==null?void 0:j.trim())||void 0}}).filter(w=>w.name),v={...o,name:o.name.trim(),type:o.type.trim(),group:o.group.trim(),method:o.method.trim(),url_template:o.url_template.trim(),description:o.description.trim(),returns:o.returns.trim(),parameters:x,headers:o.headers.filter(w=>d.includes(w)),query_params:o.query_params.filter(w=>d.includes(w)),body_params:o.body_params.filter(w=>d.includes(w)),examples:o.examples.map(w=>w.trim()).filter(Boolean)};await i(v)}return s.jsx(Zt,{open:e,size:"xl",title:u?"编辑工具定义":"新增工具定义",onClose:l,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:l,children:"取消"}),s.jsx(V,{loading:r,onClick:()=>void h(),children:u?"保存工具":"创建工具"})]}),children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"基本信息"}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"工具名称"}),s.jsx(ae,{value:o.name,onChange:x=>c(v=>({...v,name:x.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"HTTP 方法"}),s.jsxs(Ie,{value:o.method,onChange:x=>c(v=>({...v,method:x.target.value})),children:[s.jsx("option",{value:"",children:"请选择"}),t.http_methods.map(x=>s.jsx("option",{value:x,children:x},x))]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"API 类型"}),s.jsxs(Ie,{value:o.type,onChange:x=>c(v=>({...v,type:x.target.value})),children:[s.jsx("option",{value:"",children:"请选择"}),t.api_types.map(x=>s.jsx("option",{value:x,children:x},x))]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"API 分组"}),s.jsxs(Ie,{value:o.group,onChange:x=>c(v=>({...v,group:x.target.value})),children:[s.jsx("option",{value:"",children:"请选择"}),t.api_groups.map(x=>s.jsx("option",{value:x,children:x},x))]})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"URL 模板"}),s.jsx(ae,{value:o.url_template,onChange:x=>c(v=>({...v,url_template:x.target.value})),placeholder:"/dwf/v1/meta/entities/{class_name}"}),s.jsxs("p",{className:"text-xs text-slate-400",children:["变量参数请使用 ",s.jsx("code",{className:"font-mono",children:"{param_name}"})," 格式。"]})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"工具描述"}),s.jsx(_t,{rows:3,value:o.description,onChange:x=>c(v=>({...v,description:x.target.value}))})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"返回值描述"}),s.jsx(_t,{rows:2,value:o.returns,onChange:x=>c(v=>({...v,returns:x.target.value})),placeholder:"描述返回值结构、关键字段或异常情况。"})]})]})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"参数配置"}),s.jsx(V,{size:"sm",variant:"secondary",icon:Pe,onClick:()=>c(x=>({...x,parameters:[...x.parameters,vh({name:"",type:t.param_types[0]??"string",required:!0,description:""})]})),children:"添加参数"})]}),o.parameters.length===0?s.jsx("div",{className:"rounded-2xl border border-dashed border-slate-200 bg-slate-50 px-4 py-8 text-center text-sm text-slate-500",children:"暂无参数"}):s.jsx("div",{className:"space-y-3",children:o.parameters.map((x,v)=>s.jsxs("div",{className:"grid gap-3 rounded-2xl border border-slate-200 p-4 md:grid-cols-[1.4fr_1fr_auto_2fr_auto]",children:[s.jsx(ae,{value:x.name,onChange:w=>c(j=>{const m=[...j.parameters];return m[v]={...x,name:w.target.value},{...j,parameters:m}}),placeholder:"参数名"}),s.jsx(Ie,{value:x.type,onChange:w=>c(j=>{const m=[...j.parameters];return m[v]={...x,type:w.target.value},{...j,parameters:m}}),children:t.param_types.map(w=>s.jsx("option",{value:w,children:w},w))}),s.jsxs("label",{className:"inline-flex items-center gap-2 rounded-xl border border-slate-200 px-3 text-sm text-slate-600",children:[s.jsx("input",{type:"checkbox",checked:x.required,onChange:w=>c(j=>{const m=[...j.parameters];return m[v]={...x,required:w.target.checked},{...j,parameters:m}})}),"必填"]}),s.jsx(ae,{value:x.description??"",onChange:w=>c(j=>{const m=[...j.parameters];return m[v]={...x,description:w.target.value},{...j,parameters:m}}),placeholder:"参数说明"}),s.jsx(V,{size:"sm",variant:"ghost",icon:Ft,onClick:()=>c(w=>({...w,parameters:w.parameters.filter((j,m)=>m!==v)})),children:"删除"})]},x.localId))}),d.length>0?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-slate-500",children:"配置每个参数在HTTP请求中的位置(Headers、Query参数、Body参数)"}),s.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:f.map(({key:x,label:v,values:w})=>s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("h4",{className:"text-sm font-semibold text-slate-900",children:v}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:d.map(j=>s.jsx("button",{className:se("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",w.includes(j)?"border-indigo-200 bg-indigo-50 text-indigo-700":"border-slate-200 bg-white text-slate-500 hover:border-slate-300"),onClick:()=>c(m=>({...m,[x]:oy(m[x],j)})),type:"button",children:j},`${x}-${j}`))})]},x))})]}):null]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"调用示例"}),s.jsx(V,{size:"sm",variant:"secondary",icon:Pe,onClick:()=>c(x=>({...x,examples:[...x.examples,""]})),children:"添加示例"})]}),s.jsx("div",{className:"space-y-3",children:o.examples.map((x,v)=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(_t,{className:"min-w-0 flex-1",rows:2,value:x,onChange:w=>c(j=>{const m=[...j.examples];return m[v]=w.target.value,{...j,examples:m}}),placeholder:"例如:query_meta('Asset', language_type='zh-CN')"}),s.jsx("button",{type:"button",title:"删除示例","aria-label":"删除示例",onClick:()=>c(w=>({...w,examples:w.examples.length===1?[""]:w.examples.filter((j,m)=>m!==v)})),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:bg-slate-50 hover:text-rose-500",children:s.jsx(Ft,{className:"h-4 w-4"})})]},`example-${v}`))})]}),s.jsx("section",{className:"rounded-2xl border border-slate-200 p-4",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"高级设置"}),s.jsxs(J,{tone:o.evolution_enabled?"indigo":"slate",children:[s.jsx(pc,{className:"mr-1 h-3.5 w-3.5"}),"工具进化"]})]}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"启用后,调用上下文将进入工具进化任务流,由评估智能体进行优化。"})]}),s.jsxs("label",{className:"inline-flex items-center gap-2 rounded-full border border-slate-200 px-3 py-2 text-sm text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:o.evolution_enabled,onChange:x=>c(v=>({...v,evolution_enabled:x.target.checked}))}),"启用"]})]})})]})})}const uy={api_types:[],api_groups:[],http_methods:[],param_types:[]};function dy(){const{apiBaseUrl:e}=Tt(),{pushToast:t}=ct(),[n,r]=p.useState([]),[l,i]=p.useState(uy),[a,o]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(null),[h,x]=p.useState(""),[v,w]=p.useState({api_type:"",group:"",method:""}),[j,m]=p.useState(!1),[g,y]=p.useState(null),[k,N]=p.useState(!1),[S,b]=p.useState(null),M=Dr(h,200);async function B(){o(!0),u("");try{const[L,Q]=await Promise.all([wv(e),gc(e,{api_type:v.api_type||void 0,group:v.group||void 0,method:v.method||void 0})]);i(L),r(Q)}catch(L){u(Y(L))}finally{o(!1)}}p.useEffect(()=>{B()},[e,v.api_type,v.group,v.method]),p.useEffect(()=>{d&&(t({tone:d.tone,title:d.title,description:d.description}),f(null))},[d,t]);const T=n.filter(L=>{if(!M.trim())return!0;const Q=M.toLowerCase();return[L.name,L.description,L.group,L.type,L.method,L.url_template].join(" ").toLowerCase().includes(Q)});async function E(L){N(!0);try{g?(await kv(e,L),f({tone:"success",title:"工具已更新",description:L.name})):(await jv(e,L),f({tone:"success",title:"工具已创建",description:L.name})),m(!1),y(null),await B()}catch(Q){f({tone:"error",title:"工具保存失败",description:Y(Q)})}finally{N(!1)}}async function I(){if(S)try{await Nv(e,S.name),t({tone:"success",title:"工具已删除",description:S.name}),b(null),await B()}catch(L){f({tone:"error",title:"工具删除失败",description:Y(L)})}}const O=[{key:"tool",header:"工具",headerClassName:"w-[36%]",cellClassName:"w-[36%]",render:L=>s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("div",{className:"font-semibold text-slate-900",children:L.name}),s.jsx("p",{title:L.description||"暂无工具描述",className:"max-w-xl truncate text-sm text-slate-500",children:L.description||"暂无工具描述"})]})},{key:"tags",header:"标签",headerClassName:"w-[21%]",cellClassName:"w-[21%]",render:L=>s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(J,{tone:"slate",children:L.type}),s.jsx(J,{tone:"amber",children:L.group}),s.jsx(J,{tone:"green",children:L.method}),L.evolution_enabled?s.jsx(J,{tone:"indigo",children:"进化开启"}):null]})},{key:"url",header:"URL",headerClassName:"w-[25%]",cellClassName:"w-[25%]",render:L=>s.jsx("div",{title:L.url_template,className:"max-w-[320px] truncate font-mono text-xs text-slate-600",children:L.url_template})},{key:"summary",header:"摘要",headerClassName:"w-[180px]",cellClassName:"w-[180px]",render:L=>{var Q,K;return s.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[s.jsxs("div",{children:["参数 ",((Q=L.parameters)==null?void 0:Q.length)??0]}),s.jsxs("div",{children:["示例 ",((K=L.examples)==null?void 0:K.length)??0]}),s.jsx("div",{children:L.returns?"已定义返回值":"未定义返回值"})]})}},{key:"actions",header:"操作",headerClassName:"w-[72px]",cellClassName:"w-[72px]",render:L=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{icon:rr,label:"编辑工具",onClick:()=>{y(L),m(!0)}}),s.jsx(We,{icon:Ft,label:"删除工具",tone:"danger",onClick:()=>b(L)})]})}];return s.jsxs(s.Fragment,{children:[s.jsx(Si,{icon:lh,title:"工具管理",description:"配置和管理 DWF MCP 工具,修改后需重启 MCP 实例生效。",meta:s.jsxs(J,{tone:"indigo",children:[T.length," 个工具"]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void B(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{y(null),m(!0)},children:"新建工具"})]})}),s.jsxs(bi,{children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"搜索工具"}),s.jsxs("div",{className:"relative",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:h,onChange:L=>x(L.target.value),placeholder:"按名称、描述或 URL 搜索"})]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"服务类型"}),s.jsxs(Ie,{value:v.api_type,onChange:L=>w(Q=>({...Q,api_type:L.target.value})),children:[s.jsx("option",{value:"",children:"全部"}),l.api_types.map(L=>s.jsx("option",{value:L,children:L},L))]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"分组"}),s.jsxs(Ie,{value:v.group,onChange:L=>w(Q=>({...Q,group:L.target.value})),children:[s.jsx("option",{value:"",children:"全部"}),l.api_groups.map(L=>s.jsx("option",{value:L,children:L},L))]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"HTTP 方法"}),s.jsxs(Ie,{value:v.method,onChange:L=>w(Q=>({...Q,method:L.target.value})),children:[s.jsx("option",{value:"",children:"全部"}),l.http_methods.map(L=>s.jsx("option",{value:L,children:L},L))]})]})]}),a?s.jsx(gt,{label:"正在加载工具目录..."}):null,!a&&c?s.jsx(Mt,{description:c,onRetry:()=>void B()}):null,!a&&!c&&T.length===0?s.jsx(Ue,{icon:pc,title:"没有匹配的工具",description:"可以清空筛选,或者直接新建工具。",action:s.jsx(V,{icon:Pe,onClick:()=>{y(null),m(!0)},children:"新建工具"})}):null,!a&&!c&&T.length>0?s.jsx(Or,{columns:O,rows:T,rowKey:L=>L.name}):null,s.jsx(cy,{open:j,enums:l,tool:g,submitting:k,onClose:()=>{m(!1),y(null)},onSubmit:E}),s.jsx(Bt,{open:!!S,title:"删除工具定义",description:`工具“${(S==null?void 0:S.name)??""}”删除后将无法再被 MCP 实例引用。`,confirmText:"确认删除",variant:"danger",onClose:()=>b(null),onConfirm:()=>void I()})]})}function fy(e,t){if(t<=7)return Array.from({length:t},(i,a)=>a);const n=new Set([0,t-1,e-1,e,e+1]),r=Array.from(n).filter(i=>i>=0&&i<t).sort((i,a)=>i-a),l=[];return r.forEach((i,a)=>{a>0&&i-r[a-1]>1&&l.push("ellipsis"),l.push(i)}),l}function cd({currentPage:e,totalItems:t,pageSize:n,onPageChange:r}){const l=Math.max(1,Math.ceil(t/n)),i=fy(e,l);return s.jsxs("div",{className:"flex flex-col gap-3 border-t border-slate-100 px-1 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"text-sm text-slate-500",children:["共 ",t," 条,第 ",e+1," / ",l," 页"]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>r(e-1),disabled:e===0,className:"inline-flex h-9 items-center gap-1 rounded-xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50",children:[s.jsx(Og,{className:"h-4 w-4"}),"上一页"]}),i.map((a,o)=>a==="ellipsis"?s.jsx("div",{className:"inline-flex h-9 w-9 items-center justify-center text-slate-400",children:s.jsx(Qg,{className:"h-4 w-4"})},`ellipsis-${o}`):s.jsx("button",{type:"button",onClick:()=>r(a),className:se("inline-flex h-9 min-w-9 items-center justify-center rounded-xl border px-3 text-sm shadow-sm transition-colors",a===e?"border-indigo-600 bg-indigo-600 text-white":"border-slate-200 bg-white text-slate-700 hover:bg-slate-50"),children:a+1},a)),s.jsxs("button",{type:"button",onClick:()=>r(e+1),disabled:e>=l-1,className:"inline-flex h-9 items-center gap-1 rounded-xl border border-slate-200 bg-white px-3 text-sm text-slate-700 shadow-sm transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50",children:["下一页",s.jsx(ih,{className:"h-4 w-4"})]})]})]})}const fs={pending:{label:"待处理",tone:"amber"},processing:{label:"处理中",tone:"amber"},completed:{label:"评估完成",tone:"indigo"},adopted:{label:"已采纳",tone:"green"},rejected:{label:"已拒绝",tone:"rose"},failed:{label:"失败",tone:"rose"},no_evolution:{label:"无需进化",tone:"slate"}},ud={description:{label:"描述优化",tone:"indigo"},examples:{label:"示例优化",tone:"green"},parameters:{label:"参数优化",tone:"amber"}};function dd(e){return typeof e=="string"?e||"(空)":e===null?"null":e===void 0?"(空)":typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)}function py({open:e,apiBaseUrl:t,taskId:n,onClose:r,onUpdated:l}){const[i,a]=p.useState(null),[o,c]=p.useState(!1),[u,d]=p.useState(""),[f,h]=p.useState(!1),[x,v]=p.useState({}),[w,j]=p.useState(null);async function m(){if(n){c(!0),d("");try{const N=await Sv(t,n);a(N);const S={};N.suggestions.forEach((b,M)=>{S[M]=N.status==="completed"}),v(S)}catch(N){d(Y(N))}finally{c(!1)}}}p.useEffect(()=>{e&&n&&m()},[t,e,n]);const g=(i==null?void 0:i.status)==="completed",y=Object.entries(x).filter(([,N])=>N).map(([N])=>Number(N));async function k(){if(!(!i||!w)){h(!0);try{w==="adopt"?(await _v(t,i.id,y),l({tone:"success",title:"建议已采纳",description:`已采纳 ${y.length} 条建议。`})):(await Cv(t,i.id),l({tone:"info",title:"任务已拒绝",description:i.tool_name})),j(null),r()}catch(N){d(Y(N)),j(null)}finally{h(!1)}}}return s.jsxs(s.Fragment,{children:[s.jsxs(Zt,{open:e,size:"xl",title:"工具进化任务详情",onClose:r,footer:s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("div",{className:"text-sm text-slate-500",children:g?`已选 ${y.length} 条建议`:"当前任务不可采纳"}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(V,{variant:"secondary",onClick:r,children:"关闭"}),g?s.jsxs(s.Fragment,{children:[s.jsx(V,{variant:"secondary",onClick:()=>j("reject"),disabled:f,children:"拒绝建议"}),s.jsx(V,{onClick:()=>j("adopt"),disabled:y.length===0||f,children:"采纳建议"})]}):null]})]}),children:[o?s.jsx(gt,{label:"正在加载任务详情..."}):null,!o&&u?s.jsx(Mt,{description:u,onRetry:()=>void m()}):null,!o&&!u&&i?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:i.tool_name}),s.jsx(J,{tone:fs[i.status].tone,children:fs[i.status].label}),s.jsx(J,{tone:i.is_success?"green":"rose",children:i.is_success?"执行成功":"执行失败"})]}),s.jsxs("div",{className:"mt-4 grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4",children:[s.jsx("div",{className:"text-sm text-slate-500",children:"创建时间"}),s.jsx("div",{className:"mt-2 text-sm font-semibold text-slate-900",children:mt(i.created_at)})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4",children:[s.jsx("div",{className:"text-sm text-slate-500",children:"处理时间"}),s.jsx("div",{className:"mt-2 text-sm font-semibold text-slate-900",children:mt(i.processed_at)})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4",children:[s.jsx("div",{className:"text-sm text-slate-500",children:"确认时间"}),s.jsx("div",{className:"mt-2 text-sm font-semibold text-slate-900",children:mt(i.confirmed_at)})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4",children:[s.jsx("div",{className:"text-sm text-slate-500",children:"建议数量"}),s.jsx("div",{className:"mt-2 text-sm font-semibold text-slate-900",children:i.suggestions.length})]})]})]}),s.jsxs("section",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"调用上下文"}),s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4",children:[s.jsx("div",{className:"text-sm font-medium text-slate-700",children:"LLM 原始查询"}),s.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm leading-6 text-slate-600",children:i.llm_query||"(空)"}),i.error_message?s.jsx("p",{className:"mt-3 text-sm text-rose-600",children:i.error_message}):null]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsx(bl,{title:"调用参数",value:i.call_parameters}),s.jsx(bl,{title:"执行结果",value:i.execution_result})]}),s.jsx(bl,{title:"API定义快照",value:i.api_definition_snapshot})]})]}),s.jsxs("section",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"进化建议"}),s.jsx("div",{className:"mt-4 space-y-4",children:i.suggestions.length>0?i.suggestions.map((N,S)=>s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[g?s.jsx("input",{type:"checkbox",checked:!!x[S],onChange:b=>v(M=>({...M,[S]:b.target.checked}))}):null,s.jsxs("span",{className:"text-sm font-semibold text-slate-900",children:["建议 ",S+1]}),s.jsx(J,{tone:ud[N.suggestion_type].tone,children:ud[N.suggestion_type].label}),N.field_name?s.jsx(J,{tone:"slate",children:N.field_name}):null]}),s.jsxs("div",{className:"mt-5 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-[88px_1fr] md:items-start",children:[s.jsx("div",{className:"pt-1 text-sm font-medium text-slate-500",children:"原始值"}),s.jsx("div",{className:"rounded-2xl bg-slate-50 px-4 py-3",children:s.jsx("pre",{className:"whitespace-pre-wrap break-all text-sm leading-7 text-slate-400 line-through decoration-slate-300",children:dd(N.original_value)})})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-[88px_1fr] md:items-start",children:[s.jsx("div",{className:"pt-1 text-sm font-medium text-slate-500",children:"建议值"}),s.jsx("div",{className:"rounded-2xl bg-emerald-50/70 px-4 py-3",children:s.jsx("pre",{className:"whitespace-pre-wrap break-all text-sm font-medium leading-7 text-emerald-700",children:dd(N.suggested_value)})})]}),s.jsxs("div",{className:"grid gap-3 border-t border-slate-100 pt-4 md:grid-cols-[88px_1fr] md:items-start",children:[s.jsx("div",{className:"pt-1 text-sm font-medium text-slate-500",children:"理由"}),s.jsx("p",{className:"text-sm italic leading-7 text-slate-500",children:N.reason})]})]})]},`${N.suggestion_type}-${S}`)):i.status==="pending"||i.status==="processing"?s.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-5 text-sm text-slate-500",children:"工具进化仍在评估中,请稍后重新查看。"}):s.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 px-4 py-5 text-sm text-slate-500",children:"当前没有可采纳建议。"})})]})]}):null]}),s.jsx(Bt,{open:w==="adopt",title:"采纳选中的建议",description:`将把 ${y.length} 条建议写回工具定义。此操作会影响工具后续行为。`,confirmText:f?"处理中...":"确认采纳",onClose:()=>j(null),onConfirm:()=>void k()}),s.jsx(Bt,{open:w==="reject",title:"拒绝当前任务",description:"拒绝后任务将标记为 rejected,本次评估结果不会写回工具定义。",confirmText:f?"处理中...":"确认拒绝",variant:"warning",onClose:()=>j(null),onConfirm:()=>void k()})]})}const ia=20,cl=0;function hy(){const{apiBaseUrl:e}=Tt(),{pushToast:t}=ct(),[n,r]=p.useState([]),[l,i]=p.useState(0),[a,o]=p.useState(cl),[c,u]=p.useState([]),[d,f]=p.useState(!0),[h,x]=p.useState(""),[v,w]=p.useState(null),[j,m]=p.useState(""),[g,y]=p.useState(""),[k,N]=p.useState(""),[S,b]=p.useState(""),[M,B]=p.useState(null),T=Dr(k,180);async function E(){try{const z=await gc(e);u(z.map(_=>_.name))}catch{u([])}}async function I(z=a){f(!0),x("");try{const _=await bv(e,{page:z,page_size:ia,status:j||void 0,tool_name:g||void 0});r(_.items),i(_.total_count)}catch(_){x(Y(_))}finally{f(!1)}}async function O(){await Promise.all([I(a),E()])}p.useEffect(()=>{E()},[e]),p.useEffect(()=>{I(a)},[e,a,j,g]),p.useEffect(()=>{v&&(t({tone:v.tone,title:v.title,description:v.description}),w(null))},[v,t]);const L=n.filter(z=>{if(!T.trim())return!0;const _=T.toLowerCase();return[z.tool_name,z.status,z.error_message,z.llm_query].join(" ").toLowerCase().includes(_)});async function Q(){if(M)try{if(await Ev(e,M.id),t({tone:"success",title:"进化任务已删除",description:M.tool_name}),B(null),n.length===1&&a>cl){o(z=>z-1);return}await I(a)}catch(z){w({tone:"error",title:"删除任务失败",description:Y(z)})}}const K=[{key:"tool",header:"工具名称",headerClassName:"w-[56%]",cellClassName:"w-[56%]",render:z=>s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("div",{className:"truncate font-semibold text-slate-900",children:z.tool_name}),s.jsx(J,{tone:z.is_success?"green":"rose",children:z.is_success?"调用成功":"调用失败"})]}),s.jsx("p",{title:z.error_message||z.llm_query||"该任务没有记录内容。",className:"block w-full truncate text-sm text-slate-500",children:z.error_message||z.llm_query||"该任务没有记录内容。"})]})},{key:"status",header:"任务状态",headerClassName:"w-[16%]",cellClassName:"w-[16%]",render:z=>s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(J,{tone:fs[z.status].tone,children:fs[z.status].label})})},{key:"summary",header:"信息",headerClassName:"w-[180px]",cellClassName:"w-[180px]",render:z=>s.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[s.jsxs("div",{children:[z.suggestions.length," 条建议"]}),s.jsx("div",{children:mt(z.created_at)})]})},{key:"actions",header:"操作",headerClassName:"w-[72px]",cellClassName:"w-[72px]",render:z=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{icon:oh,label:"查看详情",onClick:()=>b(z.id)}),s.jsx(We,{icon:Ft,label:"删除任务",tone:"danger",onClick:()=>B(z)})]})}],R=n.filter(z=>z.status==="pending"||z.status==="processing").length,C=n.filter(z=>z.status==="completed").length,D=n.filter(z=>z.status==="adopted").length,U=n.filter(z=>z.status==="rejected").length,F=n.filter(z=>z.status==="no_evolution").length,G=D+U+F;return s.jsxs(s.Fragment,{children:[s.jsx(Si,{icon:ch,title:"工具进化任务",description:"管理和查看 MCP 工具进化任务,审核优化建议",meta:s.jsxs(J,{tone:"indigo",children:[l," 条任务"]}),actions:s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void O(),children:"刷新"})}),s.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-300 bg-slate-100 px-4 py-4",children:[s.jsx("p",{className:"text-sm text-slate-600",children:"任务总数"}),s.jsx("p",{className:"mt-2 text-2xl font-bold text-slate-950",children:l})]}),s.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50/90 px-4 py-4",children:[s.jsx("p",{className:"text-sm text-amber-700",children:"待处理 / 处理中"}),s.jsx("p",{className:"mt-2 text-2xl font-bold text-amber-950",children:R})]}),s.jsxs("div",{className:"rounded-2xl border border-indigo-200 bg-indigo-50/80 px-4 py-4",children:[s.jsx("p",{className:"text-sm text-indigo-700",children:"等待人工审核"}),s.jsx("p",{className:"mt-2 text-2xl font-bold text-indigo-950",children:C})]}),s.jsxs("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50/80 px-4 py-4",children:[s.jsx("p",{className:"text-sm text-emerald-700",children:"已完成"}),s.jsxs("div",{className:"mt-2 flex items-end gap-4",children:[s.jsx("p",{className:"text-2xl font-bold text-emerald-950",children:G}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 pb-1 text-xs text-emerald-700/70",children:[s.jsxs("span",{children:["已采纳 ",D]}),s.jsxs("span",{children:["已拒绝 ",U]}),s.jsxs("span",{children:["无需进化 ",F]})]})]})]})]}),s.jsxs(bi,{children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"任务状态"}),s.jsxs(Ie,{value:j,onChange:z=>{m(z.target.value),o(cl)},children:[s.jsx("option",{value:"",children:"全部"}),Object.entries(fs).map(([z,_])=>s.jsx("option",{value:z,children:_.label},z))]})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"工具名称"}),s.jsxs(Ie,{value:g,onChange:z=>{y(z.target.value),o(cl)},children:[s.jsx("option",{value:"",children:"全部"}),c.map(z=>s.jsx("option",{value:z,children:z},z))]})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2 xl:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"搜索任务"}),s.jsxs("div",{className:"relative",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{className:"pl-9",value:k,onChange:z=>N(z.target.value),placeholder:"按工具名、状态、报错或查询内容搜索"})]})]})]}),d?s.jsx(gt,{label:"正在加载进化任务..."}):null,!d&&h?s.jsx(Mt,{description:h,onRetry:()=>void I(a)}):null,!d&&!h&&n.length===0?s.jsx(Ue,{icon:Ug,title:"暂无进化任务",description:"当前没有任务记录。"}):null,!d&&!h&&n.length>0&&L.length===0?s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ue,{icon:St,title:"当前页没有匹配任务",description:"可以调整筛选条件或切换页码继续查看。"}),s.jsx(cd,{currentPage:a,pageSize:ia,totalItems:l,onPageChange:o})]}):null,!d&&!h&&L.length>0?s.jsxs("div",{className:"space-y-4",children:[s.jsx(Or,{columns:K,rows:L,rowKey:z=>z.id}),s.jsx(cd,{currentPage:a,pageSize:ia,totalItems:l,onPageChange:o})]}):null,s.jsx(py,{open:!!S,apiBaseUrl:e,taskId:S,onClose:()=>b(""),onUpdated:z=>{w(z),I(a)}}),s.jsx(Bt,{open:!!M,title:"删除进化任务",description:`任务“${(M==null?void 0:M.tool_name)??""}”删除后将无法再回看这次评估上下文。`,confirmText:"确认删除",variant:"danger",onClose:()=>B(null),onConfirm:()=>void Q()})]})}function my(){return s.jsx(nh,{})}const aa=new Map;async function fe(e,t,n={}){var d;const r=new URL(`${e}${t}`);Object.entries(n.query??{}).forEach(([f,h])=>{h!=null&&h!==""&&r.searchParams.set(f,String(h))});const l=(n.method??"GET").toUpperCase(),i=((d=n.backendBaseUrl)==null?void 0:d.trim())||"",a=`${l}:${r.toString()}:backend=${i}`,o=async()=>{const f=await fetch(r.toString(),{...n,method:l,headers:{"Content-Type":"application/json",...n.headers??{}}});if(!f.ok){const h=await f.json().catch(()=>null);throw new Error((h==null?void 0:h.detail)??`${f.status} ${f.statusText}`)}if(f.status!==204)return f.json()};if(l!=="GET")return o();const c=aa.get(a);if(c)return c;const u=o().finally(()=>{aa.delete(a)});return aa.set(a,u),u}async function yh(e){return fe(e,"/providers")}async function wh(e){return fe(e,"/model-categories")}async function xy(e,t){return fe(e,"/providers",{method:"POST",body:JSON.stringify(t)})}async function gy(e,t,n){return fe(e,`/providers/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function vy(e,t){return fe(e,`/providers/${t}`,{method:"DELETE"})}async function yy(e,t){return fe(e,`/providers/${t}/test`,{method:"POST"})}async function jh(e){return fe(e,"/mcp/connectors")}async function wy(e,t){return fe(e,"/mcp/connectors",{method:"POST",body:JSON.stringify(t)})}async function jy(e,t,n){return fe(e,`/mcp/connectors/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function ky(e,t){return fe(e,`/mcp/connectors/${t}`,{method:"DELETE"})}async function kh(e,t){return fe(e,`/mcp/connectors/${t}/test`,{method:"POST"})}async function Ny(e,t,n){return fe(e,"/mcp/test",{method:"POST",body:JSON.stringify(t),backendBaseUrl:n})}async function by(e,t={},n){return fe(e,"/mcp/backend",{query:t,backendBaseUrl:n})}async function Nh(e,t={}){return fe(e,"/agents",{query:t})}async function Sy(e,t){return fe(e,"/agents",{method:"POST",body:JSON.stringify(t)})}async function _y(e,t,n){return fe(e,`/agents/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function Cy(e,t){return fe(e,`/agents/${t}`,{method:"DELETE"})}async function bh(e){return fe(e,"/skills")}async function Ey(e,t){return fe(e,`/skills/${t}`)}async function Py(e,t){return fe(e,"/skills",{method:"POST",body:JSON.stringify(t)})}async function Ty(e,t){const n=await fetch(`${e}/skills/upload`,{method:"POST",headers:{"Content-Type":"application/zip"},body:await t.arrayBuffer()});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)??`${n.status} ${n.statusText}`)}return n.json()}async function fd(e,t,n){return fe(e,`/skills/${t}`,{method:"PUT",body:JSON.stringify(n)})}async function My(e,t){return fe(e,`/skills/${t}`,{method:"DELETE"})}async function Ry(e,t={}){return fe(e,"/sessions",{query:t})}async function pd(e,t){return fe(e,"/sessions",{method:"POST",body:JSON.stringify(t)})}async function Ay(e,t){return fe(e,`/sessions/${t}`,{method:"DELETE"})}async function Ly(e,t){return fe(e,`/sessions/${t}/messages`)}async function Iy(e,t,n,r){return fe(e,`/sessions/${t}/messages`,{method:"POST",body:JSON.stringify(n),backendBaseUrl:r})}async function zy(e,t){return fe(e,`/runs/${t}/abort`,{method:"POST"})}async function $y(e,t,n){return fetch(`${e}/runs/${t}/stream`,{method:"GET",headers:{Accept:"text/event-stream"},signal:n})}function Dy({open:e,agents:t,selectedAgentId:n,sessions:r,selectedSessionId:l,sessionsLoading:i,disabled:a,onClose:o,onAgentChange:c,onCreateSession:u,onSelectSession:d,onDeleteSession:f,deletingSessionId:h}){const[x,v]=p.useState(""),w=p.useMemo(()=>{const j=x.trim().toLowerCase();return j?r.filter(m=>(m.title||"").toLowerCase().includes(j)):r},[x,r]);return e?s.jsxs("div",{className:"absolute inset-0 z-30",children:[s.jsx("button",{className:"absolute inset-0 bg-slate-950/18 backdrop-blur-[2px] animate-fade-in",onClick:o}),s.jsxs("div",{className:"absolute inset-y-0 left-0 flex w-[320px] max-w-[85vw] animate-slide-up flex-col border-r border-slate-200 bg-[#f8f7f4] shadow-[0_32px_80px_rgba(15,23,42,0.16)]",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 px-5 py-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-900",children:[s.jsx(uh,{className:"h-4 w-4 text-slate-500"}),"对话与 Agent"]}),s.jsx("button",{className:"rounded-xl p-2 text-slate-400 transition hover:bg-white hover:text-slate-700",onClick:o,children:s.jsx(Ni,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"space-y-4 border-b border-slate-200 px-5 py-4",children:s.jsxs("label",{className:"block space-y-2",children:[s.jsx("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"当前 Agent"}),s.jsx(Ie,{value:n,disabled:a,onChange:j=>c(j.target.value),children:t.map(j=>s.jsxs("option",{value:j.id,children:[j.name,j.enabled?"":"(已停用)"]},j.id))})]})}),s.jsxs("div",{className:"scrollbar-subtle flex-1 overflow-y-auto px-4 py-4",children:[s.jsx("div",{className:"mb-2 px-2 text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"最近会话"}),s.jsxs("div",{className:"mb-4 flex items-center gap-2 px-1",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(St,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),s.jsx(ae,{value:x,onChange:j=>v(j.target.value),placeholder:"搜索会话...",className:"bg-white pl-9"})]}),s.jsx("button",{type:"button",disabled:a,onClick:u,title:"新建会话",className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-500 shadow-sm transition hover:border-slate-300 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50",children:s.jsx(Pe,{className:"h-4 w-4"})})]}),i?s.jsx("div",{className:"px-2 py-8 text-sm text-slate-500",children:"正在加载会话..."}):w.length?s.jsx("div",{className:"space-y-2",children:w.map(j=>s.jsxs("div",{className:se("rounded-2xl border px-4 py-3 transition",l===j.id?"border-indigo-200 bg-white shadow-sm ring-1 ring-indigo-100":"border-transparent bg-transparent hover:border-slate-200 hover:bg-white"),children:[s.jsx("button",{type:"button",disabled:a,onClick:()=>{d(j.id),o()},className:"block w-full text-left disabled:cursor-not-allowed disabled:opacity-50",children:s.jsx("div",{className:"truncate text-sm font-semibold text-slate-900",children:j.title||"新会话"})}),s.jsxs("div",{className:"mt-2 flex items-end justify-between gap-3",children:[s.jsx("div",{className:"text-xs text-slate-500",children:mt(j.last_message_at||j.updated_at)}),s.jsx("button",{type:"button",disabled:a||h===j.id,onClick:()=>f(j),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl text-rose-400 transition hover:bg-rose-50 hover:text-rose-600 disabled:cursor-not-allowed disabled:opacity-50",title:"删除会话",children:s.jsx(Ft,{className:"h-4 w-4"})})]})]},j.id))}):s.jsx("div",{className:"px-2 py-8 text-sm text-slate-500",children:x?"没有匹配的会话":"还没有会话,先新建一个。"})]})]})]}):null}function yc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sr=yc();function Sh(e){sr=e}var ps={exec:()=>null};function ue(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(l,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ye.caret,"$1"),n=n.replace(l,a),r},getRegex:()=>new RegExp(n,t)};return r}var Ye={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Oy=/^(?:[ \t]*(?:\n|$))+/,Fy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,By=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Uy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wc=/(?:[*+-]|\d{1,9}[.)])/,_h=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ch=ue(_h).replace(/bull/g,wc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wy=ue(_h).replace(/bull/g,wc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),jc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hy=/^[^\n]+/,kc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Vy=ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qy=ue(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wc).getRegex(),_i="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Nc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,qy=ue("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Nc).replace("tag",_i).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Eh=ue(jc).replace("hr",Fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_i).getRegex(),Ky=ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Eh).getRegex(),bc={blockquote:Ky,code:Fy,def:Vy,fences:By,heading:Uy,hr:Fs,html:qy,lheading:Ch,list:Qy,newline:Oy,paragraph:Eh,table:ps,text:Hy},hd=ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_i).getRegex(),Gy={...bc,lheading:Wy,table:hd,paragraph:ue(jc).replace("hr",Fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_i).getRegex()},Zy={...bc,html:ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Nc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ps,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ue(jc).replace("hr",Fs).replace("heading",` *#{1,6} *[^
341
+ ]`).replace("lheading",Ch).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Jy=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ph=/^( {2,}|\\)\n(?!\s*$)/,Yy=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ci=/[\p{P}\p{S}]/u,Sc=/[\s\p{P}\p{S}]/u,Th=/[^\s\p{P}\p{S}]/u,e1=ue(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sc).getRegex(),Mh=/(?!~)[\p{P}\p{S}]/u,t1=/(?!~)[\s\p{P}\p{S}]/u,n1=/(?:[^\s\p{P}\p{S}]|~)/u,r1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Rh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,s1=ue(Rh,"u").replace(/punct/g,Ci).getRegex(),l1=ue(Rh,"u").replace(/punct/g,Mh).getRegex(),Ah="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",i1=ue(Ah,"gu").replace(/notPunctSpace/g,Th).replace(/punctSpace/g,Sc).replace(/punct/g,Ci).getRegex(),a1=ue(Ah,"gu").replace(/notPunctSpace/g,n1).replace(/punctSpace/g,t1).replace(/punct/g,Mh).getRegex(),o1=ue("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Th).replace(/punctSpace/g,Sc).replace(/punct/g,Ci).getRegex(),c1=ue(/\\(punct)/,"gu").replace(/punct/g,Ci).getRegex(),u1=ue(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),d1=ue(Nc).replace("(?:-->|$)","-->").getRegex(),f1=ue("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",d1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ti=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,p1=ue(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ti).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lh=ue(/^!?\[(label)\]\[(ref)\]/).replace("label",ti).replace("ref",kc).getRegex(),Ih=ue(/^!?\[(ref)\](?:\[\])?/).replace("ref",kc).getRegex(),h1=ue("reflink|nolink(?!\\()","g").replace("reflink",Lh).replace("nolink",Ih).getRegex(),_c={_backpedal:ps,anyPunctuation:c1,autolink:u1,blockSkip:r1,br:Ph,code:Xy,del:ps,emStrongLDelim:s1,emStrongRDelimAst:i1,emStrongRDelimUnd:o1,escape:Jy,link:p1,nolink:Ih,punctuation:e1,reflink:Lh,reflinkSearch:h1,tag:f1,text:Yy,url:ps},m1={..._c,link:ue(/^!?\[(label)\]\((.*?)\)/).replace("label",ti).getRegex(),reflink:ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ti).getRegex()},oo={..._c,emStrongRDelimAst:a1,emStrongLDelim:l1,url:ue(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},x1={...oo,br:ue(Ph).replace("{2,}","*").getRegex(),text:ue(oo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ul={normal:bc,gfm:Gy,pedantic:Zy},Gr={normal:_c,gfm:oo,breaks:x1,pedantic:m1},g1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},md=e=>g1[e];function Vt(e,t){if(t){if(Ye.escapeTest.test(e))return e.replace(Ye.escapeReplace,md)}else if(Ye.escapeTestNoEncode.test(e))return e.replace(Ye.escapeReplaceNoEncode,md);return e}function xd(e){try{e=encodeURI(e).replace(Ye.percentDecode,"%")}catch{return null}return e}function gd(e,t){var i;const n=e.replace(Ye.findPipe,(a,o,c)=>{let u=!1,d=o;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),r=n.split(Ye.splitPipe);let l=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;l<r.length;l++)r[l]=r[l].trim().replace(Ye.slashPipe,"|");return r}function Zr(e,t,n){const r=e.length;if(r===0)return"";let l=0;for(;l<r&&e.charAt(r-l-1)===t;)l++;return e.slice(0,r-l)}function v1(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function vd(e,t,n,r,l){const i=t.href,a=t.title||null,o=e[1].replace(l.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,c}function y1(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const l=r[1];return t.split(`
342
+ `).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[o]=a;return o.length>=l.length?i.slice(l.length):i}).join(`
343
+ `)}var ni=class{constructor(e){pe(this,"options");pe(this,"rules");pe(this,"lexer");this.options=e||sr}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zr(n,`
344
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=y1(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Zr(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Zr(t[0],`
345
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Zr(t[0],`
346
+ `).split(`
347
+ `),r="",l="";const i=[];for(;n.length>0;){let a=!1;const o=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))o.push(n[c]),a=!0;else if(!a)o.push(n[c]);else break;n=n.slice(c);const u=o.join(`
348
+ `),d=u.replace(this.rules.other.blockquoteSetextReplace,`
349
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
350
+ ${u}`:u,l=l?`${l}
351
+ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;const h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const x=h,v=x.raw+`
352
+ `+n.join(`
353
+ `),w=this.blockquote(v);i[i.length-1]=w,r=r.substring(0,r.length-x.raw.length)+w.raw,l=l.substring(0,l.length-x.text.length)+w.text;break}else if((h==null?void 0:h.type)==="list"){const x=h,v=x.raw+`
354
+ `+n.join(`
355
+ `),w=this.list(v);i[i.length-1]=w,r=r.substring(0,r.length-h.raw.length)+w.raw,l=l.substring(0,l.length-x.raw.length)+w.raw,n=v.substring(i.at(-1).raw.length).split(`
356
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:l}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,l={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let c=!1,u="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(`
357
+ `,1)[0].replace(this.rules.other.listReplaceTabs,m=>" ".repeat(3*m.length)),h=e.split(`
358
+ `,1)[0],x=!f.trim(),v=0;if(this.options.pedantic?(v=2,d=f.trimStart()):x?v=t[1].length+1:(v=t[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=f.slice(v),v+=t[1].length),x&&this.rules.other.blankLine.test(h)&&(u+=h+`
359
+ `,e=e.substring(h.length+1),c=!0),!c){const m=this.rules.other.nextBulletRegex(v),g=this.rules.other.hrRegex(v),y=this.rules.other.fencesBeginRegex(v),k=this.rules.other.headingBeginRegex(v),N=this.rules.other.htmlBeginRegex(v);for(;e;){const S=e.split(`
360
+ `,1)[0];let b;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),b=h):b=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||k.test(h)||N.test(h)||m.test(h)||g.test(h))break;if(b.search(this.rules.other.nonSpaceChar)>=v||!h.trim())d+=`
361
+ `+b.slice(v);else{if(x||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(f)||k.test(f)||g.test(f))break;d+=`
362
+ `+h}!x&&!h.trim()&&(x=!0),u+=S+`
363
+ `,e=e.substring(S.length+1),f=b.slice(v)}}l.loose||(a?l.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let w=null,j;this.options.gfm&&(w=this.rules.other.listIsTask.exec(d),w&&(j=w[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:u,task:!!w,checked:j,loose:!1,text:d,tokens:[]}),l.raw+=u}const o=l.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let c=0;c<l.items.length;c++)if(this.lexer.state.top=!1,l.items[c].tokens=this.lexer.blockTokens(l.items[c].text,[]),!l.loose){const u=l.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));l.loose=d}if(l.loose)for(let c=0;c<l.items.length;c++)l.items[c].loose=!0;return l}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:l}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=gd(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
364
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(const o of l)i.rows.push(gd(o,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
365
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Zr(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=v1(t[2],"()");if(i===-2)return;if(i>-1){const o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],l="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],l=i[3])}else l=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),vd(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=t[r.toLowerCase()];if(!l){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return vd(n,l,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...r[0]].length-1;let a,o,c=i,u=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){u+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+u);const f=[...r[0]][0].length,h=e.slice(0,i+r.index+f+o);if(Math.min(i,o)%2){const v=h.slice(1,-1);return{type:"em",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}const x=h.slice(2,-2);return{type:"strong",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),l=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&l&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,l;if(t[2]==="@")r=t[0],l="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?l="http://"+t[0]:l=t[0]}return{type:"link",raw:t[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},nn=class co{constructor(t){pe(this,"tokens");pe(this,"options");pe(this,"state");pe(this,"tokenizer");pe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||sr,this.options.tokenizer=this.options.tokenizer||new ni,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Ye,block:ul.normal,inline:Gr.normal};this.options.pedantic?(n.block=ul.pedantic,n.inline=Gr.pedantic):this.options.gfm&&(n.block=ul.gfm,this.options.breaks?n.inline=Gr.breaks:n.inline=Gr.gfm),this.tokenizer.rules=n}static get rules(){return{block:ul,inline:Gr}}static lex(t,n){return new co(n).lex(t)}static lexInline(t,n){return new co(n).inlineTokens(t)}lex(t){t=t.replace(Ye.carriageReturn,`
366
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var l,i,a;for(this.options.pedantic&&(t=t.replace(Ye.tabCharGlobal," ").replace(Ye.spaceLine,""));t;){let o;if((i=(l=this.options.extensions)==null?void 0:l.block)!=null&&i.some(u=>(o=u.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);const u=n.at(-1);o.raw.length===1&&u!==void 0?u.raw+=`
367
+ `:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
368
+ `+o.raw,u.text+=`
369
+ `+o.text,this.inlineQueue.at(-1).src=u.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
370
+ `+o.raw,u.text+=`
371
+ `+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
372
+ `+o.raw,u.text+=`
373
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(o),r=c.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
374
+ `+o.raw,u.text+=`
375
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(o);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var o,c,u;let r=t,l=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,l.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(l=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((c=(o=this.options.extensions)==null?void 0:o.inline)!=null&&c.some(h=>(d=h.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const h=n.at(-1);d.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,a)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let h=1/0;const x=t.slice(1);let v;this.options.extensions.startInline.forEach(w=>{v=w.call({lexer:this},x),typeof v=="number"&&v>=0&&(h=Math.min(h,v))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},ri=class{constructor(e){pe(this,"options");pe(this,"parser");this.options=e||sr}space(e){return""}code({text:e,lang:t,escaped:n}){var i;const r=(i=(t||"").match(Ye.notSpaceStart))==null?void 0:i[0],l=e.replace(Ye.endingNewline,"")+`
376
+ `;return r?'<pre><code class="language-'+Vt(r)+'">'+(n?l:Vt(l,!0))+`</code></pre>
377
+ `:"<pre><code>"+(n?l:Vt(l,!0))+`</code></pre>
378
+ `}blockquote({tokens:e}){return`<blockquote>
379
+ ${this.parser.parse(e)}</blockquote>
380
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
381
+ `}hr(e){return`<hr>
382
+ `}list(e){const t=e.ordered,n=e.start;let r="";for(let a=0;a<e.items.length;a++){const o=e.items[a];r+=this.listitem(o)}const l=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+l+i+`>
383
+ `+r+"</"+l+`>
384
+ `}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Vt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
385
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
386
+ `}table(e){let t="",n="";for(let l=0;l<e.header.length;l++)n+=this.tablecell(e.header[l]);t+=this.tablerow({text:n});let r="";for(let l=0;l<e.rows.length;l++){const i=e.rows[l];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
387
+ <thead>
388
+ `+t+`</thead>
389
+ `+r+`</table>
390
+ `}tablerow({text:e}){return`<tr>
391
+ ${e}</tr>
392
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
393
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Vt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),l=xd(e);if(l===null)return r;e=l;let i='<a href="'+e+'"';return t&&(i+=' title="'+Vt(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const l=xd(e);if(l===null)return Vt(n);e=l;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${Vt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Vt(e.text)}},Cc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},rn=class uo{constructor(t){pe(this,"options");pe(this,"renderer");pe(this,"textRenderer");this.options=t||sr,this.options.renderer=this.options.renderer||new ri,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Cc}static parse(t,n){return new uo(n).parse(t)}static parseInline(t,n){return new uo(n).parseInline(t)}parse(t,n=!0){var l,i;let r="";for(let a=0;a<t.length;a++){const o=t[a];if((i=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&i[o.type]){const u=o,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=d||"";continue}}const c=o;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],d+=`
394
+ `+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):r+=d;continue}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(t,n=this.renderer){var l,i;let r="";for(let a=0;a<t.length;a++){const o=t[a];if((i=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&i[o.type]){const u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=u||"";continue}}const c=o;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},ua,Sl=(ua=class{constructor(e){pe(this,"options");pe(this,"block");this.options=e||sr}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?nn.lex:nn.lexInline}provideParser(){return this.block?rn.parse:rn.parseInline}},pe(ua,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),ua),w1=class{constructor(...e){pe(this,"defaults",yc());pe(this,"options",this.setOptions);pe(this,"parse",this.parseMarkdown(!0));pe(this,"parseInline",this.parseMarkdown(!1));pe(this,"Parser",rn);pe(this,"Renderer",ri);pe(this,"TextRenderer",Cc);pe(this,"Lexer",nn);pe(this,"Tokenizer",ni);pe(this,"Hooks",Sl);this.use(...e)}walkTokens(e,t){var r,l;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const o of a.header)n=n.concat(this.walkTokens(o.tokens,t));for(const o of a.rows)for(const c of o)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=i;(l=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&l[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{const c=a[o].flat(1/0);n=n.concat(this.walkTokens(c,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const i=t.renderers[l.name];i?t.renderers[l.name]=function(...a){let o=l.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:t.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[l.level];i?i.unshift(l.tokenizer):t[l.level]=[l.tokenizer],l.start&&(l.level==="block"?t.startBlock?t.startBlock.push(l.start):t.startBlock=[l.start]:l.level==="inline"&&(t.startInline?t.startInline.push(l.start):t.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(t.childTokens[l.name]=l.childTokens)}),r.extensions=t),n.renderer){const l=this.defaults.renderer||new ri(this.defaults);for(const i in n.renderer){if(!(i in l))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,o=n.renderer[a],c=l[a];l[a]=(...u)=>{let d=o.apply(l,u);return d===!1&&(d=c.apply(l,u)),d||""}}r.renderer=l}if(n.tokenizer){const l=this.defaults.tokenizer||new ni(this.defaults);for(const i in n.tokenizer){if(!(i in l))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,o=n.tokenizer[a],c=l[a];l[a]=(...u)=>{let d=o.apply(l,u);return d===!1&&(d=c.apply(l,u)),d}}r.tokenizer=l}if(n.hooks){const l=this.defaults.hooks||new Sl;for(const i in n.hooks){if(!(i in l))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,o=n.hooks[a],c=l[a];Sl.passThroughHooks.has(i)?l[a]=u=>{if(this.defaults.async)return Promise.resolve(o.call(l,u)).then(f=>c.call(l,f));const d=o.call(l,u);return c.call(l,d)}:l[a]=(...u)=>{let d=o.apply(l,u);return d===!1&&(d=c.apply(l,u)),d}}r.hooks=l}if(n.walkTokens){const l=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),l&&(o=o.concat(l.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nn.lex(e,t??this.defaults)}parser(e,t){return rn.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const l={...r},i={...this.defaults,...l},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&l.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const o=i.hooks?i.hooks.provideLexer():e?nn.lex:nn.lexInline,c=i.hooks?i.hooks.provideParser():e?rn.parse:rn.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(u=>o(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>c(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let u=o(n,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let d=c(u,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(u){return a(u)}}}onError(e,t){return n=>{if(n.message+=`
395
+ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+Vt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},er=new w1;function ce(e,t){return er.parse(e,t)}ce.options=ce.setOptions=function(e){return er.setOptions(e),ce.defaults=er.defaults,Sh(ce.defaults),ce};ce.getDefaults=yc;ce.defaults=sr;ce.use=function(...e){return er.use(...e),ce.defaults=er.defaults,Sh(ce.defaults),ce};ce.walkTokens=function(e,t){return er.walkTokens(e,t)};ce.parseInline=er.parseInline;ce.Parser=rn;ce.parser=rn.parse;ce.Renderer=ri;ce.TextRenderer=Cc;ce.Lexer=nn;ce.lexer=nn.lex;ce.Tokenizer=ni;ce.Hooks=Sl;ce.parse=ce;ce.options;ce.setOptions;ce.use;ce.walkTokens;ce.parseInline;rn.parse;nn.lex;ce.setOptions({breaks:!0,gfm:!0});function j1(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const Ec=p.memo(function({content:t,inverted:n=!1,className:r}){const l=p.useMemo(()=>ce.parse(j1(t),{async:!1}),[t]);return s.jsx("div",{className:se("text-[15px] leading-7","[&_a]:font-medium [&_a]:underline [&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:pl-4 [&_blockquote]:italic","[&_code]:rounded-md [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[13px]","[&_h1]:mb-3 [&_h1]:mt-1 [&_h1]:text-xl [&_h1]:font-semibold [&_h2]:mb-2 [&_h2]:mt-4 [&_h2]:text-lg [&_h2]:font-semibold","[&_h3]:mb-2 [&_h3]:mt-3 [&_h3]:text-base [&_h3]:font-semibold [&_li]:mb-1 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6","[&_p]:my-2 [&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-xl [&_pre]:border [&_pre]:p-4 [&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_strong]:font-semibold [&_table]:my-4 [&_table]:w-full [&_table]:border-collapse [&_td]:border [&_td]:px-3 [&_td]:py-2 [&_th]:border [&_th]:px-3 [&_th]:py-2 [&_th]:text-left","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6",n?"text-white/92 [&_a]:text-white [&_blockquote]:border-white/25 [&_code]:bg-white/12 [&_pre]:border-white/12 [&_pre]:bg-slate-950/20 [&_table]:text-white/92 [&_td]:border-white/12 [&_th]:border-white/12":"text-slate-700 [&_a]:text-indigo-600 [&_blockquote]:border-slate-200 [&_code]:bg-slate-100 [&_pre]:border-slate-200 [&_pre]:bg-slate-950 [&_pre]:text-slate-50 [&_td]:border-slate-200 [&_th]:border-slate-200",r),dangerouslySetInnerHTML:{__html:l}})});function zh({thinking:e,streaming:t}){const[n,r]=p.useState(!1),l=!!(e!=null&&e.trim());return p.useEffect(()=>{t&&l&&r(!0)},[t,l]),!t&&!l?null:t&&!l?s.jsxs("div",{className:"inline-flex items-center gap-2 px-1 py-1 text-sm text-slate-500",children:[s.jsx(Pt,{className:"h-4 w-4 animate-spin text-indigo-500"}),s.jsx("span",{children:"思考中..."})]}):s.jsxs("div",{className:"w-full",children:[s.jsxs("button",{type:"button",onClick:()=>r(i=>!i),className:se("inline-flex items-center gap-2 px-1 py-1 text-left text-sm font-medium text-slate-500 transition hover:text-slate-700",n?"mb-3":""),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(pc,{className:"h-4 w-4 text-indigo-500"}),s.jsx("span",{children:t?"正在思考":"思考过程"})]}),s.jsx(Fn,{className:se("h-4 w-4 text-slate-400 transition-transform",n?"rotate-180":"")})]}),n?s.jsx("div",{className:"max-w-[70ch] border-l-2 border-slate-200/80 pl-5 text-sm leading-7 text-slate-500",children:s.jsx("div",{className:"[&_p:first-child]:mt-0 [&_p:last-child]:mb-0",children:s.jsx(Ec,{content:e??"",className:"text-[15px] leading-8 text-slate-500 [&_blockquote]:border-slate-200/80 [&_code]:bg-slate-100/80 [&_p]:my-3"})})}):null]})}function yd({role:e,content:t,createdAt:n,agentName:r="DWF Agent",streaming:l=!1,thinking:i,continuation:a=!1}){const o=e==="user",c=!o&&!a,u=!o&&(!!(i!=null&&i.trim())||l),d=!!t||(o?!0:!u);return s.jsxs("div",{className:se("flex w-full gap-4",o?"justify-end":"justify-start"),children:[c?s.jsx("div",{className:"mt-1 flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-slate-200 bg-white text-slate-500 shadow-sm",children:s.jsx(In,{className:"h-4 w-4"})}):o?null:s.jsx("div",{className:"w-10 shrink-0"}),s.jsxs("div",{className:se(o?"max-w-[min(80%,820px)] order-first":"w-full max-w-[min(76%,820px)] min-w-0"),children:[o||c?s.jsxs("div",{className:se("mb-1 flex items-center gap-2 text-xs",o?"justify-end text-slate-500":"justify-start text-slate-400"),children:[s.jsx("span",{className:"font-semibold text-slate-900",children:o?"你":r}),n?s.jsx("span",{children:mt(n)}):null,l?s.jsx("span",{className:"text-indigo-500",children:"生成中"}):null]}):null,u?s.jsx(zh,{thinking:i,streaming:l}):null,d?s.jsx("div",{className:se("rounded-[18px]",u&&!o?"mt-3":"",o?"bg-[#EDF3FE] px-4 py-0.5 text-slate-800":"bg-transparent px-5 py-1 text-slate-800"),children:s.jsxs("div",{className:se(o?"":"w-full max-w-[70ch]"),children:[t?s.jsx(Ec,{content:t}):null,!t&&!i&&!l?s.jsx("div",{className:"py-2 text-sm text-slate-400",children:"暂无回复内容"}):null]})}):null]}),o?s.jsx("div",{className:"mt-1 flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-[#D8E5FA] bg-[#EDF3FE] text-indigo-600 shadow-sm",children:s.jsx(rv,{className:"h-4 w-4"})}):null]})}function k1(e){return e?`dwf-preview-${e}`:"dwf-preview"}function N1({capability:e,createdAt:t}){const{defaultEnvironmentId:n}=Tt(),r=k1(n);return s.jsx("div",{className:"flex w-full justify-start",children:s.jsx("div",{className:"w-full max-w-[min(76%,820px)] pl-14",children:s.jsx("div",{className:"rounded-[20px] border border-indigo-100 bg-gradient-to-br from-indigo-50 via-white to-slate-50 px-4 py-3 shadow-[0_18px_45px_rgba(15,23,42,0.06)]",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-indigo-100 bg-white text-indigo-600",children:s.jsx(Zg,{className:"h-3.5 w-3.5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm font-semibold text-slate-900",children:"DWF 预览"}),s.jsx(J,{tone:"indigo",children:"preview_url"}),t?s.jsx("span",{className:"text-xs text-slate-500",children:mt(t)}):null]}),s.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600",children:e.data.description}),s.jsx("div",{className:"mt-3",children:s.jsxs("button",{type:"button",onClick:()=>{const l=window.open(e.data.preview_url,r);l==null||l.focus()},className:"inline-flex h-10 items-center justify-center gap-2 rounded-xl bg-indigo-600 px-4 text-sm font-medium text-white shadow-sm transition hover:bg-indigo-700",children:["前往预览",s.jsx(zg,{className:"h-4 w-4"})]})})]})]})})})})}function wd({capability:e,createdAt:t}){return e.category==="preview_url"?s.jsx(N1,{capability:e,createdAt:t}):null}function b1(e){return e==="running"?"indigo":e==="success"?"green":e==="error"?"rose":"slate"}function S1(e){return e==="running"?"执行中":e==="success"?"成功":e==="error"?"失败":"已中断"}function jd(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function _1(e){if(!jd(e))return"";const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(n=>jd(n)).filter(n=>n.type==="text"&&typeof n.text=="string").map(n=>String(n.text)).filter(Boolean).join(`
396
+ `):""}function C1(e){return _1(e).trim()||vc(e)}function fo({title:e,status:t,startedAt:n,finishedAt:r,serverId:l,args:i,result:a,embedded:o=!1}){const[c,u]=p.useState(!1),d=i!==void 0||a!==void 0;return s.jsx("div",{className:o?"w-full":"flex w-full justify-start",children:s.jsx("div",{className:o?"w-full":"w-full max-w-[min(76%,820px)] pl-14",children:s.jsxs("div",{className:"rounded-[20px] border border-slate-200/80 bg-gradient-to-br from-slate-50 to-white px-4 py-3 shadow-[0_18px_45px_rgba(15,23,42,0.06)]",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-500",children:t==="running"?s.jsx(Pt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(ph,{className:"h-3.5 w-3.5"})}),s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"truncate text-sm font-semibold text-slate-900",children:e}),s.jsx(J,{tone:b1(t),children:S1(t)}),l?s.jsx(J,{tone:"slate",children:l}):null]}),n||r?s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-slate-500",children:[n?s.jsxs("span",{children:["开始于 ",mt(n)]}):null,r?s.jsxs("span",{children:["结束于 ",mt(r)]}):null]}):null]}),d?s.jsx("button",{type:"button",onClick:()=>u(f=>!f),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition hover:border-slate-300 hover:text-slate-900",title:c?"收起详情":"展开详情",children:s.jsx(Fn,{className:se("h-4 w-4 transition-transform",c&&"rotate-180")})}):null]})})]}),c&&d?s.jsxs("div",{className:"mt-3 space-y-3",children:[i!==void 0?s.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4",children:[s.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"调用参数"}),s.jsx("pre",{className:"scrollbar-subtle overflow-x-auto text-xs leading-6 text-slate-600",children:vc(i)})]}):null,a!==void 0?s.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-950 p-4 text-slate-50",children:[s.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"调用结果"}),s.jsx("pre",{className:"scrollbar-subtle max-h-[520px] overflow-auto whitespace-pre-wrap break-words text-xs leading-6 text-slate-100",children:C1(a)})]}):null]}):null]})})})}function E1(e){return e==="running"?"indigo":e==="success"?"green":e==="error"?"rose":"slate"}function P1(e){return e==="running"?"执行中":e==="success"?"完成":e==="error"?"失败":"已中断"}function kd({state:e,startedAt:t,finishedAt:n}){const[r,l]=p.useState(!1),i=!!e.prompt,a=!!e.thinking||e.status==="running"||!!e.content||!!e.error||e.toolEvents.length>0||e.timeline.length>0||i,o=new Map(e.toolEvents.map(c=>[c.id,c]));return s.jsx("div",{className:"flex w-full justify-start",children:s.jsx("div",{className:"min-w-0 w-full max-w-[min(76%,820px)] pl-14",children:s.jsx("div",{className:"overflow-hidden rounded-[20px] border border-indigo-100 bg-white px-4 py-3 shadow-[0_18px_45px_rgba(15,23,42,0.06)]",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-indigo-100 bg-indigo-50 text-indigo-600",children:e.status==="running"?s.jsx(Pt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(In,{className:"h-3.5 w-3.5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"truncate text-sm font-semibold text-slate-900",children:e.name||"SubAgent"}),s.jsx(J,{tone:E1(e.status),children:P1(e.status)}),e.description?s.jsx(J,{tone:"slate",children:e.description}):null]}),t||n?s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-slate-500",children:[t?s.jsxs("span",{children:["开始于 ",mt(t)]}):null,n?s.jsxs("span",{children:["结束于 ",mt(n)]}):null]}):null]}),a?s.jsx("button",{type:"button",onClick:()=>l(c=>!c),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition hover:border-slate-300 hover:text-slate-900",title:r?"折叠 SubAgent":"展开 SubAgent","aria-expanded":r,children:s.jsx(Fn,{className:se("h-4 w-4 transition-transform",r&&"rotate-180")})}):null]}),r&&e.prompt?s.jsxs("div",{className:"mt-3 rounded-xl border border-slate-200 bg-slate-50 p-4",children:[s.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.16em] text-slate-400",children:"Task"}),s.jsx("pre",{className:"scrollbar-subtle overflow-x-auto whitespace-pre-wrap text-xs leading-6 text-slate-600",children:e.prompt})]}):null,r&&e.timeline.length?s.jsx("div",{className:"min-w-0",children:e.timeline.map(c=>{if(c.type==="assistant"){const d=!!c.thinking.trim()||c.status==="running";return s.jsxs("div",{className:"min-w-0",children:[d?s.jsx("div",{className:"mt-3",children:s.jsx(zh,{thinking:c.thinking,streaming:c.status==="running"})}):null,c.content?s.jsx("div",{className:"mt-3 min-w-0 max-w-full overflow-x-auto",children:s.jsx(Ec,{content:c.content,className:"max-w-full break-words [&_code]:break-words [&_table]:min-w-max"})}):null]},c.id)}const u=o.get(c.toolEventId);return u?s.jsx("div",{className:"mt-3 min-w-0",children:s.jsx(fo,{title:u.displayName,status:u.status,startedAt:u.startedAt,finishedAt:u.finishedAt,args:u.args,result:u.result,embedded:!0})},c.id):null})}):r&&e.status==="running"?s.jsx("div",{className:"mt-3 text-sm text-slate-400",children:"SubAgent 正在工作..."}):null,r&&e.error?s.jsx("div",{className:"mt-3 rounded-xl border border-rose-200 bg-rose-50 px-3 py-2 text-sm text-rose-700",children:e.error}):null,r&&a?s.jsx("div",{className:"h-3"}):null]})]})})})})}function dl(e,t,n){const r=t?e.findIndex(i=>i.type==="assistant"&&i.id===t):-1;if(r>=0){const i=e[r],a=[...e];return a[r]={...i,content:`${i.content}${n.delta??""}`,thinking:`${i.thinking}${n.thinkingDelta??""}`,status:"running"},{timeline:a,assistantItemId:t}}const l=`assistant:${n.now}:${e.length}`;return{timeline:[...e,{type:"assistant",id:l,content:n.delta??"",thinking:n.thinkingDelta??"",status:"running",startedAt:n.now}],assistantItemId:l}}function Jr(e,t,n){var l,i;const r=t?e.findIndex(a=>a.type==="assistant"&&a.id===t):-1;if(r>=0){const a=e[r],o=[...e];return o[r]={...a,content:n.content??a.content,thinking:n.thinking??a.thinking,status:"success",finishedAt:n.now},{timeline:o,assistantItemId:void 0}}return!((l=n.content)!=null&&l.trim())&&!((i=n.thinking)!=null&&i.trim())?{timeline:e,assistantItemId:void 0}:{timeline:[...e,{type:"assistant",id:`assistant:${n.now}:${e.length}`,content:n.content??"",thinking:n.thinking??"",status:"success",startedAt:n.now,finishedAt:n.now}],assistantItemId:void 0}}function Nd(e,t){return e.some(n=>n.type==="tool"&&n.toolEventId===t)?e:[...e,{type:"tool",id:`tool:${t}`,toolEventId:t}]}function T1(e){try{return JSON.parse(e).detail??e}catch{return e}}function M1(e,t){return{id:`optimistic-user-${Date.now()}`,session_id:e,role:"user",content:t,metadata:{},created_at:new Date().toISOString()}}function po(e){return`dwf-agent:last-session:${e}`}function ho(e){return`dwf-agent:last-agent:${e}`}function R1(e){if(!e||typeof window>"u")return"";try{return window.localStorage.getItem(po(e))||""}catch{return""}}function A1(e){if(!e||typeof window>"u")return"";try{return window.localStorage.getItem(ho(e))||""}catch{return""}}function L1(e,t){if(!(!e||typeof window>"u"))try{t?window.localStorage.setItem(po(e),t):window.localStorage.removeItem(po(e))}catch{}}function I1(e,t){if(!(!e||typeof window>"u"))try{t?window.localStorage.setItem(ho(e),t):window.localStorage.removeItem(ho(e))}catch{}}function z1(e){if(!e||typeof e!="object")return!1;const t=e.category,n=e.data;return t!=="preview_url"||!n||typeof n!="object"?!1:typeof n.preview_url=="string"&&typeof n.description=="string"}function $h(e){return z1(e)?e:void 0}function $1(e){var t;return $h((t=e.metadata)==null?void 0:t.dwf_agent)}function D1(e){var t;if(!(!e||typeof e!="object"))return $h((t=e.details)==null?void 0:t.dwf_agent)}function Dh(e){if(e.metadata&&Object.keys(e.metadata).length>0)return Object.prototype.hasOwnProperty.call(e.metadata,"result")?e.metadata.result:e.metadata;if(e.content)try{return JSON.parse(e.content)}catch{return e.content}}function Oh(e){if(!(!e.metadata||Object.keys(e.metadata).length===0)&&Object.prototype.hasOwnProperty.call(e.metadata,"args"))return e.metadata.args}function ln(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function _l(e,t="running"){const n=ln(e)?e:{};return{streamAgentId:void 0,name:typeof n.name=="string"?n.name:"SubAgent",description:typeof n.description=="string"?n.description:void 0,prompt:typeof n.prompt=="string"?n.prompt:void 0,content:"",thinking:"",status:t,toolEvents:[],timeline:[]}}function Fh(e){if(!ln(e))return"";const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(n=>ln(n)).filter(n=>n.type==="text"&&typeof n.text=="string").map(n=>String(n.text)).join(`
397
+ `):""}function O1(e){return Array.isArray(e)?e.filter(t=>ln(t)).map((t,n)=>{const r=typeof t.status=="string"?t.status:"success",l=r==="running"||r==="success"||r==="error"||r==="aborted"?r:"success",i=typeof t.toolCallId=="string"?t.toolCallId:void 0,a=typeof t.toolName=="string"?t.toolName:void 0;return{id:typeof t.id=="string"?t.id:i??`${a??"tool"}:${n}`,status:l,displayName:typeof t.displayName=="string"?t.displayName:typeof t.toolName=="string"?t.toolName:"未知工具",toolCallId:i,toolName:a,args:t.args,result:t.result,startedAt:typeof t.startedAt=="string"?t.startedAt:new Date().toISOString(),finishedAt:typeof t.finishedAt=="string"?t.finishedAt:void 0}}):[]}function mo(e,t,n,r,l){if(Array.isArray(e)){const a=e.filter(o=>ln(o)).map((o,c)=>{if(o.type==="tool"){const u=typeof o.toolEventId=="string"?o.toolEventId:void 0;return u?{type:"tool",id:typeof o.id=="string"?o.id:`tool:${u}:${c}`,toolEventId:u}:void 0}if(o.type==="assistant"){const u=typeof o.status=="string"?o.status:"success";return{type:"assistant",id:typeof o.id=="string"?o.id:`assistant:${c}`,content:typeof o.content=="string"?o.content:"",thinking:typeof o.thinking=="string"?o.thinking:"",status:u==="running"?"running":"success",startedAt:typeof o.startedAt=="string"?o.startedAt:new Date().toISOString(),finishedAt:typeof o.finishedAt=="string"?o.finishedAt:void 0}}}).filter(o=>!!o);if(a.length)return a}const i=t.map(a=>({type:"tool",id:`tool:${a.id}`,toolEventId:a.id}));return(n.trim()||r.trim())&&i.push({type:"assistant",id:"assistant:final",content:n,thinking:r,status:l==="running"?"running":"success",startedAt:new Date().toISOString()}),i}function F1(e){const t=Oh(e),n=Dh(e),r=_l(t,e.tool_status==="error"?"error":e.tool_status==="aborted"?"aborted":"success");if(r.content=Fh(n),ln(n)&&ln(n.details)&&ln(n.details.sub_agent)){const l=n.details.sub_agent;typeof l.name=="string"&&(r.name=l.name),typeof l.description=="string"&&(r.description=l.description),typeof l.status=="string"&&["completed","error","timeout","aborted"].includes(l.status)&&(r.status=l.status==="completed"?"success":l.status==="timeout"?"error":l.status),r.toolEvents=O1(l.tool_events),r.timeline=mo(l.timeline,r.toolEvents,r.content,r.thinking,r.status)}return r.timeline.length||(r.timeline=mo(void 0,r.toolEvents,r.content,r.thinking,r.status)),r}function Xr(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.type==="assistant"&&n.status==="running")return n.id}}function bd(e,t,n){const r=typeof t.toolCallId=="string"?t.toolCallId:void 0,l=typeof t.toolName=="string"?t.toolName:void 0,i=r?e.findIndex(o=>o.toolCallId===r):e.findIndex(o=>o.status==="running"&&o.toolName===l),a={id:i>=0?e[i].id:r??`${l??"tool"}:${Date.now()}`,status:n,displayName:String(t.displayName??t.toolName??"未知工具"),toolCallId:r,toolName:l,args:i>=0?e[i].args:t.args,result:n==="running"?void 0:t.result,startedAt:i>=0?e[i].startedAt:new Date().toISOString(),finishedAt:n==="running"?void 0:new Date().toISOString()};if(i>=0){const o=[...e];return o[i]=a,o}return[...e,a]}function Sd(e){var n;const t=(n=e.metadata)==null?void 0:n.thinking;return typeof t=="string"?t:""}function B1(e,t){var n,r;if(((n=e[t])==null?void 0:n.role)!=="assistant")return!1;for(let l=t-1;l>=0;l-=1){const i=(r=e[l])==null?void 0:r.role;if(i==="user")return!1;if(i==="assistant")return!0}return!1}async function U1(e,t){if(!e.ok)throw new Error(T1(await e.text()));if(!e.body)throw new Error("Agent 流式输出不可用。");const n=e.body.getReader(),r=new TextDecoder;let l="";for(;;){const{value:i,done:a}=await n.read();if(a)break;l+=r.decode(i,{stream:!0});let o=l.indexOf(`
398
+
399
+ `);for(;o>=0;){const c=l.slice(0,o).trim();if(l=l.slice(o+2),c){const u=c.split(/\r?\n/);let d="message";const f=[];u.forEach(v=>{v.startsWith("event:")?d=v.slice(6).trim():v.startsWith("data:")&&f.push(v.slice(5).trimStart())});const h=f.join(`
400
+ `);let x={};if(h)try{x=JSON.parse(h)}catch{o=l.indexOf(`
401
+
402
+ `);continue}t({event:d,data:x})}o=l.indexOf(`
403
+
404
+ `)}}}function W1(){var Ic;const e=Os(),{agentApiBaseUrl:t,apiBaseUrl:n,defaultEnvironmentId:r}=Tt(),{pushToast:l}=ct(),[i,a]=p.useState(!1),[o,c]=p.useState([]),[u,d]=p.useState(!0),[f,h]=p.useState(""),[x,v]=p.useState(""),[w,j]=p.useState([]),[m,g]=p.useState(!1),[y,k]=p.useState(""),[N,S]=p.useState([]),[b,M]=p.useState(!1),[B,T]=p.useState(""),[E,I]=p.useState([]),[O,L]=p.useState([]),[Q,K]=p.useState(!1),[R,C]=p.useState(""),[D,U]=p.useState(""),[F,G]=p.useState(!1),[z,_]=p.useState(null),[le,ie]=p.useState(""),Re=p.useRef(null),wt=p.useRef(null),ze=p.useRef(null),rt=p.useRef(null),ut=p.useRef(!0),W=p.useRef(!1),ve=p.useRef(!0),_e=p.useRef(0),Rt=p.useRef(!1),Ze=p.useRef(""),Wt=p.useRef(""),dt=p.useRef(void 0),hn=p.useRef(null),Je=p.useMemo(()=>o.find(P=>P.id===x)??null,[o,x]);function Pc(P){v(P),r&&I1(r,P)}function Fr(P,A=x){k(P),A&&L1(A,P)}function Tc(P="smooth"){const A=Re.current;A&&(ve.current=!0,A.scrollTo({top:A.scrollHeight,behavior:P}))}function Ei(){const P=Re.current;if(!P)return;const q=P.scrollHeight-P.scrollTop-P.clientHeight<=32;P.scrollTop<_e.current&&!q?ve.current=!1:q&&(ve.current=!0),_e.current=P.scrollTop,ut.current=q,G(!q)}function Mc(){hn.current===null&&(hn.current=requestAnimationFrame(()=>{hn.current=null,Ei()}))}function Jt(){Ze.current="",Wt.current="",dt.current=void 0,L([])}p.useEffect(()=>{Re.current&&Ei()},[]),p.useEffect(()=>{const P=rt.current;if(!P||typeof ResizeObserver>"u")return;const A=new ResizeObserver(()=>Mc());return A.observe(P),()=>A.disconnect()},[y]),p.useEffect(()=>{(W.current||ve.current||ut.current)&&(Tc(W.current?"smooth":"auto"),W.current=!1),Mc()},[N,O,E,D,Q]),p.useEffect(()=>()=>{var P;(P=wt.current)==null||P.abort(),hn.current!==null&&cancelAnimationFrame(hn.current)},[]),p.useEffect(()=>{const P=ze.current;if(!P)return;const A=28,Z=160;P.style.height="0px";const q=Math.min(Math.max(P.scrollHeight,A),Z);P.style.height=`${q}px`,P.style.overflowY=P.scrollHeight>Z?"auto":"hidden"},[B]);async function Rc(P){var A,Z;if(!r){c([]),v(""),j([]),k(""),S([]),Jt(),I([]),d(!1),h("");return}d(!0),h("");try{const q=await Nh(t,{dwf_instance_id:r});c(q.items);const te=A1(r),re=P&&q.items.some(Te=>Te.id===P)?P:te&&q.items.some(Te=>Te.id===te)?te:((A=q.items.find(Te=>Te.enabled))==null?void 0:A.id)??((Z=q.items[0])==null?void 0:Z.id)??"";Pc(re)}catch(q){h(Y(q))}finally{d(!1)}}async function Ac(P,A){var Z;if(!P){j([]),k("");return}g(!0);try{const q=await Ry(t,{agent_id:P});j(q.items);const te=R1(P),re=A&&q.items.some(Te=>Te.id===A)?A:te&&q.items.some(Te=>Te.id===te)?te:((Z=q.items[0])==null?void 0:Z.id)??"";Fr(re,P)}catch(q){l({tone:"error",title:"会话列表加载失败",description:Y(q)}),j([]),k("")}finally{g(!1)}}async function lr(P){if(!P){S([]);return}M(!0);try{const A=await Ly(t,P);S(A.items)}catch(A){l({tone:"error",title:"消息加载失败",description:Y(A)}),S([])}finally{M(!1)}}p.useEffect(()=>{Rc()},[t,r]),p.useEffect(()=>{if(!x){j([]),k(""),S([]);return}Jt(),I([]),Ac(x)},[t,x]),p.useEffect(()=>{if(!y){S([]);return}Q||(Jt(),I([]),lr(y))},[t,y,Q]);async function Bh(P){if(y)return y;const A=await pd(t,{agent_id:P});return j(Z=>[A,...Z]),Fr(A.id,P),S([]),A.id}function Uh({event:P,data:A}){if(P==="assistant_delta"){const Z=String(A.delta??"");if(Z){Ze.current+=Z;const q=new Date().toISOString();L(te=>{const re=dl(te,dt.current,{delta:Z,now:q});return dt.current=re.assistantItemId,re.timeline})}return}if(P==="assistant_thinking_delta"){const Z=String(A.delta??"");if(Z){Wt.current+=Z;const q=new Date().toISOString();L(te=>{const re=dl(te,dt.current,{thinkingDelta:Z,now:q});return dt.current=re.assistantItemId,re.timeline})}return}if(P==="assistant_message_end"){const Z=String(A.content??Ze.current),q=String(A.thinking??Wt.current);Ze.current=Z,Wt.current=q;const te=new Date().toISOString();L(re=>{const Te=Jr(re,dt.current,{content:Z,thinking:q,now:te});return dt.current=Te.assistantItemId,Te.timeline});return}if(P==="tool_execution_start"){const Z=String(A.displayName??A.toolName??"未知工具"),q=typeof A.serverId=="string"?A.serverId:void 0,te=typeof A.toolName=="string"?A.toolName:void 0,re=typeof A.toolCallId=="string"?A.toolCallId:void 0,Te={id:re??`${q??"server"}:${te??Z}:${Date.now()}`,status:"running",displayName:Z,toolCallId:re,serverId:q,toolName:te,args:A.args,subAgent:te==="Agent"?{..._l(A.args),streamAgentId:re}:void 0,startedAt:new Date().toISOString()};I(Ce=>[...Ce,Te]),L(Ce=>{let Oe=Ce;if(dt.current){const ee=Jr(Oe,dt.current,{now:Te.startedAt});Oe=ee.timeline,dt.current=ee.assistantItemId}return Nd(Oe,Te.id)});return}if(P==="tool_execution_update"){const Z=typeof A.streamAgentId=="string"?A.streamAgentId:void 0,q=typeof A.parentToolCallId=="string"?A.parentToolCallId:Z,te=typeof A.innerEvent=="string"?A.innerEvent:"",re=ln(A.innerData)?A.innerData:{};if(!Z||!q)return;I(Te=>Te.map(Ce=>{if(Ce.toolCallId!==q&&Ce.id!==q)return Ce;let ee={...Ce.subAgent??{..._l(Ce.args),streamAgentId:Z},streamAgentId:Z};if(te==="assistant_delta"){const ye=String(re.delta??""),mn=dl(ee.timeline,Xr(ee.timeline),{delta:ye,now:new Date().toISOString()});ee={...ee,content:`${ee.content}${ye}`,timeline:mn.timeline}}else if(te==="assistant_thinking_delta"){const ye=String(re.delta??""),mn=dl(ee.timeline,Xr(ee.timeline),{thinkingDelta:ye,now:new Date().toISOString()});ee={...ee,thinking:`${ee.thinking}${ye}`,timeline:mn.timeline}}else if(te==="assistant_message_end"){const ye=Jr(ee.timeline,Xr(ee.timeline),{content:String(re.content??ee.content),thinking:String(re.thinking??ee.thinking),now:new Date().toISOString()});ee={...ee,content:String(re.content??ee.content),thinking:String(re.thinking??ee.thinking),timeline:ye.timeline}}else if(te==="tool_execution_start"){const ye=new Date().toISOString(),mn=Jr(ee.timeline,Xr(ee.timeline),{now:ye}).timeline,Bn=bd(ee.toolEvents,re,"running"),zc=typeof re.toolCallId=="string"?re.toolCallId:void 0,qh=typeof re.toolName=="string"?re.toolName:void 0,$c=zc?Bn.find(Bs=>Bs.toolCallId===zc):Bn.find(Bs=>Bs.status==="running"&&Bs.toolName===qh);ee={...ee,toolEvents:Bn,timeline:$c?Nd(mn,$c.id):mn}}else if(te==="tool_execution_end")ee={...ee,toolEvents:bd(ee.toolEvents,re,re.isError?"error":"success")};else if(te==="run_error")ee={...ee,status:re.aborted?"aborted":"error",error:String(re.message??"SubAgent 运行失败")};else if(te==="run_end"){const ye=String(re.status??""),mn=Jr(ee.timeline,Xr(ee.timeline),{now:new Date().toISOString()}).timeline;ee={...ee,status:ye==="completed"?"success":ye==="aborted"?"aborted":ye==="error"?"error":ee.status,toolEvents:ee.toolEvents.map(Bn=>Bn.status==="running"?{...Bn,status:"aborted",finishedAt:new Date().toISOString()}:Bn),timeline:mn}}return{...Ce,subAgent:ee}}));return}if(P==="tool_execution_end"){const Z=typeof A.toolName=="string"?A.toolName:void 0,q=typeof A.serverId=="string"?A.serverId:void 0,te=typeof A.toolCallId=="string"?A.toolCallId:void 0,re=D1(A.result);I(Te=>{const Ce=[...Te],Oe=te?Ce.findIndex(ye=>ye.status==="running"&&ye.toolCallId===te):Ce.findIndex(ye=>ye.status==="running"&&ye.serverId===q&&ye.toolName===Z),ee={id:Oe>=0?Ce[Oe].id:te??`${q??"server"}:${Z??"tool"}:${Date.now()}`,status:A.isError?"error":"success",displayName:String(A.displayName??A.toolName??"未知工具"),toolCallId:te,serverId:q,toolName:Z,args:Oe>=0?Ce[Oe].args:void 0,result:A.result,capability:re,subAgent:(Oe>=0?Ce[Oe].subAgent:void 0)??(Z==="Agent"?(()=>{const ye=Fh(A.result);return{..._l(Oe>=0?Ce[Oe].args:void 0,A.isError?"error":"success"),content:ye,timeline:mo(void 0,[],ye,"",A.isError?"error":"success")}})():void 0),startedAt:Oe>=0?Ce[Oe].startedAt:new Date().toISOString(),finishedAt:new Date().toISOString()};return Oe>=0?(Ce[Oe]=ee,Ce):[...Ce,ee]});return}if(P==="run_error"){if(A.aborted){U("");return}U(String(A.message??"运行失败"));return}P==="run_end"&&I(Z=>Z.map(q=>q.status==="running"?{...q,status:"aborted",finishedAt:new Date().toISOString()}:q))}async function Wh(P,A,Z){const q=new AbortController;wt.current=q;try{const te=await $y(t,P,q.signal);await U1(te,Uh)}catch(te){if(te instanceof DOMException&&te.name==="AbortError")return;throw te}finally{wt.current=null,C(""),K(!1),await Promise.all([lr(A),Ac(Z,A)]),Jt(),I([])}}async function Lc(P){const A=B.trim();if(!A||Q||!Je)return;if(!Je.enabled){l({tone:"error",title:"当前 Agent 已停用",description:"请先启用该 Agent,或切换到其他可用 Agent。"});return}const Z=Je.id;U("");try{const q=await Bh(Z);S(re=>[...re,M1(q,A)]),T(""),Jt(),I([]),ve.current=!0,W.current=!0,K(!0);const te=await Iy(t,q,{content:A},n);C(te.run_id),await Wh(te.run_id,q,Z)}catch(q){K(!1),Jt(),I([]),l({tone:"error",title:"消息发送失败",description:Y(q)}),y&&await lr(y)}}async function Pi(){if(!(!x||Q))try{const P=await pd(t,{agent_id:x});j(A=>[P,...A]),Fr(P.id,x),S([]),Jt(),I([]),a(!1)}catch(P){l({tone:"error",title:"新建会话失败",description:Y(P)})}}async function Hh(){var A;if(!z||!x)return;const P=z.id;ie(P);try{await Ay(t,P);const Z=w.filter(q=>q.id!==P);if(j(Z),y===P){const q=((A=Z[0])==null?void 0:A.id)??"";Fr(q,x),S([]),Jt(),I([]),q&&await lr(q)}_(null),l({tone:"success",title:"会话已删除",description:z.title||"新会话"})}catch(Z){l({tone:"error",title:"会话删除失败",description:Y(Z)})}finally{ie("")}}async function Vh(){var P;if(R)try{await zy(t,R),(P=wt.current)==null||P.abort(),K(!1),C(""),Jt(),l({tone:"info",title:"运行已中断"}),y&&await lr(y)}catch(A){l({tone:"error",title:"中断运行失败",description:Y(A)})}}const Qh=(Ic=O.find(P=>P.type==="assistant"))==null?void 0:Ic.id;return r?u?s.jsx(gt,{label:"正在加载 Agent 工作台..."}):f?s.jsx(Mt,{description:f,onRetry:()=>void Rc(x)}):o.length?s.jsxs("div",{className:"relative flex h-full min-h-0 overflow-hidden",children:[s.jsx(Dy,{open:i,agents:o,selectedAgentId:x,sessions:w,selectedSessionId:y,sessionsLoading:m,disabled:Q,deletingSessionId:le,onClose:()=>a(!1),onAgentChange:Pc,onCreateSession:()=>void Pi(),onSelectSession:Fr,onDeleteSession:P=>_(P)}),s.jsx("div",{className:"absolute left-3 top-3 z-20 md:left-4 md:top-4",children:s.jsx("button",{type:"button",onClick:()=>a(!0),className:"rounded-2xl border border-slate-200 bg-white p-3 text-slate-500 shadow-sm transition hover:border-slate-300 hover:text-slate-900",title:"查看 Agent 与会话",children:s.jsx(uh,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"absolute right-3 top-3 z-20 flex items-center gap-2 md:right-4 md:top-4",children:[s.jsx("button",{type:"button",onClick:()=>y&&void lr(y),disabled:!y||Q,className:"rounded-2xl border border-slate-200 bg-white p-3 text-slate-500 shadow-sm transition hover:border-slate-300 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50",title:"刷新记录",children:s.jsx(Ut,{className:"h-4 w-4"})}),s.jsx("button",{type:"button",onClick:()=>void Pi(),disabled:!x||Q,className:"rounded-2xl border border-slate-200 bg-white p-3 text-slate-500 shadow-sm transition hover:border-slate-300 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50",title:"新建会话",children:s.jsx(Pe,{className:"h-4 w-4"})})]}),s.jsx("div",{ref:Re,onScroll:Ei,className:"scrollbar-subtle absolute inset-0 overflow-y-auto px-3 scroll-pb-[19rem] md:px-4 md:scroll-pb-[19.5rem]",children:s.jsx("div",{ref:rt,className:"mx-auto flex min-h-full w-full max-w-5xl flex-col pb-[19rem] pt-16 md:pb-[19.5rem] md:pt-[4.5rem]",children:y?b?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{label:"正在加载会话内容..."})}):s.jsxs("div",{className:"space-y-6",children:[N.length===0&&O.length===0?s.jsxs("div",{className:"mx-auto flex max-w-lg flex-col items-center gap-4 px-6 py-16 text-center",children:[s.jsx("div",{className:"rounded-full border border-slate-200 bg-slate-50 px-4 py-1.5 text-sm font-medium text-slate-500",children:"开始对话"}),s.jsx("div",{className:"text-sm leading-7 text-slate-500",children:"向 Agent 发一个任务,它会调用工具,搜索网页来完成您的任务。"})]}):null,N.map((P,A)=>{if(P.role==="tool"){const Z=$1(P);return Z?s.jsx(wd,{capability:Z,createdAt:P.created_at},P.id):P.tool_name==="Agent"?s.jsx(kd,{state:F1(P),startedAt:P.created_at},P.id):s.jsx(fo,{title:P.tool_name||"工具调用",status:P.tool_status||"success",startedAt:P.created_at,args:Oh(P),result:Dh(P)},P.id)}return P.role==="assistant"&&!P.content.trim()&&!Sd(P)?null:s.jsx(yd,{role:P.role,content:P.content,createdAt:P.created_at,agentName:(Je==null?void 0:Je.name)||"DWF Agent",thinking:P.role==="assistant"?Sd(P):void 0,continuation:B1(N,A)},P.id)}),O.map(P=>{if(P.type==="assistant")return!P.content.trim()&&!P.thinking.trim()?null:s.jsx(yd,{role:"assistant",content:P.content,agentName:(Je==null?void 0:Je.name)||"DWF Agent",streaming:Q&&P.status==="running",thinking:P.thinking,continuation:P.id!==Qh},P.id);const A=E.find(Z=>Z.id===P.toolEventId);return A?A.capability&&A.status!=="running"?s.jsx(wd,{capability:A.capability,createdAt:A.finishedAt||A.startedAt},P.id):A.subAgent?s.jsx(kd,{state:{...A.subAgent,status:A.status==="running"?A.subAgent.status:A.status},startedAt:A.startedAt,finishedAt:A.finishedAt},P.id):s.jsx(fo,{title:A.displayName,status:A.status,serverId:A.serverId,startedAt:A.startedAt,finishedAt:A.finishedAt,args:A.args,result:A.result},P.id):null}),D?s.jsx("div",{className:"mx-auto w-full max-w-3xl rounded-[20px] border border-rose-200 bg-rose-50 px-5 py-4 text-sm text-rose-700",children:D}):null]}):s.jsxs("div",{className:"mx-auto flex max-w-xl flex-1 flex-col items-center justify-center px-6 text-center",children:[s.jsx("div",{className:"rounded-full border border-slate-200 bg-slate-50 px-4 py-1.5 text-sm font-medium text-slate-500",children:"对话开始"}),s.jsx("div",{className:"mt-6 max-w-lg text-balance text-3xl font-semibold tracking-tight text-slate-900",children:"选择一个 Agent,然后开始一轮真正调用 MCP 工具的对话。"}),s.jsx("p",{className:"mt-4 text-sm leading-7 text-slate-500",children:"左上角按钮里可以切换 Agent、查看最近会话和新建会话。消息、工具调用和结果都会直接显示在主对话区。"}),s.jsx(V,{className:"mt-8",icon:Pe,disabled:Q,onClick:()=>void Pi(),children:"新建会话"})]})})}),s.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 bg-gradient-to-t from-white via-white/96 to-transparent px-3 pb-3 pt-10 md:px-4",children:s.jsxs("div",{className:"mx-auto flex w-full max-w-5xl flex-col items-center gap-2",children:[F?s.jsx("button",{type:"button",onClick:()=>Tc("smooth"),className:"pointer-events-auto mb-1 inline-flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-700 shadow-[0_10px_30px_rgba(15,23,42,0.10)] transition hover:border-slate-300 hover:text-slate-900",title:"滚动到底部",children:s.jsx(Fn,{className:"h-5 w-5"})}):null,s.jsx("div",{className:"pointer-events-auto w-full rounded-[24px] border border-slate-200/90 bg-white/95 shadow-[0_32px_90px_rgba(15,23,42,0.18)] backdrop-blur-xl",children:s.jsxs("div",{className:"px-5 pb-2 pt-3",children:[s.jsx("textarea",{ref:ze,rows:1,value:B,placeholder:Je?"输入任务...":"请先在左上角选择 Agent",disabled:Q||!Je,onChange:P=>T(P.target.value),onCompositionStart:()=>{Rt.current=!0},onCompositionEnd:()=>{Rt.current=!1},onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&!P.nativeEvent.isComposing&&!Rt.current&&(P.preventDefault(),Lc())},className:"scrollbar-subtle min-h-0 w-full resize-none overflow-y-hidden border-none bg-transparent px-0 py-0 text-[15px] leading-7 text-slate-900 outline-none placeholder:text-slate-400 disabled:cursor-not-allowed"}),s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 border-t border-slate-100 pt-2.5",children:[s.jsx("div",{className:"text-xs text-slate-400",children:"Enter 发送,Shift + Enter 换行"}),s.jsx("button",{type:"button",disabled:!Je||!Q&&!B.trim(),onClick:()=>{if(Q){Vh();return}Lc()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-2xl text-white shadow-sm transition disabled:cursor-not-allowed disabled:bg-slate-200 disabled:text-slate-400",Q?"bg-rose-500 hover:bg-rose-600":"bg-indigo-600 hover:bg-indigo-700"),title:Q?"中断运行":"发送消息",children:Q?s.jsx(ev,{className:"h-4 w-4"}):s.jsx(Yg,{className:"h-4 w-4"})})]})]})}),s.jsx("div",{className:"w-full px-1 text-left text-xs text-slate-400",children:"AI 可能会出错,请核对重要信息。"})]})}),s.jsx(Bt,{open:!!z,title:"删除会话",description:`会话“${(z==null?void 0:z.title)||"新会话"}”删除后无法恢复。`,confirmText:"确认删除",variant:"danger",onClose:()=>_(null),onConfirm:()=>void Hh()})]}):s.jsx("div",{className:"p-6",children:s.jsx(Ue,{icon:In,title:"还没有 Agent",description:"先创建一个 Agent,并绑定模型提供商与 MCP 后,再进入对话工作台。",action:s.jsx(V,{onClick:()=>e("/agent/configs"),icon:Pe,children:"前往 Agent配置"})})}):s.jsx(Ue,{icon:In,title:"请先选择 DWF 工作区",description:"Agent 与工作区绑定。先在左侧选择一个 DWF 工作区,再创建 Agent 并发起对话。"})}function _d(e){return{name:(e==null?void 0:e.name)??"",description:(e==null?void 0:e.description)??"",provider_id:(e==null?void 0:e.provider_id)??"",model_id:(e==null?void 0:e.model_id)??"",system_prompt:(e==null?void 0:e.system_prompt)??"",dwf_tool_mode:(e==null?void 0:e.dwf_tool_mode)??"dwf_cli",backend_mcp_instance_ids:(e==null?void 0:e.backend_mcp_instance_ids)??[],mcp_connector_ids:(e==null?void 0:e.mcp_connector_ids)??[],enabled_skill_ids:(e==null?void 0:e.enabled_skill_ids)??[],enabled:(e==null?void 0:e.enabled)??!0}}function Cd(e,t){const n=new Set(t.map(r=>r.id));return e.filter(r=>n.has(r))}function Ed(e,t,n){return n?[...e,t]:e.filter(r=>r!==t)}function oa(e,t){if(e)return t.find(n=>n.category===e.provider_type)}function H1(e,t){return e?!t||t.models.length===0?!0:!t.models.some(n=>n.id===e):!1}function V1({open:e,agent:t,providers:n,modelCategories:r,backendMcpInstances:l,mcpConnectors:i,skills:a,submitting:o,onClose:c,onSubmit:u}){const{agentApiBaseUrl:d,apiBaseUrl:f}=Tt(),{pushToast:h}=ct(),[x,v]=p.useState(_d(t)),[w,j]=p.useState(null),[m,g]=p.useState(!1);p.useEffect(()=>{if(!e)return;const E=_d(t),I=n.find(L=>L.id===E.provider_id),O=oa(I,r);v({...E,enabled_skill_ids:Cd(E.enabled_skill_ids,a)}),g(H1(E.model_id,O)),j(null)},[e,t,a,n,r]);const y=!!t,k=n.find(E=>E.id===x.provider_id),N=oa(k,r),S=(N==null?void 0:N.models)??[],b=!!k&&S.length>0&&!m,M=k!=null&&k.default_model?`使用模型提供商默认模型(${k.default_model})`:"使用模型提供商默认模型";async function B(E){const I=`backend:${E.id}`;j(I);try{const O=await Ny(d,{backend_instance_id:E.id},f);h({tone:"success",title:"MCP 连接成功",description:O.tool_count?`已发现 ${O.tool_count} 个工具`:O.message})}catch(O){h({tone:"error",title:"MCP 连接失败",description:Y(O)})}finally{j(O=>O===I?null:O)}}async function T(E){const I=`connector:${E.id}`;j(I);try{const O=await kh(d,E.id);h({tone:"success",title:"MCP 连接成功",description:O.tool_count?`已发现 ${O.tool_count} 个工具`:O.message})}catch(O){h({tone:"error",title:"MCP 连接失败",description:Y(O)})}finally{j(O=>O===I?null:O)}}return s.jsx(Zt,{open:e,title:y?"编辑 Agent":"新建 Agent",size:"xl",onClose:c,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:c,children:"取消"}),s.jsx(V,{loading:o,onClick:()=>void u({name:x.name.trim(),description:x.description.trim(),provider_id:x.provider_id,model_id:x.model_id.trim(),system_prompt:x.system_prompt,dwf_tool_mode:x.dwf_tool_mode,backend_mcp_instance_ids:x.backend_mcp_instance_ids,mcp_connector_ids:x.mcp_connector_ids,enabled_skill_ids:Cd(x.enabled_skill_ids,a),enabled:x.enabled}),children:y?"保存 Agent":"创建 Agent"})]}),children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"基本信息"}),s.jsxs("div",{className:"form-grid",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Agent 名称"}),s.jsx(ae,{value:x.name,onChange:E=>v(I=>({...I,name:E.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"模型提供商"}),s.jsxs(Ie,{value:x.provider_id,onChange:E=>{const I=E.target.value,O=n.find(Q=>Q.id===I),L=oa(O,r);g(!!O&&((L==null?void 0:L.models.length)??0)===0),v(Q=>({...Q,provider_id:I,model_id:""}))},children:[s.jsx("option",{value:"",children:"请选择模型提供商"}),n.map(E=>s.jsx("option",{value:E.id,children:E.name},E.id))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"模型 ID"}),S.length>0&&(N!=null&&N.allow_custom_model)?s.jsx("button",{type:"button",className:"text-xs font-medium text-indigo-600 hover:text-indigo-700",onClick:()=>{const E=!m;g(E),E||v(I=>({...I,model_id:""}))},children:m?"选择内置模型":"自定义模型 ID"}):null]}),b?s.jsxs(Ie,{value:x.model_id,onChange:E=>v(I=>({...I,model_id:E.target.value})),children:[s.jsx("option",{value:"",children:M}),S.map(E=>s.jsx("option",{value:E.id,children:E.name},E.id))]}):s.jsx(ae,{value:x.model_id,onChange:E=>v(I=>({...I,model_id:E.target.value})),placeholder:k?"留空则使用模型提供商默认模型":"请先选择模型提供商",disabled:!k})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"描述"}),s.jsx(_t,{rows:3,value:x.description,onChange:E=>v(I=>({...I,description:E.target.value}))})]}),s.jsxs("label",{className:"space-y-2 md:col-span-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"System Prompt"}),s.jsx(_t,{rows:8,value:x.system_prompt,onChange:E=>v(I=>({...I,system_prompt:E.target.value})),placeholder:"补充 Agent 的职责边界、偏好和输出风格。"})]})]}),s.jsxs("label",{className:"inline-flex items-center gap-3 rounded-2xl border border-slate-200 px-4 py-3 text-sm text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:x.enabled,onChange:E=>v(I=>({...I,enabled:E.target.checked}))}),"启用该 Agent"]})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Skills"}),s.jsxs(J,{tone:"indigo",children:[x.enabled_skill_ids.length," 个已启用"]})]}),a.length?s.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:a.map(E=>s.jsxs("label",{className:"flex min-w-0 items-start gap-3 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm",children:[s.jsx("input",{className:"mt-1",type:"checkbox",checked:x.enabled_skill_ids.includes(E.id),onChange:I=>v(O=>({...O,enabled_skill_ids:Ed(O.enabled_skill_ids,E.id,I.target.checked)}))}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium text-slate-900",children:E.name}),s.jsx(J,{tone:E.source==="builtin"?"green":"amber",children:E.source==="builtin"?"内置":"用户"})]}),s.jsx("div",{className:"mt-1 break-words text-xs text-slate-500",children:E.description})]})]},E.id))}):s.jsx("div",{className:"rounded-2xl border border-dashed border-slate-200 bg-slate-50 px-4 py-6 text-center text-sm text-slate-500",children:"暂无可用 Skills。可先在 Skills 页面创建或上传。"})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"DWF 工具模式"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"选择 Agent 如何使用当前工作区 MCP。"})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("label",{className:"flex items-start gap-3 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm",children:[s.jsx("input",{className:"mt-1",type:"radio",name:"dwf_tool_mode",checked:x.dwf_tool_mode==="dwf_cli",onChange:()=>v(E=>({...E,dwf_tool_mode:"dwf_cli"}))}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-slate-900",children:"DWF-CLI命令行"}),s.jsx("div",{className:"mt-1 text-xs text-slate-500",children:"Agent 通过一个命令行工具按需查看和调用 DWF 能力,减少上下文占用。"})]})]}),s.jsxs("label",{className:"flex items-start gap-3 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm",children:[s.jsx("input",{className:"mt-1",type:"radio",name:"dwf_tool_mode",checked:x.dwf_tool_mode==="direct_mcp",onChange:()=>v(E=>({...E,dwf_tool_mode:"direct_mcp"}))}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-slate-900",children:"直连 MCP"}),s.jsx("div",{className:"mt-1 text-xs text-slate-500",children:"直接连接MCP Server服务,会占用较多上下文"})]})]})]})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"当前工作区 MCP"}),s.jsxs("div",{className:"flex items-center gap-2",children:[x.backend_mcp_instance_ids.length?s.jsx("button",{type:"button",className:"text-xs font-medium text-slate-500 hover:text-slate-700",onClick:()=>v(E=>({...E,backend_mcp_instance_ids:[]})),children:"清除绑定"}):null,s.jsxs(J,{tone:"indigo",children:[x.backend_mcp_instance_ids.length," 个已绑定"]})]})]}),l.length>0?s.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:l.map(E=>s.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm",children:[s.jsxs("label",{className:"flex min-w-0 flex-1 items-start gap-3",children:[s.jsx("input",{className:"mt-1",type:"radio",name:"backend_mcp_instance_id",checked:x.backend_mcp_instance_ids.includes(E.id),onChange:I=>v(O=>({...O,backend_mcp_instance_ids:I.target.checked?[E.id]:[]}))}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium text-slate-900",children:E.name}),s.jsx(J,{tone:"green",children:"平台托管"})]}),s.jsx("div",{className:"mt-1 break-all text-xs text-slate-500",children:E.proxy_endpoint||E.endpoint||"暂无地址"})]})]}),s.jsx("div",{className:"pt-1",children:s.jsx(We,{icon:ei,label:"测试连接",loading:w===`backend:${E.id}`,disabled:!(E.proxy_endpoint||E.endpoint),onClick:()=>void B(E)})})]},E.id))}):s.jsx("div",{className:"rounded-2xl border border-dashed border-slate-200 bg-slate-50 px-4 py-6 text-center text-sm text-slate-500",children:"暂无运行中的 MCP 实例,可前往 MCP 实例界面查看并运行。"})]}),s.jsxs("section",{className:"space-y-4 rounded-2xl border border-slate-200 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"外部 MCP"}),s.jsxs(J,{tone:"indigo",children:[x.mcp_connector_ids.length," 个已绑定"]})]}),s.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:i.map(E=>s.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm",children:[s.jsxs("label",{className:"flex min-w-0 flex-1 items-start gap-3",children:[s.jsx("input",{className:"mt-1",type:"checkbox",checked:x.mcp_connector_ids.includes(E.id),onChange:I=>v(O=>({...O,mcp_connector_ids:Ed(O.mcp_connector_ids,E.id,I.target.checked)}))}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium text-slate-900",children:E.name}),s.jsx(J,{tone:"amber",children:"外部"})]}),s.jsx("div",{className:"mt-1 truncate text-xs text-slate-500",children:E.url})]})]}),s.jsx("div",{className:"pt-1",children:s.jsx(We,{icon:ei,label:"测试连接",loading:w===`connector:${E.id}`,onClick:()=>void T(E)})})]},E.id))})]})]})})}function Q1(){const{agentApiBaseUrl:e,apiBaseUrl:t,defaultEnvironmentId:n}=Tt(),{pushToast:r}=ct(),[l,i]=p.useState([]),[a,o]=p.useState([]),[c,u]=p.useState([]),[d,f]=p.useState([]),[h,x]=p.useState([]),[v,w]=p.useState([]),[j,m]=p.useState(!0),[g,y]=p.useState(""),[k,N]=p.useState(!1),[S,b]=p.useState(null),[M,B]=p.useState(!1),[T,E]=p.useState(null);async function I(){if(!n){i([]),o([]),u([]),f([]),x([]),w([]),m(!1),y("");return}m(!0),y("");try{const[K,R,C,D,U,F]=await Promise.all([Nh(e,{dwf_instance_id:n}),yh(e),wh(e),by(e,{dwf_instance_id:n},t),jh(e),bh(e)]);i(K.items),o(R.items.filter(G=>G.enabled)),u(C.items),f(D.items),x(U.items.filter(G=>G.enabled)),w(F.items.filter(G=>G.enabled))}catch(K){y(Y(K))}finally{m(!1)}}p.useEffect(()=>{I()},[e,t,n]);async function O(K){B(!0);try{S?(await _y(e,S.id,K),r({tone:"success",title:"Agent 已更新",description:S.name})):(await Sy(e,{...K,dwf_instance_id:n}),r({tone:"success",title:"Agent 已创建",description:K.name})),N(!1),b(null),await I()}catch(R){r({tone:"error",title:"Agent 保存失败",description:Y(R)})}finally{B(!1)}}async function L(){if(T)try{await Cy(e,T.id),r({tone:"success",title:"Agent 已删除",description:T.name}),E(null),await I()}catch(K){r({tone:"error",title:"Agent 删除失败",description:Y(K)})}}const Q=[{key:"name",header:"Agent",headerClassName:"w-[32%]",cellClassName:"w-[32%]",render:K=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-semibold text-slate-900",children:K.name}),s.jsx("div",{className:"truncate text-sm text-slate-500",children:K.description||"暂无描述"})]})},{key:"provider",header:"模型",headerClassName:"w-[24%]",cellClassName:"w-[24%]",render:K=>s.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[s.jsx("div",{children:K.provider_name||"未绑定模型提供商"}),s.jsx("div",{children:K.model_id||"使用模型提供商默认模型"})]})},{key:"bindings",header:"MCP 工具",headerClassName:"w-[24%]",cellClassName:"w-[24%]",render:K=>{var R;return s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(J,{tone:"green",children:["工作区 MCP ",K.backend_mcp_instance_ids.length]}),s.jsxs(J,{tone:"amber",children:["外部 MCP ",K.mcp_connector_ids.length]}),s.jsxs(J,{tone:"indigo",children:["Skills ",((R=K.enabled_skill_ids)==null?void 0:R.length)??0]})]})}},{key:"status",header:"状态",headerClassName:"w-[10%]",cellClassName:"w-[10%]",render:K=>s.jsx(J,{tone:K.enabled?"green":"slate",children:K.enabled?"已启用":"已停用"})},{key:"actions",header:"操作",headerClassName:"w-[72px]",cellClassName:"w-[72px]",render:K=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{icon:rr,label:"编辑 Agent",onClick:()=>{b(K),N(!0)}}),s.jsx(We,{icon:Ft,label:"删除 Agent",tone:"danger",onClick:()=>E(K)})]})}];return n?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Agent配置"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"配置当前DWF工作区下的智能体。"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void I(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{b(null),N(!0)},children:"新建 Agent"})]})]}),j?s.jsx(gt,{label:"正在加载 Agent 配置..."}):null,!j&&g?s.jsx(Mt,{description:g,onRetry:()=>void I()}):null,!j&&!g&&l.length===0?s.jsx(Ue,{icon:In,title:"当前工作区下还没有 Agent",description:"先创建一个 Agent,绑定模型提供商与 MCP 后才能进入对话执行。",action:s.jsx(V,{icon:Pe,onClick:()=>{b(null),N(!0)},children:"新建 Agent"})}):null,!j&&!g&&l.length>0?s.jsx(Or,{columns:Q,rows:l,rowKey:K=>K.id}):null,s.jsx(V1,{open:k,agent:S,providers:a,modelCategories:c,backendMcpInstances:d,mcpConnectors:h,skills:v,submitting:M,onClose:()=>{N(!1),b(null)},onSubmit:O}),s.jsx(Bt,{open:!!T,title:"删除 Agent",description:`Agent“${(T==null?void 0:T.name)??""}”删除后,会清除所有关联对话的会话记录。`,confirmText:"确认删除",variant:"danger",onClose:()=>E(null),onConfirm:()=>void L()})]}):s.jsx(Ue,{icon:In,title:"请先选择 DWF 工作区",description:"Agent 与工作区绑定。先在左侧选择一个 DWF 工作区,再创建和查看该工作区下的 Agent。"})}function q1(e){return e.find(t=>t.category==="openrouter")??e[0]}function Pd(e,t){var l;const n=q1(t),r=e?t.find(i=>i.category===e.provider_type):n;return{name:(e==null?void 0:e.name)??"",provider_type:(e==null?void 0:e.provider_type)??(n==null?void 0:n.category)??"openrouter",base_url:(e==null?void 0:e.base_url)??(r==null?void 0:r.default_base_url)??"https://openrouter.ai/api/v1",default_model:(e==null?void 0:e.default_model)??((l=r==null?void 0:r.models[0])==null?void 0:l.id)??"",api_key:"",enabled:(e==null?void 0:e.enabled)??!0}}function K1(e,t){return!t||t.models.length===0?!0:e!=null&&e.default_model?!t.models.some(n=>n.id===e.default_model):!1}function G1({open:e,provider:t,modelCategories:n,submitting:r,onClose:l,onSubmit:i}){const[a,o]=p.useState(()=>Pd(t,n)),[c,u]=p.useState(!1);p.useEffect(()=>{if(!e)return;const w=Pd(t,n),j=n.find(m=>m.category===w.provider_type);o(w),u(K1(t,j))},[e,t,n]);const d=!!t,f=n.find(w=>w.category===a.provider_type),h=f||!a.provider_type?n:[...n,{category:a.provider_type,label:`${a.provider_type}(未在白名单)`,default_base_url:a.base_url,allow_custom_model:!0,models:[]}],x=(f==null?void 0:f.models)??[],v=x.length>0&&!c;return s.jsx(Zt,{open:e,title:d?"编辑 Model提供商":"新建 Model提供商",onClose:l,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:l,children:"取消"}),s.jsx(V,{loading:r,onClick:()=>void i({name:a.name.trim(),provider_type:a.provider_type,base_url:a.base_url.trim(),default_model:a.default_model.trim(),enabled:a.enabled,...a.api_key.trim()?{api_key:a.api_key.trim()}:{}}),children:d?"保存":"创建"})]}),children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("label",{className:"block space-y-2.5",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"名称"}),s.jsx(ae,{value:a.name,onChange:w=>o(j=>({...j,name:w.target.value})),placeholder:"用于标识模型提供商"})]}),s.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[s.jsxs("label",{className:"space-y-2.5",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"模型提供商"}),s.jsx(Ie,{value:a.provider_type,onChange:w=>{const j=w.target.value,m=n.find(g=>g.category===j);o(g=>{var y;return{...g,provider_type:j,base_url:(m==null?void 0:m.default_base_url)??g.base_url,default_model:((y=m==null?void 0:m.models[0])==null?void 0:y.id)??""}}),u(((m==null?void 0:m.models.length)??0)===0)},disabled:h.length===0,children:h.map(w=>s.jsx("option",{value:w.category,children:w.label},w.category))})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"默认模型"}),x.length>0&&(f!=null&&f.allow_custom_model)?s.jsx("button",{type:"button",className:"text-xs font-medium text-indigo-600 hover:text-indigo-700",onClick:()=>{u(w=>{const j=!w;return j||o(m=>{var g;return{...m,default_model:((g=x[0])==null?void 0:g.id)??""}}),j})},children:c?"选择内置模型":"自定义模型 ID"}):null]}),v?s.jsx(Ie,{value:a.default_model,onChange:w=>o(j=>({...j,default_model:w.target.value})),children:x.map(w=>s.jsx("option",{value:w.id,children:w.name},w.id))}):s.jsx(ae,{value:a.default_model,onChange:w=>o(j=>({...j,default_model:w.target.value})),placeholder:a.provider_type==="openrouter"?"例如:openai/gpt-4o-mini":"输入自定义模型 ID"})]})]}),s.jsxs("label",{className:"block space-y-2.5",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Base URL"}),s.jsx(ae,{value:a.base_url,onChange:w=>o(j=>({...j,base_url:w.target.value}))})]}),s.jsxs("label",{className:"block space-y-2.5",children:[s.jsxs("span",{className:"text-sm font-medium text-slate-700",children:["API Key",d?"(留空表示不修改)":""]}),s.jsx(ae,{type:"password",value:a.api_key,onChange:w=>o(j=>({...j,api_key:w.target.value})),placeholder:"输入该模型服务的 API Key"})]}),s.jsxs("label",{className:"inline-flex items-center gap-3 rounded-2xl border border-slate-200 px-4 py-3 text-sm text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:a.enabled,onChange:w=>o(j=>({...j,enabled:w.target.checked}))}),"启用该 Model提供商"]})]})})}function Z1(){const{agentApiBaseUrl:e}=Tt(),{pushToast:t}=ct(),[n,r]=p.useState([]),[l,i]=p.useState([]),[a,o]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,x]=p.useState(null),[v,w]=p.useState(!1),[j,m]=p.useState(null);async function g(){o(!0),u("");try{const[b,M]=await Promise.all([yh(e),wh(e)]);r(b.items),i(M.items)}catch(b){u(Y(b))}finally{o(!1)}}p.useEffect(()=>{g()},[e]);async function y(b){w(!0);try{h?(await gy(e,h.id,b),t({tone:"success",title:"Model提供商已更新",description:h.name})):(await xy(e,b),t({tone:"success",title:"Model提供商已创建",description:b.name})),f(!1),x(null),await g()}catch(M){t({tone:"error",title:"Model提供商保存失败",description:Y(M)})}finally{w(!1)}}async function k(){if(j)try{await vy(e,j.id),t({tone:"success",title:"Model提供商已删除",description:j.name}),m(null),await g()}catch(b){t({tone:"error",title:"Model提供商删除失败",description:Y(b)})}}async function N(b){try{const M=await yy(e,b.id);t({tone:"success",title:"Model提供商连接成功",description:M.models.length?`已发现 ${M.models.length} 个模型`:M.message})}catch(M){t({tone:"error",title:"Model提供商连接失败",description:Y(M)})}}const S=[{key:"name",header:"名称",headerClassName:"w-[22%]",cellClassName:"w-[22%]",render:b=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-semibold text-slate-900",children:b.name}),s.jsx("div",{className:"text-sm text-slate-500",children:b.provider_type})]})},{key:"endpoint",header:"服务地址",headerClassName:"w-[22%]",cellClassName:"w-[22%]",render:b=>s.jsxs("div",{className:"space-y-1 text-sm text-slate-500",children:[s.jsx("div",{className:"truncate",children:b.base_url}),s.jsx("div",{children:b.api_key_masked||"未配置 API Key"})]})},{key:"model",header:"默认模型",headerClassName:"w-[18%]",cellClassName:"w-[18%]",render:b=>s.jsx("div",{className:"text-sm text-slate-600",children:b.default_model||"未设置"})},{key:"status",header:"状态",headerClassName:"w-[16%]",cellClassName:"w-[16%]",render:b=>s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(J,{tone:b.enabled?"green":"slate",children:b.enabled?"已启用":"已停用"}),s.jsx(J,{tone:b.api_key_set?"indigo":"rose",children:b.api_key_set?"已配置 Key":"缺少 Key"})]})},{key:"actions",header:"操作",headerClassName:"w-[92px]",cellClassName:"w-[92px]",render:b=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{icon:ei,label:"测试连接",onClick:()=>void N(b)}),s.jsx(We,{icon:rr,label:"编辑 Model提供商",onClick:()=>{x(b),f(!0)}}),s.jsx(We,{icon:Ft,label:"删除 Model提供商",tone:"danger",onClick:()=>m(b)})]})}];return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Model提供商"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"管理推理服务模型提供商的凭证信息"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void g(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{x(null),f(!0)},children:"新建 Model提供商"})]})]}),a?s.jsx(gt,{label:"正在加载 Model提供商..."}):null,!a&&c?s.jsx(Mt,{description:c,onRetry:()=>void g()}):null,!a&&!c&&n.length===0?s.jsx(Ue,{icon:dh,title:"还没有 Model提供商",description:"先配置 Model提供商,后续 Agent 才能选择模型并执行任务。",action:s.jsx(V,{icon:Pe,onClick:()=>{x(null),f(!0)},children:"新建 Model提供商"})}):null,!a&&!c&&n.length>0?s.jsx(Or,{columns:S,rows:n,rowKey:b=>b.id}):null,s.jsx(G1,{open:d,provider:h,modelCategories:l,submitting:v,onClose:()=>{f(!1),x(null)},onSubmit:y}),s.jsx(Bt,{open:!!j,title:"删除 Model提供商",description:`Model提供商“${(j==null?void 0:j.name)??""}”删除后,关联 Agent 需要重新绑定新的模型服务。`,confirmText:"确认删除",variant:"danger",onClose:()=>m(null),onConfirm:()=>void k()})]})}function Td(e){return{name:(e==null?void 0:e.name)??"",description:(e==null?void 0:e.description)??"",url:(e==null?void 0:e.url)??"",headers:e?JSON.stringify(e.headers??{},null,2):"{}",enabled:(e==null?void 0:e.enabled)??!0}}function J1({open:e,server:t,submitting:n,onClose:r,onSubmit:l}){const{pushToast:i}=ct(),[a,o]=p.useState(Td(t));p.useEffect(()=>{e&&o(Td(t))},[e,t]);const c=!!t;function u(){try{const d=JSON.parse(a.headers||"{}");l({name:a.name.trim(),description:a.description.trim(),url:a.url.trim(),headers:d,enabled:a.enabled})}catch{i({tone:"error",title:"请求头格式不正确",description:"Headers 需要是有效的 JSON 对象。"})}}return s.jsx(Zt,{open:e,title:c?"编辑外部 MCP":"新建外部 MCP",onClose:r,footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:r,children:"取消"}),s.jsx(V,{loading:n,onClick:u,children:c?"保存 MCP":"创建 MCP"})]}),children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"名称"}),s.jsx(ae,{value:a.name,onChange:d=>o(f=>({...f,name:d.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"描述"}),s.jsx(_t,{rows:3,value:a.description,onChange:d=>o(f=>({...f,description:d.target.value}))})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"MCP URL"}),s.jsx(ae,{value:a.url,onChange:d=>o(f=>({...f,url:d.target.value})),placeholder:"https://example.com/mcp"})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Headers(JSON)"}),s.jsx(_t,{rows:5,value:a.headers,onChange:d=>o(f=>({...f,headers:d.target.value}))})]}),s.jsxs("label",{className:"inline-flex items-center gap-3 rounded-2xl border border-slate-200 px-4 py-3 text-sm text-slate-700",children:[s.jsx("input",{type:"checkbox",checked:a.enabled,onChange:d=>o(f=>({...f,enabled:d.target.checked}))}),"启用该 MCP 连接"]})]})})}function X1(){const{agentApiBaseUrl:e}=Tt(),{pushToast:t}=ct(),[n,r]=p.useState([]),[l,i]=p.useState(!0),[a,o]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,x]=p.useState(!1),[v,w]=p.useState(null);async function j(){i(!0),o("");try{const N=await jh(e);r(N.items)}catch(N){o(Y(N))}finally{i(!1)}}p.useEffect(()=>{j()},[e]);async function m(N){x(!0);try{d?(await jy(e,d.id,N),t({tone:"success",title:"外部 MCP 已更新",description:d.name})):(await wy(e,N),t({tone:"success",title:"外部 MCP 已创建",description:N.name})),u(!1),f(null),await j()}catch(S){t({tone:"error",title:"外部 MCP 保存失败",description:Y(S)})}finally{x(!1)}}async function g(){if(v)try{await ky(e,v.id),t({tone:"success",title:"外部 MCP 已删除",description:v.name}),w(null),await j()}catch(N){t({tone:"error",title:"外部 MCP 删除失败",description:Y(N)})}}async function y(N){try{const S=await kh(e,N.id);t({tone:"success",title:"MCP 连接成功",description:S.tool_count?`已发现 ${S.tool_count} 个工具`:S.message})}catch(S){t({tone:"error",title:"MCP 连接失败",description:Y(S)})}}const k=[{key:"name",header:"外部 MCP",headerClassName:"w-[32%]",cellClassName:"w-[32%]",render:N=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-semibold text-slate-900",children:N.name}),s.jsx("div",{className:"truncate text-sm text-slate-500",children:N.description||"暂无描述"})]})},{key:"url",header:"URL",headerClassName:"w-[40%]",cellClassName:"w-[40%]",render:N=>s.jsx("div",{title:N.url,className:"truncate font-mono text-xs text-slate-600",children:N.url})},{key:"status",header:"状态",headerClassName:"w-[18%]",cellClassName:"w-[18%]",render:N=>s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(J,{tone:N.enabled?"green":"slate",children:N.enabled?"已启用":"已停用"}),s.jsxs(J,{tone:"indigo",children:[Object.keys(N.headers??{}).length," 个请求头"]})]})},{key:"actions",header:"操作",headerClassName:"w-[92px]",cellClassName:"w-[92px]",render:N=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(We,{icon:ei,label:"测试连接",onClick:()=>void y(N)}),s.jsx(We,{icon:rr,label:"编辑外部 MCP",onClick:()=>{f(N),u(!0)}}),s.jsx(We,{icon:Ft,label:"删除外部 MCP",tone:"danger",onClick:()=>w(N)})]})}];return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"MCP管理"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"配置 Agent 可以连接的外部 Streamable-HTTP MCP Server连接。"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void j(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:()=>{f(null),u(!0)},children:"新建外部 MCP"})]})]}),l?s.jsx(gt,{label:"正在加载外部 MCP..."}):null,!l&&a?s.jsx(Mt,{description:a,onRetry:()=>void j()}):null,!l&&!a&&n.length===0?s.jsx(Ue,{icon:As,title:"未配置外部 MCP",description:"支持配置 Streamable-HTTP 协议的MCP Server,以供Agent连接。",action:s.jsx(V,{icon:Pe,onClick:()=>{f(null),u(!0)},children:"新建外部 MCP"})}):null,!l&&!a&&n.length>0?s.jsx(Or,{columns:k,rows:n,rowKey:N=>N.id}):null,s.jsx(J1,{open:c,server:d,submitting:h,onClose:()=>{u(!1),f(null)},onSubmit:m}),s.jsx(Bt,{open:!!v,title:"删除外部 MCP",description:`外部 MCP“${(v==null?void 0:v.name)??""}”删除后,相关 Agent 需要重新配置。`,confirmText:"确认删除",variant:"danger",onClose:()=>w(null),onConfirm:()=>void g()})]})}const ca=(e,t)=>`---
405
+ name: ${e||"my-skill"}
406
+ description: ${t||"Describe when and how this skill should be used."}
407
+ ---
408
+
409
+ # ${e||"my-skill"}
410
+
411
+ Use this skill when the task matches the description above.
412
+ `;function Md(e){return e==="builtin"?"内置":"用户"}function Rd(e){return e==="builtin"?"indigo":"green"}function Y1(){const{agentApiBaseUrl:e}=Tt(),{pushToast:t}=ct(),n=p.useRef(null),[r,l]=p.useState([]),[i,a]=p.useState(!0),[o,c]=p.useState(""),[u,d]=p.useState(null),[f,h]=p.useState("manual"),[x,v]=p.useState(null),[w,j]=p.useState(null),[m,g]=p.useState(()=>({name:"",description:"",skill_md:ca("","")})),[y,k]=p.useState(""),[N,S]=p.useState(!1),[b,M]=p.useState(!1),[B,T]=p.useState(null),[E,I]=p.useState(null);async function O(){a(!0),c("");try{const _=await bh(e);l(_.items)}catch(_){c(Y(_))}finally{a(!1)}}p.useEffect(()=>{O()},[e]);const L=p.useMemo(()=>u==="create"?"新建 Skill":u==="edit"?`编辑 ${(x==null?void 0:x.name)??"Skill"}`:(x==null?void 0:x.name)??"Skill详情",[u,x]);async function Q(_,le="detail"){try{const ie=await Ey(e,_.id);v(ie),k(ie.skill_md),d(le)}catch(ie){t({tone:"error",title:"Skill详情加载失败",description:Y(ie)})}}function K(){v(null),h("manual"),j(null),g({name:"",description:"",skill_md:ca("","")}),d("create")}function R(_){g(le=>{const ie={...le,..._};return _.name!==void 0||_.description!==void 0?{...ie,skill_md:ca(ie.name.trim(),ie.description.trim())}:ie})}async function C(){S(!0);try{const _=await Py(e,{name:m.name.trim(),description:m.description.trim(),skill_md:m.skill_md});t({tone:"success",title:"Skill已创建",description:_.name}),d(null),await O()}catch(_){t({tone:"error",title:"Skill创建失败",description:Y(_)})}finally{S(!1)}}async function D(){if(x){S(!0);try{const _=await fd(e,x.id,{skill_md:y});v(_),k(_.skill_md),d("detail"),t({tone:"success",title:"Skill已更新",description:_.name}),await O()}catch(_){t({tone:"error",title:"Skill更新失败",description:Y(_)})}finally{S(!1)}}}async function U(){if(!w){t({tone:"error",title:"请选择 ZIP 文件",description:"上传前需要先选择一个符合 Agent Skills 规范的 ZIP 包。"});return}M(!0);try{const _=await Ty(e,w);t({tone:"success",title:"Skill已上传",description:_.name}),d(null),await O()}catch(_){t({tone:"error",title:"Skill上传失败",description:Y(_)})}finally{M(!1),n.current&&(n.current.value="")}}async function F(){if(B)try{await My(e,B.id),t({tone:"success",title:"Skill已删除",description:B.name}),T(null),await O()}catch(_){t({tone:"error",title:"Skill删除失败",description:Y(_)})}}async function G(_){I(_.id);try{const le=await fd(e,_.id,{enabled:!_.enabled});l(ie=>ie.map(Re=>Re.id===le.id?le:Re)),t({tone:"success",title:le.enabled?"Skill已启用":"Skill已禁用",description:le.name})}catch(le){t({tone:"error",title:"Skill状态更新失败",description:Y(le)})}finally{I(null)}}const z=[{key:"name",header:"名称",headerClassName:"w-[14%]",cellClassName:"w-[14%]",render:_=>s.jsx("div",{className:"truncate font-semibold text-slate-900",title:_.name,children:_.name})},{key:"description",header:"描述",headerClassName:"w-[42%]",cellClassName:"w-[42%]",render:_=>s.jsx("div",{className:"group max-w-full rounded-xl transition-colors hover:bg-slate-50",children:s.jsx("div",{className:"line-clamp-2 max-w-full px-2 py-1 text-sm leading-6 text-slate-500 group-hover:line-clamp-none group-hover:text-slate-700",children:_.description||"暂无描述"})})},{key:"source",header:"来源",headerClassName:"w-[9%]",cellClassName:"w-[9%]",render:_=>s.jsx(J,{tone:Rd(_.source),children:Md(_.source)})},{key:"enabled",header:"启用状态",headerClassName:"w-[9%]",cellClassName:"w-[9%]",render:_=>s.jsx("button",{type:"button",role:"switch","aria-checked":_.enabled,title:_.enabled?"禁用 Skill":"启用 Skill",disabled:E===_.id,onClick:()=>void G(_),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${_.enabled?"bg-emerald-500 hover:bg-emerald-600":"bg-slate-300 hover:bg-slate-400"}`,children:s.jsx("span",{className:`h-5 w-5 rounded-full bg-white shadow-sm transition-transform ${_.enabled?"translate-x-[22px]":"translate-x-0.5"}`})})},{key:"updated",header:"更新时间",headerClassName:"w-[15%]",cellClassName:"w-[15%]",render:_=>s.jsx("div",{className:"text-sm text-slate-600",children:mt(_.updated_at)})},{key:"actions",header:"操作",headerClassName:"w-[11%]",cellClassName:"w-[11%]",render:_=>s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(We,{icon:oh,label:"查看 Skill",tooltipAlign:"end",onClick:()=>void Q(_)}),s.jsx(We,{icon:rr,label:"编辑 Skill",tooltipAlign:"end",disabled:_.source!=="user",onClick:()=>void Q(_,"edit")}),s.jsx(We,{icon:Ft,label:"删除 Skill",tone:"danger",tooltipAlign:"end",disabled:_.source!=="user",onClick:()=>T(_)})]})}];return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Skills库"}),s.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"创建或上传 Agent Skills,并在 Agent 配置中选择启用。"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{ref:n,type:"file",accept:".zip,application/zip,application/x-zip-compressed",className:"hidden",onChange:_=>{var le;return j(((le=_.target.files)==null?void 0:le[0])??null)}}),s.jsx(V,{variant:"secondary",icon:Ut,onClick:()=>void O(),children:"刷新"}),s.jsx(V,{icon:Pe,onClick:K,children:"新建 Skill"})]})]}),i?s.jsx(gt,{label:"正在加载 Skills..."}):null,!i&&o?s.jsx(Mt,{description:o,onRetry:()=>void O()}):null,!i&&!o&&r.length===0?s.jsx(Ue,{icon:$g,title:"还没有 Skills",description:"支持通过标准 SKILL.md 创建 Skill,或导入符合 Agent Skills 规范的 ZIP 包。",action:s.jsx(V,{icon:Pe,onClick:K,children:"新建 Skill"})}):null,!i&&!o&&r.length>0?s.jsx(Or,{columns:z,rows:r,rowKey:_=>_.id}):null,s.jsxs(Zt,{open:!!u,title:L,description:u==="create"?f==="upload"?"上传符合 Agent Skills 规范的 ZIP 包。":"创建一个标准 SKILL.md skill。":(x==null?void 0:x.description)||void 0,size:"xl",onClose:()=>d(null),footer:s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(V,{variant:"secondary",onClick:()=>d(null),children:"关闭"}),u==="create"?s.jsx(V,{loading:f==="upload"?b:N,onClick:()=>{if(f==="upload"){U();return}C()},children:f==="upload"?"上传 Skill":"创建 Skill"}):null,u==="edit"?s.jsx(V,{loading:N,onClick:()=>void D(),children:"保存 Skill"}):null]}),children:[u==="create"?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("button",{type:"button",onClick:()=>h("upload"),className:`flex items-start gap-3 rounded-2xl border px-4 py-4 text-left transition-colors ${f==="upload"?"border-indigo-300 bg-indigo-50 text-indigo-900":"border-slate-200 bg-white text-slate-700 hover:bg-slate-50"}`,children:[s.jsx(nv,{className:"mt-0.5 h-5 w-5 shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"上传本地 Skill ZIP"}),s.jsx("div",{className:"mt-1 text-xs leading-5 text-slate-500",children:"导入包含 SKILL.md 的标准 Skill 包。"})]})]}),s.jsxs("button",{type:"button",onClick:()=>h("manual"),className:`flex items-start gap-3 rounded-2xl border px-4 py-4 text-left transition-colors ${f==="manual"?"border-indigo-300 bg-indigo-50 text-indigo-900":"border-slate-200 bg-white text-slate-700 hover:bg-slate-50"}`,children:[s.jsx(Pe,{className:"mt-0.5 h-5 w-5 shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"创建 Skill"}),s.jsx("div",{className:"mt-1 text-xs leading-5 text-slate-500",children:"编辑 SKILL.md 并保存到 Skills 库。"})]})]})]}),f==="upload"?s.jsx("div",{className:"rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-5 py-6",children:s.jsxs("div",{className:"flex flex-col items-start gap-4 md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-semibold text-slate-900",children:(w==null?void 0:w.name)??"选择 Skill ZIP 文件"}),s.jsx("div",{className:"mt-1 break-words text-sm text-slate-500",children:w?`${Math.round(w.size/1024)} KB`:"ZIP 包需要包含单个 Skill 目录和 SKILL.md 文件。"})]}),s.jsx(V,{variant:"secondary",icon:nd,onClick:()=>{var _;return(_=n.current)==null?void 0:_.click()},children:"选择文件"})]})}):null,f==="manual"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Name"}),s.jsx(ae,{value:m.name,placeholder:"my-skill",onChange:_=>R({name:_.target.value})})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Description"}),s.jsx(ae,{value:m.description,placeholder:"When this skill should be used",onChange:_=>R({description:_.target.value})})]}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"SKILL.md"}),s.jsx(_t,{rows:18,className:"font-mono text-xs leading-5",value:m.skill_md,onChange:_=>g(le=>({...le,skill_md:_.target.value}))})]})]}):null]}):null,u==="detail"&&x?s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"Source"}),s.jsx("div",{className:"mt-2",children:s.jsx(J,{tone:Rd(x.source),children:Md(x.source)})})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"Files"}),s.jsx("div",{className:"mt-2 text-lg font-semibold text-slate-900",children:x.files.length})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-400",children:"Updated"}),s.jsx("div",{className:"mt-2 text-sm text-slate-700",children:mt(x.updated_at)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-800",children:[s.jsx(nd,{className:"h-4 w-4"}),"文件结构"]}),s.jsx("div",{className:"max-h-56 overflow-auto rounded-2xl border border-slate-200 bg-slate-50 p-3",children:x.files.length?s.jsx("div",{className:"space-y-1 font-mono text-xs text-slate-600",children:x.files.map(_=>s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsx("span",{children:_.type==="directory"?`${_.path}/`:_.path}),_.type==="file"?s.jsxs("span",{className:"shrink-0 text-slate-400",children:[_.size," B"]}):null]},_.path))}):s.jsx("div",{className:"text-sm text-slate-500",children:"暂无文件"})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-800",children:[s.jsx(qg,{className:"h-4 w-4"}),"SKILL.md"]}),s.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-2xl border border-slate-200 bg-slate-950 p-4 text-xs leading-5 text-slate-100",children:x.skill_md})]})]}):null,u==="edit"&&x?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"只能编辑用户 Skill 的 SKILL.md。Name 必须保持与目录名和 frontmatter 一致。"}),s.jsxs("label",{className:"space-y-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-700",children:"SKILL.md"}),s.jsx(_t,{rows:24,className:"font-mono text-xs leading-5",value:y,onChange:_=>k(_.target.value)})]})]}):null]}),s.jsx(Bt,{open:!!B,title:"删除 Skill",description:`Skill“${(B==null?void 0:B.name)??""}”删除后,会从所有 Agent 配置中移除。`,confirmText:"确认删除",variant:"danger",onClose:()=>T(null),onConfirm:()=>void F()})]})}function ew(){return s.jsxs(gg,{children:[s.jsxs(qe,{element:s.jsx(Iv,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(ll,{to:"/environments",replace:!0})}),s.jsx(qe,{path:"/environments",element:s.jsx(Gv,{})}),s.jsx(qe,{path:"/mcp-instances",element:s.jsx(iy,{})}),s.jsx(qe,{path:"/tools",element:s.jsx(dy,{})}),s.jsx(qe,{path:"/tool-evolution",element:s.jsx(hy,{})}),s.jsxs(qe,{path:"/agent",element:s.jsx(my,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(ll,{to:"/agent/chat",replace:!0})}),s.jsx(qe,{path:"chat",element:s.jsx(W1,{})}),s.jsx(qe,{path:"configs",element:s.jsx(Q1,{})}),s.jsx(qe,{path:"providers",element:s.jsx(Z1,{})}),s.jsx(qe,{path:"mcp",element:s.jsx(X1,{})}),s.jsx(qe,{path:"skills",element:s.jsx(Y1,{})}),s.jsx(qe,{path:"*",element:s.jsx(ll,{to:"/agent/chat",replace:!0})})]})]}),s.jsx(qe,{path:"*",element:s.jsx(ll,{to:"/environments",replace:!0})})]})}function tw(){return s.jsx(Mv,{children:s.jsx(Ov,{children:s.jsx(Sg,{children:s.jsx(ew,{})})})})}da.createRoot(document.getElementById("root")).render(s.jsx(tw,{}));