openclaw-agent-builder 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -8
- package/dist/assets/index-C9IXUW-V.css +1 -0
- package/dist/assets/index-CHYw1YB7.js +263 -0
- package/dist/index.html +2 -2
- package/electron/icons/icon.icns +0 -0
- package/electron/icons/icon.ico +0 -0
- package/electron/icons/icon.png +0 -0
- package/electron/main.js +161 -0
- package/package.json +15 -3
- package/server/index.js +5 -4
- package/server/routes/chat.js +6 -3
- package/server/utils/paths.js +19 -0
- package/dist/assets/index-C7Hk4nus.css +0 -1
- package/dist/assets/index-CpVghac4.js +0 -227
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
(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 s of l)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ha={exports:{}},vl={},Va={exports:{}},D={};/**
|
|
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 pr=Symbol.for("react.element"),md=Symbol.for("react.portal"),hd=Symbol.for("react.fragment"),gd=Symbol.for("react.strict_mode"),yd=Symbol.for("react.profiler"),xd=Symbol.for("react.provider"),vd=Symbol.for("react.context"),wd=Symbol.for("react.forward_ref"),kd=Symbol.for("react.suspense"),Sd=Symbol.for("react.memo"),jd=Symbol.for("react.lazy"),Ni=Symbol.iterator;function Nd(e){return e===null||typeof e!="object"?null:(e=Ni&&e[Ni]||e["@@iterator"],typeof e=="function"?e:null)}var Ka={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ga=Object.assign,Ya={};function Sn(e,t,n){this.props=e,this.context=t,this.refs=Ya,this.updater=n||Ka}Sn.prototype.isReactComponent={};Sn.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")};Sn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qa(){}Qa.prototype=Sn.prototype;function oo(e,t,n){this.props=e,this.context=t,this.refs=Ya,this.updater=n||Ka}var io=oo.prototype=new Qa;io.constructor=oo;Ga(io,Sn.prototype);io.isPureReactComponent=!0;var bi=Array.isArray,Xa=Object.prototype.hasOwnProperty,ao={current:null},Ja={key:!0,ref:!0,__self:!0,__source:!0};function Za(e,t,n){var r,l={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Xa.call(t,r)&&!Ja.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1<a){for(var u=Array(a),d=0;d<a;d++)u[d]=arguments[d+2];l.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)l[r]===void 0&&(l[r]=a[r]);return{$$typeof:pr,type:e,key:s,ref:i,props:l,_owner:ao.current}}function bd(e,t){return{$$typeof:pr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function uo(e){return typeof e=="object"&&e!==null&&e.$$typeof===pr}function Cd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ci=/\/+/g;function Ml(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Cd(""+e.key):t.toString(36)}function Or(e,t,n,r,l){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case pr:case md:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+Ml(i,0):r,bi(l)?(n="",e!=null&&(n=e.replace(Ci,"$&/")+"/"),Or(l,t,n,"",function(d){return d})):l!=null&&(uo(l)&&(l=bd(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(Ci,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",bi(e))for(var a=0;a<e.length;a++){s=e[a];var u=r+Ml(s,a);i+=Or(s,t,n,u,l)}else if(u=Nd(e),typeof u=="function")for(e=u.call(e),a=0;!(s=e.next()).done;)s=s.value,u=r+Ml(s,a++),i+=Or(s,t,n,u,l);else if(s==="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 i}function xr(e,t,n){if(e==null)return e;var r=[],l=0;return Or(e,r,"","",function(s){return t.call(n,s,l++)}),r}function Ed(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 ve={current:null},zr={transition:null},_d={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:zr,ReactCurrentOwner:ao};function qa(){throw Error("act(...) is not supported in production builds of React.")}D.Children={map:xr,forEach:function(e,t,n){xr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xr(e,function(){t++}),t},toArray:function(e){return xr(e,function(t){return t})||[]},only:function(e){if(!uo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};D.Component=Sn;D.Fragment=hd;D.Profiler=yd;D.PureComponent=oo;D.StrictMode=gd;D.Suspense=kd;D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_d;D.act=qa;D.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=Ga({},e.props),l=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=ao.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)Xa.call(t,u)&&!Ja.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var d=0;d<u;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:pr,type:e.type,key:l,ref:s,props:r,_owner:i}};D.createContext=function(e){return e={$$typeof:vd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xd,_context:e},e.Consumer=e};D.createElement=Za;D.createFactory=function(e){var t=Za.bind(null,e);return t.type=e,t};D.createRef=function(){return{current:null}};D.forwardRef=function(e){return{$$typeof:wd,render:e}};D.isValidElement=uo;D.lazy=function(e){return{$$typeof:jd,_payload:{_status:-1,_result:e},_init:Ed}};D.memo=function(e,t){return{$$typeof:Sd,type:e,compare:t===void 0?null:t}};D.startTransition=function(e){var t=zr.transition;zr.transition={};try{e()}finally{zr.transition=t}};D.unstable_act=qa;D.useCallback=function(e,t){return ve.current.useCallback(e,t)};D.useContext=function(e){return ve.current.useContext(e)};D.useDebugValue=function(){};D.useDeferredValue=function(e){return ve.current.useDeferredValue(e)};D.useEffect=function(e,t){return ve.current.useEffect(e,t)};D.useId=function(){return ve.current.useId()};D.useImperativeHandle=function(e,t,n){return ve.current.useImperativeHandle(e,t,n)};D.useInsertionEffect=function(e,t){return ve.current.useInsertionEffect(e,t)};D.useLayoutEffect=function(e,t){return ve.current.useLayoutEffect(e,t)};D.useMemo=function(e,t){return ve.current.useMemo(e,t)};D.useReducer=function(e,t,n){return ve.current.useReducer(e,t,n)};D.useRef=function(e){return ve.current.useRef(e)};D.useState=function(e){return ve.current.useState(e)};D.useSyncExternalStore=function(e,t,n){return ve.current.useSyncExternalStore(e,t,n)};D.useTransition=function(){return ve.current.useTransition()};D.version="18.3.1";Va.exports=D;var w=Va.exports;const eu=Ba(w);/**
|
|
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 Td=w,Pd=Symbol.for("react.element"),Id=Symbol.for("react.fragment"),Ad=Object.prototype.hasOwnProperty,Rd=Td.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ld={key:!0,ref:!0,__self:!0,__source:!0};function tu(e,t,n){var r,l={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Ad.call(t,r)&&!Ld.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:Pd,type:e,key:s,ref:i,props:l,_owner:Rd.current}}vl.Fragment=Id;vl.jsx=tu;vl.jsxs=tu;Ha.exports=vl;var o=Ha.exports,fs={},nu={exports:{}},Ae={},ru={exports:{}},lu={};/**
|
|
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(S,P){var A=S.length;S.push(P);e:for(;0<A;){var O=A-1>>>1,$=S[O];if(0<l($,P))S[O]=P,S[A]=$,A=O;else break e}}function n(S){return S.length===0?null:S[0]}function r(S){if(S.length===0)return null;var P=S[0],A=S.pop();if(A!==P){S[0]=A;e:for(var O=0,$=S.length,oe=$>>>1;O<oe;){var ie=2*(O+1)-1,Ye=S[ie],L=ie+1,_=S[L];if(0>l(Ye,A))L<$&&0>l(_,Ye)?(S[O]=_,S[L]=A,O=L):(S[O]=Ye,S[ie]=A,O=ie);else if(L<$&&0>l(_,A))S[O]=_,S[L]=A,O=L;else break e}}return P}function l(S,P){var A=S.sortIndex-P.sortIndex;return A!==0?A:S.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],d=[],g=1,h=null,m=3,x=!1,v=!1,k=!1,I=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(S){for(var P=n(d);P!==null;){if(P.callback===null)r(d);else if(P.startTime<=S)r(d),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(d)}}function y(S){if(k=!1,f(S),!v)if(n(u)!==null)v=!0,J(j);else{var P=n(d);P!==null&&H(y,P.startTime-S)}}function j(S,P){v=!1,k&&(k=!1,p(E),E=-1),x=!0;var A=m;try{for(f(P),h=n(u);h!==null&&(!(h.expirationTime>P)||S&&!M());){var O=h.callback;if(typeof O=="function"){h.callback=null,m=h.priorityLevel;var $=O(h.expirationTime<=P);P=e.unstable_now(),typeof $=="function"?h.callback=$:h===n(u)&&r(u),f(P)}else r(u);h=n(u)}if(h!==null)var oe=!0;else{var ie=n(d);ie!==null&&H(y,ie.startTime-P),oe=!1}return oe}finally{h=null,m=A,x=!1}}var b=!1,C=null,E=-1,F=5,R=-1;function M(){return!(e.unstable_now()-R<F)}function W(){if(C!==null){var S=e.unstable_now();R=S;var P=!0;try{P=C(!0,S)}finally{P?se():(b=!1,C=null)}}else b=!1}var se;if(typeof c=="function")se=function(){c(W)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ke=fe.port2;fe.port1.onmessage=W,se=function(){ke.postMessage(null)}}else se=function(){I(W,0)};function J(S){C=S,b||(b=!0,se())}function H(S,P){E=I(function(){S(e.unstable_now())},P)}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(S){S.callback=null},e.unstable_continueExecution=function(){v||x||(v=!0,J(j))},e.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<S?Math.floor(1e3/S):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(S){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var A=m;m=P;try{return S()}finally{m=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(S,P){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var A=m;m=S;try{return P()}finally{m=A}},e.unstable_scheduleCallback=function(S,P,A){var O=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?O+A:O):A=O,S){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=A+$,S={id:g++,callback:P,priorityLevel:S,startTime:A,expirationTime:$,sortIndex:-1},A>O?(S.sortIndex=A,t(d,S),n(u)===null&&S===n(d)&&(k?(p(E),E=-1):k=!0,H(y,A-O))):(S.sortIndex=$,t(u,S),v||x||(v=!0,J(j))),S},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(S){var P=m;return function(){var A=m;m=P;try{return S.apply(this,arguments)}finally{m=A}}}})(lu);ru.exports=lu;var Dd=ru.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 Od=w,Ie=Dd;function N(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 su=new Set,Qn={};function Ht(e,t){mn(e,t),mn(e+"Capture",t)}function mn(e,t){for(Qn[e]=t,e=0;e<t.length;e++)su.add(t[e])}var ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ps=Object.prototype.hasOwnProperty,zd=/^[: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]*$/,Ei={},_i={};function Md(e){return ps.call(_i,e)?!0:ps.call(Ei,e)?!1:zd.test(e)?_i[e]=!0:(Ei[e]=!0,!1)}function Fd(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 Ud(e,t,n,r){if(t===null||typeof t>"u"||Fd(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 we(e,t,n,r,l,s,i){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=s,this.removeEmptyString=i}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new we(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){de[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){de[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){de[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var co=/[\-:]([a-z])/g;function fo(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(co,fo);de[t]=new we(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(co,fo);de[t]=new we(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(co,fo);de[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});de.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){de[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function po(e,t,n,r){var l=de.hasOwnProperty(t)?de[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ud(t,n,l,r)&&(n=null),r||l===null?Md(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 ct=Od.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vr=Symbol.for("react.element"),Qt=Symbol.for("react.portal"),Xt=Symbol.for("react.fragment"),mo=Symbol.for("react.strict_mode"),ms=Symbol.for("react.profiler"),ou=Symbol.for("react.provider"),iu=Symbol.for("react.context"),ho=Symbol.for("react.forward_ref"),hs=Symbol.for("react.suspense"),gs=Symbol.for("react.suspense_list"),go=Symbol.for("react.memo"),ft=Symbol.for("react.lazy"),au=Symbol.for("react.offscreen"),Ti=Symbol.iterator;function Cn(e){return e===null||typeof e!="object"?null:(e=Ti&&e[Ti]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,Fl;function On(e){if(Fl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fl=t&&t[1]||""}return`
|
|
34
|
+
`+Fl+e}var Ul=!1;function Wl(e,t){if(!e||Ul)return"";Ul=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var l=d.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),i=l.length-1,a=s.length-1;1<=i&&0<=a&&l[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(l[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||l[i]!==s[a]){var u=`
|
|
37
|
+
`+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=a);break}}}finally{Ul=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?On(e):""}function Wd(e){switch(e.tag){case 5:return On(e.type);case 16:return On("Lazy");case 13:return On("Suspense");case 19:return On("SuspenseList");case 0:case 2:case 15:return e=Wl(e.type,!1),e;case 11:return e=Wl(e.type.render,!1),e;case 1:return e=Wl(e.type,!0),e;default:return""}}function ys(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 Xt:return"Fragment";case Qt:return"Portal";case ms:return"Profiler";case mo:return"StrictMode";case hs:return"Suspense";case gs:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iu:return(e.displayName||"Context")+".Consumer";case ou:return(e._context.displayName||"Context")+".Provider";case ho:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case go:return t=e.displayName||null,t!==null?t:ys(e.type)||"Memo";case ft:t=e._payload,e=e._init;try{return ys(e(t))}catch{}}return null}function $d(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 ys(t);case 8:return t===mo?"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 Ct(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bd(e){var t=uu(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wr(e){e._valueTracker||(e._valueTracker=Bd(e))}function cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yr(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 xs(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ct(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 du(e,t){t=t.checked,t!=null&&po(e,"checked",t,!1)}function vs(e,t){du(e,t);var n=Ct(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")?ws(e,t.type,n):t.hasOwnProperty("defaultValue")&&ws(e,t.type,Ct(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ii(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 ws(e,t,n){(t!=="number"||Yr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zn=Array.isArray;function an(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=""+Ct(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 ks(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(N(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ai(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(N(92));if(zn(n)){if(1<n.length)throw Error(N(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ct(n)}}function fu(e,t){var n=Ct(t.value),r=Ct(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 Ri(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function pu(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 Ss(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?pu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kr,mu=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(kr=kr||document.createElement("div"),kr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Un={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},Hd=["Webkit","ms","Moz","O"];Object.keys(Un).forEach(function(e){Hd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Un[t]=Un[e]})});function hu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Un.hasOwnProperty(e)&&Un[e]?(""+t).trim():t+"px"}function gu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=hu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Vd=X({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 js(e,t){if(t){if(Vd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Ns(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 bs=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cs=null,un=null,cn=null;function Li(e){if(e=gr(e)){if(typeof Cs!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Nl(t),Cs(e.stateNode,e.type,t))}}function yu(e){un?cn?cn.push(e):cn=[e]:un=e}function xu(){if(un){var e=un,t=cn;if(cn=un=null,Li(e),t)for(e=0;e<t.length;e++)Li(t[e])}}function vu(e,t){return e(t)}function wu(){}var $l=!1;function ku(e,t,n){if($l)return e(t,n);$l=!0;try{return vu(e,t,n)}finally{$l=!1,(un!==null||cn!==null)&&(wu(),xu())}}function Jn(e,t){var n=e.stateNode;if(n===null)return null;var r=Nl(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(N(231,t,typeof n));return n}var Es=!1;if(ot)try{var En={};Object.defineProperty(En,"passive",{get:function(){Es=!0}}),window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{Es=!1}function Kd(e,t,n,r,l,s,i,a,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(g){this.onError(g)}}var Wn=!1,Qr=null,Xr=!1,_s=null,Gd={onError:function(e){Wn=!0,Qr=e}};function Yd(e,t,n,r,l,s,i,a,u){Wn=!1,Qr=null,Kd.apply(Gd,arguments)}function Qd(e,t,n,r,l,s,i,a,u){if(Yd.apply(this,arguments),Wn){if(Wn){var d=Qr;Wn=!1,Qr=null}else throw Error(N(198));Xr||(Xr=!0,_s=d)}}function Vt(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 Su(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 Di(e){if(Vt(e)!==e)throw Error(N(188))}function Xd(e){var t=e.alternate;if(!t){if(t=Vt(e),t===null)throw Error(N(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var s=l.alternate;if(s===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===n)return Di(l),e;if(s===r)return Di(l),t;s=s.sibling}throw Error(N(188))}if(n.return!==r.return)n=l,r=s;else{for(var i=!1,a=l.child;a;){if(a===n){i=!0,n=l,r=s;break}if(a===r){i=!0,r=l,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=l;break}if(a===r){i=!0,r=s,n=l;break}a=a.sibling}if(!i)throw Error(N(189))}}if(n.alternate!==r)throw Error(N(190))}if(n.tag!==3)throw Error(N(188));return n.stateNode.current===n?e:t}function ju(e){return e=Xd(e),e!==null?Nu(e):null}function Nu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nu(e);if(t!==null)return t;e=e.sibling}return null}var bu=Ie.unstable_scheduleCallback,Oi=Ie.unstable_cancelCallback,Jd=Ie.unstable_shouldYield,Zd=Ie.unstable_requestPaint,q=Ie.unstable_now,qd=Ie.unstable_getCurrentPriorityLevel,xo=Ie.unstable_ImmediatePriority,Cu=Ie.unstable_UserBlockingPriority,Jr=Ie.unstable_NormalPriority,ef=Ie.unstable_LowPriority,Eu=Ie.unstable_IdlePriority,wl=null,Ze=null;function tf(e){if(Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(wl,e,void 0,(e.current.flags&128)===128)}catch{}}var Ve=Math.clz32?Math.clz32:lf,nf=Math.log,rf=Math.LN2;function lf(e){return e>>>=0,e===0?32:31-(nf(e)/rf|0)|0}var Sr=64,jr=4194304;function Mn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Mn(a):(s&=i,s!==0&&(r=Mn(s)))}else i=n&~l,i!==0?r=Mn(i):s!==0&&(r=Mn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&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-Ve(t),l=1<<n,r|=e[n],t&=~l;return r}function sf(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 of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Ve(s),a=1<<i,u=l[i];u===-1?(!(a&n)||a&r)&&(l[i]=sf(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}function Ts(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _u(){var e=Sr;return Sr<<=1,!(Sr&4194240)&&(Sr=64),e}function Bl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ve(t),e[t]=n}function af(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-Ve(n),s=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~s}}function vo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ve(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var U=0;function Tu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Pu,wo,Iu,Au,Ru,Ps=!1,Nr=[],xt=null,vt=null,wt=null,Zn=new Map,qn=new Map,mt=[],uf="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 zi(e,t){switch(e){case"focusin":case"focusout":xt=null;break;case"dragenter":case"dragleave":vt=null;break;case"mouseover":case"mouseout":wt=null;break;case"pointerover":case"pointerout":Zn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qn.delete(t.pointerId)}}function _n(e,t,n,r,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[l]},t!==null&&(t=gr(t),t!==null&&wo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function cf(e,t,n,r,l){switch(t){case"focusin":return xt=_n(xt,e,t,n,r,l),!0;case"dragenter":return vt=_n(vt,e,t,n,r,l),!0;case"mouseover":return wt=_n(wt,e,t,n,r,l),!0;case"pointerover":var s=l.pointerId;return Zn.set(s,_n(Zn.get(s)||null,e,t,n,r,l)),!0;case"gotpointercapture":return s=l.pointerId,qn.set(s,_n(qn.get(s)||null,e,t,n,r,l)),!0}return!1}function Lu(e){var t=Lt(e.target);if(t!==null){var n=Vt(t);if(n!==null){if(t=n.tag,t===13){if(t=Su(n),t!==null){e.blockedOn=t,Ru(e.priority,function(){Iu(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 Mr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Is(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bs=r,n.target.dispatchEvent(r),bs=null}else return t=gr(n),t!==null&&wo(t),e.blockedOn=n,!1;t.shift()}return!0}function Mi(e,t,n){Mr(e)&&n.delete(t)}function df(){Ps=!1,xt!==null&&Mr(xt)&&(xt=null),vt!==null&&Mr(vt)&&(vt=null),wt!==null&&Mr(wt)&&(wt=null),Zn.forEach(Mi),qn.forEach(Mi)}function Tn(e,t){e.blockedOn===t&&(e.blockedOn=null,Ps||(Ps=!0,Ie.unstable_scheduleCallback(Ie.unstable_NormalPriority,df)))}function er(e){function t(l){return Tn(l,e)}if(0<Nr.length){Tn(Nr[0],e);for(var n=1;n<Nr.length;n++){var r=Nr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xt!==null&&Tn(xt,e),vt!==null&&Tn(vt,e),wt!==null&&Tn(wt,e),Zn.forEach(t),qn.forEach(t),n=0;n<mt.length;n++)r=mt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<mt.length&&(n=mt[0],n.blockedOn===null);)Lu(n),n.blockedOn===null&&mt.shift()}var dn=ct.ReactCurrentBatchConfig,qr=!0;function ff(e,t,n,r){var l=U,s=dn.transition;dn.transition=null;try{U=1,ko(e,t,n,r)}finally{U=l,dn.transition=s}}function pf(e,t,n,r){var l=U,s=dn.transition;dn.transition=null;try{U=4,ko(e,t,n,r)}finally{U=l,dn.transition=s}}function ko(e,t,n,r){if(qr){var l=Is(e,t,n,r);if(l===null)ql(e,t,r,el,n),zi(e,r);else if(cf(l,e,t,n,r))r.stopPropagation();else if(zi(e,r),t&4&&-1<uf.indexOf(e)){for(;l!==null;){var s=gr(l);if(s!==null&&Pu(s),s=Is(e,t,n,r),s===null&&ql(e,t,r,el,n),s===l)break;l=s}l!==null&&r.stopPropagation()}else ql(e,t,r,null,n)}}var el=null;function Is(e,t,n,r){if(el=null,e=yo(r),e=Lt(e),e!==null)if(t=Vt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Su(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 el=e,null}function Du(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(qd()){case xo:return 1;case Cu:return 4;case Jr:case ef:return 16;case Eu:return 536870912;default:return 16}default:return 16}}var gt=null,So=null,Fr=null;function Ou(){if(Fr)return Fr;var e,t=So,n=t.length,r,l="value"in gt?gt.value:gt.textContent,s=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[s-r];r++);return Fr=l.slice(e,1<r?1-r:void 0)}function Ur(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 br(){return!0}function Fi(){return!1}function Re(e){function t(n,r,l,s,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?br:Fi,this.isPropagationStopped=Fi,this}return X(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=br)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=br)},persist:function(){},isPersistent:br}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=Re(jn),hr=X({},jn,{view:0,detail:0}),mf=Re(hr),Hl,Vl,Pn,kl=X({},hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:No,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!==Pn&&(Pn&&e.type==="mousemove"?(Hl=e.screenX-Pn.screenX,Vl=e.screenY-Pn.screenY):Vl=Hl=0,Pn=e),Hl)},movementY:function(e){return"movementY"in e?e.movementY:Vl}}),Ui=Re(kl),hf=X({},kl,{dataTransfer:0}),gf=Re(hf),yf=X({},hr,{relatedTarget:0}),Kl=Re(yf),xf=X({},jn,{animationName:0,elapsedTime:0,pseudoElement:0}),vf=Re(xf),wf=X({},jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kf=Re(wf),Sf=X({},jn,{data:0}),Wi=Re(Sf),jf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nf={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"},bf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bf[e])?!!t[e]:!1}function No(){return Cf}var Ef=X({},hr,{key:function(e){if(e.key){var t=jf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ur(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:No,charCode:function(e){return e.type==="keypress"?Ur(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ur(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_f=Re(Ef),Tf=X({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$i=Re(Tf),Pf=X({},hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:No}),If=Re(Pf),Af=X({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rf=Re(Af),Lf=X({},kl,{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}),Df=Re(Lf),Of=[9,13,27,32],bo=ot&&"CompositionEvent"in window,$n=null;ot&&"documentMode"in document&&($n=document.documentMode);var zf=ot&&"TextEvent"in window&&!$n,zu=ot&&(!bo||$n&&8<$n&&11>=$n),Bi=" ",Hi=!1;function Mu(e,t){switch(e){case"keyup":return Of.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jt=!1;function Mf(e,t){switch(e){case"compositionend":return Fu(t);case"keypress":return t.which!==32?null:(Hi=!0,Bi);case"textInput":return e=t.data,e===Bi&&Hi?null:e;default:return null}}function Ff(e,t){if(Jt)return e==="compositionend"||!bo&&Mu(e,t)?(e=Ou(),Fr=So=gt=null,Jt=!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 zu&&t.locale!=="ko"?null:t.data;default:return null}}var Uf={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 Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Uf[e.type]:t==="textarea"}function Uu(e,t,n,r){yu(r),t=tl(t,"onChange"),0<t.length&&(n=new jo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bn=null,tr=null;function Wf(e){Ju(e,0)}function Sl(e){var t=en(e);if(cu(t))return e}function $f(e,t){if(e==="change")return t}var Wu=!1;if(ot){var Gl;if(ot){var Yl="oninput"in document;if(!Yl){var Ki=document.createElement("div");Ki.setAttribute("oninput","return;"),Yl=typeof Ki.oninput=="function"}Gl=Yl}else Gl=!1;Wu=Gl&&(!document.documentMode||9<document.documentMode)}function Gi(){Bn&&(Bn.detachEvent("onpropertychange",$u),tr=Bn=null)}function $u(e){if(e.propertyName==="value"&&Sl(tr)){var t=[];Uu(t,tr,e,yo(e)),ku(Wf,t)}}function Bf(e,t,n){e==="focusin"?(Gi(),Bn=t,tr=n,Bn.attachEvent("onpropertychange",$u)):e==="focusout"&&Gi()}function Hf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sl(tr)}function Vf(e,t){if(e==="click")return Sl(t)}function Kf(e,t){if(e==="input"||e==="change")return Sl(t)}function Gf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ge=typeof Object.is=="function"?Object.is:Gf;function nr(e,t){if(Ge(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(!ps.call(t,l)||!Ge(e[l],t[l]))return!1}return!0}function Yi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qi(e,t){var n=Yi(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=Yi(n)}}function Bu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(){for(var e=window,t=Yr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yr(e.document)}return t}function Co(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 Yf(e){var t=Hu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bu(n.ownerDocument.documentElement,n)){if(r!==null&&Co(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,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Qi(n,s);var i=Qi(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 Qf=ot&&"documentMode"in document&&11>=document.documentMode,Zt=null,As=null,Hn=null,Rs=!1;function Xi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rs||Zt==null||Zt!==Yr(r)||(r=Zt,"selectionStart"in r&&Co(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}),Hn&&nr(Hn,r)||(Hn=r,r=tl(As,"onSelect"),0<r.length&&(t=new jo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zt)))}function Cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qt={animationend:Cr("Animation","AnimationEnd"),animationiteration:Cr("Animation","AnimationIteration"),animationstart:Cr("Animation","AnimationStart"),transitionend:Cr("Transition","TransitionEnd")},Ql={},Vu={};ot&&(Vu=document.createElement("div").style,"AnimationEvent"in window||(delete qt.animationend.animation,delete qt.animationiteration.animation,delete qt.animationstart.animation),"TransitionEvent"in window||delete qt.transitionend.transition);function jl(e){if(Ql[e])return Ql[e];if(!qt[e])return e;var t=qt[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vu)return Ql[e]=t[n];return e}var Ku=jl("animationend"),Gu=jl("animationiteration"),Yu=jl("animationstart"),Qu=jl("transitionend"),Xu=new Map,Ji="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 Tt(e,t){Xu.set(e,t),Ht(t,[e])}for(var Xl=0;Xl<Ji.length;Xl++){var Jl=Ji[Xl],Xf=Jl.toLowerCase(),Jf=Jl[0].toUpperCase()+Jl.slice(1);Tt(Xf,"on"+Jf)}Tt(Ku,"onAnimationEnd");Tt(Gu,"onAnimationIteration");Tt(Yu,"onAnimationStart");Tt("dblclick","onDoubleClick");Tt("focusin","onFocus");Tt("focusout","onBlur");Tt(Qu,"onTransitionEnd");mn("onMouseEnter",["mouseout","mouseover"]);mn("onMouseLeave",["mouseout","mouseover"]);mn("onPointerEnter",["pointerout","pointerover"]);mn("onPointerLeave",["pointerout","pointerover"]);Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fn="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(" "),Zf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fn));function Zi(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Qd(r,t,void 0,e),e.currentTarget=null}function Ju(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 s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],u=a.instance,d=a.currentTarget;if(a=a.listener,u!==s&&l.isPropagationStopped())break e;Zi(l,a,d),s=u}else for(i=0;i<r.length;i++){if(a=r[i],u=a.instance,d=a.currentTarget,a=a.listener,u!==s&&l.isPropagationStopped())break e;Zi(l,a,d),s=u}}}if(Xr)throw e=_s,Xr=!1,_s=null,e}function V(e,t){var n=t[Ms];n===void 0&&(n=t[Ms]=new Set);var r=e+"__bubble";n.has(r)||(Zu(t,e,2,!1),n.add(r))}function Zl(e,t,n){var r=0;t&&(r|=4),Zu(n,e,r,t)}var Er="_reactListening"+Math.random().toString(36).slice(2);function rr(e){if(!e[Er]){e[Er]=!0,su.forEach(function(n){n!=="selectionchange"&&(Zf.has(n)||Zl(n,!1,e),Zl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Er]||(t[Er]=!0,Zl("selectionchange",!1,t))}}function Zu(e,t,n,r){switch(Du(t)){case 1:var l=ff;break;case 4:l=pf;break;default:l=ko}n=l.bind(null,t,n,e),l=void 0,!Es||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 ql(e,t,n,r,l){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;i=i.return}for(;a!==null;){if(i=Lt(a),i===null)return;if(u=i.tag,u===5||u===6){r=s=i;continue e}a=a.parentNode}}r=r.return}ku(function(){var d=s,g=yo(n),h=[];e:{var m=Xu.get(e);if(m!==void 0){var x=jo,v=e;switch(e){case"keypress":if(Ur(n)===0)break e;case"keydown":case"keyup":x=_f;break;case"focusin":v="focus",x=Kl;break;case"focusout":v="blur",x=Kl;break;case"beforeblur":case"afterblur":x=Kl;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=Ui;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=gf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=If;break;case Ku:case Gu:case Yu:x=vf;break;case Qu:x=Rf;break;case"scroll":x=mf;break;case"wheel":x=Df;break;case"copy":case"cut":case"paste":x=kf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=$i}var k=(t&4)!==0,I=!k&&e==="scroll",p=k?m!==null?m+"Capture":null:m;k=[];for(var c=d,f;c!==null;){f=c;var y=f.stateNode;if(f.tag===5&&y!==null&&(f=y,p!==null&&(y=Jn(c,p),y!=null&&k.push(lr(c,y,f)))),I)break;c=c.return}0<k.length&&(m=new x(m,v,null,n,g),h.push({event:m,listeners:k}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",m&&n!==bs&&(v=n.relatedTarget||n.fromElement)&&(Lt(v)||v[it]))break e;if((x||m)&&(m=g.window===g?g:(m=g.ownerDocument)?m.defaultView||m.parentWindow:window,x?(v=n.relatedTarget||n.toElement,x=d,v=v?Lt(v):null,v!==null&&(I=Vt(v),v!==I||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=d),x!==v)){if(k=Ui,y="onMouseLeave",p="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(k=$i,y="onPointerLeave",p="onPointerEnter",c="pointer"),I=x==null?m:en(x),f=v==null?m:en(v),m=new k(y,c+"leave",x,n,g),m.target=I,m.relatedTarget=f,y=null,Lt(g)===d&&(k=new k(p,c+"enter",v,n,g),k.target=f,k.relatedTarget=I,y=k),I=y,x&&v)t:{for(k=x,p=v,c=0,f=k;f;f=Kt(f))c++;for(f=0,y=p;y;y=Kt(y))f++;for(;0<c-f;)k=Kt(k),c--;for(;0<f-c;)p=Kt(p),f--;for(;c--;){if(k===p||p!==null&&k===p.alternate)break t;k=Kt(k),p=Kt(p)}k=null}else k=null;x!==null&&qi(h,m,x,k,!1),v!==null&&I!==null&&qi(h,I,v,k,!0)}}e:{if(m=d?en(d):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var j=$f;else if(Vi(m))if(Wu)j=Kf;else{j=Hf;var b=Bf}else(x=m.nodeName)&&x.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(j=Vf);if(j&&(j=j(e,d))){Uu(h,j,n,g);break e}b&&b(e,m,d),e==="focusout"&&(b=m._wrapperState)&&b.controlled&&m.type==="number"&&ws(m,"number",m.value)}switch(b=d?en(d):window,e){case"focusin":(Vi(b)||b.contentEditable==="true")&&(Zt=b,As=d,Hn=null);break;case"focusout":Hn=As=Zt=null;break;case"mousedown":Rs=!0;break;case"contextmenu":case"mouseup":case"dragend":Rs=!1,Xi(h,n,g);break;case"selectionchange":if(Qf)break;case"keydown":case"keyup":Xi(h,n,g)}var C;if(bo)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Jt?Mu(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(zu&&n.locale!=="ko"&&(Jt||E!=="onCompositionStart"?E==="onCompositionEnd"&&Jt&&(C=Ou()):(gt=g,So="value"in gt?gt.value:gt.textContent,Jt=!0)),b=tl(d,E),0<b.length&&(E=new Wi(E,e,null,n,g),h.push({event:E,listeners:b}),C?E.data=C:(C=Fu(n),C!==null&&(E.data=C)))),(C=zf?Mf(e,n):Ff(e,n))&&(d=tl(d,"onBeforeInput"),0<d.length&&(g=new Wi("onBeforeInput","beforeinput",null,n,g),h.push({event:g,listeners:d}),g.data=C))}Ju(h,t)})}function lr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,s=l.stateNode;l.tag===5&&s!==null&&(l=s,s=Jn(e,n),s!=null&&r.unshift(lr(e,s,l)),s=Jn(e,t),s!=null&&r.push(lr(e,s,l))),e=e.return}return r}function Kt(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qi(e,t,n,r,l){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,u=a.alternate,d=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&d!==null&&(a=d,l?(u=Jn(n,s),u!=null&&i.unshift(lr(n,u,a))):l||(u=Jn(n,s),u!=null&&i.push(lr(n,u,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var qf=/\r\n?/g,ep=/\u0000|\uFFFD/g;function ea(e){return(typeof e=="string"?e:""+e).replace(qf,`
|
|
38
|
+
`).replace(ep,"")}function _r(e,t,n){if(t=ea(t),ea(e)!==t&&n)throw Error(N(425))}function nl(){}var Ls=null,Ds=null;function Os(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 zs=typeof setTimeout=="function"?setTimeout:void 0,tp=typeof clearTimeout=="function"?clearTimeout:void 0,ta=typeof Promise=="function"?Promise:void 0,np=typeof queueMicrotask=="function"?queueMicrotask:typeof ta<"u"?function(e){return ta.resolve(null).then(e).catch(rp)}:zs;function rp(e){setTimeout(function(){throw e})}function es(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),er(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);er(t)}function kt(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 na(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 Nn=Math.random().toString(36).slice(2),Je="__reactFiber$"+Nn,sr="__reactProps$"+Nn,it="__reactContainer$"+Nn,Ms="__reactEvents$"+Nn,lp="__reactListeners$"+Nn,sp="__reactHandles$"+Nn;function Lt(e){var t=e[Je];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[Je]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=na(e);e!==null;){if(n=e[Je])return n;e=na(e)}return t}e=n,n=e.parentNode}return null}function gr(e){return e=e[Je]||e[it],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function en(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(N(33))}function Nl(e){return e[sr]||null}var Fs=[],tn=-1;function Pt(e){return{current:e}}function K(e){0>tn||(e.current=Fs[tn],Fs[tn]=null,tn--)}function B(e,t){tn++,Fs[tn]=e.current,e.current=t}var Et={},ge=Pt(Et),Ne=Pt(!1),Ft=Et;function hn(e,t){var n=e.type.contextTypes;if(!n)return Et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function be(e){return e=e.childContextTypes,e!=null}function rl(){K(Ne),K(ge)}function ra(e,t,n){if(ge.current!==Et)throw Error(N(168));B(ge,t),B(Ne,n)}function qu(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(N(108,$d(e)||"Unknown",l));return X({},n,r)}function ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Et,Ft=ge.current,B(ge,e),B(Ne,Ne.current),!0}function la(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=qu(e,t,Ft),r.__reactInternalMemoizedMergedChildContext=e,K(Ne),K(ge),B(ge,e)):K(Ne),B(Ne,n)}var tt=null,bl=!1,ts=!1;function ec(e){tt===null?tt=[e]:tt.push(e)}function op(e){bl=!0,ec(e)}function It(){if(!ts&&tt!==null){ts=!0;var e=0,t=U;try{var n=tt;for(U=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tt=null,bl=!1}catch(l){throw tt!==null&&(tt=tt.slice(e+1)),bu(xo,It),l}finally{U=t,ts=!1}}return null}var nn=[],rn=0,sl=null,ol=0,De=[],Oe=0,Ut=null,nt=1,rt="";function At(e,t){nn[rn++]=ol,nn[rn++]=sl,sl=e,ol=t}function tc(e,t,n){De[Oe++]=nt,De[Oe++]=rt,De[Oe++]=Ut,Ut=e;var r=nt;e=rt;var l=32-Ve(r)-1;r&=~(1<<l),n+=1;var s=32-Ve(t)+l;if(30<s){var i=l-l%5;s=(r&(1<<i)-1).toString(32),r>>=i,l-=i,nt=1<<32-Ve(t)+l|n<<l|r,rt=s+e}else nt=1<<s|n<<l|r,rt=e}function Eo(e){e.return!==null&&(At(e,1),tc(e,1,0))}function _o(e){for(;e===sl;)sl=nn[--rn],nn[rn]=null,ol=nn[--rn],nn[rn]=null;for(;e===Ut;)Ut=De[--Oe],De[Oe]=null,rt=De[--Oe],De[Oe]=null,nt=De[--Oe],De[Oe]=null}var Te=null,_e=null,G=!1,He=null;function nc(e,t){var n=ze(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 sa(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,Te=e,_e=kt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Te=e,_e=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ut!==null?{id:nt,overflow:rt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ze(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Te=e,_e=null,!0):!1;default:return!1}}function Us(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ws(e){if(G){var t=_e;if(t){var n=t;if(!sa(e,t)){if(Us(e))throw Error(N(418));t=kt(n.nextSibling);var r=Te;t&&sa(e,t)?nc(r,n):(e.flags=e.flags&-4097|2,G=!1,Te=e)}}else{if(Us(e))throw Error(N(418));e.flags=e.flags&-4097|2,G=!1,Te=e}}}function oa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Te=e}function Tr(e){if(e!==Te)return!1;if(!G)return oa(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Os(e.type,e.memoizedProps)),t&&(t=_e)){if(Us(e))throw rc(),Error(N(418));for(;t;)nc(e,t),t=kt(t.nextSibling)}if(oa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){_e=kt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}_e=null}}else _e=Te?kt(e.stateNode.nextSibling):null;return!0}function rc(){for(var e=_e;e;)e=kt(e.nextSibling)}function gn(){_e=Te=null,G=!1}function To(e){He===null?He=[e]:He.push(e)}var ip=ct.ReactCurrentBatchConfig;function In(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(N(309));var r=n.stateNode}if(!r)throw Error(N(147,e));var l=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=l.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(N(284));if(!n._owner)throw Error(N(290,e))}return e}function Pr(e,t){throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ia(e){var t=e._init;return t(e._payload)}function lc(e){function t(p,c){if(e){var f=p.deletions;f===null?(p.deletions=[c],p.flags|=16):f.push(c)}}function n(p,c){if(!e)return null;for(;c!==null;)t(p,c),c=c.sibling;return null}function r(p,c){for(p=new Map;c!==null;)c.key!==null?p.set(c.key,c):p.set(c.index,c),c=c.sibling;return p}function l(p,c){return p=bt(p,c),p.index=0,p.sibling=null,p}function s(p,c,f){return p.index=f,e?(f=p.alternate,f!==null?(f=f.index,f<c?(p.flags|=2,c):f):(p.flags|=2,c)):(p.flags|=1048576,c)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,c,f,y){return c===null||c.tag!==6?(c=as(f,p.mode,y),c.return=p,c):(c=l(c,f),c.return=p,c)}function u(p,c,f,y){var j=f.type;return j===Xt?g(p,c,f.props.children,y,f.key):c!==null&&(c.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ft&&ia(j)===c.type)?(y=l(c,f.props),y.ref=In(p,c,f),y.return=p,y):(y=Gr(f.type,f.key,f.props,null,p.mode,y),y.ref=In(p,c,f),y.return=p,y)}function d(p,c,f,y){return c===null||c.tag!==4||c.stateNode.containerInfo!==f.containerInfo||c.stateNode.implementation!==f.implementation?(c=us(f,p.mode,y),c.return=p,c):(c=l(c,f.children||[]),c.return=p,c)}function g(p,c,f,y,j){return c===null||c.tag!==7?(c=Mt(f,p.mode,y,j),c.return=p,c):(c=l(c,f),c.return=p,c)}function h(p,c,f){if(typeof c=="string"&&c!==""||typeof c=="number")return c=as(""+c,p.mode,f),c.return=p,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case vr:return f=Gr(c.type,c.key,c.props,null,p.mode,f),f.ref=In(p,null,c),f.return=p,f;case Qt:return c=us(c,p.mode,f),c.return=p,c;case ft:var y=c._init;return h(p,y(c._payload),f)}if(zn(c)||Cn(c))return c=Mt(c,p.mode,f,null),c.return=p,c;Pr(p,c)}return null}function m(p,c,f,y){var j=c!==null?c.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return j!==null?null:a(p,c,""+f,y);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case vr:return f.key===j?u(p,c,f,y):null;case Qt:return f.key===j?d(p,c,f,y):null;case ft:return j=f._init,m(p,c,j(f._payload),y)}if(zn(f)||Cn(f))return j!==null?null:g(p,c,f,y,null);Pr(p,f)}return null}function x(p,c,f,y,j){if(typeof y=="string"&&y!==""||typeof y=="number")return p=p.get(f)||null,a(c,p,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case vr:return p=p.get(y.key===null?f:y.key)||null,u(c,p,y,j);case Qt:return p=p.get(y.key===null?f:y.key)||null,d(c,p,y,j);case ft:var b=y._init;return x(p,c,f,b(y._payload),j)}if(zn(y)||Cn(y))return p=p.get(f)||null,g(c,p,y,j,null);Pr(c,y)}return null}function v(p,c,f,y){for(var j=null,b=null,C=c,E=c=0,F=null;C!==null&&E<f.length;E++){C.index>E?(F=C,C=null):F=C.sibling;var R=m(p,C,f[E],y);if(R===null){C===null&&(C=F);break}e&&C&&R.alternate===null&&t(p,C),c=s(R,c,E),b===null?j=R:b.sibling=R,b=R,C=F}if(E===f.length)return n(p,C),G&&At(p,E),j;if(C===null){for(;E<f.length;E++)C=h(p,f[E],y),C!==null&&(c=s(C,c,E),b===null?j=C:b.sibling=C,b=C);return G&&At(p,E),j}for(C=r(p,C);E<f.length;E++)F=x(C,p,E,f[E],y),F!==null&&(e&&F.alternate!==null&&C.delete(F.key===null?E:F.key),c=s(F,c,E),b===null?j=F:b.sibling=F,b=F);return e&&C.forEach(function(M){return t(p,M)}),G&&At(p,E),j}function k(p,c,f,y){var j=Cn(f);if(typeof j!="function")throw Error(N(150));if(f=j.call(f),f==null)throw Error(N(151));for(var b=j=null,C=c,E=c=0,F=null,R=f.next();C!==null&&!R.done;E++,R=f.next()){C.index>E?(F=C,C=null):F=C.sibling;var M=m(p,C,R.value,y);if(M===null){C===null&&(C=F);break}e&&C&&M.alternate===null&&t(p,C),c=s(M,c,E),b===null?j=M:b.sibling=M,b=M,C=F}if(R.done)return n(p,C),G&&At(p,E),j;if(C===null){for(;!R.done;E++,R=f.next())R=h(p,R.value,y),R!==null&&(c=s(R,c,E),b===null?j=R:b.sibling=R,b=R);return G&&At(p,E),j}for(C=r(p,C);!R.done;E++,R=f.next())R=x(C,p,E,R.value,y),R!==null&&(e&&R.alternate!==null&&C.delete(R.key===null?E:R.key),c=s(R,c,E),b===null?j=R:b.sibling=R,b=R);return e&&C.forEach(function(W){return t(p,W)}),G&&At(p,E),j}function I(p,c,f,y){if(typeof f=="object"&&f!==null&&f.type===Xt&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case vr:e:{for(var j=f.key,b=c;b!==null;){if(b.key===j){if(j=f.type,j===Xt){if(b.tag===7){n(p,b.sibling),c=l(b,f.props.children),c.return=p,p=c;break e}}else if(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ft&&ia(j)===b.type){n(p,b.sibling),c=l(b,f.props),c.ref=In(p,b,f),c.return=p,p=c;break e}n(p,b);break}else t(p,b);b=b.sibling}f.type===Xt?(c=Mt(f.props.children,p.mode,y,f.key),c.return=p,p=c):(y=Gr(f.type,f.key,f.props,null,p.mode,y),y.ref=In(p,c,f),y.return=p,p=y)}return i(p);case Qt:e:{for(b=f.key;c!==null;){if(c.key===b)if(c.tag===4&&c.stateNode.containerInfo===f.containerInfo&&c.stateNode.implementation===f.implementation){n(p,c.sibling),c=l(c,f.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=us(f,p.mode,y),c.return=p,p=c}return i(p);case ft:return b=f._init,I(p,c,b(f._payload),y)}if(zn(f))return v(p,c,f,y);if(Cn(f))return k(p,c,f,y);Pr(p,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,f),c.return=p,p=c):(n(p,c),c=as(f,p.mode,y),c.return=p,p=c),i(p)):n(p,c)}return I}var yn=lc(!0),sc=lc(!1),il=Pt(null),al=null,ln=null,Po=null;function Io(){Po=ln=al=null}function Ao(e){var t=il.current;K(il),e._currentValue=t}function $s(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 fn(e,t){al=e,Po=ln=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(je=!0),e.firstContext=null)}function Fe(e){var t=e._currentValue;if(Po!==e)if(e={context:e,memoizedValue:t,next:null},ln===null){if(al===null)throw Error(N(308));ln=e,al.dependencies={lanes:0,firstContext:e}}else ln=ln.next=e;return t}var Dt=null;function Ro(e){Dt===null?Dt=[e]:Dt.push(e)}function oc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ro(t)):(n.next=l.next,l.next=n),t.interleaved=n,at(e,r)}function at(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 pt=!1;function Lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ic(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 lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function St(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,z&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,at(e,n)}return l=r.interleaved,l===null?(t.next=t,Ro(r)):(t.next=l.next,l.next=t),r.interleaved=t,at(e,n)}function Wr(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,vo(e,n)}}function aa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,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;pt=!1;var s=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,i===null?s=d:i.next=d,i=u;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==i&&(a===null?g.firstBaseUpdate=d:a.next=d,g.lastBaseUpdate=u))}if(s!==null){var h=l.baseState;i=0,g=d=u=null,a=s;do{var m=a.lane,x=a.eventTime;if((r&m)===m){g!==null&&(g=g.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,k=a;switch(m=t,x=n,k.tag){case 1:if(v=k.payload,typeof v=="function"){h=v.call(x,h,m);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=k.payload,m=typeof v=="function"?v.call(x,h,m):v,m==null)break e;h=X({},h,m);break e;case 2:pt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[a]:m.push(a))}else x={eventTime:x,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(d=g=x,u=h):g=g.next=x,i|=m;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;m=a,a=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(g===null&&(u=h),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=g,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);$t|=i,e.lanes=i,e.memoizedState=h}}function ua(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(N(191,l));l.call(r)}}}var yr={},qe=Pt(yr),or=Pt(yr),ir=Pt(yr);function Ot(e){if(e===yr)throw Error(N(174));return e}function Do(e,t){switch(B(ir,t),B(or,e),B(qe,yr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ss(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ss(t,e)}K(qe),B(qe,t)}function xn(){K(qe),K(or),K(ir)}function ac(e){Ot(ir.current);var t=Ot(qe.current),n=Ss(t,e.type);t!==n&&(B(or,e),B(qe,n))}function Oo(e){or.current===e&&(K(qe),K(or))}var Y=Pt(0);function cl(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 ns=[];function zo(){for(var e=0;e<ns.length;e++)ns[e]._workInProgressVersionPrimary=null;ns.length=0}var $r=ct.ReactCurrentDispatcher,rs=ct.ReactCurrentBatchConfig,Wt=0,Q=null,te=null,re=null,dl=!1,Vn=!1,ar=0,ap=0;function pe(){throw Error(N(321))}function Mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ge(e[n],t[n]))return!1;return!0}function Fo(e,t,n,r,l,s){if(Wt=s,Q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$r.current=e===null||e.memoizedState===null?fp:pp,e=n(r,l),Vn){s=0;do{if(Vn=!1,ar=0,25<=s)throw Error(N(301));s+=1,re=te=null,t.updateQueue=null,$r.current=mp,e=n(r,l)}while(Vn)}if($r.current=fl,t=te!==null&&te.next!==null,Wt=0,re=te=Q=null,dl=!1,t)throw Error(N(300));return e}function Uo(){var e=ar!==0;return ar=0,e}function Xe(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return re===null?Q.memoizedState=re=e:re=re.next=e,re}function Ue(){if(te===null){var e=Q.alternate;e=e!==null?e.memoizedState:null}else e=te.next;var t=re===null?Q.memoizedState:re.next;if(t!==null)re=t,te=e;else{if(e===null)throw Error(N(310));te=e,e={memoizedState:te.memoizedState,baseState:te.baseState,baseQueue:te.baseQueue,queue:te.queue,next:null},re===null?Q.memoizedState=re=e:re=re.next=e}return re}function ur(e,t){return typeof t=="function"?t(e):t}function ls(e){var t=Ue(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=te,l=r.baseQueue,s=n.pending;if(s!==null){if(l!==null){var i=l.next;l.next=s.next,s.next=i}r.baseQueue=l=s,n.pending=null}if(l!==null){s=l.next,r=r.baseState;var a=i=null,u=null,d=s;do{var g=d.lane;if((Wt&g)===g)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var h={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(a=u=h,i=r):u=u.next=h,Q.lanes|=g,$t|=g}d=d.next}while(d!==null&&d!==s);u===null?i=r:u.next=a,Ge(r,t.memoizedState)||(je=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do s=l.lane,Q.lanes|=s,$t|=s,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ss(e){var t=Ue(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,s=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do s=e(s,i.action),i=i.next;while(i!==l);Ge(s,t.memoizedState)||(je=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function uc(){}function cc(e,t){var n=Q,r=Ue(),l=t(),s=!Ge(r.memoizedState,l);if(s&&(r.memoizedState=l,je=!0),r=r.queue,Wo(pc.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||re!==null&&re.memoizedState.tag&1){if(n.flags|=2048,cr(9,fc.bind(null,n,r,l,t),void 0,null),le===null)throw Error(N(349));Wt&30||dc(n,t,l)}return l}function dc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fc(e,t,n,r){t.value=n,t.getSnapshot=r,mc(t)&&hc(e)}function pc(e,t,n){return n(function(){mc(t)&&hc(e)})}function mc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ge(e,n)}catch{return!0}}function hc(e){var t=at(e,1);t!==null&&Ke(t,e,1,-1)}function ca(e){var t=Xe();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t.queue=e,e=e.dispatch=dp.bind(null,Q,e),[t.memoizedState,e]}function cr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.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 gc(){return Ue().memoizedState}function Br(e,t,n,r){var l=Xe();Q.flags|=e,l.memoizedState=cr(1|t,n,void 0,r===void 0?null:r)}function Cl(e,t,n,r){var l=Ue();r=r===void 0?null:r;var s=void 0;if(te!==null){var i=te.memoizedState;if(s=i.destroy,r!==null&&Mo(r,i.deps)){l.memoizedState=cr(t,n,s,r);return}}Q.flags|=e,l.memoizedState=cr(1|t,n,s,r)}function da(e,t){return Br(8390656,8,e,t)}function Wo(e,t){return Cl(2048,8,e,t)}function yc(e,t){return Cl(4,2,e,t)}function xc(e,t){return Cl(4,4,e,t)}function vc(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 wc(e,t,n){return n=n!=null?n.concat([e]):null,Cl(4,4,vc.bind(null,t,e),n)}function $o(){}function kc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Sc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function jc(e,t,n){return Wt&21?(Ge(n,t)||(n=_u(),Q.lanes|=n,$t|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,je=!0),e.memoizedState=n)}function up(e,t){var n=U;U=n!==0&&4>n?n:4,e(!0);var r=rs.transition;rs.transition={};try{e(!1),t()}finally{U=n,rs.transition=r}}function Nc(){return Ue().memoizedState}function cp(e,t,n){var r=Nt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bc(e))Cc(t,n);else if(n=oc(e,t,n,r),n!==null){var l=xe();Ke(n,e,r,l),Ec(n,t,r)}}function dp(e,t,n){var r=Nt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bc(e))Cc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(l.hasEagerState=!0,l.eagerState=a,Ge(a,i)){var u=t.interleaved;u===null?(l.next=l,Ro(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=oc(e,t,l,r),n!==null&&(l=xe(),Ke(n,e,r,l),Ec(n,t,r))}}function bc(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function Cc(e,t){Vn=dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ec(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vo(e,n)}}var fl={readContext:Fe,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},fp={readContext:Fe,useCallback:function(e,t){return Xe().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:da,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Br(4194308,4,vc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Br(4194308,4,e,t)},useInsertionEffect:function(e,t){return Br(4,2,e,t)},useMemo:function(e,t){var n=Xe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xe();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=cp.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=Xe();return e={current:e},t.memoizedState=e},useState:ca,useDebugValue:$o,useDeferredValue:function(e){return Xe().memoizedState=e},useTransition:function(){var e=ca(!1),t=e[0];return e=up.bind(null,e[1]),Xe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,l=Xe();if(G){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),le===null)throw Error(N(349));Wt&30||dc(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,da(pc.bind(null,r,s,e),[e]),r.flags|=2048,cr(9,fc.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Xe(),t=le.identifierPrefix;if(G){var n=rt,r=nt;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ar++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ap++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},pp={readContext:Fe,useCallback:kc,useContext:Fe,useEffect:Wo,useImperativeHandle:wc,useInsertionEffect:yc,useLayoutEffect:xc,useMemo:Sc,useReducer:ls,useRef:gc,useState:function(){return ls(ur)},useDebugValue:$o,useDeferredValue:function(e){var t=Ue();return jc(t,te.memoizedState,e)},useTransition:function(){var e=ls(ur)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:uc,useSyncExternalStore:cc,useId:Nc,unstable_isNewReconciler:!1},mp={readContext:Fe,useCallback:kc,useContext:Fe,useEffect:Wo,useImperativeHandle:wc,useInsertionEffect:yc,useLayoutEffect:xc,useMemo:Sc,useReducer:ss,useRef:gc,useState:function(){return ss(ur)},useDebugValue:$o,useDeferredValue:function(e){var t=Ue();return te===null?t.memoizedState=e:jc(t,te.memoizedState,e)},useTransition:function(){var e=ss(ur)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:uc,useSyncExternalStore:cc,useId:Nc,unstable_isNewReconciler:!1};function $e(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var El={isMounted:function(e){return(e=e._reactInternals)?Vt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xe(),l=Nt(e),s=lt(r,l);s.payload=t,n!=null&&(s.callback=n),t=St(e,s,l),t!==null&&(Ke(t,e,l,r),Wr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xe(),l=Nt(e),s=lt(r,l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=St(e,s,l),t!==null&&(Ke(t,e,l,r),Wr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xe(),r=Nt(e),l=lt(n,r);l.tag=2,t!=null&&(l.callback=t),t=St(e,l,r),t!==null&&(Ke(t,e,r,n),Wr(t,e,r))}};function fa(e,t,n,r,l,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!nr(n,r)||!nr(l,s):!0}function _c(e,t,n){var r=!1,l=Et,s=t.contextType;return typeof s=="object"&&s!==null?s=Fe(s):(l=be(t)?Ft:ge.current,r=t.contextTypes,s=(r=r!=null)?hn(e,l):Et),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=El,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=s),t}function pa(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&&El.enqueueReplaceState(t,t.state,null)}function Hs(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Lo(e);var s=t.contextType;typeof s=="object"&&s!==null?l.context=Fe(s):(s=be(t)?Ft:ge.current,l.context=hn(e,s)),l.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Bs(e,t,s,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&&El.enqueueReplaceState(l,l.state,null),ul(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function vn(e,t){try{var n="",r=t;do n+=Wd(r),r=r.return;while(r);var l=n}catch(s){l=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:l,digest:null}}function os(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Vs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hp=typeof WeakMap=="function"?WeakMap:Map;function Tc(e,t,n){n=lt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ml||(ml=!0,to=r),Vs(e,t)},n}function Pc(e,t,n){n=lt(-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(){Vs(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Vs(e,t),typeof r!="function"&&(jt===null?jt=new Set([this]):jt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function ma(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new hp;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=Tp.bind(null,e,t,n),t.then(e,e))}function ha(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 ga(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=lt(-1,1),t.tag=2,St(n,t,1))),n.lanes|=1),e)}var gp=ct.ReactCurrentOwner,je=!1;function ye(e,t,n,r){t.child=e===null?sc(t,null,n,r):yn(t,e.child,n,r)}function ya(e,t,n,r,l){n=n.render;var s=t.ref;return fn(t,l),r=Fo(e,t,n,r,s,l),n=Uo(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ut(e,t,l)):(G&&n&&Eo(t),t.flags|=1,ye(e,t,r,l),t.child)}function xa(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!Xo(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Ic(e,t,s,r,l)):(e=Gr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&l)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:nr,n(i,r)&&e.ref===t.ref)return ut(e,t,l)}return t.flags|=1,e=bt(s,r),e.ref=t.ref,e.return=t,t.child=e}function Ic(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(nr(s,r)&&e.ref===t.ref)if(je=!1,t.pendingProps=r=s,(e.lanes&l)!==0)e.flags&131072&&(je=!0);else return t.lanes=e.lanes,ut(e,t,l)}return Ks(e,t,n,r,l)}function Ac(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},B(on,Ee),Ee|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,B(on,Ee),Ee|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,B(on,Ee),Ee|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,B(on,Ee),Ee|=r;return ye(e,t,l,n),t.child}function Rc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ks(e,t,n,r,l){var s=be(n)?Ft:ge.current;return s=hn(t,s),fn(t,l),n=Fo(e,t,n,r,s,l),r=Uo(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ut(e,t,l)):(G&&r&&Eo(t),t.flags|=1,ye(e,t,n,l),t.child)}function va(e,t,n,r,l){if(be(n)){var s=!0;ll(t)}else s=!1;if(fn(t,l),t.stateNode===null)Hr(e,t),_c(t,n,r),Hs(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var u=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=Fe(d):(d=be(n)?Ft:ge.current,d=hn(t,d));var g=n.getDerivedStateFromProps,h=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function";h||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||u!==d)&&pa(t,i,r,d),pt=!1;var m=t.memoizedState;i.state=m,ul(t,r,i,l),u=t.memoizedState,a!==r||m!==u||Ne.current||pt?(typeof g=="function"&&(Bs(t,n,g,r),u=t.memoizedState),(a=pt||fa(t,n,a,r,m,u,d))?(h||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=d,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,ic(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:$e(t.type,a),i.props=d,h=t.pendingProps,m=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Fe(u):(u=be(n)?Ft:ge.current,u=hn(t,u));var x=n.getDerivedStateFromProps;(g=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==h||m!==u)&&pa(t,i,r,u),pt=!1,m=t.memoizedState,i.state=m,ul(t,r,i,l);var v=t.memoizedState;a!==h||m!==v||Ne.current||pt?(typeof x=="function"&&(Bs(t,n,x,r),v=t.memoizedState),(d=pt||fa(t,n,d,r,m,v,u)||!1)?(g||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,v,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,v,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),i.props=r,i.state=v,i.context=u,r=d):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Gs(e,t,n,r,s,l)}function Gs(e,t,n,r,l,s){Rc(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&la(t,n,!1),ut(e,t,s);r=t.stateNode,gp.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=yn(t,e.child,null,s),t.child=yn(t,null,a,s)):ye(e,t,a,s),t.memoizedState=r.state,l&&la(t,n,!0),t.child}function Lc(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),Do(e,t.containerInfo)}function wa(e,t,n,r,l){return gn(),To(l),t.flags|=256,ye(e,t,n,r),t.child}var Ys={dehydrated:null,treeContext:null,retryLane:0};function Qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dc(e,t,n){var r=t.pendingProps,l=Y.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),B(Y,l&1),e===null)return Ws(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):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Pl(i,r,0,null),e=Mt(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Qs(n),t.memoizedState=Ys,e):Bo(t,i));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return yp(e,t,i,r,a,l,n);if(s){s=r.fallback,i=t.mode,l=e.child,a=l.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=bt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?s=bt(a,s):(s=Mt(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?Qs(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Ys,r}return s=e.child,e=s.sibling,r=bt(s,{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 Bo(e,t){return t=Pl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ir(e,t,n,r){return r!==null&&To(r),yn(t,e.child,null,n),e=Bo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yp(e,t,n,r,l,s,i){if(n)return t.flags&256?(t.flags&=-257,r=os(Error(N(422))),Ir(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=Pl({mode:"visible",children:r.children},l,0,null),s=Mt(s,l,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&yn(t,e.child,null,i),t.child.memoizedState=Qs(i),t.memoizedState=Ys,s);if(!(t.mode&1))return Ir(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(N(419)),r=os(s,r,void 0),Ir(e,t,i,r)}if(a=(i&e.childLanes)!==0,je||a){if(r=le,r!==null){switch(i&-i){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|i)?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,at(e,l),Ke(r,e,l,-1))}return Qo(),r=os(Error(N(421))),Ir(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Pp.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,_e=kt(l.nextSibling),Te=t,G=!0,He=null,e!==null&&(De[Oe++]=nt,De[Oe++]=rt,De[Oe++]=Ut,nt=e.id,rt=e.overflow,Ut=t),t=Bo(t,r.children),t.flags|=4096,t)}function ka(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$s(e.return,t,n)}function is(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function Oc(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(ye(e,t,r.children,n),r=Y.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&&ka(e,n,t);else if(e.tag===19)ka(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(B(Y,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&&cl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),is(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&cl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}is(t,!0,n,null,s);break;case"together":is(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ut(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$t|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=bt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xp(e,t,n){switch(t.tag){case 3:Lc(t),gn();break;case 5:ac(t);break;case 1:be(t.type)&&ll(t);break;case 4:Do(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;B(il,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(B(Y,Y.current&1),t.flags|=128,null):n&t.child.childLanes?Dc(e,t,n):(B(Y,Y.current&1),e=ut(e,t,n),e!==null?e.sibling:null);B(Y,Y.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Oc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),B(Y,Y.current),r)break;return null;case 22:case 23:return t.lanes=0,Ac(e,t,n)}return ut(e,t,n)}var zc,Xs,Mc,Fc;zc=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}};Xs=function(){};Mc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Ot(qe.current);var s=null;switch(n){case"input":l=xs(e,l),r=xs(e,r),s=[];break;case"select":l=X({},l,{value:void 0}),r=X({},r,{value:void 0}),s=[];break;case"textarea":l=ks(e,l),r=ks(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=nl)}js(n,r);var i;n=null;for(d in l)if(!r.hasOwnProperty(d)&&l.hasOwnProperty(d)&&l[d]!=null)if(d==="style"){var a=l[d];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Qn.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var u=r[d];if(a=l!=null?l[d]:void 0,r.hasOwnProperty(d)&&u!==a&&(u!=null||a!=null))if(d==="style")if(a){for(i in a)!a.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&a[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(s||(s=[]),s.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Qn.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&V("scroll",e),s||a===u||(s=[])):(s=s||[]).push(d,u))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}};Fc=function(e,t,n,r){n!==r&&(t.flags|=4)};function An(e,t){if(!G)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 me(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 vp(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 me(t),null;case 1:return be(t.type)&&rl(),me(t),null;case 3:return r=t.stateNode,xn(),K(Ne),K(ge),zo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Tr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,He!==null&&(lo(He),He=null))),Xs(e,t),me(t),null;case 5:Oo(t);var l=Ot(ir.current);if(n=t.type,e!==null&&t.stateNode!=null)Mc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return me(t),null}if(e=Ot(qe.current),Tr(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Je]=t,r[sr]=s,e=(t.mode&1)!==0,n){case"dialog":V("cancel",r),V("close",r);break;case"iframe":case"object":case"embed":V("load",r);break;case"video":case"audio":for(l=0;l<Fn.length;l++)V(Fn[l],r);break;case"source":V("error",r);break;case"img":case"image":case"link":V("error",r),V("load",r);break;case"details":V("toggle",r);break;case"input":Pi(r,s),V("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},V("invalid",r);break;case"textarea":Ai(r,s),V("invalid",r)}js(n,s),l=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&_r(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&_r(r.textContent,a,e),l=["children",""+a]):Qn.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&V("scroll",r)}switch(n){case"input":wr(r),Ii(r,s,!0);break;case"textarea":wr(r),Ri(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=nl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Je]=t,e[sr]=r,zc(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ns(n,r),n){case"dialog":V("cancel",e),V("close",e),l=r;break;case"iframe":case"object":case"embed":V("load",e),l=r;break;case"video":case"audio":for(l=0;l<Fn.length;l++)V(Fn[l],e);l=r;break;case"source":V("error",e),l=r;break;case"img":case"image":case"link":V("error",e),V("load",e),l=r;break;case"details":V("toggle",e),l=r;break;case"input":Pi(e,r),l=xs(e,r),V("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=X({},r,{value:void 0}),V("invalid",e);break;case"textarea":Ai(e,r),l=ks(e,r),V("invalid",e);break;default:l=r}js(n,l),a=l;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?gu(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&mu(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Xn(e,u):typeof u=="number"&&Xn(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Qn.hasOwnProperty(s)?u!=null&&s==="onScroll"&&V("scroll",e):u!=null&&po(e,s,u,i))}switch(n){case"input":wr(e),Ii(e,r,!1);break;case"textarea":wr(e),Ri(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ct(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?an(e,!!r.multiple,s,!1):r.defaultValue!=null&&an(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=nl)}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 me(t),null;case 6:if(e&&t.stateNode!=null)Fc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(N(166));if(n=Ot(ir.current),Ot(qe.current),Tr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Je]=t,(s=r.nodeValue!==n)&&(e=Te,e!==null))switch(e.tag){case 3:_r(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_r(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Je]=t,t.stateNode=r}return me(t),null;case 13:if(K(Y),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&_e!==null&&t.mode&1&&!(t.flags&128))rc(),gn(),t.flags|=98560,s=!1;else if(s=Tr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(N(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Je]=t}else gn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;me(t),s=!1}else He!==null&&(lo(He),He=null),s=!0;if(!s)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||Y.current&1?ne===0&&(ne=3):Qo())),t.updateQueue!==null&&(t.flags|=4),me(t),null);case 4:return xn(),Xs(e,t),e===null&&rr(t.stateNode.containerInfo),me(t),null;case 10:return Ao(t.type._context),me(t),null;case 17:return be(t.type)&&rl(),me(t),null;case 19:if(K(Y),s=t.memoizedState,s===null)return me(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)An(s,!1);else{if(ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=cl(e),i!==null){for(t.flags|=128,An(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return B(Y,Y.current&1|2),t.child}e=e.sibling}s.tail!==null&&q()>wn&&(t.flags|=128,r=!0,An(s,!1),t.lanes=4194304)}else{if(!r)if(e=cl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),An(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!G)return me(t),null}else 2*q()-s.renderingStartTime>wn&&n!==1073741824&&(t.flags|=128,r=!0,An(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=q(),t.sibling=null,n=Y.current,B(Y,r?n&1|2:n&1),t):(me(t),null);case 22:case 23:return Yo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ee&1073741824&&(me(t),t.subtreeFlags&6&&(t.flags|=8192)):me(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function wp(e,t){switch(_o(t),t.tag){case 1:return be(t.type)&&rl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),K(Ne),K(ge),zo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Oo(t),null;case 13:if(K(Y),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Y),null;case 4:return xn(),null;case 10:return Ao(t.type._context),null;case 22:case 23:return Yo(),null;case 24:return null;default:return null}}var Ar=!1,he=!1,kp=typeof WeakSet=="function"?WeakSet:Set,T=null;function sn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function Js(e,t,n){try{n()}catch(r){Z(e,t,r)}}var Sa=!1;function Sp(e,t){if(Ls=qr,e=Hu(),Co(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,u=-1,d=0,g=0,h=e,m=null;t:for(;;){for(var x;h!==n||l!==0&&h.nodeType!==3||(a=i+l),h!==s||r!==0&&h.nodeType!==3||(u=i+r),h.nodeType===3&&(i+=h.nodeValue.length),(x=h.firstChild)!==null;)m=h,h=x;for(;;){if(h===e)break t;if(m===n&&++d===l&&(a=i),m===s&&++g===r&&(u=i),(x=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ds={focusedElem:e,selectionRange:n},qr=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;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 k=v.memoizedProps,I=v.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?k:$e(t.type,k),I);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(y){Z(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return v=Sa,Sa=!1,v}function Kn(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 s=l.destroy;l.destroy=void 0,s!==void 0&&Js(t,n,s)}l=l.next}while(l!==r)}}function _l(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 Zs(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 Uc(e){var t=e.alternate;t!==null&&(e.alternate=null,Uc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Je],delete t[sr],delete t[Ms],delete t[lp],delete t[sp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Wc(e){return e.tag===5||e.tag===3||e.tag===4}function ja(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qs(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=nl));else if(r!==4&&(e=e.child,e!==null))for(qs(e,t,n),e=e.sibling;e!==null;)qs(e,t,n),e=e.sibling}function eo(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(eo(e,t,n),e=e.sibling;e!==null;)eo(e,t,n),e=e.sibling}var ae=null,Be=!1;function dt(e,t,n){for(n=n.child;n!==null;)$c(e,t,n),n=n.sibling}function $c(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(wl,n)}catch{}switch(n.tag){case 5:he||sn(n,t);case 6:var r=ae,l=Be;ae=null,dt(e,t,n),ae=r,Be=l,ae!==null&&(Be?(e=ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ae.removeChild(n.stateNode));break;case 18:ae!==null&&(Be?(e=ae,n=n.stateNode,e.nodeType===8?es(e.parentNode,n):e.nodeType===1&&es(e,n),er(e)):es(ae,n.stateNode));break;case 4:r=ae,l=Be,ae=n.stateNode.containerInfo,Be=!0,dt(e,t,n),ae=r,Be=l;break;case 0:case 11:case 14:case 15:if(!he&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Js(n,t,i),l=l.next}while(l!==r)}dt(e,t,n);break;case 1:if(!he&&(sn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Z(n,t,a)}dt(e,t,n);break;case 21:dt(e,t,n);break;case 22:n.mode&1?(he=(r=he)||n.memoizedState!==null,dt(e,t,n),he=r):dt(e,t,n);break;default:dt(e,t,n)}}function Na(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new kp),t.forEach(function(r){var l=Ip.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:ae=a.stateNode,Be=!1;break e;case 3:ae=a.stateNode.containerInfo,Be=!0;break e;case 4:ae=a.stateNode.containerInfo,Be=!0;break e}a=a.return}if(ae===null)throw Error(N(160));$c(s,i,l),ae=null,Be=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(d){Z(l,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bc(t,e),t=t.sibling}function Bc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(We(t,e),Qe(e),r&4){try{Kn(3,e,e.return),_l(3,e)}catch(k){Z(e,e.return,k)}try{Kn(5,e,e.return)}catch(k){Z(e,e.return,k)}}break;case 1:We(t,e),Qe(e),r&512&&n!==null&&sn(n,n.return);break;case 5:if(We(t,e),Qe(e),r&512&&n!==null&&sn(n,n.return),e.flags&32){var l=e.stateNode;try{Xn(l,"")}catch(k){Z(e,e.return,k)}}if(r&4&&(l=e.stateNode,l!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&du(l,s),Ns(a,i);var d=Ns(a,s);for(i=0;i<u.length;i+=2){var g=u[i],h=u[i+1];g==="style"?gu(l,h):g==="dangerouslySetInnerHTML"?mu(l,h):g==="children"?Xn(l,h):po(l,g,h,d)}switch(a){case"input":vs(l,s);break;case"textarea":fu(l,s);break;case"select":var m=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!s.multiple;var x=s.value;x!=null?an(l,!!s.multiple,x,!1):m!==!!s.multiple&&(s.defaultValue!=null?an(l,!!s.multiple,s.defaultValue,!0):an(l,!!s.multiple,s.multiple?[]:"",!1))}l[sr]=s}catch(k){Z(e,e.return,k)}}break;case 6:if(We(t,e),Qe(e),r&4){if(e.stateNode===null)throw Error(N(162));l=e.stateNode,s=e.memoizedProps;try{l.nodeValue=s}catch(k){Z(e,e.return,k)}}break;case 3:if(We(t,e),Qe(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{er(t.containerInfo)}catch(k){Z(e,e.return,k)}break;case 4:We(t,e),Qe(e);break;case 13:We(t,e),Qe(e),l=e.child,l.flags&8192&&(s=l.memoizedState!==null,l.stateNode.isHidden=s,!s||l.alternate!==null&&l.alternate.memoizedState!==null||(Ko=q())),r&4&&Na(e);break;case 22:if(g=n!==null&&n.memoizedState!==null,e.mode&1?(he=(d=he)||g,We(t,e),he=d):We(t,e),Qe(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(T=e,g=e.child;g!==null;){for(h=T=g;T!==null;){switch(m=T,x=m.child,m.tag){case 0:case 11:case 14:case 15:Kn(4,m,m.return);break;case 1:sn(m,m.return);var v=m.stateNode;if(typeof v.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(k){Z(r,n,k)}}break;case 5:sn(m,m.return);break;case 22:if(m.memoizedState!==null){Ca(h);continue}}x!==null?(x.return=m,T=x):Ca(h)}g=g.sibling}e:for(g=null,h=e;;){if(h.tag===5){if(g===null){g=h;try{l=h.stateNode,d?(s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,u=h.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=hu("display",i))}catch(k){Z(e,e.return,k)}}}else if(h.tag===6){if(g===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(k){Z(e,e.return,k)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;g===h&&(g=null),h=h.return}g===h&&(g=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:We(t,e),Qe(e),r&4&&Na(e);break;case 21:break;default:We(t,e),Qe(e)}}function Qe(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Wc(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Xn(l,""),r.flags&=-33);var s=ja(e);eo(e,s,l);break;case 3:case 4:var i=r.stateNode.containerInfo,a=ja(e);qs(e,a,i);break;default:throw Error(N(161))}}catch(u){Z(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jp(e,t,n){T=e,Hc(e)}function Hc(e,t,n){for(var r=(e.mode&1)!==0;T!==null;){var l=T,s=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||Ar;if(!i){var a=l.alternate,u=a!==null&&a.memoizedState!==null||he;a=Ar;var d=he;if(Ar=i,(he=u)&&!d)for(T=l;T!==null;)i=T,u=i.child,i.tag===22&&i.memoizedState!==null?Ea(l):u!==null?(u.return=i,T=u):Ea(l);for(;s!==null;)T=s,Hc(s),s=s.sibling;T=l,Ar=a,he=d}ba(e)}else l.subtreeFlags&8772&&s!==null?(s.return=l,T=s):ba(e)}}function ba(e){for(;T!==null;){var t=T;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:he||_l(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!he)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:$e(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ua(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ua(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var h=g.dehydrated;h!==null&&er(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}he||t.flags&512&&Zs(t)}catch(m){Z(t,t.return,m)}}if(t===e){T=null;break}if(n=t.sibling,n!==null){n.return=t.return,T=n;break}T=t.return}}function Ca(e){for(;T!==null;){var t=T;if(t===e){T=null;break}var n=t.sibling;if(n!==null){n.return=t.return,T=n;break}T=t.return}}function Ea(e){for(;T!==null;){var t=T;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{_l(4,t)}catch(u){Z(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){Z(t,l,u)}}var s=t.return;try{Zs(t)}catch(u){Z(t,s,u)}break;case 5:var i=t.return;try{Zs(t)}catch(u){Z(t,i,u)}}}catch(u){Z(t,t.return,u)}if(t===e){T=null;break}var a=t.sibling;if(a!==null){a.return=t.return,T=a;break}T=t.return}}var Np=Math.ceil,pl=ct.ReactCurrentDispatcher,Ho=ct.ReactCurrentOwner,Me=ct.ReactCurrentBatchConfig,z=0,le=null,ee=null,ce=0,Ee=0,on=Pt(0),ne=0,dr=null,$t=0,Tl=0,Vo=0,Gn=null,Se=null,Ko=0,wn=1/0,et=null,ml=!1,to=null,jt=null,Rr=!1,yt=null,hl=0,Yn=0,no=null,Vr=-1,Kr=0;function xe(){return z&6?q():Vr!==-1?Vr:Vr=q()}function Nt(e){return e.mode&1?z&2&&ce!==0?ce&-ce:ip.transition!==null?(Kr===0&&(Kr=_u()),Kr):(e=U,e!==0||(e=window.event,e=e===void 0?16:Du(e.type)),e):1}function Ke(e,t,n,r){if(50<Yn)throw Yn=0,no=null,Error(N(185));mr(e,n,r),(!(z&2)||e!==le)&&(e===le&&(!(z&2)&&(Tl|=n),ne===4&&ht(e,ce)),Ce(e,r),n===1&&z===0&&!(t.mode&1)&&(wn=q()+500,bl&&It()))}function Ce(e,t){var n=e.callbackNode;of(e,t);var r=Zr(e,e===le?ce:0);if(r===0)n!==null&&Oi(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Oi(n),t===1)e.tag===0?op(_a.bind(null,e)):ec(_a.bind(null,e)),np(function(){!(z&6)&&It()}),n=null;else{switch(Tu(r)){case 1:n=xo;break;case 4:n=Cu;break;case 16:n=Jr;break;case 536870912:n=Eu;break;default:n=Jr}n=Zc(n,Vc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Vc(e,t){if(Vr=-1,Kr=0,z&6)throw Error(N(327));var n=e.callbackNode;if(pn()&&e.callbackNode!==n)return null;var r=Zr(e,e===le?ce:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gl(e,r);else{t=r;var l=z;z|=2;var s=Gc();(le!==e||ce!==t)&&(et=null,wn=q()+500,zt(e,t));do try{Ep();break}catch(a){Kc(e,a)}while(!0);Io(),pl.current=s,z=l,ee!==null?t=0:(le=null,ce=0,t=ne)}if(t!==0){if(t===2&&(l=Ts(e),l!==0&&(r=l,t=ro(e,l))),t===1)throw n=dr,zt(e,0),ht(e,r),Ce(e,q()),n;if(t===6)ht(e,r);else{if(l=e.current.alternate,!(r&30)&&!bp(l)&&(t=gl(e,r),t===2&&(s=Ts(e),s!==0&&(r=s,t=ro(e,s))),t===1))throw n=dr,zt(e,0),ht(e,r),Ce(e,q()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(N(345));case 2:Rt(e,Se,et);break;case 3:if(ht(e,r),(r&130023424)===r&&(t=Ko+500-q(),10<t)){if(Zr(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){xe(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=zs(Rt.bind(null,e,Se,et),t);break}Rt(e,Se,et);break;case 4:if(ht(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-Ve(r);s=1<<i,i=t[i],i>l&&(l=i),r&=~s}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Np(r/1960))-r,10<r){e.timeoutHandle=zs(Rt.bind(null,e,Se,et),r);break}Rt(e,Se,et);break;case 5:Rt(e,Se,et);break;default:throw Error(N(329))}}}return Ce(e,q()),e.callbackNode===n?Vc.bind(null,e):null}function ro(e,t){var n=Gn;return e.current.memoizedState.isDehydrated&&(zt(e,t).flags|=256),e=gl(e,t),e!==2&&(t=Se,Se=n,t!==null&&lo(t)),e}function lo(e){Se===null?Se=e:Se.push.apply(Se,e)}function bp(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],s=l.getSnapshot;l=l.value;try{if(!Ge(s(),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 ht(e,t){for(t&=~Vo,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ve(t),r=1<<n;e[n]=-1,t&=~r}}function _a(e){if(z&6)throw Error(N(327));pn();var t=Zr(e,0);if(!(t&1))return Ce(e,q()),null;var n=gl(e,t);if(e.tag!==0&&n===2){var r=Ts(e);r!==0&&(t=r,n=ro(e,r))}if(n===1)throw n=dr,zt(e,0),ht(e,t),Ce(e,q()),n;if(n===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rt(e,Se,et),Ce(e,q()),null}function Go(e,t){var n=z;z|=1;try{return e(t)}finally{z=n,z===0&&(wn=q()+500,bl&&It())}}function Bt(e){yt!==null&&yt.tag===0&&!(z&6)&&pn();var t=z;z|=1;var n=Me.transition,r=U;try{if(Me.transition=null,U=1,e)return e()}finally{U=r,Me.transition=n,z=t,!(z&6)&&It()}}function Yo(){Ee=on.current,K(on)}function zt(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,tp(n)),ee!==null)for(n=ee.return;n!==null;){var r=n;switch(_o(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&rl();break;case 3:xn(),K(Ne),K(ge),zo();break;case 5:Oo(r);break;case 4:xn();break;case 13:K(Y);break;case 19:K(Y);break;case 10:Ao(r.type._context);break;case 22:case 23:Yo()}n=n.return}if(le=e,ee=e=bt(e.current,null),ce=Ee=t,ne=0,dr=null,Vo=Tl=$t=0,Se=Gn=null,Dt!==null){for(t=0;t<Dt.length;t++)if(n=Dt[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=l,r.next=i}n.pending=r}Dt=null}return e}function Kc(e,t){do{var n=ee;try{if(Io(),$r.current=fl,dl){for(var r=Q.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}dl=!1}if(Wt=0,re=te=Q=null,Vn=!1,ar=0,Ho.current=null,n===null||n.return===null){ne=1,dr=t,ee=null;break}e:{var s=e,i=n.return,a=n,u=t;if(t=ce,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,g=a,h=g.tag;if(!(g.mode&1)&&(h===0||h===11||h===15)){var m=g.alternate;m?(g.updateQueue=m.updateQueue,g.memoizedState=m.memoizedState,g.lanes=m.lanes):(g.updateQueue=null,g.memoizedState=null)}var x=ha(i);if(x!==null){x.flags&=-257,ga(x,i,a,s,t),x.mode&1&&ma(s,d,t),t=x,u=d;var v=t.updateQueue;if(v===null){var k=new Set;k.add(u),t.updateQueue=k}else v.add(u);break e}else{if(!(t&1)){ma(s,d,t),Qo();break e}u=Error(N(426))}}else if(G&&a.mode&1){var I=ha(i);if(I!==null){!(I.flags&65536)&&(I.flags|=256),ga(I,i,a,s,t),To(vn(u,a));break e}}s=u=vn(u,a),ne!==4&&(ne=2),Gn===null?Gn=[s]:Gn.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=Tc(s,u,t);aa(s,p);break e;case 1:a=u;var c=s.type,f=s.stateNode;if(!(s.flags&128)&&(typeof c.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(jt===null||!jt.has(f)))){s.flags|=65536,t&=-t,s.lanes|=t;var y=Pc(s,a,t);aa(s,y);break e}}s=s.return}while(s!==null)}Qc(n)}catch(j){t=j,ee===n&&n!==null&&(ee=n=n.return);continue}break}while(!0)}function Gc(){var e=pl.current;return pl.current=fl,e===null?fl:e}function Qo(){(ne===0||ne===3||ne===2)&&(ne=4),le===null||!($t&268435455)&&!(Tl&268435455)||ht(le,ce)}function gl(e,t){var n=z;z|=2;var r=Gc();(le!==e||ce!==t)&&(et=null,zt(e,t));do try{Cp();break}catch(l){Kc(e,l)}while(!0);if(Io(),z=n,pl.current=r,ee!==null)throw Error(N(261));return le=null,ce=0,ne}function Cp(){for(;ee!==null;)Yc(ee)}function Ep(){for(;ee!==null&&!Jd();)Yc(ee)}function Yc(e){var t=Jc(e.alternate,e,Ee);e.memoizedProps=e.pendingProps,t===null?Qc(e):ee=t,Ho.current=null}function Qc(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wp(n,t),n!==null){n.flags&=32767,ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ne=6,ee=null;return}}else if(n=vp(n,t,Ee),n!==null){ee=n;return}if(t=t.sibling,t!==null){ee=t;return}ee=t=e}while(t!==null);ne===0&&(ne=5)}function Rt(e,t,n){var r=U,l=Me.transition;try{Me.transition=null,U=1,_p(e,t,n,r)}finally{Me.transition=l,U=r}return null}function _p(e,t,n,r){do pn();while(yt!==null);if(z&6)throw Error(N(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(N(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(af(e,s),e===le&&(ee=le=null,ce=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Rr||(Rr=!0,Zc(Jr,function(){return pn(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Me.transition,Me.transition=null;var i=U;U=1;var a=z;z|=4,Ho.current=null,Sp(e,n),Bc(n,e),Yf(Ds),qr=!!Ls,Ds=Ls=null,e.current=n,jp(n),Zd(),z=a,U=i,Me.transition=s}else e.current=n;if(Rr&&(Rr=!1,yt=e,hl=l),s=e.pendingLanes,s===0&&(jt=null),tf(n.stateNode),Ce(e,q()),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(ml)throw ml=!1,e=to,to=null,e;return hl&1&&e.tag!==0&&pn(),s=e.pendingLanes,s&1?e===no?Yn++:(Yn=0,no=e):Yn=0,It(),null}function pn(){if(yt!==null){var e=Tu(hl),t=Me.transition,n=U;try{if(Me.transition=null,U=16>e?16:e,yt===null)var r=!1;else{if(e=yt,yt=null,hl=0,z&6)throw Error(N(331));var l=z;for(z|=4,T=e.current;T!==null;){var s=T,i=s.child;if(T.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var d=a[u];for(T=d;T!==null;){var g=T;switch(g.tag){case 0:case 11:case 15:Kn(8,g,s)}var h=g.child;if(h!==null)h.return=g,T=h;else for(;T!==null;){g=T;var m=g.sibling,x=g.return;if(Uc(g),g===d){T=null;break}if(m!==null){m.return=x,T=m;break}T=x}}}var v=s.alternate;if(v!==null){var k=v.child;if(k!==null){v.child=null;do{var I=k.sibling;k.sibling=null,k=I}while(k!==null)}}T=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,T=i;else e:for(;T!==null;){if(s=T,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Kn(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,T=p;break e}T=s.return}}var c=e.current;for(T=c;T!==null;){i=T;var f=i.child;if(i.subtreeFlags&2064&&f!==null)f.return=i,T=f;else e:for(i=c;T!==null;){if(a=T,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:_l(9,a)}}catch(j){Z(a,a.return,j)}if(a===i){T=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,T=y;break e}T=a.return}}if(z=l,It(),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(wl,e)}catch{}r=!0}return r}finally{U=n,Me.transition=t}}return!1}function Ta(e,t,n){t=vn(n,t),t=Tc(e,t,1),e=St(e,t,1),t=xe(),e!==null&&(mr(e,1,t),Ce(e,t))}function Z(e,t,n){if(e.tag===3)Ta(e,e,n);else for(;t!==null;){if(t.tag===3){Ta(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jt===null||!jt.has(r))){e=vn(n,e),e=Pc(t,e,1),t=St(t,e,1),e=xe(),t!==null&&(mr(t,1,e),Ce(t,e));break}}t=t.return}}function Tp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=xe(),e.pingedLanes|=e.suspendedLanes&n,le===e&&(ce&n)===n&&(ne===4||ne===3&&(ce&130023424)===ce&&500>q()-Ko?zt(e,0):Vo|=n),Ce(e,t)}function Xc(e,t){t===0&&(e.mode&1?(t=jr,jr<<=1,!(jr&130023424)&&(jr=4194304)):t=1);var n=xe();e=at(e,t),e!==null&&(mr(e,t,n),Ce(e,n))}function Pp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xc(e,n)}function Ip(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(N(314))}r!==null&&r.delete(t),Xc(e,n)}var Jc;Jc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ne.current)je=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return je=!1,xp(e,t,n);je=!!(e.flags&131072)}else je=!1,G&&t.flags&1048576&&tc(t,ol,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hr(e,t),e=t.pendingProps;var l=hn(t,ge.current);fn(t,n),l=Fo(null,t,r,e,l,n);var s=Uo();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,be(r)?(s=!0,ll(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Lo(t),l.updater=El,t.stateNode=l,l._reactInternals=t,Hs(t,r,e,n),t=Gs(null,t,r,!0,s,n)):(t.tag=0,G&&s&&Eo(t),ye(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Rp(r),e=$e(r,e),l){case 0:t=Ks(null,t,r,e,n);break e;case 1:t=va(null,t,r,e,n);break e;case 11:t=ya(null,t,r,e,n);break e;case 14:t=xa(null,t,r,$e(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:$e(r,l),Ks(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:$e(r,l),va(e,t,r,l,n);case 3:e:{if(Lc(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,l=s.element,ic(e,t),ul(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=vn(Error(N(423)),t),t=wa(e,t,r,n,l);break e}else if(r!==l){l=vn(Error(N(424)),t),t=wa(e,t,r,n,l);break e}else for(_e=kt(t.stateNode.containerInfo.firstChild),Te=t,G=!0,He=null,n=sc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gn(),r===l){t=ut(e,t,n);break e}ye(e,t,r,n)}t=t.child}return t;case 5:return ac(t),e===null&&Ws(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,i=l.children,Os(r,l)?i=null:s!==null&&Os(r,s)&&(t.flags|=32),Rc(e,t),ye(e,t,i,n),t.child;case 6:return e===null&&Ws(t),null;case 13:return Dc(e,t,n);case 4:return Do(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yn(t,null,r,n):ye(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:$e(r,l),ya(e,t,r,l,n);case 7:return ye(e,t,t.pendingProps,n),t.child;case 8:return ye(e,t,t.pendingProps.children,n),t.child;case 12:return ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,i=l.value,B(il,r._currentValue),r._currentValue=i,s!==null)if(Ge(s.value,i)){if(s.children===l.children&&!Ne.current){t=ut(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=lt(-1,n&-n),u.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?u.next=u:(u.next=g.next,g.next=u),d.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),$s(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(N(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),$s(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}ye(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,fn(t,n),l=Fe(l),r=r(l),t.flags|=1,ye(e,t,r,n),t.child;case 14:return r=t.type,l=$e(r,t.pendingProps),l=$e(r.type,l),xa(e,t,r,l,n);case 15:return Ic(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:$e(r,l),Hr(e,t),t.tag=1,be(r)?(e=!0,ll(t)):e=!1,fn(t,n),_c(t,r,l),Hs(t,r,l,n),Gs(null,t,r,!0,e,n);case 19:return Oc(e,t,n);case 22:return Ac(e,t,n)}throw Error(N(156,t.tag))};function Zc(e,t){return bu(e,t)}function Ap(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 ze(e,t,n,r){return new Ap(e,t,n,r)}function Xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rp(e){if(typeof e=="function")return Xo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ho)return 11;if(e===go)return 14}return 2}function bt(e,t){var n=e.alternate;return n===null?(n=ze(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 Gr(e,t,n,r,l,s){var i=2;if(r=e,typeof e=="function")Xo(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Xt:return Mt(n.children,l,s,t);case mo:i=8,l|=8;break;case ms:return e=ze(12,n,t,l|2),e.elementType=ms,e.lanes=s,e;case hs:return e=ze(13,n,t,l),e.elementType=hs,e.lanes=s,e;case gs:return e=ze(19,n,t,l),e.elementType=gs,e.lanes=s,e;case au:return Pl(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ou:i=10;break e;case iu:i=9;break e;case ho:i=11;break e;case go:i=14;break e;case ft:i=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Mt(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function Pl(e,t,n,r){return e=ze(22,e,r,t),e.elementType=au,e.lanes=n,e.stateNode={isHidden:!1},e}function as(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function us(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lp(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=Bl(0),this.expirationTimes=Bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Jo(e,t,n,r,l,s,i,a,u){return e=new Lp(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ze(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lo(s),e}function Dp(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qt,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function qc(e){if(!e)return Et;e=e._reactInternals;e:{if(Vt(e)!==e||e.tag!==1)throw Error(N(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(be(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(N(171))}if(e.tag===1){var n=e.type;if(be(n))return qu(e,n,t)}return t}function ed(e,t,n,r,l,s,i,a,u){return e=Jo(n,r,!0,e,l,s,i,a,u),e.context=qc(null),n=e.current,r=xe(),l=Nt(n),s=lt(r,l),s.callback=t??null,St(n,s,l),e.current.lanes=l,mr(e,l,r),Ce(e,r),e}function Il(e,t,n,r){var l=t.current,s=xe(),i=Nt(l);return n=qc(n),t.context===null?t.context=n:t.pendingContext=n,t=lt(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=St(l,t,i),e!==null&&(Ke(e,l,i,s),Wr(e,l,i)),i}function yl(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 Pa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zo(e,t){Pa(e,t),(e=e.alternate)&&Pa(e,t)}function Op(){return null}var td=typeof reportError=="function"?reportError:function(e){console.error(e)};function qo(e){this._internalRoot=e}Al.prototype.render=qo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));Il(e,t,null,null)};Al.prototype.unmount=qo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bt(function(){Il(null,e,null,null)}),t[it]=null}};function Al(e){this._internalRoot=e}Al.prototype.unstable_scheduleHydration=function(e){if(e){var t=Au();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mt.length&&t!==0&&t<mt[n].priority;n++);mt.splice(n,0,e),n===0&&Lu(e)}};function ei(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Rl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ia(){}function zp(e,t,n,r,l){if(l){if(typeof r=="function"){var s=r;r=function(){var d=yl(i);s.call(d)}}var i=ed(t,r,e,0,null,!1,!1,"",Ia);return e._reactRootContainer=i,e[it]=i.current,rr(e.nodeType===8?e.parentNode:e),Bt(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var d=yl(u);a.call(d)}}var u=Jo(e,0,!1,null,null,!1,!1,"",Ia);return e._reactRootContainer=u,e[it]=u.current,rr(e.nodeType===8?e.parentNode:e),Bt(function(){Il(t,u,n,r)}),u}function Ll(e,t,n,r,l){var s=n._reactRootContainer;if(s){var i=s;if(typeof l=="function"){var a=l;l=function(){var u=yl(i);a.call(u)}}Il(t,i,e,l)}else i=zp(n,t,e,l,r);return yl(i)}Pu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Mn(t.pendingLanes);n!==0&&(vo(t,n|1),Ce(t,q()),!(z&6)&&(wn=q()+500,It()))}break;case 13:Bt(function(){var r=at(e,1);if(r!==null){var l=xe();Ke(r,e,1,l)}}),Zo(e,1)}};wo=function(e){if(e.tag===13){var t=at(e,134217728);if(t!==null){var n=xe();Ke(t,e,134217728,n)}Zo(e,134217728)}};Iu=function(e){if(e.tag===13){var t=Nt(e),n=at(e,t);if(n!==null){var r=xe();Ke(n,e,t,r)}Zo(e,t)}};Au=function(){return U};Ru=function(e,t){var n=U;try{return U=e,t()}finally{U=n}};Cs=function(e,t,n){switch(t){case"input":if(vs(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=Nl(r);if(!l)throw Error(N(90));cu(r),vs(r,l)}}}break;case"textarea":fu(e,n);break;case"select":t=n.value,t!=null&&an(e,!!n.multiple,t,!1)}};vu=Go;wu=Bt;var Mp={usingClientEntryPoint:!1,Events:[gr,en,Nl,yu,xu,Go]},Rn={findFiberByHostInstance:Lt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Fp={bundleType:Rn.bundleType,version:Rn.version,rendererPackageName:Rn.rendererPackageName,rendererConfig:Rn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ct.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ju(e),e===null?null:e.stateNode},findFiberByHostInstance:Rn.findFiberByHostInstance||Op,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 Lr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lr.isDisabled&&Lr.supportsFiber)try{wl=Lr.inject(Fp),Ze=Lr}catch{}}Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mp;Ae.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ei(t))throw Error(N(200));return Dp(e,t,null,n)};Ae.createRoot=function(e,t){if(!ei(e))throw Error(N(299));var n=!1,r="",l=td;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Jo(e,1,!1,null,null,n,!1,r,l),e[it]=t.current,rr(e.nodeType===8?e.parentNode:e),new qo(t)};Ae.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(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=ju(t),e=e===null?null:e.stateNode,e};Ae.flushSync=function(e){return Bt(e)};Ae.hydrate=function(e,t,n){if(!Rl(t))throw Error(N(200));return Ll(null,e,t,!0,n)};Ae.hydrateRoot=function(e,t,n){if(!ei(e))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,l=!1,s="",i=td;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=ed(t,null,e,1,n??null,l,!1,s,i),e[it]=t.current,rr(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 Al(t)};Ae.render=function(e,t,n){if(!Rl(t))throw Error(N(200));return Ll(null,e,t,!1,n)};Ae.unmountComponentAtNode=function(e){if(!Rl(e))throw Error(N(40));return e._reactRootContainer?(Bt(function(){Ll(null,null,e,!1,function(){e._reactRootContainer=null,e[it]=null})}),!0):!1};Ae.unstable_batchedUpdates=Go;Ae.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Rl(n))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return Ll(e,t,n,!1,r)};Ae.version="18.3.1-next-f1338f8080-20240426";function nd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nd)}catch(e){console.error(e)}}nd(),nu.exports=Ae;var Up=nu.exports,Aa=Up;fs.createRoot=Aa.createRoot,fs.hydrateRoot=Aa.hydrateRoot;function Wp({size:e="sm"}){const t=e==="sm"?"w-4 h-4":"w-5 h-5";return o.jsx("div",{className:`${t} border-2 border-claw-500 border-t-transparent rounded-full animate-spin shrink-0`})}function ti(){return o.jsxs("span",{className:"flex gap-1",children:[o.jsx("span",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),o.jsx("span",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}function Ra({text:e}){const[t,n]=w.useState(!1);function r(){navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})}return o.jsx("button",{onClick:r,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors px-2 py-0.5 rounded border border-gray-700 hover:border-gray-500",children:t?"✓ Copied":"Copy"})}function $p({onReady:e}){const[t,n]=w.useState("checking"),[r,l]=w.useState(null),[s,i]=w.useState(""),[a,u]=w.useState(""),[d,g]=w.useState(0),h=w.useRef(null);w.useEffect(()=>{m()},[]),w.useEffect(()=>{h.current&&(h.current.scrollTop=h.current.scrollHeight)},[s]),w.useEffect(()=>{if(t!=="installing")return;const v=setInterval(()=>g(k=>k+1),1e3);return()=>clearInterval(v)},[t]);async function m(){n("checking");try{const k=await(await fetch("/api/preflight")).json();k.installed?(l(k.version),n("ok"),setTimeout(e,1200)):n("missing")}catch{n("missing")}}async function x(){n("installing"),i(""),u(""),g(0);try{const k=(await fetch("/api/preflight/install",{method:"POST"})).body.getReader(),I=new TextDecoder;let p="";for(;;){const{done:c,value:f}=await k.read();if(c)break;p+=I.decode(f,{stream:!0});const y=p.split(`
|
|
41
|
+
`);p=y.pop();for(const j of y)if(j.startsWith("data:"))try{const{type:b,data:C}=JSON.parse(j.slice(5).trim());b==="log"&&i(E=>E+C),b==="done"&&(l(C),n("ok"),setTimeout(e,1500)),b==="error"&&(u(C),n("error"))}catch{}}}catch(v){u(v.message),n("error")}}return t==="checking"?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[o.jsx("div",{className:"text-4xl",children:"🦞"}),o.jsx("p",{className:"text-gray-400 text-sm animate-pulse",children:"Checking your setup..."})]}):t==="ok"?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[o.jsx("div",{className:"text-4xl",children:"🦞"}),o.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[o.jsx("span",{className:"text-xl",children:"✓"}),o.jsx("span",{className:"font-semibold",children:"OpenClaw is ready"})]}),r&&o.jsx("p",{className:"text-xs text-gray-600",children:r}),o.jsx("p",{className:"text-sm text-gray-500",children:"Starting the builder..."})]}):t==="installing"?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen px-6",children:[o.jsx("div",{className:"text-4xl mb-5",children:"🦞"}),o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx(Wp,{size:"md"}),o.jsx("h2",{className:"text-lg font-bold text-white",children:"Installing OpenClaw..."})]}),o.jsxs("p",{className:"text-sm text-gray-500 mb-5",children:[d,"s elapsed · usually takes under a minute"]}),o.jsx("div",{ref:h,className:"w-full max-w-lg h-40 bg-gray-900 border border-gray-700 rounded-xl p-4 font-mono text-xs text-green-400 overflow-y-auto scrollbar-thin",children:s||"Starting npm install..."}),o.jsxs("div",{className:"flex items-center gap-2 mt-4 text-xs text-gray-600",children:[o.jsx("span",{children:"Downloading packages"}),o.jsx(ti,{})]})]}):t==="error"?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen px-6",children:[o.jsx("div",{className:"text-4xl mb-4",children:"🦞"}),o.jsx("h2",{className:"text-lg font-bold text-white mb-2",children:"Installation ran into a problem"}),o.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Try running this in your terminal instead:"}),o.jsxs("div",{className:"w-full max-w-lg bg-gray-900 border border-gray-700 rounded-xl p-4 flex items-center justify-between mb-4",children:[o.jsx("code",{className:"text-sm text-claw-400",children:"npm install -g openclaw"}),o.jsx(Ra,{text:"npm install -g openclaw"})]}),a&&o.jsx("p",{className:"text-xs text-red-400 mb-4 max-w-lg text-center",children:a}),o.jsx("button",{onClick:m,className:"px-5 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors",children:"Check again →"})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen px-6",children:[o.jsx("div",{className:"text-5xl mb-5",children:"🦞"}),o.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Welcome to OpenClaw Agent Builder"}),o.jsx("p",{className:"text-gray-400 text-sm text-center max-w-md mb-8",children:"This tool requires OpenClaw to be installed on your computer. It's free and takes about a minute to set up."}),o.jsxs("div",{className:"w-full max-w-md space-y-4",children:[o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-5",children:[o.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:"Install automatically"}),o.jsx("p",{className:"text-xs text-gray-500 mb-4",children:"We'll run the installer for you. Requires Node.js 18+ to be installed."}),o.jsx("button",{onClick:x,className:"w-full px-5 py-2.5 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors",children:"Install OpenClaw →"})]}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-5",children:[o.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:"Install manually"}),o.jsx("p",{className:"text-xs text-gray-500 mb-3",children:'Run this in your terminal, then come back and click "Check again."'}),o.jsxs("div",{className:"flex items-center justify-between bg-gray-900 rounded-lg px-3 py-2 mb-3",children:[o.jsx("code",{className:"text-sm text-claw-400",children:"npm install -g openclaw"}),o.jsx(Ra,{text:"npm install -g openclaw"})]}),o.jsx("button",{onClick:m,className:"text-sm text-gray-400 hover:text-white transition-colors underline",children:"I've installed it — check again"})]}),o.jsxs("p",{className:"text-center text-xs text-gray-600",children:["Already installed?"," ",o.jsx("button",{onClick:e,className:"underline hover:text-gray-400 transition-colors",children:"Skip this check"})]})]})]})}const Bp={},La=e=>{let t;const n=new Set,r=(g,h)=>{const m=typeof g=="function"?g(t):g;if(!Object.is(m,t)){const x=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,x))}},l=()=>t,u={setState:r,getState:l,getInitialState:()=>d,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(Bp?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,l,u);return u},Hp=e=>e?La(e):La;var rd={exports:{}},ld={},sd={exports:{}},od={};/**
|
|
42
|
+
* @license React
|
|
43
|
+
* use-sync-external-store-shim.production.js
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/var kn=w;function Vp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kp=typeof Object.is=="function"?Object.is:Vp,Gp=kn.useState,Yp=kn.useEffect,Qp=kn.useLayoutEffect,Xp=kn.useDebugValue;function Jp(e,t){var n=t(),r=Gp({inst:{value:n,getSnapshot:t}}),l=r[0].inst,s=r[1];return Qp(function(){l.value=n,l.getSnapshot=t,cs(l)&&s({inst:l})},[e,n,t]),Yp(function(){return cs(l)&&s({inst:l}),e(function(){cs(l)&&s({inst:l})})},[e]),Xp(n),n}function cs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kp(e,n)}catch{return!0}}function Zp(e,t){return t()}var qp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zp:Jp;od.useSyncExternalStore=kn.useSyncExternalStore!==void 0?kn.useSyncExternalStore:qp;sd.exports=od;var em=sd.exports;/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var Dl=w,tm=em;function nm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rm=typeof Object.is=="function"?Object.is:nm,lm=tm.useSyncExternalStore,sm=Dl.useRef,om=Dl.useEffect,im=Dl.useMemo,am=Dl.useDebugValue;ld.useSyncExternalStoreWithSelector=function(e,t,n,r,l){var s=sm(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=im(function(){function u(x){if(!d){if(d=!0,g=x,x=r(x),l!==void 0&&i.hasValue){var v=i.value;if(l(v,x))return h=v}return h=x}if(v=h,rm(g,x))return v;var k=r(x);return l!==void 0&&l(v,k)?(g=x,v):(g=x,h=k)}var d=!1,g,h,m=n===void 0?null:n;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,n,r,l]);var a=lm(e,s[0],s[1]);return om(function(){i.hasValue=!0,i.value=a},[a]),am(a),a};rd.exports=ld;var um=rd.exports;const cm=Ba(um),id={},{useDebugValue:dm}=eu,{useSyncExternalStoreWithSelector:fm}=cm;let Da=!1;const pm=e=>e;function mm(e,t=pm,n){(id?"production":void 0)!=="production"&&n&&!Da&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Da=!0);const r=fm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dm(r),r}const Oa=e=>{(id?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Hp(e):e,n=(r,l)=>mm(t,r,l);return Object.assign(n,t),n},ad=e=>e?Oa(e):Oa,so=()=>({id:"",name:"",mission:"",inputs:"",outputs:"",failure:"",escalation:"",never:[]}),za=()=>({version:"1.0",team:{name:"",mission:""},agents:[so()],orchestration:{mode:"hub_and_spoke",router_agent:""},handoffs:[],shared_constraints:{never:[]},shared_memory:{mode:"separate",location:""},routing:{defaultAgentId:"",bindings:[]},capabilities:{recommendedSkills:[],webSearch:!1,webFetch:!1,memory:"lancedb",tools:{deny:[]}}}),Pe=ad((e,t)=>{const n=r=>l=>e(s=>({teamSpec:{...s.teamSpec,[r]:{...s.teamSpec[r],...l}}}));return{phase:0,subStep:0,isTeam:null,isMainAgent:null,defaultWorkspace:"~/.openclaw/workspace",conversationMessages:[],conversationComplete:!1,teamSpec:za(),generatedFiles:[],writeResult:null,validationOutput:"",isGenerating:!1,isWriting:!1,isValidating:!1,channelChoice:null,setPhase:r=>e({phase:r,subStep:0}),setSubStep:r=>e({subStep:r}),setIsTeam:r=>{if(e({isTeam:r}),!r){const{teamSpec:l}=t(),s=l.agents[0]||so();e(i=>({teamSpec:{...i.teamSpec,orchestration:{mode:"hub_and_spoke",router_agent:s.id},handoffs:[],routing:{defaultAgentId:s.id,bindings:[]},team:{...i.teamSpec.team,name:i.teamSpec.team.name||(s.name?s.name+" Workspace":"")}}}))}},updateTeam:n("team"),updateOrchestration:n("orchestration"),updateSharedMemory:n("shared_memory"),updateRouting:n("routing"),updateSharedConstraints:n("shared_constraints"),addAgent:()=>e(r=>({teamSpec:{...r.teamSpec,agents:[...r.teamSpec.agents,so()]}})),removeAgent:r=>e(l=>({teamSpec:{...l.teamSpec,agents:l.teamSpec.agents.filter((s,i)=>i!==r)}})),updateAgent:(r,l)=>e(s=>{const i=[...s.teamSpec.agents];i[r]={...i[r],...l};const a=!t().isTeam&&r===0?{orchestration:{mode:"hub_and_spoke",router_agent:i[0].id},routing:{defaultAgentId:i[0].id,bindings:[]}}:{};return{teamSpec:{...s.teamSpec,agents:i,...a}}}),addHandoff:()=>e(r=>({teamSpec:{...r.teamSpec,handoffs:[...r.teamSpec.handoffs,{from:"",to:"",when:"",payload_contract:""}]}})),removeHandoff:r=>e(l=>({teamSpec:{...l.teamSpec,handoffs:l.teamSpec.handoffs.filter((s,i)=>i!==r)}})),updateHandoff:(r,l)=>e(s=>{const i=[...s.teamSpec.handoffs];return i[r]={...i[r],...l},{teamSpec:{...s.teamSpec,handoffs:i}}}),addBinding:()=>e(r=>({teamSpec:{...r.teamSpec,routing:{...r.teamSpec.routing,bindings:[...r.teamSpec.routing.bindings||[],{agentId:"",match:{channel:""}}]}}})),removeBinding:r=>e(l=>({teamSpec:{...l.teamSpec,routing:{...l.teamSpec.routing,bindings:l.teamSpec.routing.bindings.filter((s,i)=>i!==r)}}})),updateBinding:(r,l)=>e(s=>{const i=[...s.teamSpec.routing.bindings];return i[r]={...i[r],...l},{teamSpec:{...s.teamSpec,routing:{...s.teamSpec.routing,bindings:i}}}}),setIsMainAgent:r=>e({isMainAgent:r}),setDefaultWorkspace:r=>e({defaultWorkspace:r}),setConversationMessages:r=>e({conversationMessages:r}),setConversationComplete:r=>e({conversationComplete:r}),mergeTeamSpec:r=>e(l=>{var a,u,d,g;const s=l.teamSpec,i={...s};if(r.version&&(i.version=r.version),r.team&&(i.team={...s.team,...r.team}),r.orchestration&&(i.orchestration={...s.orchestration,...r.orchestration}),r.shared_memory&&(i.shared_memory={...s.shared_memory,...r.shared_memory}),r.routing&&(i.routing={...s.routing,...r.routing}),r.shared_constraints&&(i.shared_constraints={...s.shared_constraints,...r.shared_constraints}),r.handoffs!==void 0&&(i.handoffs=r.handoffs),r.capabilities&&(i.capabilities={...s.capabilities,...r.capabilities,recommendedSkills:r.capabilities.recommendedSkills??((a=s.capabilities)==null?void 0:a.recommendedSkills)??[],tools:{...((u=s.capabilities)==null?void 0:u.tools)||{},...r.capabilities.tools||{}},agentToolDeny:{...((d=s.capabilities)==null?void 0:d.agentToolDeny)||{},...((g=r.capabilities)==null?void 0:g.agentToolDeny)||{}}}),r.agents){const h=new Map(s.agents.filter(x=>x.id).map(x=>[x.id,x]));for(const x of r.agents)x.id&&h.set(x.id,{...h.get(x.id)||{},...x});const m=Array.from(h.values());i.agents=m.length>0?m:s.agents}return{teamSpec:i}}),setGeneratedFiles:r=>e({generatedFiles:r}),setWriteResult:r=>e({writeResult:r}),setValidationOutput:r=>e({validationOutput:r}),setIsGenerating:r=>e({isGenerating:r}),setIsWriting:r=>e({isWriting:r}),setIsValidating:r=>e({isValidating:r}),setChannelChoice:r=>e({channelChoice:r}),reset:()=>e({phase:0,subStep:0,isTeam:null,isMainAgent:null,defaultWorkspace:"~/.openclaw/workspace",teamSpec:za(),generatedFiles:[],writeResult:null,validationOutput:"",isGenerating:!1,isWriting:!1,isValidating:!1,channelChoice:null,conversationMessages:[],conversationComplete:!1})}}),ud="openclaw-ai-config";function hm(){try{const e=localStorage.getItem(ud);return e?JSON.parse(e):{}}catch{return{}}}function Ln(e){try{localStorage.setItem(ud,JSON.stringify({provider:e.provider,apiKey:e.apiKey,model:e.model,configured:e.configured,openclawEnv:e.openclawEnv||!1}))}catch{}}const Dn=hm(),Ol=ad((e,t)=>({provider:Dn.provider||"openclaw",apiKey:Dn.apiKey||"",model:Dn.model||"claude-sonnet-4-6",configured:Dn.configured||!1,openclawEnv:Dn.openclawEnv||!1,openclawDefault:null,setProvider:n=>{e({provider:n}),Ln(t())},setApiKey:n=>{e({apiKey:n}),Ln(t())},setModel:n=>{e({model:n}),Ln(t())},configure:({provider:n,apiKey:r,model:l,openclawEnv:s})=>{const i={provider:n,apiKey:r||"",model:l,configured:!0,openclawEnv:!!s};e(i),Ln({...t(),...i})},reset:()=>{const n={provider:"openclaw",apiKey:"",model:"claude-sonnet-4-6",configured:!1,openclawEnv:!1};e(n),Ln(n)},setOpenclawDefault:n=>e({openclawDefault:n})})),Ma={CHAT:0,PLAYGROUND:6},Fa=["Chat","Review","Generate","Capabilities","Connect","Validate","Playground"];function bn(){const{phase:e,setPhase:t}=Pe();function n(){t(Math.min(e+1,Ma.PLAYGROUND))}function r(){t(Math.max(e-1,Ma.CHAT))}return{phase:e,advance:n,goBack:r}}function gm({currentPhase:e}){return o.jsx("div",{className:"flex items-center gap-1",children:Fa.map((t,n)=>{const r=n<e,l=n===e;return o.jsxs("div",{className:"flex items-center",children:[o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold border-2 transition-all ${r?"border-claw-500 bg-claw-600 text-white":l?"border-claw-400 bg-claw-500/20 text-claw-300 ring-2 ring-claw-500/30":"border-gray-600 bg-gray-800 text-gray-500"}`,children:r?"✓":n+1}),o.jsx("span",{className:`text-[10px] leading-tight mt-1 text-center w-16 ${l?"text-claw-300 font-medium":r?"text-claw-500":"text-gray-600"}`,children:t})]}),n<Fa.length-1&&o.jsx("div",{className:`h-0.5 w-6 mx-1 mb-5 rounded ${r?"bg-claw-600":"bg-gray-700"}`})]},n)})})}const ds={anthropic:{label:"Anthropic Claude",badge:"Recommended",defaultModel:"claude-sonnet-4-6",placeholder:"sk-ant-api03-...",costNote:"Free $5 credit on signup · ~100 sessions",steps:[{text:"Create a free account",url:"https://console.anthropic.com",urlLabel:"console.anthropic.com",note:"Includes $5 in free credit — enough for ~100 builder sessions."},{text:o.jsxs(o.Fragment,{children:["In the left sidebar, click ",o.jsx("strong",{className:"text-gray-200",children:"API Keys"}),"."]})},{text:o.jsxs(o.Fragment,{children:["Click ",o.jsx("strong",{className:"text-gray-200",children:"Create Key"}),", give it any name, and copy it."]})},{text:"Paste it in the field below."}]},openai:{label:"OpenAI GPT",defaultModel:"gpt-4o",placeholder:"sk-proj-...",costNote:"Pay as you go · ~$0.05 per session",steps:[{text:"Create an account",url:"https://platform.openai.com/signup",urlLabel:"platform.openai.com",note:"You'll need to add a small credit balance — $5 is plenty to get started."},{text:o.jsxs(o.Fragment,{children:["Click your profile icon (top-right) → ",o.jsx("strong",{className:"text-gray-200",children:"API keys"}),"."]})},{text:o.jsxs(o.Fragment,{children:["Click ",o.jsx("strong",{className:"text-gray-200",children:"Create new secret key"})," and copy it."]})},{text:"Paste it in the field below."}]}};function ym({onDone:e}){const{configure:t,setOpenclawDefault:n}=Ol(),[r,l]=w.useState(null),[s,i]=w.useState("anthropic"),[a,u]=w.useState("need"),[d,g]=w.useState(""),[h,m]=w.useState(""),[x,v]=w.useState(!1);w.useEffect(()=>{fetch("/api/chat/openclaw-status").then(f=>f.json()).then(f=>{l(f),n(f),f.available&&(t({provider:"openclaw",apiKey:"",model:f.normalized||f.model||"claude-sonnet-4-6",openclawEnv:!0}),e==null||e())}).catch(()=>l({available:!1}))},[]);function k(f){i(f),g(""),m("")}function I(f){u(f),m("")}async function p(){if(!d.trim()){m("Paste your API key to continue.");return}m(""),v(!0);const f=ds[s].defaultModel;try{const y=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:'Say "ok" and nothing else.'}],apiKey:d.trim(),model:f,provider:s})}),j=await y.json();if(!y.ok)throw new Error(j.error||"Connection failed");t({provider:s,apiKey:d.trim(),model:f}),e==null||e()}catch(y){const j=y.message||"";j.includes("401")||j.includes("invalid")||j.includes("auth")||j.includes("key")?m("That key didn't work — make sure you copied it in full."):j.includes("credit")||j.includes("balance")||j.includes("quota")?m("Your account has no remaining credit. Add a balance and try again."):m(`Connection failed: ${j}`)}finally{v(!1)}}if(r===null)return o.jsx("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 text-center",children:o.jsx("p",{className:"text-gray-500 text-sm",children:"Checking your setup..."})});const c=ds[s];return o.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 max-w-md",children:[o.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:"Connect an AI model"}),o.jsx("p",{className:"text-xs text-gray-400 mb-5",children:"The builder has a conversation with you to design your agent — it needs an AI model to do that."}),o.jsx("div",{className:"flex gap-2 mb-5",children:Object.entries(ds).map(([f,y])=>o.jsxs("button",{onClick:()=>k(f),className:`flex-1 flex flex-col items-start px-4 py-3 rounded-xl border text-left transition-colors ${s===f?"border-claw-500 bg-claw-900/30":"border-gray-700 bg-gray-800/60 hover:border-gray-600"}`,children:[o.jsxs("div",{className:"flex items-center gap-2 mb-0.5 flex-wrap",children:[o.jsx("span",{className:`text-sm font-semibold ${s===f?"text-white":"text-gray-300"}`,children:y.label}),y.badge&&o.jsx("span",{className:"text-xs bg-claw-800 text-claw-300 px-1.5 py-0.5 rounded-full leading-none",children:y.badge})]}),o.jsx("span",{className:"text-xs text-gray-500",children:y.costNote})]},f))}),o.jsx("div",{className:"flex gap-1 p-1 bg-gray-800 rounded-lg mb-5",children:[{id:"need",label:"I need to get a key"},{id:"have",label:"I already have one"}].map(f=>o.jsx("button",{onClick:()=>I(f.id),className:`flex-1 px-3 py-1.5 rounded-md text-xs font-medium transition-colors ${a===f.id?"bg-gray-700 text-white shadow-sm":"text-gray-500 hover:text-gray-300"}`,children:f.label},f.id))}),a==="need"&&o.jsx("ol",{className:"space-y-3 mb-5",children:c.steps.map((f,y)=>o.jsxs("li",{className:"flex gap-3",children:[o.jsx("div",{className:"w-5 h-5 rounded-full bg-claw-900 border border-claw-700 flex items-center justify-center text-xs font-bold text-claw-400 shrink-0 mt-0.5",children:y+1}),o.jsxs("div",{className:"text-sm text-gray-300 leading-relaxed min-w-0",children:[f.url?o.jsxs(o.Fragment,{children:["Go to"," ",o.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"text-claw-400 hover:text-claw-300 underline font-medium",children:f.urlLabel})," ","and ",f.text.toLowerCase(),"."]}):f.text,f.note&&o.jsx("span",{className:"block text-xs text-gray-500 mt-0.5",children:f.note})]})]},y))}),o.jsxs("div",{className:"mb-1",children:[a==="need"&&o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Paste your key here:"}),o.jsx("input",{type:"password",value:d,onChange:f=>{g(f.target.value),m("")},onKeyDown:f=>f.key==="Enter"&&p(),placeholder:c.placeholder,autoFocus:a==="have",className:"w-full bg-gray-800 border border-gray-700 rounded-xl px-4 py-3 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 font-mono"}),o.jsx("p",{className:"text-xs text-gray-600 mt-1.5",children:"Stored in your browser session only — never sent to us."})]}),h&&o.jsx("p",{className:"text-red-400 text-xs mt-3 mb-1",children:h}),o.jsx("button",{onClick:p,disabled:x||!d.trim(),className:"w-full mt-4 px-5 py-3 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors disabled:opacity-40",children:x?"⟳ Testing connection...":"Connect →"})]})}function Ua(e){return(e?`SETUP MODE: MAIN AGENT
|
|
58
|
+
You are configuring the user's PRIMARY default agent — the one that handles all conversations when no other agent matches.
|
|
59
|
+
- Do NOT ask for a technical ID or slug. Never mention agent IDs to the user.
|
|
60
|
+
- You CAN and SHOULD ask what they want to call their helper and what personality it should have.
|
|
61
|
+
- Always silently set id: "main" in the teamspec for this agent.
|
|
62
|
+
- Frame this as their "main assistant" — the one that's always there for them.
|
|
63
|
+
- Since this is their first/primary helper, focus on making it general and useful rather than narrowly specialized.
|
|
64
|
+
|
|
65
|
+
`:`SETUP MODE: NEW AGENT
|
|
66
|
+
You are helping the user add a NEW specialist agent alongside their existing setup.
|
|
67
|
+
- Ask for a name that distinguishes this agent from their other helpers.
|
|
68
|
+
- Pick an appropriate lowercase-hyphen id slug from the name.
|
|
69
|
+
- You can ask if this new helper should work with their other agents, or work independently.
|
|
70
|
+
|
|
71
|
+
`)+xm}const xm=`You are a friendly, patient assistant helping someone set up an AI helper (called an "agent") for OpenClaw. The person you're talking to may have no technical background at all — imagine helping a relative who's never programmed anything.
|
|
72
|
+
|
|
73
|
+
YOUR JOB:
|
|
74
|
+
Have a natural conversation to understand what they want their AI helper to do. Ask one question at a time. Listen carefully. Ask follow-up questions when answers are vague. When you have a complete picture, build the technical spec silently in a <teamspec> block (the user never sees this — it's background work).
|
|
75
|
+
|
|
76
|
+
CONVERSATION STYLE:
|
|
77
|
+
- Warm, patient, and encouraging. Like a helpful nephew who knows computers.
|
|
78
|
+
- Plain English only. Never say: agent, orchestration, payload, escalation, slug, schema, TeamSpec, hub-and-spoke, handoff chain, manager topology, or any other technical term.
|
|
79
|
+
- Instead say: "helper", "what it does", "what starts it", "what it produces", "when to ask a real person", "what it should never do"
|
|
80
|
+
- When someone is vague ("I want it to do stuff with emails"), ask what specifically. Give examples to help: "Like, when an important email arrives, it sends you a text? Or does it sort them into folders?"
|
|
81
|
+
- One question at a time. Wait for the answer before asking the next thing.
|
|
82
|
+
- If someone says something unclear, reflect it back: "So if I understand right, you want it to..."
|
|
83
|
+
- Be encouraging: "That's a great use case!" / "Perfect, that makes sense."
|
|
84
|
+
|
|
85
|
+
HANDLING VAGUE ANSWERS:
|
|
86
|
+
If the user gives a vague or one-word answer, DO NOT accept it and move on. Always dig deeper with a concrete follow-up:
|
|
87
|
+
- "Help me with tasks" → "What kind of tasks? Can you give me an example of something you'd want this helper to do?"
|
|
88
|
+
- "Just general stuff" → "I totally get wanting a general helper! Can you walk me through a typical day — what's one thing that eats up your time that you'd love to hand off?"
|
|
89
|
+
- "I don't know" → "No worries! Let me throw out some ideas people love — a helper that summarizes your emails, one that tracks prices on things you want to buy, or one that manages your calendar. Any of those sound interesting?"
|
|
90
|
+
- "Yes" / "No" with no detail → Ask a more specific version of the question or offer 2-3 concrete options to react to.
|
|
91
|
+
|
|
92
|
+
WHAT TO LEARN (natural order — don't treat this as a checklist, let it flow):
|
|
93
|
+
1. What should this helper do? What's the big goal?
|
|
94
|
+
2. Is this one helper doing everything, or would it make more sense to have a small team of helpers (e.g. one that watches for things, another that takes action)?
|
|
95
|
+
3. For each helper:
|
|
96
|
+
- What's the main thing it does?
|
|
97
|
+
- What causes it to start working? (A message? A schedule? Someone asking it something?)
|
|
98
|
+
- What does it produce when it's done? (A message? A file? An email draft?)
|
|
99
|
+
- When it gets stuck or doesn't have enough info, what should it do?
|
|
100
|
+
- Are there things it should NEVER do, no matter what? (e.g. "never send an email without asking me first", "never delete anything")
|
|
101
|
+
- What kinds of actions should it always check with a real person before doing?
|
|
102
|
+
4. Should each helper remember things on its own, or share notes with the team?
|
|
103
|
+
|
|
104
|
+
SAFETY & GUARDRAILS — proactively explore these based on what's RELEVANT to the helper being built. Don't ask about categories that don't apply (e.g. don't ask about smart-home safety for an email helper). Weave these naturally into the conversation — don't present them as a list.
|
|
105
|
+
|
|
106
|
+
Categories to probe (only relevant ones):
|
|
107
|
+
1. Destructive actions — Should it delete things permanently, or move to trash? Should it confirm before overwriting files or data? Example: "If your helper is organizing files and finds duplicates, should it delete them right away, or always ask you first?"
|
|
108
|
+
2. Communication — Should it draft messages for your approval before sending, or send directly? Are there contacts it should never message? Example: "When it sends emails on your behalf, should it always show you a draft first?"
|
|
109
|
+
3. Purchases/financial — Is there a spending limit before it needs approval? Should it ever make purchases on its own? Example: "If it finds a deal under $20, can it buy it, or should it always check with you?"
|
|
110
|
+
4. Personal data — Are there things it should never share or store? Privacy boundaries? Example: "Should it ever share your location or personal details with other services?"
|
|
111
|
+
5. System/device control — For smart-home or system helpers: what actions need confirmation? Safety limits? Example: "Should it be able to unlock your front door on its own, or always ask first?"
|
|
112
|
+
6. Irreversible actions (universal) — Anything that can't be undone should always require confirmation. This applies to every helper.
|
|
113
|
+
|
|
114
|
+
Translation rules (apply silently — don't explain these to the user):
|
|
115
|
+
- "Never do X" / "Don't ever..." → add to agent's never[] array
|
|
116
|
+
- "Ask me first before..." / "Check with me when..." → add to agent's escalation
|
|
117
|
+
- "Don't let it use..." / "Block access to..." → add to capabilities.tools.deny (values: exec, browser, write, read, web)
|
|
118
|
+
|
|
119
|
+
COMPLETENESS CHECKLIST — do NOT mark complete="true" until ALL of these are covered for EACH helper:
|
|
120
|
+
[ ] Clear, specific mission (not vague like "help with stuff" — must describe what it actually does)
|
|
121
|
+
[ ] At least 2 specific inputs/triggers (what causes it to act)
|
|
122
|
+
[ ] At least 2 specific outputs (what it produces or does when triggered)
|
|
123
|
+
[ ] Failure handling strategy (what happens when it's stuck or unsure)
|
|
124
|
+
[ ] At least 1 escalation rule (when to involve a human)
|
|
125
|
+
[ ] At least 2 "never" rules (specific things it must never do)
|
|
126
|
+
[ ] Safety/confirmation preferences (what needs approval, what's off-limits, destruction vs trash)
|
|
127
|
+
[ ] Memory preference (should it remember things? what kind of memory?)
|
|
128
|
+
[ ] Skills assessment (which skills/capabilities does it need: web search, browsing, specific integrations?)
|
|
129
|
+
|
|
130
|
+
If any item is missing, ask about it naturally before wrapping up. Don't rush.
|
|
131
|
+
|
|
132
|
+
RECOMMENDING SKILLS — VERY IMPORTANT:
|
|
133
|
+
As you learn what the helper will do, proactively suggest relevant skills and capabilities. Weave this naturally into the conversation — don't make it feel like a checklist. Mention skills conversationally: "Oh, since you want it to track your music taste, there's a Spotify skill that would be perfect for that — I'll make sure we include it." Always explain WHY the skill fits.
|
|
134
|
+
|
|
135
|
+
Skills and capabilities you know about:
|
|
136
|
+
|
|
137
|
+
BUILT-IN CAPABILITIES (always available, no install needed):
|
|
138
|
+
- Web search: searches the internet (Brave or Perplexity). Use when: research helpers, news monitors, price trackers, anything needing current info.
|
|
139
|
+
- Web browsing: opens and reads web pages. Use when: anything that needs to read a specific URL, scrape a page, or interact with a website.
|
|
140
|
+
- Memory — Vector (LanceDB): remembers things semantically — finds related memories even without exact words. Ideal for: personal assistants, taste trackers, relationship managers, anything that learns about the user over time. Needs an OpenAI embedding API key.
|
|
141
|
+
- Memory — Core: simpler structured memory. Good for: helpers that need to remember a short list of facts.
|
|
142
|
+
|
|
143
|
+
INSTALLED SKILLS (already on this machine):
|
|
144
|
+
- homeassistant: Controls smart home — lights, locks, thermostats, automations. Use when: agent interacts with the home.
|
|
145
|
+
- discord: Discord operations — reading channels, sending messages. Use when: agent lives in or manages Discord.
|
|
146
|
+
- memory-hygiene: Audits and cleans vector memory. Recommend for long-running agents.
|
|
147
|
+
- memory-tiering: Multi-tier memory (hot/warm/cold). Good for agents with lots of history.
|
|
148
|
+
- multi-agent-coordination: Helps agents delegate within a team. Use for multi-agent setups.
|
|
149
|
+
- playwright: Automates web browsers — clicks, fills forms, screenshots. Use when: agent interacts with websites.
|
|
150
|
+
- tesla: Tesla vehicle integration — status, lock/unlock, climate. Use for Tesla owners.
|
|
151
|
+
- virustotal: Security scanning of files and URLs. Good for: security helpers, file monitors.
|
|
152
|
+
|
|
153
|
+
COMMUNITY SKILLS FROM CLAWHUB (clawhub.ai — installed with: clawhub install <id>):
|
|
154
|
+
- spotify: Spotify — search tracks, recommendations, playlists, listening history. Use for: music helpers, taste trackers.
|
|
155
|
+
- apple-music: Apple Music integration. Alternative to Spotify.
|
|
156
|
+
- lastfm: Last.fm music stats and scrobbling. Good for: music history trackers.
|
|
157
|
+
- notion: Read/write Notion pages and databases. Good for: knowledge base helpers, project trackers.
|
|
158
|
+
- github: GitHub issues, PRs, code search. Good for: developer assistants.
|
|
159
|
+
- linear: Linear issue tracking. Good for: project management helpers.
|
|
160
|
+
- todoist: Todoist tasks. Good for: personal productivity helpers.
|
|
161
|
+
- google-calendar: Read/create Google Calendar events. Good for: scheduling helpers.
|
|
162
|
+
- airtable: Airtable database read/write. Good for: data management helpers.
|
|
163
|
+
- slack: Slack messaging and channel ops. Good for: Slack-based helpers.
|
|
164
|
+
- twitter-x: Post and read Twitter/X. Good for: social media helpers.
|
|
165
|
+
- weather: Weather lookups. Good for: anything needing weather data.
|
|
166
|
+
- news: News headlines and article fetching. Good for: news briefing helpers.
|
|
167
|
+
- wolfram: Wolfram Alpha computations. Good for: math, science, facts.
|
|
168
|
+
|
|
169
|
+
SKILL MATCHING GUIDE (use as inspiration, not a rigid map):
|
|
170
|
+
- Music tracking / recommendations → spotify or apple-music + lastfm + memory (lancedb)
|
|
171
|
+
- Smart home control → homeassistant
|
|
172
|
+
- Research assistant → web search + web browsing
|
|
173
|
+
- Productivity / tasks → todoist or notion or linear
|
|
174
|
+
- Developer assistant → github
|
|
175
|
+
- News / research briefing → news + web search
|
|
176
|
+
- Security monitoring → virustotal
|
|
177
|
+
- Social media → twitter-x
|
|
178
|
+
- Scheduling → google-calendar
|
|
179
|
+
- Browser automation → playwright
|
|
180
|
+
- Tesla owner → tesla
|
|
181
|
+
|
|
182
|
+
WHEN YOU THINK YOU HAVE EVERYTHING — CONFIRMATION LOOP:
|
|
183
|
+
Do NOT set complete="true" immediately. Instead, run this loop:
|
|
184
|
+
|
|
185
|
+
1. First, review the COMPLETENESS CHECKLIST above. If any item is missing, keep asking — do not present a summary yet.
|
|
186
|
+
|
|
187
|
+
2. Once all items are covered, present a clear, friendly summary of everything you've captured. Use plain English. Cover: what each helper does, what triggers it, what it produces, any skills you're recommending and why, what it'll never do. Example:
|
|
188
|
+
"Okay, here's what I've got! You want a helper called [name] that [mission]. It kicks in when [trigger]. I'm going to set it up with [skill] so it can [reason]. It'll always ask you before [escalation], and it'll never [never rules]. Does that sound right? Anything you'd like to add or change?"
|
|
189
|
+
|
|
190
|
+
3. Wait for their response. They might say:
|
|
191
|
+
- "Yes, that's right!" → proceed to step 4
|
|
192
|
+
- "Actually, change X to Y" → update the spec silently, confirm back, ask again
|
|
193
|
+
- They might add something → incorporate it, update the summary, ask again
|
|
194
|
+
|
|
195
|
+
4. Keep going until they explicitly confirm. At least one full round, two or three is fine.
|
|
196
|
+
|
|
197
|
+
5. Only once they've confirmed: include complete="true" in your teamspec block.
|
|
198
|
+
|
|
199
|
+
─── TECHNICAL SPEC (invisible to user) ───────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
As you learn facts, silently update the spec. The user never sees these blocks.
|
|
202
|
+
|
|
203
|
+
<teamspec>
|
|
204
|
+
{ ...partial TeamSpec JSON... }
|
|
205
|
+
</teamspec>
|
|
206
|
+
|
|
207
|
+
When confirmed complete:
|
|
208
|
+
<teamspec complete="true">
|
|
209
|
+
{ ...full TeamSpec... }
|
|
210
|
+
</teamspec>
|
|
211
|
+
|
|
212
|
+
TeamSpec shape:
|
|
213
|
+
{
|
|
214
|
+
"version": "1.0",
|
|
215
|
+
"team": { "name": "string", "mission": "string" },
|
|
216
|
+
"agents": [{
|
|
217
|
+
"id": "lowercase-hyphen-slug",
|
|
218
|
+
"name": "string",
|
|
219
|
+
"mission": "string",
|
|
220
|
+
"inputs": "line1\\nline2",
|
|
221
|
+
"outputs": "line1\\nline2",
|
|
222
|
+
"failure": "string",
|
|
223
|
+
"escalation": "string",
|
|
224
|
+
"never": ["string", "string"]
|
|
225
|
+
}],
|
|
226
|
+
"orchestration": { "mode": "manager|handoff_chain|hub_and_spoke", "router_agent": "string" },
|
|
227
|
+
"handoffs": [{ "from": "string", "to": "string", "when": "string", "payload_contract": "string" }],
|
|
228
|
+
"shared_constraints": { "never": ["string"] },
|
|
229
|
+
"shared_memory": { "mode": "separate|shared_summary", "location": "string" },
|
|
230
|
+
"routing": { "defaultAgentId": "string", "bindings": [] },
|
|
231
|
+
"capabilities": {
|
|
232
|
+
"webSearch": false,
|
|
233
|
+
"webFetch": false,
|
|
234
|
+
"memory": "lancedb|core|none",
|
|
235
|
+
"recommendedSkills": [
|
|
236
|
+
{
|
|
237
|
+
"id": "skill-id",
|
|
238
|
+
"name": "Human-readable name",
|
|
239
|
+
"reason": "Why this skill fits in plain English",
|
|
240
|
+
"source": "installed|clawhub",
|
|
241
|
+
"install": "clawhub install skill-id",
|
|
242
|
+
"requiresApiKey": false,
|
|
243
|
+
"apiKeyName": "ENV_VAR_IF_NEEDED"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"tools": { "deny": [] }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
Technical decisions you make silently (never ask the user):
|
|
251
|
+
- agent IDs: short lowercase-hyphen slugs from names ("Email Watcher" → "email-watcher")
|
|
252
|
+
- orchestration mode: infer from structure (multiple coordinated → "manager"; sequential pipeline → "handoff_chain"; single or independent → "hub_and_spoke")
|
|
253
|
+
- For a single helper: handoffs=[], routing.defaultAgentId=that agent's id, orchestration.mode="hub_and_spoke"
|
|
254
|
+
- shared_constraints.never: at least one sensible team-wide rule
|
|
255
|
+
- never[] rules: specific and actionable ("Never send emails without approval" not "Be helpful")
|
|
256
|
+
- capabilities.memory: "lancedb" for helpers that learn preferences or history; "none" for stateless helpers
|
|
257
|
+
- capabilities.webSearch: true if the helper needs current info, prices, news, or facts it can't know in advance
|
|
258
|
+
- capabilities.webFetch: true if the helper needs to read specific URLs or browse web pages`;function vm(e){const t=[],n=/<teamspec(\s+complete="true")?>([\s\S]*?)<\/teamspec>/g;let r;for(;(r=n.exec(e))!==null;)try{t.push({spec:JSON.parse(r[2].trim()),complete:!!r[1]})}catch{}return t}function wm(e){return e.replace(/<teamspec[\s\S]*?<\/teamspec>/g,"").trim()}function km({msg:e}){const t=e.role==="user",n=e.role==="assistant"?wm(e.content):e.content;if(!n)return null;const r=n.split(`
|
|
259
|
+
`);return o.jsxs("div",{className:`flex ${t?"justify-end":"justify-start"} mb-4`,children:[!t&&o.jsx("div",{className:"w-8 h-8 rounded-full bg-claw-700 flex items-center justify-center text-sm mr-3 mt-0.5 shrink-0",children:"🦞"}),o.jsx("div",{className:`max-w-[75%] rounded-2xl px-4 py-3 text-sm leading-relaxed ${t?"bg-claw-700 text-white rounded-br-sm":"bg-gray-800 text-gray-100 rounded-bl-sm"}`,children:r.map((l,s)=>o.jsxs("span",{children:[l,s<r.length-1&&o.jsx("br",{})]},s))}),t&&o.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center text-sm ml-3 mt-0.5 shrink-0",children:"👤"})]})}function Sm({installCtx:e,onConfirm:t}){const[n,r]=w.useState("new");if(w.useEffect(()=>{e.isFreshInstall&&t(!0,e.defaultWorkspace)},[]),e.isFreshInstall)return null;const l=e.existingAgentCount,s=[{id:"new",title:"Add a new agent",desc:l>0?`Add a specialist alongside your ${l} existing agent${l>1?"s":""}.`:"Create a new specialist with its own personality and workspace."},{id:"main",title:"Replace my main agent",desc:"Rebuild the default helper that responds to all your conversations."}];return o.jsxs("div",{className:"max-w-lg mx-auto pt-8",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"text-4xl mb-3",children:"🦞"}),o.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Let's build your AI helper"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'll have a friendly conversation with you and handle all the technical stuff behind the scenes."})]}),o.jsx("div",{className:"space-y-3 mb-6",children:s.map(i=>o.jsxs("button",{onClick:()=>r(i.id),className:`w-full flex items-start gap-4 p-4 rounded-xl border text-left transition-colors ${n===i.id?"border-claw-500 bg-claw-900/30":"border-gray-700 bg-gray-800/60 hover:border-gray-600"}`,children:[o.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 mt-0.5 ${n===i.id?"border-claw-400 bg-claw-500":"border-gray-600"}`,children:n===i.id&&o.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:`text-sm font-semibold ${n===i.id?"text-white":"text-gray-300"}`,children:i.title}),o.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:i.desc})]})]},i.id))}),o.jsx("button",{onClick:()=>t(n==="main",e.defaultWorkspace),className:"w-full px-5 py-3 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors",children:"Let's go →"})]})}function cd(){const{conversationMessages:e,setConversationMessages:t,conversationComplete:n,setConversationComplete:r,mergeTeamSpec:l,isMainAgent:s,setIsMainAgent:i,setDefaultWorkspace:a}=Pe(),{configured:u,provider:d,apiKey:g,model:h,openclawEnv:m}=Ol(),{advance:x}=bn(),[v,k]=w.useState(""),[I,p]=w.useState(!1),[c,f]=w.useState(""),[y,j]=w.useState(!1),[b,C]=w.useState(null),[E,F]=w.useState(!1),R=w.useRef(!1),M=w.useRef(null),W=w.useRef(null),se=w.useRef(null);w.useEffect(()=>{fetch("/api/install-context").then(S=>S.json()).then(S=>C(S)).catch(()=>C({isFreshInstall:!1,defaultWorkspace:"~/.openclaw/workspace",existingAgentCount:0}))},[]);function fe(S,P){i(S),a(P),M.current=Ua(S),F(!0)}w.useEffect(()=>{u&&E&&!R.current&&e.length===0&&(R.current=!0,ke("Hello! I'd like to build an AI helper.",[]))},[u,E]),w.useEffect(()=>{var S;(S=W.current)==null||S.scrollIntoView({behavior:"smooth"})},[e,I]);async function ke(S,P){const A={role:"user",content:S},O=S.startsWith("Hello! I'd like to build"),$=O?P:[...P,A];O||t($),p(!0),f("");try{const oe=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:O?[{role:"user",content:"Start the conversation with a warm greeting and your first question."}]:$,...m?{}:{apiKey:g},model:h,provider:d,system:M.current||Ua(s),maxTokens:4096})}),ie=await oe.json();if(!oe.ok)throw new Error(ie.error||"AI request failed");const Ye={role:"assistant",content:ie.content},L=[...$,Ye];t(L);const _=vm(ie.content);for(const Le of _)l(Le.spec),Le.complete&&r(!0)}catch(oe){f(oe.message)}finally{p(!1),setTimeout(()=>{var oe;return(oe=se.current)==null?void 0:oe.focus()},100)}}function J(){const S=v.trim();!S||I||(k(""),ke(S,e))}function H(S){S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),J())}return!u||y?o.jsxs("div",{className:"max-w-lg mx-auto pt-8",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("div",{className:"text-4xl mb-3",children:"🦞"}),o.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Let's build your AI helper"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'll have a friendly conversation with you and handle all the technical stuff behind the scenes."})]}),o.jsx(ym,{onDone:()=>{j(!1),R.current=!1}})]}):E?o.jsxs("div",{className:"flex flex-col h-full max-w-2xl mx-auto",children:[o.jsxs("div",{className:"flex-1 overflow-y-auto py-4 scrollbar-thin",children:[e.length===0&&!I&&o.jsx("div",{className:"text-center text-gray-600 text-sm mt-16",children:"Starting conversation..."}),e.map((S,P)=>o.jsx(km,{msg:S},P)),I&&o.jsxs("div",{className:"flex justify-start mb-4",children:[o.jsx("div",{className:"w-8 h-8 rounded-full bg-claw-700 flex items-center justify-center text-sm mr-3 shrink-0",children:"🦞"}),o.jsx("div",{className:"bg-gray-800 rounded-2xl rounded-bl-sm px-4 py-3",children:o.jsx(ti,{})})]}),c&&o.jsxs("div",{className:"bg-red-900/30 border border-red-700 rounded-xl p-3 mb-4 text-sm text-red-300",children:[c,o.jsx("button",{onClick:()=>{f(""),j(!0)},className:"ml-2 underline text-xs",children:"Check AI settings"})]}),n&&!I&&o.jsxs("div",{className:"bg-green-900/20 border border-green-700 rounded-xl p-4 mb-4 text-center",children:[o.jsx("p",{className:"text-green-300 text-sm font-medium mb-3",children:"✓ All set! Ready to review and generate your agent files."}),o.jsx("button",{onClick:x,className:"px-6 py-2.5 bg-green-700 hover:bg-green-600 text-white rounded-xl text-sm font-semibold transition-colors",children:"Review & generate →"})]}),o.jsx("div",{ref:W})]}),o.jsxs("div",{className:"border-t border-gray-800 pt-4 pb-2",children:[o.jsxs("div",{className:"flex gap-3 items-end",children:[o.jsx("textarea",{ref:se,value:v,onChange:S=>k(S.target.value),onKeyDown:H,placeholder:"Type your reply...",rows:2,disabled:I,className:"flex-1 bg-gray-800 border border-gray-700 rounded-xl px-4 py-3 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 resize-none disabled:opacity-50 leading-relaxed"}),o.jsx("button",{onClick:J,disabled:I||!v.trim(),className:"px-5 py-3 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors disabled:opacity-40 shrink-0",children:"Send"})]}),o.jsxs("div",{className:"flex items-center justify-between mt-2 px-1",children:[o.jsx("span",{className:"text-xs text-gray-600",children:"Press Enter to send, Shift+Enter for new line"}),!n&&e.length>=10&&o.jsx("button",{onClick:x,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"Skip to review →"})]})]})]}):b?o.jsx(Sm,{installCtx:b,onConfirm:fe}):o.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-sm pt-16 justify-center",children:[o.jsx("span",{className:"animate-spin",children:"⟳"})," Checking your setup..."]})}function dd({value:e,onSave:t,multiline:n,className:r=""}){const[l,s]=w.useState(!1),[i,a]=w.useState(e),u=w.useRef(null);w.useEffect(()=>{a(e)},[e]),w.useEffect(()=>{var h;l&&((h=u.current)==null||h.focus())},[l]);function d(){s(!1);const h=i.trim();h!==e&&t(h)}function g(h){h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),d()),h.key==="Escape"&&(a(e),s(!1))}if(l){const h=n?"textarea":"input";return o.jsx(h,{ref:u,value:i,onChange:m=>a(m.target.value),onBlur:d,onKeyDown:g,rows:n?3:void 0,className:`bg-gray-900 border border-claw-500 rounded px-2 py-1 text-sm text-gray-100 w-full focus:outline-none ${r}`})}return o.jsx("span",{onClick:()=>{a(e),s(!0)},className:`cursor-pointer hover:bg-gray-700/50 rounded px-1 -mx-1 transition-colors ${r}`,title:"Click to edit",children:e})}function fd({rules:e,onChange:t,label:n}){const[r,l]=w.useState(!1),[s,i]=w.useState(""),a=w.useRef(null);w.useEffect(()=>{var m;r&&((m=a.current)==null||m.focus())},[r]);function u(m,x){const v=[...e];v[m]=x,t(v)}function d(m){t(e.filter((x,v)=>v!==m))}function g(){const m=s.trim();m&&t([...e,m]),i(""),l(!1)}function h(m){m.key==="Enter"&&(m.preventDefault(),g()),m.key==="Escape"&&(i(""),l(!1))}return o.jsxs("div",{children:[o.jsx("p",{className:"text-gray-500 text-xs uppercase tracking-wider mb-2 font-medium",children:n}),o.jsx("ul",{className:"space-y-1",children:e.map((m,x)=>o.jsxs("li",{className:"text-xs text-red-300 flex items-start gap-1.5 group",children:[o.jsx("span",{className:"mt-0.5 shrink-0",children:"✕"}),o.jsx("span",{className:"flex-1",children:o.jsx(dd,{value:m,onSave:v=>v?u(x,v):d(x),className:"text-xs text-red-300"})}),o.jsx("button",{onClick:()=>d(x),className:"opacity-0 group-hover:opacity-100 text-gray-600 hover:text-red-400 transition-opacity shrink-0 ml-1",title:"Remove rule",children:"×"})]},x))}),r?o.jsx("div",{className:"mt-2",children:o.jsx("input",{ref:a,value:s,onChange:m=>i(m.target.value),onBlur:g,onKeyDown:h,placeholder:"e.g. Never delete files without asking",className:"bg-gray-900 border border-claw-500 rounded px-2 py-1 text-xs text-gray-100 w-full focus:outline-none"})}):o.jsx("button",{onClick:()=>l(!0),className:"mt-2 text-xs text-gray-500 hover:text-claw-400 transition-colors",children:"+ Add rule"})]})}function jm({agent:e,agentIdx:t,updateAgent:n}){const r=Array.isArray(e.never)?e.never:[];return o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-5 mb-4",children:[o.jsx("div",{className:"flex items-start justify-between mb-3",children:o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-white text-base",children:e.name||e.id}),o.jsx("code",{className:"text-xs text-gray-500",children:e.id})]})}),o.jsx("p",{className:"text-sm text-gray-300 mb-4",children:e.mission}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[e.inputs&&o.jsxs("div",{children:[o.jsx("p",{className:"text-gray-500 uppercase tracking-wider mb-1 font-medium",children:"Triggered by"}),o.jsx("p",{className:"text-gray-300",children:e.inputs.replace(/\n/g," · ")})]}),e.outputs&&o.jsxs("div",{children:[o.jsx("p",{className:"text-gray-500 uppercase tracking-wider mb-1 font-medium",children:"Produces"}),o.jsx("p",{className:"text-gray-300",children:e.outputs.replace(/\n/g," · ")})]}),e.failure&&o.jsxs("div",{children:[o.jsx("p",{className:"text-gray-500 uppercase tracking-wider mb-1 font-medium",children:"When stuck"}),o.jsx("p",{className:"text-gray-300",children:e.failure})]}),e.escalation&&o.jsxs("div",{children:[o.jsx("p",{className:"text-gray-500 uppercase tracking-wider mb-1 font-medium",children:"Asks you first"}),o.jsx(dd,{value:e.escalation,onSave:l=>n(t,{escalation:l}),multiline:!0,className:"text-xs text-gray-300"})]})]}),o.jsx("div",{className:"mt-4 pt-4 border-t border-gray-700",children:o.jsx(fd,{rules:r,onChange:l=>n(t,{never:l}),label:"Will never"})})]})}function Nm(){var m,x,v,k,I,p;const e=Pe(c=>c.teamSpec),t=Pe(c=>c.updateAgent),n=Pe(c=>c.updateSharedConstraints),{advance:r,goBack:l}=bn(),[s,i]=w.useState(!1),a=((m=e.agents)==null?void 0:m.filter(c=>c.id))||[],u=((x=e.shared_memory)==null?void 0:x.mode)||"separate",d=a.length>1,g=((v=e.shared_constraints)==null?void 0:v.never)||[],h=a.reduce((c,f)=>c+(Array.isArray(f.never)?f.never.length:0),0)+g.length;return o.jsxs("div",{className:"max-w-2xl",children:[((k=e.team)==null?void 0:k.name)&&o.jsxs("div",{className:"mb-6",children:[o.jsx("h2",{className:"text-xl font-bold text-white mb-1",children:e.team.name}),e.team.mission&&o.jsx("p",{className:"text-gray-400 text-sm",children:e.team.mission})]}),a.length===0&&o.jsx("div",{className:"bg-yellow-900/20 border border-yellow-700 rounded-xl p-4 mb-4",children:o.jsx("p",{className:"text-yellow-300 text-sm",children:"The conversation didn't produce a complete agent spec yet. Go back and continue the conversation, or the files will be generated with placeholder values."})}),h<2&&a.length>0&&o.jsx("div",{className:"bg-yellow-900/20 border border-yellow-700 rounded-xl p-4 mb-4",children:o.jsx("p",{className:"text-yellow-300 text-sm",children:"Consider adding rules about when your helper should ask before acting."})}),a.map(c=>o.jsx(jm,{agent:c,agentIdx:e.agents.indexOf(c),updateAgent:t},c.id)),d&&((I=e.handoffs)==null?void 0:I.length)>0&&o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-4",children:[o.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-3 font-medium",children:"How they hand off work"}),e.handoffs.map((c,f)=>o.jsxs("p",{className:"text-sm text-gray-300 mb-1",children:[o.jsx("span",{className:"text-claw-400",children:c.from})," → ",o.jsx("span",{className:"text-claw-400",children:c.to}),c.when&&o.jsxs("span",{className:"text-gray-500",children:[" when ",c.when]})]},f))]}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-5 mb-4",children:[o.jsx("h3",{className:"font-semibold text-white text-sm mb-3",children:d?"Shared rules (all helpers)":"Global rules"}),o.jsx(fd,{rules:g,onChange:c=>n({never:c}),label:"Will never"})]}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-6",children:[o.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1 font-medium",children:"Memory"}),o.jsx("p",{className:"text-sm text-gray-300",children:u==="shared_summary"?`Shared team memory${(p=e.shared_memory)!=null&&p.location?` at ${e.shared_memory.location}`:""}`:"Each helper keeps its own notes"})]}),o.jsxs("div",{className:"mb-6",children:[o.jsx("button",{onClick:()=>i(c=>!c),className:"text-xs text-gray-600 hover:text-gray-400 transition-colors",children:s?"▾ Hide technical details":"▸ Show technical details"}),s&&o.jsx("pre",{className:"mt-2 bg-gray-900 border border-gray-700 rounded-xl p-4 text-xs text-green-400 font-mono overflow-auto max-h-64 scrollbar-thin",children:JSON.stringify(e,null,2)})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx("button",{onClick:l,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-xl text-sm transition-colors",children:"← Go back"}),o.jsx("button",{onClick:r,className:"px-6 py-2.5 bg-green-700 hover:bg-green-600 text-white rounded-xl text-sm font-semibold transition-colors",children:"Looks good — generate files →"})]})]})}function bm({files:e}){const[t,n]=w.useState(null);if(!e||e.length===0)return null;const r=e.find(l=>l.path===t);return o.jsxs("div",{className:"grid grid-cols-2 gap-4 h-full",children:[o.jsxs("div",{className:"overflow-auto scrollbar-thin",children:[o.jsxs("p",{className:"text-xs text-gray-500 mb-2 uppercase tracking-wider",children:["Files to write (",e.length,")"]}),o.jsx("ul",{className:"space-y-1",children:e.map(l=>o.jsx("li",{children:o.jsxs("button",{onClick:()=>n(t===l.path?null:l.path),className:`w-full text-left text-xs px-2 py-1.5 rounded font-mono truncate transition-colors ${t===l.path?"bg-claw-600/30 text-claw-300 border border-claw-600/50":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:["📄 ",l.path]})},l.path))})]}),o.jsx("div",{className:"overflow-auto scrollbar-thin",children:r?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-gray-500 mb-2 font-mono truncate",children:r.path}),o.jsx("pre",{className:"text-xs text-gray-300 bg-gray-900 rounded p-3 overflow-auto whitespace-pre-wrap",children:r.content})]}):o.jsx("p",{className:"text-xs text-gray-600 mt-8 text-center",children:"Click a file to preview"})})]})}function Cm(){var F,R;const{teamSpec:e,generatedFiles:t,setGeneratedFiles:n,writeResult:r,setWriteResult:l,isGenerating:s,setIsGenerating:i,isWriting:a,setIsWriting:u,isMainAgent:d,defaultWorkspace:g}=Pe(),{advance:h}=bn(),[m,x]=w.useState([]),[v,k]=w.useState(!1),[I,p]=w.useState(""),[c,f]=w.useState(!1),[y,j]=w.useState("");w.useEffect(()=>{t.length===0&&b()},[]);async function b(){i(!0),p("");try{const M=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamSpec:e})}),W=await M.json();if(!M.ok)throw new Error(W.error||"Generation failed");n(W.files);const se=e.agents.map(J=>J.id).join(","),ke=await(await fetch(`/api/check-paths?agents=${se}`)).json();x(ke.conflicts.filter(J=>J.exists))}catch(M){p(M.message)}finally{i(!1)}}async function C(){var M;u(!0),p(""),j("");try{const W={};if(d)for(const H of e.agents)W[H.id]=g||"~/.openclaw/workspace";else await Promise.all(e.agents.map(async H=>{const P=await(await fetch(`/api/resolve-workspace/${H.id}`)).json();W[H.id]=P.workspace}));const se=t.map(H=>{const S=H.path.match(/^workspace-([^/]+)\/(.+)$/);if(S){const[,P,A]=S,O=W[P]||`~/.openclaw/workspace-${P}`;return{...H,path:`${O}/${A}`}}return{...H,path:`~/.openclaw/${H.path}`}}),fe=await fetch("/api/write",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:se,force:v})}),ke=await fe.json();if(!fe.ok)throw new Error(ke.error||"Write failed");l(ke),(await fetch("/api/openclaw-config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({isMainAgent:!!d,agents:d?void 0:{list:e.agents.map(H=>({id:H.id,workspace:W[H.id]||`~/.openclaw/workspace-${H.id}`}))},bindings:e.routing.bindings||[],defaultAgentId:e.routing.defaultAgentId||((M=e.agents[0])==null?void 0:M.id)})})).ok?f(!0):j("Files written, but failed to update openclaw.json. You may need to add the agent manually.")}catch(W){p(W.message)}finally{u(!1)}}const E=r&&(c||y);return o.jsxs("div",{className:"max-w-4xl",children:[s&&o.jsxs("div",{className:"flex items-center gap-2 text-claw-400 mb-4",children:[o.jsx("span",{className:"animate-spin",children:"⟳"}),o.jsx("span",{className:"text-sm",children:"Generating files..."})]}),!s&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-80 mb-6",children:o.jsx(bm,{files:t})}),m.length>0&&!r&&o.jsxs("div",{className:"bg-yellow-900/30 border border-yellow-700 rounded-xl p-4 mb-4",children:[o.jsx("p",{className:"text-yellow-400 text-sm font-semibold mb-2",children:"⚠ Existing workspaces detected"}),o.jsx("ul",{className:"text-xs text-yellow-300 space-y-1 mb-3",children:m.map(M=>o.jsxs("li",{children:[o.jsx("code",{children:M.path})," already exists"]},M.agentId))}),o.jsxs("label",{className:"flex items-center gap-2 text-sm text-yellow-200 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:v,onChange:M=>k(M.target.checked),className:"rounded"}),"Overwrite existing files (backs up as .bak-YYYYMMDD-HHmmss)"]})]}),r&&o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-4 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-green-400 text-sm",children:"✓"}),o.jsxs("span",{className:"text-sm text-gray-200",children:["Written ",((F=r.written)==null?void 0:F.length)||0," files to ",o.jsx("code",{className:"text-claw-400",children:"~/.openclaw/"}),((R=r.skipped)==null?void 0:R.length)>0&&o.jsxs("span",{className:"text-gray-500",children:[" (",r.skipped.length," skipped, already existed)"]})]})]}),c&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-green-400 text-sm",children:"✓"}),o.jsxs("span",{className:"text-sm text-gray-200",children:["Agent",e.agents.length>1?"s":""," registered in ",o.jsx("code",{className:"text-claw-400",children:"openclaw.json"}),o.jsx("span",{className:"text-gray-500 ml-1",children:"— gateway will pick them up on next restart"})]})]}),y&&o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-yellow-400 text-sm",children:"⚠"}),o.jsx("span",{className:"text-sm text-yellow-300",children:y})]})]}),I&&o.jsx("p",{className:"text-red-400 text-sm mb-4",children:I}),o.jsxs("div",{className:"flex gap-3 flex-wrap",children:[!r&&o.jsx("button",{onClick:b,disabled:s,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-lg text-sm transition-colors disabled:opacity-50",children:"↺ Regenerate"}),!r&&o.jsx("button",{onClick:C,disabled:a,className:"px-6 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-lg text-sm font-semibold transition-colors disabled:opacity-50",children:a?"⟳ Writing...":"Write to ~/.openclaw →"}),E&&o.jsx("button",{onClick:h,className:"px-6 py-2 bg-green-700 hover:bg-green-600 text-white rounded-lg text-sm font-semibold transition-colors",children:"Set up capabilities →"})]})]})]})}function Em({enabled:e,onChange:t}){return o.jsx("button",{onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e?"bg-claw-600":"bg-gray-700"}`,children:o.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e?"translate-x-6":"translate-x-1"}`})})}function Gt({label:e,value:t,onChange:n,placeholder:r,type:l="text",hint:s}){return o.jsxs("div",{children:[e&&o.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:e}),o.jsx("input",{type:l,value:t,onChange:i=>n(i.target.value),placeholder:r,className:"w-full bg-gray-900 border border-gray-700 rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-claw-500"}),s&&o.jsx("p",{className:"text-xs text-gray-600 mt-1",children:s})]})}const _m=[{id:"exec",label:"Shell/exec",desc:"Run terminal commands"},{id:"browser",label:"Browser",desc:"Open and interact with web pages"},{id:"write",label:"Write files",desc:"Create or modify files"},{id:"read",label:"Read files",desc:"Read files from disk"},{id:"web",label:"Web search",desc:"Search the internet"}];function Tm({agent:e}){var s,i;const{teamSpec:t,mergeTeamSpec:n}=Pe(),r=((i=(s=t.capabilities)==null?void 0:s.agentToolDeny)==null?void 0:i[e.id])||[];function l(a){var h;const u=((h=t.capabilities)==null?void 0:h.agentToolDeny)||{},d=u[e.id]||[],g=d.includes(a)?d.filter(m=>m!==a):[...d,a];n({capabilities:{...t.capabilities,agentToolDeny:{...u,[e.id]:g}}})}return o.jsxs("div",{className:"bg-gray-900/30 rounded-lg p-3",children:[o.jsx("p",{className:"text-xs font-medium text-gray-300 mb-2",children:e.name||e.id}),o.jsx("div",{className:"flex flex-wrap gap-2",children:_m.map(a=>{const u=r.includes(a.id);return o.jsxs("button",{onClick:()=>l(a.id),title:a.desc,className:`text-xs px-2.5 py-1 rounded-lg border transition-colors ${u?"border-red-700 bg-red-900/30 text-red-300":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"}`,children:[u?"✕ ":"",a.label]},a.id)})}),r.length>0&&o.jsxs("p",{className:"text-xs text-gray-600 mt-2",children:[e.name||e.id," cannot use: ",r.join(", ")]})]})}function Dr({title:e,icon:t,description:n,globalNote:r,enabled:l,onToggle:s,children:i}){return o.jsxs("div",{className:`border rounded-xl p-4 transition-colors ${l?"border-claw-700 bg-gray-800/60":"border-gray-800 bg-gray-800/20"}`,children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 mb-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-lg",children:t}),o.jsx("span",{className:"font-semibold text-sm text-white",children:e}),r&&o.jsx("span",{className:"text-xs text-yellow-500 border border-yellow-800 rounded px-1.5 py-0.5",children:"global"})]}),o.jsx(Em,{enabled:l,onChange:s})]}),o.jsx("p",{className:"text-xs text-gray-500 mb-3 ml-7",children:n}),l&&i&&o.jsx("div",{className:"ml-7 space-y-3 pt-2 border-t border-gray-700",children:i})]})}function Pm(){var L;const{advance:e}=bn(),{teamSpec:t}=Pe(),n=((L=t.capabilities)==null?void 0:L.recommendedSkills)||[],[r,l]=w.useState(!0),[s,i]=w.useState(!1),[a,u]=w.useState(!1),[d,g]=w.useState(""),[h,m]=w.useState("none"),[x,v]=w.useState(!0),[k,I]=w.useState(!1),[p,c]=w.useState(""),[f,y]=w.useState("text-embedding-3-small"),[j,b]=w.useState(!1),[C,E]=w.useState("brave"),[F,R]=w.useState(""),[M,W]=w.useState(""),[se,fe]=w.useState(!1),[ke,J]=w.useState(!1),[H,S]=w.useState(""),[P,A]=w.useState("http://homeassistant.local:8123"),[O,$]=w.useState(!1),[oe,ie]=w.useState("");w.useEffect(()=>{fetch("/api/capabilities").then(_=>_.json()).then(_=>{var ni,ri,li,si,oi,ii,ai,ui,ci,di,fi,pi,mi,hi,gi,yi,xi,vi,wi,ki,Si,ji;const Le=((ni=_.memory)==null?void 0:ni.mode)||"none",zl=(ri=t.capabilities)==null?void 0:ri.memory;m(Le!=="none"?Le:zl||"none"),v(((si=(li=_.memory)==null?void 0:li.lancedb)==null?void 0:si.autoRecall)??!0),I(((ii=(oi=_.memory)==null?void 0:oi.lancedb)==null?void 0:ii.autoCapture)??!1),c(((ui=(ai=_.memory)==null?void 0:ai.lancedb)==null?void 0:ui.embeddingApiKey)||""),y(((di=(ci=_.memory)==null?void 0:ci.lancedb)==null?void 0:di.embeddingModel)||"text-embedding-3-small");const pd=((fi=_.webSearch)==null?void 0:fi.enabled)||!1;b(pd||((pi=t.capabilities)==null?void 0:pi.webSearch)||!1),E(((mi=_.webSearch)==null?void 0:mi.provider)||"brave"),R(((hi=_.webSearch)==null?void 0:hi.braveApiKey)||""),W(((gi=_.webSearch)==null?void 0:gi.perplexityApiKey)||""),fe(((yi=_.webFetch)==null?void 0:yi.enabled)||((xi=t.capabilities)==null?void 0:xi.webFetch)||!1),J(((vi=_.homeAssistant)==null?void 0:vi.enabled)||!1),S(((wi=_.homeAssistant)==null?void 0:wi.token)||""),A(((ki=_.homeAssistant)==null?void 0:ki.url)||"http://homeassistant.local:8123"),$(((Si=_.googlePlaces)==null?void 0:Si.enabled)||!1),ie(((ji=_.googlePlaces)==null?void 0:ji.apiKey)||"")}).catch(()=>{}).finally(()=>l(!1))},[]);async function Ye(){var _;i(!0),g("");try{const Le=await fetch("/api/capabilities",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentToolDeny:((_=t.capabilities)==null?void 0:_.agentToolDeny)||{},memory:{mode:h,lancedb:{autoRecall:x,autoCapture:k,embeddingApiKey:p,embeddingModel:f}},webSearch:{enabled:j,provider:C,braveApiKey:F,perplexityApiKey:M},webFetch:{enabled:se},homeAssistant:{enabled:ke,token:H,url:P},googlePlaces:{enabled:O,apiKey:oe}})}),zl=await Le.json();if(!Le.ok)throw new Error(zl.error||"Save failed");u(!0)}catch(Le){g(Le.message)}finally{i(!1)}}return r?o.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[o.jsx("span",{className:"animate-spin",children:"⟳"})," Loading current config..."]}):o.jsxs("div",{className:"max-w-2xl space-y-4",children:[n.length>0&&o.jsxs("div",{className:"border border-claw-700/50 bg-claw-900/20 rounded-xl p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx("span",{className:"text-base",children:"✨"}),o.jsx("span",{className:"text-sm font-semibold text-claw-300",children:"Recommended for your agent"})]}),o.jsx("div",{className:"space-y-3",children:n.map(_=>o.jsx("div",{className:"flex items-start gap-3 bg-gray-900/40 rounded-lg p-3",children:o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"text-sm font-medium text-white",children:_.name}),o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded border ${_.source==="installed"?"text-green-400 border-green-800 bg-green-900/20":"text-blue-400 border-blue-800 bg-blue-900/20"}`,children:_.source==="installed"?"already installed":"clawhub"}),_.requiresApiKey&&o.jsx("span",{className:"text-xs text-yellow-500 border border-yellow-800 rounded px-1.5 py-0.5",children:"needs API key"})]}),o.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:_.reason}),_.source==="clawhub"&&_.install&&o.jsx("code",{className:"text-xs text-gray-600 mt-1 block",children:_.install})]})},_.id))}),o.jsx("p",{className:"text-xs text-gray-600 mt-3",children:`Skills marked "clawhub" need to be installed via the terminal command shown above. They'll live in your agent's workspace and only apply to this agent.`})]}),o.jsxs("div",{className:"bg-yellow-900/20 border border-yellow-800/50 rounded-xl px-4 py-3 text-xs text-yellow-400",children:["These settings apply to ",o.jsx("strong",{children:"all agents"})," in your OpenClaw gateway — not just the one you just built."]}),o.jsxs("div",{className:"border border-gray-800 bg-gray-800/20 rounded-xl p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"text-lg",children:"🧠"}),o.jsx("span",{className:"font-semibold text-sm text-white",children:"Memory"}),o.jsx("span",{className:"text-xs text-yellow-500 border border-yellow-800 rounded px-1.5 py-0.5",children:"global"})]}),o.jsx("p",{className:"text-xs text-gray-500 mb-4 ml-7",children:"How agents remember things between conversations."}),o.jsxs("div",{className:"ml-7 space-y-3",children:[o.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{id:"none",label:"None",desc:"Manual markdown files only"},{id:"core",label:"Core",desc:"Lightweight structured memory"},{id:"lancedb",label:"Vector (LanceDB)",desc:"Semantic search — finds memories by meaning"}].map(_=>o.jsxs("button",{onClick:()=>m(_.id),className:`text-left p-3 rounded-lg border text-xs transition-colors ${h===_.id?"border-claw-500 bg-claw-900/30 text-white":"border-gray-700 bg-gray-900/30 text-gray-400 hover:border-gray-600"}`,children:[o.jsx("div",{className:"font-semibold mb-0.5",children:_.label}),o.jsx("div",{className:"text-gray-500",children:_.desc})]},_.id))}),h==="lancedb"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-700",children:[o.jsx(Gt,{label:"OpenAI Embedding API Key",value:p,onChange:c,placeholder:"sk-...",type:"password",hint:"Used only for generating memory embeddings — not for chat. text-embedding-3-small is fast and cheap."}),o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-300 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:x,onChange:_=>v(_.target.checked),className:"rounded"}),"Auto-recall",o.jsx("span",{className:"text-gray-600",children:"(search memory on every message)"})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-300 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:k,onChange:_=>I(_.target.checked),className:"rounded"}),"Auto-capture",o.jsx("span",{className:"text-gray-600",children:"(auto-save after each session)"})]})]})]})]})]}),o.jsxs(Dr,{title:"Web Search",icon:"🔍",description:"Lets agents search the web for real-time information.",globalNote:!0,enabled:j,onToggle:b,children:[o.jsx("div",{className:"flex gap-2 mb-2",children:["brave","perplexity"].map(_=>o.jsx("button",{onClick:()=>E(_),className:`px-3 py-1 rounded-lg text-xs border transition-colors capitalize ${C===_?"border-claw-500 bg-claw-900/30 text-white":"border-gray-700 text-gray-400 hover:border-gray-600"}`,children:_==="brave"?"Brave Search":"Perplexity"},_))}),C==="brave"?o.jsx(Gt,{label:"Brave Search API Key",value:F,onChange:R,placeholder:"BSA...",type:"password",hint:"Get a free key at api.search.brave.com — free tier supports 2,000 queries/month."}):o.jsx(Gt,{label:"Perplexity API Key (via OpenRouter)",value:M,onChange:W,placeholder:"sk-or-v1-...",type:"password",hint:"Uses perplexity/sonar-pro via OpenRouter. Get a key at openrouter.ai."})]}),o.jsx(Dr,{title:"Web Browsing",icon:"🌐",description:"Lets agents open URLs and read web pages. Uses a headless browser — no API key needed.",globalNote:!0,enabled:se,onToggle:fe}),o.jsxs(Dr,{title:"Home Assistant",icon:"🏠",description:"Control smart home devices — lights, locks, thermostats, automations.",enabled:ke,onToggle:J,children:[o.jsx(Gt,{label:"Long-Lived Access Token",value:H,onChange:S,placeholder:"eyJ...",type:"password",hint:"Profile → Security → Long-Lived Access Tokens → Create token."}),o.jsx(Gt,{label:"Home Assistant URL",value:P,onChange:A,placeholder:"http://homeassistant.local:8123",hint:"Your HA instance URL. Works on local network or via Nabu Casa remote access."})]}),o.jsx(Dr,{title:"Google Places",icon:"📍",description:"Location search, nearby places, business info, maps data.",enabled:O,onToggle:$,children:o.jsx(Gt,{label:"Google Maps API Key",value:oe,onChange:ie,placeholder:"AIza...",type:"password",hint:"Enable the Places API at console.cloud.google.com. Free tier: 28,000 calls/month."})}),t.agents.filter(_=>_.id).length>0&&o.jsxs("div",{className:"border border-gray-800 bg-gray-800/20 rounded-xl p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"text-lg",children:"🔒"}),o.jsx("span",{className:"font-semibold text-sm text-white",children:"Per-agent tool restrictions"})]}),o.jsx("p",{className:"text-xs text-gray-500 mb-4 ml-7",children:"Prevent specific agents from using certain tools — useful for limiting public-facing or restricted agents."}),o.jsx("div",{className:"ml-7 space-y-3",children:t.agents.filter(_=>_.id).map(_=>o.jsx(Tm,{agent:_},_.id))})]}),d&&o.jsx("p",{className:"text-red-400 text-sm",children:d}),o.jsx("div",{className:"flex gap-3 pt-2",children:a?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[o.jsx("span",{children:"✓"}),o.jsx("span",{children:"Capabilities saved to openclaw.json"})]}),o.jsx("button",{onClick:e,className:"px-6 py-2 bg-green-700 hover:bg-green-600 text-white rounded-lg text-sm font-semibold transition-colors",children:"Connect to Discord / Telegram →"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:Ye,disabled:s,className:"px-6 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-lg text-sm font-semibold transition-colors disabled:opacity-50",children:s?"⟳ Saving...":"Save capabilities →"}),o.jsx("button",{onClick:e,className:"px-4 py-2 text-gray-500 hover:text-gray-300 text-sm transition-colors",children:"Skip for now"})]})})]})}function fr({label:e,hint:t,value:n,onChange:r,type:l="text",placeholder:s,mono:i}){return o.jsxs("div",{className:"mb-4",children:[e&&o.jsx("label",{className:"block text-sm text-gray-300 font-medium mb-1",children:e}),t&&o.jsx("p",{className:"text-xs text-gray-500 mb-2",children:t}),o.jsx("input",{type:l,value:n,onChange:a=>r(a.target.value),placeholder:s,className:`w-full bg-gray-800 border border-gray-700 rounded-xl px-4 py-3 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 ${i?"font-mono":""}`})]})}function st({step:e,total:t,title:n,subtitle:r}){return o.jsxs("div",{className:"mb-6",children:[o.jsxs("div",{className:"text-xs text-gray-500 mb-1",children:["Step ",e," of ",t]}),o.jsx("h2",{className:"text-xl font-bold text-white mb-1",children:n}),r&&o.jsx("p",{className:"text-sm text-gray-400",children:r})]})}function ue({number:e,children:t}){return o.jsxs("div",{className:"flex gap-3 mb-3",children:[o.jsx("div",{className:"w-6 h-6 rounded-full bg-claw-800 border border-claw-600 flex items-center justify-center text-xs font-bold text-claw-300 shrink-0 mt-0.5",children:e}),o.jsx("div",{className:"text-sm text-gray-300 leading-relaxed",children:t})]})}function xl({href:e,children:t}){return o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-claw-400 underline hover:text-claw-300 transition-colors",children:[t," ↗"]})}function _t({onBack:e,onNext:t,nextLabel:n="Next →",nextDisabled:r,saving:l}){return o.jsxs("div",{className:"flex gap-3 mt-6",children:[e&&o.jsx("button",{onClick:e,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-xl text-sm transition-colors",children:"← Back"}),o.jsx("button",{onClick:t,disabled:r||l,className:"px-6 py-2.5 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors disabled:opacity-40",children:l?"⟳ Saving...":n})]})}function Im({agentName:e,botToken:t,setBotToken:n,appId:r,setAppId:l,onBack:s,onNext:i}){return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:2,total:6,title:"Create a Discord bot",subtitle:"Your agent needs its own Discord bot account. This takes about 3 minutes."}),o.jsxs(ue,{number:1,children:["Go to the ",o.jsx(xl,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"})," and click ",o.jsx("strong",{className:"text-white",children:"New Application"}),". Name it ",o.jsx("strong",{className:"text-white",children:e}),"."]}),o.jsxs(ue,{number:2,children:["In the left menu, click ",o.jsx("strong",{className:"text-white",children:"Bot"}),". Then click ",o.jsx("strong",{className:"text-white",children:"Add Bot"})," → ",o.jsx("strong",{className:"text-white",children:"Yes, do it!"})]}),o.jsxs(ue,{number:3,children:["Scroll down to ",o.jsx("strong",{className:"text-white",children:"Privileged Gateway Intents"})," and turn on all three:",o.jsx("span",{className:"block mt-1 text-gray-400",children:"Message Content Intent · Server Members Intent · Presence Intent"})]}),o.jsxs(ue,{number:4,children:["Click ",o.jsx("strong",{className:"text-white",children:"Reset Token"}),", confirm, then copy the token and paste it below."]}),o.jsxs(ue,{number:5,children:["Click ",o.jsx("strong",{className:"text-white",children:"General Information"})," in the left menu and copy the ",o.jsx("strong",{className:"text-white",children:"Application ID"}),"."]}),o.jsxs("div",{className:"mt-6",children:[o.jsx(fr,{label:"Bot Token",type:"password",mono:!0,placeholder:"MTQ2NDQ...",hint:"From the Bot page → Reset Token",value:t,onChange:n}),o.jsx(fr,{label:"Application ID",mono:!0,placeholder:"1234567890123456789",hint:"From the General Information page",value:r,onChange:l})]}),o.jsx(_t,{onBack:s,onNext:i,nextDisabled:!t.trim()||!r.trim()})]})}function Am({agentName:e,appId:t,confirmed:n,setConfirmed:r,onBack:l,onNext:s}){const i=`https://discord.com/oauth2/authorize?client_id=${t}&permissions=117824&scope=bot`;return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:3,total:6,title:"Add the bot to your server",subtitle:"Now invite your new bot to the Discord server where it should live."}),o.jsxs(ue,{number:1,children:["Click this link to invite ",o.jsx("strong",{className:"text-white",children:e})," to your server:"," ",o.jsx(xl,{href:i,children:"Open invite link"})]}),o.jsxs(ue,{number:2,children:["Choose your server from the dropdown, then click ",o.jsx("strong",{className:"text-white",children:"Authorize"}),". You may need to complete a CAPTCHA."]}),o.jsxs(ue,{number:3,children:["You should see ",o.jsx("strong",{className:"text-white",children:e})," appear in your server's member list."]}),o.jsxs("label",{className:"flex items-center gap-3 mt-6 p-4 bg-gray-800 border border-gray-700 rounded-xl cursor-pointer hover:border-claw-600 transition-colors",children:[o.jsx("input",{type:"checkbox",checked:n,onChange:a=>r(a.target.checked),className:"w-4 h-4 accent-claw-500"}),o.jsx("span",{className:"text-sm text-gray-200",children:"I've added the bot to my server"})]}),o.jsx(_t,{onBack:l,onNext:s,nextDisabled:!n})]})}function Rm({agentName:e,guildId:t,setGuildId:n,channelId:r,setChannelId:l,requireMention:s,setRequireMention:i,onBack:a,onNext:u}){return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:4,total:6,title:"Pick a channel",subtitle:`Which channel in your server should ${e} listen to?`}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-5",children:[o.jsx("p",{className:"text-sm text-gray-300 font-medium mb-3",children:"How to get your IDs:"}),o.jsxs(ue,{number:1,children:["Open Discord → ",o.jsx("strong",{className:"text-white",children:"Settings"})," (gear icon) → ",o.jsx("strong",{className:"text-white",children:"Advanced"})," → turn on ",o.jsx("strong",{className:"text-white",children:"Developer Mode"})]}),o.jsxs(ue,{number:2,children:["Right-click your ",o.jsx("strong",{className:"text-white",children:"server name"})," in the sidebar → ",o.jsx("strong",{className:"text-white",children:"Copy Server ID"})]}),o.jsxs(ue,{number:3,children:["Right-click the ",o.jsx("strong",{className:"text-white",children:"channel"})," where the bot should live → ",o.jsx("strong",{className:"text-white",children:"Copy Channel ID"})]})]}),o.jsx(fr,{label:"Server ID",mono:!0,placeholder:"1464413706023731212",hint:"Right-click your server name → Copy Server ID",value:t,onChange:n}),o.jsx(fr,{label:"Channel ID",mono:!0,placeholder:"1464413707005333704",hint:"Right-click the channel → Copy Channel ID",value:r,onChange:l}),o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-sm text-gray-300 font-medium mb-2",children:"How should it respond?"}),o.jsx("div",{className:"space-y-2",children:[{value:!1,label:"Respond to every message in that channel",desc:"Good for a dedicated bot channel"},{value:!0,label:"Only when @mentioned",desc:"Good for a shared channel with other people"}].map(d=>o.jsxs("label",{className:`flex items-start gap-3 p-3 rounded-xl border cursor-pointer transition-colors ${s===d.value?"border-claw-500 bg-claw-900/20":"border-gray-700 bg-gray-800 hover:border-gray-600"}`,children:[o.jsx("input",{type:"radio",checked:s===d.value,onChange:()=>i(d.value),className:"mt-0.5 accent-claw-500"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-gray-200",children:d.label}),o.jsx("div",{className:"text-xs text-gray-500",children:d.desc})]})]},String(d.value)))})]}),o.jsx(_t,{onBack:a,onNext:u,nextDisabled:!t.trim()})]})}function Lm({agentName:e,allowFrom:t,setAllowFrom:n,onBack:r,onNext:l}){const[s,i]=w.useState("");function a(){const u=s.trim();u&&!t.includes(u)&&n([...t,u]),i("")}return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:5,total:6,title:"Who can talk to it?",subtitle:`Only people you add here can message ${e}.`}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-5",children:[o.jsx("p",{className:"text-sm text-gray-300 font-medium mb-2",children:"How to find your Discord user ID:"}),o.jsx(ue,{number:1,children:"Make sure Developer Mode is on (from the previous step)"}),o.jsxs(ue,{number:2,children:["Right-click ",o.jsx("strong",{className:"text-white",children:"your own name or avatar"})," anywhere in Discord → ",o.jsx("strong",{className:"text-white",children:"Copy User ID"})]})]}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm text-gray-300 font-medium mb-2",children:"Allowed user IDs"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx("input",{value:s,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&a(),placeholder:"679071398756614175",className:"flex-1 bg-gray-800 border border-gray-700 rounded-xl px-4 py-2.5 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 font-mono"}),o.jsx("button",{onClick:a,className:"px-4 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors",children:"Add"})]}),t.length>0&&o.jsx("div",{className:"space-y-1",children:t.map(u=>o.jsxs("div",{className:"flex items-center justify-between bg-gray-800 border border-gray-700 rounded-lg px-3 py-2",children:[o.jsx("code",{className:"text-xs text-claw-400",children:u}),o.jsx("button",{onClick:()=>n(t.filter(d=>d!==u)),className:"text-gray-600 hover:text-red-400 text-xs transition-colors",children:"✕"})]},u))}),t.length===0&&o.jsx("p",{className:"text-xs text-yellow-500",children:"Add at least your own user ID so you can talk to it."})]}),o.jsx(_t,{onBack:r,onNext:l,nextDisabled:t.length===0})]})}function Wa({agentName:e,existingAgents:t,selected:n,setSelected:r,onBack:l,onNext:s,stepNum:i,totalSteps:a}){return t.length===0?(w.useEffect(()=>{s()},[]),null):o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:i,total:a,title:"Agent teamwork",subtitle:`Should ${e} be able to delegate tasks to your other agents?`}),o.jsxs("p",{className:"text-sm text-gray-400 mb-4",children:["Select any agents that ",o.jsx("strong",{className:"text-white",children:e})," should be able to work with. We'll update both sides so they can talk to each other."]}),o.jsx("div",{className:"space-y-2 mb-4",children:t.map(u=>o.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-xl border cursor-pointer transition-colors ${n.includes(u.id)?"border-claw-500 bg-claw-900/20":"border-gray-700 bg-gray-800 hover:border-gray-600"}`,children:[o.jsx("input",{type:"checkbox",checked:n.includes(u.id),onChange:d=>r(d.target.checked?[...n,u.id]:n.filter(g=>g!==u.id)),className:"accent-claw-500"}),o.jsx("span",{className:"text-lg",children:u.emoji}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-gray-200 font-medium",children:u.name}),o.jsx("div",{className:"text-xs text-gray-500",children:u.id})]})]},u.id))}),o.jsx("p",{className:"text-xs text-gray-600 mb-2",children:"You can always change this later by editing your OpenClaw config."}),o.jsx(_t,{onBack:l,onNext:s,nextLabel:"Save & continue →"})]})}function Dm({alreadyConfigured:e,botToken:t,setBotToken:n,allowFrom:r,setAllowFrom:l,onBack:s,onNext:i}){const[a,u]=w.useState("");function d(){const g=a.trim();g&&!r.includes(g)&&l([...r,g]),u("")}return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:2,total:3,title:"Set up Telegram",subtitle:e?"You already have a Telegram bot. Just add your user ID below.":"Create a Telegram bot in about 2 minutes."}),!e&&o.jsxs(o.Fragment,{children:[o.jsxs(ue,{number:1,children:["Open Telegram and search for ",o.jsx("strong",{className:"text-white",children:"@BotFather"}),", or"," ",o.jsx(xl,{href:"https://t.me/BotFather",children:"open this link"}),"."]}),o.jsxs(ue,{number:2,children:["Send the message: ",o.jsx("code",{className:"bg-gray-800 px-1.5 py-0.5 rounded text-claw-400",children:"/newbot"})]}),o.jsxs(ue,{number:3,children:['BotFather will ask for a name and a username (must end in "bot"). When done, it gives you a ',o.jsx("strong",{className:"text-white",children:"token"})," — copy it below."]}),o.jsx(fr,{label:"Bot Token",type:"password",mono:!0,placeholder:"8231064890:AAF2ojRBD...",value:t,onChange:n})]}),e&&o.jsx("div",{className:"bg-green-900/20 border border-green-700 rounded-xl p-4 mb-5",children:o.jsx("p",{className:"text-sm text-green-300",children:"✓ Telegram bot already configured. Your new agent will use the same bot."})}),o.jsxs("div",{className:"border-t border-gray-700 pt-5 mt-2",children:[o.jsx("p",{className:"text-sm text-gray-300 font-medium mb-3",children:"Your Telegram user ID"}),o.jsxs(ue,{number:e?1:4,children:["Message ",o.jsx(xl,{href:"https://t.me/userinfobot",children:"@userinfobot"})," on Telegram (just send it any message) and it'll reply with your user ID."]}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx("input",{value:a,onChange:g=>u(g.target.value),onKeyDown:g=>g.key==="Enter"&&d(),placeholder:"7103027356",className:"flex-1 bg-gray-800 border border-gray-700 rounded-xl px-4 py-2.5 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 font-mono"}),o.jsx("button",{onClick:d,className:"px-4 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors",children:"Add"})]}),r.map(g=>o.jsxs("div",{className:"flex items-center justify-between bg-gray-800 border border-gray-700 rounded-lg px-3 py-2 mb-1",children:[o.jsx("code",{className:"text-xs text-claw-400",children:g}),o.jsx("button",{onClick:()=>l(r.filter(h=>h!==g)),className:"text-gray-600 hover:text-red-400 text-xs transition-colors",children:"✕"})]},g))]}),o.jsx(_t,{onBack:s,onNext:i,nextDisabled:!e&&!t.trim()})]})}function $a({channel:e,agentName:t,onNext:n}){return o.jsx("div",{className:"max-w-xl",children:o.jsxs("div",{className:"text-center py-8",children:[o.jsx("div",{className:"text-5xl mb-4",children:e==="discord"?"🎮":e==="telegram"?"✈️":"✓"}),o.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:e==="skip"?"All set!":`${t} is connected!`}),o.jsxs("p",{className:"text-sm text-gray-400 mb-6",children:[e==="discord"&&"Your agent will appear in Discord once the OpenClaw gateway is running.",e==="telegram"&&"Your agent will respond in Telegram once the OpenClaw gateway is running.",e==="skip"&&"You can set up a channel later by editing your OpenClaw config."]}),e!=="skip"&&o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 text-left mb-6",children:[o.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-2 font-medium",children:"To go live"}),o.jsx("p",{className:"text-sm text-gray-300",children:"Make sure your OpenClaw gateway is running:"}),o.jsx("code",{className:"block mt-2 bg-gray-900 rounded-lg px-3 py-2 text-sm text-claw-400",children:"openclaw gateway"})]}),o.jsx("button",{onClick:n,className:"px-6 py-2.5 bg-green-700 hover:bg-green-600 text-white rounded-xl text-sm font-semibold transition-colors",children:"Run validation →"})]})})}function Om(){var Ye;const{teamSpec:e,setChannelChoice:t}=Pe(),{advance:n}=bn(),r=((Ye=e.agents)==null?void 0:Ye[0])||{},l=r.id||"",s=r.name||l||"Your agent",[i,a]=w.useState(null),[u,d]=w.useState(0),[g,h]=w.useState(""),[m,x]=w.useState(""),[v,k]=w.useState(!1),[I,p]=w.useState(""),[c,f]=w.useState(""),[y,j]=w.useState(!1),[b,C]=w.useState([]),[E,F]=w.useState(!1),[R,M]=w.useState(""),[W,se]=w.useState([]),[fe,ke]=w.useState([]),[J,H]=w.useState([]),[S,P]=w.useState(!1),[A,O]=w.useState(""),[$,oe]=w.useState(!1);w.useEffect(()=>{fetch("/api/channel/agents").then(L=>L.json()).then(L=>ke((L.agents||[]).filter(_=>_.id!==l))),fetch("/api/channel/telegram-status").then(L=>L.json()).then(L=>F(L.configured))},[]);async function ie(){P(!0),O("");try{const L={channel:i,agentId:l,agentName:s,agentComms:J,...i==="discord"&&{discord:{token:g,guildId:I,channelId:c,requireMention:y,allowFrom:b}},...i==="telegram"&&{telegram:{token:E?null:R,allowFrom:W}}},_=await fetch("/api/channel/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}),Le=await _.json();if(!_.ok)throw new Error(Le.error||"Save failed");t(i),oe(!0)}catch(L){O(L.message)}finally{P(!1)}}if(!i)return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:1,total:1,title:"Connect your agent",subtitle:`How do you want to talk to ${s}?`}),o.jsx("div",{className:"space-y-3 mb-6",children:[{id:"discord",emoji:"🎮",label:"Discord",desc:"Each agent gets its own bot. Best for teams and ongoing conversations.",badge:"Recommended"},{id:"telegram",emoji:"✈️",label:"Telegram",desc:"Simpler setup — all your agents share one Telegram bot.",badge:null},{id:"skip",emoji:"⏭",label:"Skip for now",desc:"I'll set up a channel later.",badge:null}].map(L=>o.jsxs("button",{onClick:()=>{a(L.id),d(1)},className:"w-full flex items-start gap-4 p-4 bg-gray-800 border border-gray-700 hover:border-claw-500 rounded-xl text-left transition-colors group",children:[o.jsx("span",{className:"text-2xl mt-0.5",children:L.emoji}),o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-white",children:L.label}),L.badge&&o.jsx("span",{className:"text-xs bg-claw-800 text-claw-300 px-2 py-0.5 rounded-full",children:L.badge})]}),o.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:L.desc})]}),o.jsx("span",{className:"text-gray-600 group-hover:text-claw-400 transition-colors mt-0.5",children:"→"})]},L.id))})]});if(i==="skip")return o.jsx($a,{channel:"skip",agentName:s,onNext:()=>{t("skip"),n()}});if($)return o.jsx($a,{channel:i,agentName:s,onNext:n});if(i==="discord"){const L=fe.length>0,_=L?6:5;if(u===1)return o.jsx(Im,{agentName:s,botToken:g,setBotToken:h,appId:m,setAppId:x,onBack:()=>a(null),onNext:()=>d(2)});if(u===2)return o.jsx(Am,{agentName:s,appId:m,confirmed:v,setConfirmed:k,onBack:()=>d(1),onNext:()=>d(3)});if(u===3)return o.jsx(Rm,{agentName:s,guildId:I,setGuildId:p,channelId:c,setChannelId:f,requireMention:y,setRequireMention:j,onBack:()=>d(2),onNext:()=>d(4)});if(u===4)return o.jsx(Lm,{agentName:s,allowFrom:b,setAllowFrom:C,onBack:()=>d(3),onNext:()=>d(L?5:6)});if(u===5&&L)return o.jsx(Wa,{agentName:s,existingAgents:fe,selected:J,setSelected:H,stepNum:5,totalSteps:_,onBack:()=>d(4),onNext:()=>d(6)});if(u===6)return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:_,total:_,title:"All done — save configuration",subtitle:"We'll write your Discord bot settings to openclaw.json."}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-5 space-y-2 text-sm text-gray-300",children:[o.jsxs("div",{children:["🤖 Bot added to ",o.jsx("strong",{className:"text-white",children:s}),"'s account"]}),I&&o.jsxs("div",{children:["🎮 Server: ",o.jsx("code",{className:"text-claw-400",children:I})]}),c&&o.jsxs("div",{children:["📢 Channel: ",o.jsx("code",{className:"text-claw-400",children:c})]}),b.length>0&&o.jsxs("div",{children:["👤 ",b.length," allowed user",b.length>1?"s":""]}),J.length>0&&o.jsxs("div",{children:["🤝 Can collaborate with: ",J.join(", ")]})]}),A&&o.jsx("p",{className:"text-red-400 text-sm mb-4",children:A}),o.jsx(_t,{onBack:()=>d(L?5:4),onNext:ie,nextLabel:"Save & continue →",saving:S})]})}if(i==="telegram"){const L=fe.length>0;if(u===1)return o.jsx(Dm,{alreadyConfigured:E,botToken:R,setBotToken:M,allowFrom:W,setAllowFrom:se,onBack:()=>a(null),onNext:()=>d(L?2:3)});if(u===2&&L)return o.jsx(Wa,{agentName:s,existingAgents:fe,selected:J,setSelected:H,stepNum:2,totalSteps:3,onBack:()=>d(1),onNext:()=>d(3)});if(u===3)return o.jsxs("div",{className:"max-w-xl",children:[o.jsx(st,{step:L?3:2,total:L?3:2,title:"Save configuration",subtitle:"We'll write your Telegram settings to openclaw.json."}),o.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-5 space-y-2 text-sm text-gray-300",children:[E?o.jsx("div",{children:"✈️ Using your existing Telegram bot"}):o.jsx("div",{children:"✈️ New Telegram bot will be configured"}),W.length>0&&o.jsxs("div",{children:["👤 ",W.length," allowed user",W.length>1?"s":""]}),J.length>0&&o.jsxs("div",{children:["🤝 Can collaborate with: ",J.join(", ")]})]}),A&&o.jsx("p",{className:"text-red-400 text-sm mb-4",children:A}),o.jsx(_t,{onBack:()=>d(L?2:1),onNext:ie,nextLabel:"Save & continue →",saving:S})]})}return null}function Yt({done:e,pending:t,label:n,sublabel:r,code:l}){const s=e?"bg-green-900/50 border-green-700 text-green-400":t?"bg-yellow-900/20 border-yellow-700 text-yellow-500":"bg-gray-800 border-gray-700 text-gray-500",i=e?"✓":"○";return o.jsxs("div",{className:"flex items-start gap-3 py-3 border-b border-gray-800 last:border-0",children:[o.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center shrink-0 mt-0.5 text-xs font-bold border ${s}`,children:i}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:`text-sm ${e?"text-gray-200":t?"text-gray-300":"text-gray-500"}`,children:n}),r&&o.jsx("div",{className:"text-xs text-gray-600 mt-0.5",children:r}),l&&o.jsx("code",{className:"text-xs text-claw-400 mt-1.5 block bg-gray-900 rounded px-2 py-1 font-mono",children:l})]})]})}function zm(){var c,f;const{validationOutput:e,setValidationOutput:t,isValidating:n,setIsValidating:r,reset:l,teamSpec:s,writeResult:i,channelChoice:a}=Pe(),{advance:u}=bn(),[d,g]=w.useState(!1),h=((c=s.agents)==null?void 0:c[0])||{},m=h.name||h.id||"your agent";async function x(){r(!0),t("");try{const j=await(await fetch("/api/validate",{method:"POST"})).json();t(j.output||"(no output)"),g(!0)}catch(y){t(`Error: ${y.message}`),g(!0)}finally{r(!1)}}const v=!!i,k=a==="discord",I=a==="telegram",p=a==="skip"||a===null;return o.jsxs("div",{className:"max-w-2xl space-y-6",children:[o.jsxs("div",{className:"border border-gray-800 bg-gray-800/20 rounded-xl overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-3 border-b border-gray-800 bg-gray-800/40",children:[o.jsx("p",{className:"text-sm font-semibold text-white",children:"Setup summary"}),o.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"What's done and what you still need to do manually"})]}),o.jsxs("div",{className:"px-4 divide-y divide-gray-800/0",children:[o.jsx(Yt,{done:v,label:v?`Agent files written (${((f=i.written)==null?void 0:f.length)||0} files)`:"Agent files not yet written",sublabel:v?"Written to ~/.openclaw/":null}),k&&o.jsx(Yt,{done:!0,label:`Discord bot configured for ${m}`,sublabel:"Token, server, channel and allowed users saved to openclaw.json"}),I&&o.jsx(Yt,{done:!0,label:"Telegram configured",sublabel:"Bot token and allowed users saved to openclaw.json"}),p&&o.jsx(Yt,{done:!1,label:"No channel configured yet",sublabel:"You can add Discord or Telegram later by editing openclaw.json"}),o.jsx(Yt,{pending:!0,label:"Start the OpenClaw gateway",sublabel:"Run this in your terminal to bring the agent online",code:"openclaw gateway"}),k&&o.jsx(Yt,{pending:!0,label:"Approve the agent via Discord DM (first time only)",sublabel:`Send a DM to your ${m} bot — it will ask you to pair before responding`})]})]}),o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm text-gray-400 mb-3",children:["Optionally run ",o.jsx("code",{className:"text-claw-400",children:"openclaw doctor"})," to validate the configuration."]}),o.jsx("button",{onClick:x,disabled:n,className:"mb-4 px-5 py-2 bg-gray-700 hover:bg-gray-600 text-gray-200 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50",children:n?"⟳ Running...":"Run openclaw doctor"}),(e||n)&&o.jsxs("div",{className:"bg-gray-950 border border-gray-700 rounded-xl overflow-hidden mb-4",children:[o.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-800 bg-gray-900",children:[o.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),o.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),o.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),o.jsx("span",{className:"text-xs text-gray-500 ml-2 font-mono",children:"terminal"})]}),o.jsx("pre",{className:"p-4 text-xs font-mono text-green-400 overflow-auto max-h-64 scrollbar-thin whitespace-pre-wrap",children:n?"Running openclaw doctor...":e})]})]}),o.jsxs("div",{className:"flex gap-3 flex-wrap",children:[o.jsx("button",{onClick:u,className:"px-6 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-lg text-sm font-semibold transition-colors",children:"Chat with your agent →"}),o.jsx("button",{onClick:l,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-lg text-sm transition-colors",children:"Start new agent/team"})]})]})}function Mm({role:e,content:t}){return o.jsx("div",{className:`flex ${e==="user"?"justify-end":"justify-start"}`,children:o.jsx("div",{className:`max-w-[80%] rounded-2xl px-3 py-2 text-sm leading-relaxed ${e==="user"?"bg-claw-700 text-white rounded-br-sm":"bg-gray-800 text-gray-100 rounded-bl-sm"}`,children:t.split(`
|
|
260
|
+
`).map((n,r)=>o.jsxs("span",{children:[n,r<t.split(`
|
|
261
|
+
`).length-1&&o.jsx("br",{})]},r))})})}function Fm(){const[e,t]=w.useState("idle"),[n,r]=w.useState(""),[l,s]=w.useState(!1),i=w.useRef(null);w.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[n]);function a(){navigator.clipboard.writeText("openclaw gateway").then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})}async function u(){t("starting"),r("");try{const g=(await fetch("/api/gateway/restart",{method:"POST"})).body.getReader(),h=new TextDecoder;let m="";for(;;){const{done:x,value:v}=await g.read();if(x)break;m+=h.decode(v,{stream:!0});const k=m.split(`
|
|
262
|
+
`);m=k.pop();for(const I of k)if(I.startsWith("data:"))try{const{type:p,data:c}=JSON.parse(I.slice(5).trim());p==="log"&&r(f=>f+c),p==="done"&&t("done"),p==="error"&&(t("error"),r(f=>f+`
|
|
263
|
+
`+c))}catch{}}}catch(d){t("error"),r("Error: "+d.message)}}return o.jsxs("div",{className:"border border-gray-700 rounded-xl p-4 mb-6 bg-gray-800/30",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-white",children:"Start the OpenClaw gateway"}),o.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Your agent goes live on Discord / Telegram once the gateway is running."})]}),e==="idle"&&o.jsx("button",{onClick:u,className:"shrink-0 px-4 py-1.5 bg-claw-600 hover:bg-claw-500 text-white rounded-lg text-xs font-semibold transition-colors",children:"Start automatically"}),e==="starting"&&o.jsxs("span",{className:"shrink-0 flex items-center gap-1.5 text-xs text-gray-400",children:[o.jsx("span",{className:"w-3 h-3 border border-gray-400 border-t-transparent rounded-full animate-spin"}),"Starting..."]}),e==="done"&&o.jsx("span",{className:"shrink-0 text-xs text-green-400",children:"✓ Live"}),e==="error"&&o.jsx("button",{onClick:u,className:"shrink-0 px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-lg text-xs transition-colors",children:"Try again"})]}),o.jsxs("div",{className:"flex items-center justify-between bg-gray-900 border border-gray-800 rounded-lg px-3 py-2",children:[o.jsx("code",{className:"text-xs text-claw-400 font-mono",children:"openclaw gateway"}),o.jsx("button",{onClick:a,className:"text-xs text-gray-600 hover:text-gray-300 transition-colors ml-3 shrink-0",children:l?"✓ Copied":"Copy"})]}),n&&o.jsx("pre",{ref:i,className:"mt-2 max-h-20 bg-gray-950 border border-gray-800 rounded-lg p-2 text-xs font-mono text-green-400 overflow-y-auto scrollbar-thin whitespace-pre-wrap",children:n})]})}function Um({agent:e}){const{provider:t,apiKey:n,model:r,openclawEnv:l}=Ol(),[s,i]=w.useState([]),[a,u]=w.useState(""),[d,g]=w.useState(!1),[h,m]=w.useState(""),x=w.useRef(null),v=w.useRef(null);w.useEffect(()=>{var p;(p=x.current)==null||p.scrollIntoView({behavior:"smooth"})},[s,d]);async function k(){const p=a.trim();if(!p||d)return;u(""),m("");const c={role:"user",content:p},f=[...s,c];i(f),g(!0);try{const y=await fetch(`/api/agent-chat/${e.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:f,...l?{}:{apiKey:n},provider:t,model:r})}),j=await y.json();if(!y.ok)throw new Error(j.error||"Chat failed");i([...f,{role:"assistant",content:j.content}])}catch(y){m(y.message)}finally{g(!1),setTimeout(()=>{var y;return(y=v.current)==null?void 0:y.focus()},100)}}function I(p){p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),k())}return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsx("div",{className:"mb-3 px-3 py-2 bg-gray-800/40 border border-gray-700/50 rounded-lg text-xs text-gray-500",children:"Preview mode — personality and rules are loaded from your workspace files. External tools (web, shell, memory) require the gateway."}),o.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3 py-2 scrollbar-thin min-h-0",children:[s.length===0&&o.jsxs("div",{className:"text-center text-gray-600 text-xs mt-8",children:["Say hello to ",e.name||e.id," to test how they respond."]}),s.map((p,c)=>o.jsx(Mm,{role:p.role,content:p.content},c)),d&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"bg-gray-800 rounded-2xl rounded-bl-sm px-3 py-2",children:o.jsx(ti,{})})}),h&&o.jsx("div",{className:"text-xs text-red-400 text-center",children:h}),o.jsx("div",{ref:x})]}),o.jsxs("div",{className:"border-t border-gray-800 pt-3",children:[o.jsxs("div",{className:"flex gap-2 items-end",children:[o.jsx("textarea",{ref:v,value:a,onChange:p=>u(p.target.value),onKeyDown:I,placeholder:`Message ${e.name||e.id}...`,rows:2,disabled:d,className:"flex-1 bg-gray-800 border border-gray-700 rounded-xl px-3 py-2 text-sm text-gray-100 placeholder-gray-600 focus:outline-none focus:border-claw-500 resize-none disabled:opacity-50 leading-relaxed"}),o.jsx("button",{onClick:k,disabled:d||!a.trim(),className:"px-4 py-2 bg-claw-600 hover:bg-claw-500 text-white rounded-xl text-sm font-semibold transition-colors disabled:opacity-40 shrink-0",children:"Send"})]}),o.jsx("p",{className:"text-xs text-gray-700 mt-1",children:"Enter to send · Shift+Enter for new line"})]})]})}function Wm(){var i;const{teamSpec:e,reset:t}=Pe(),n=e.agents.filter(a=>a.id),[r,l]=w.useState(((i=n[0])==null?void 0:i.id)||""),s=n.find(a=>a.id===r)||n[0];return o.jsxs("div",{className:"flex flex-col h-full max-w-3xl mx-auto",children:[o.jsxs("div",{className:"mb-4",children:[o.jsxs("h2",{className:"text-lg font-bold text-white mb-1",children:["Your agent",n.length>1?"s are":" is"," ready"]}),o.jsxs("p",{className:"text-sm text-gray-400",children:["Chat with ",n.length>1?"them":"it"," below to test personality and responses, then restart the gateway to go live."]})]}),o.jsx(Fm,{}),n.length>1&&o.jsx("div",{className:"flex gap-1 mb-4 border-b border-gray-800 pb-0",children:n.map(a=>o.jsx("button",{onClick:()=>l(a.id),className:`px-4 py-2 text-sm font-medium rounded-t-lg transition-colors -mb-px border-b-2 ${r===a.id?"text-white border-claw-500 bg-gray-800/40":"text-gray-500 border-transparent hover:text-gray-300 hover:border-gray-600"}`,children:a.name||a.id},a.id))}),o.jsx("div",{className:"flex-1 min-h-0 border border-gray-800 rounded-xl p-4 bg-gray-900/20",children:s&&o.jsx(Um,{agent:s},s.id)}),o.jsxs("div",{className:"pt-4 flex justify-between items-center",children:[o.jsx("button",{onClick:t,className:"text-xs text-gray-600 hover:text-gray-400 transition-colors",children:"Build another agent →"}),o.jsx("p",{className:"text-xs text-gray-700",children:"Full capabilities available once the gateway is running"})]})]})}const $m=[cd,Nm,Cm,Pm,Om,zm,Wm];function Bm(){const e=Pe(s=>s.phase),t=Pe(s=>s.reset),{configured:n,reset:r}=Ol(),l=$m[e]||cd;return o.jsxs("div",{className:"flex flex-col h-screen",children:[o.jsxs("header",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-800 shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-lg font-bold text-claw-400",children:"🦞 OpenClaw"}),o.jsx("span",{className:"text-gray-600 hidden sm:block",children:"Agent Builder"})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[n&&o.jsx("button",{onClick:r,className:"text-xs text-gray-600 hover:text-gray-400 transition-colors",children:"Change AI"}),o.jsx("button",{onClick:()=>{(e===0||confirm("Start over? Your conversation will be lost."))&&t()},className:"text-xs text-gray-600 hover:text-gray-400 transition-colors",children:"Start over"})]})]}),e>0&&o.jsx("div",{className:"px-6 py-3 border-b border-gray-800 shrink-0",children:o.jsx(gm,{currentPhase:e})}),o.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col px-6 py-4",children:o.jsx(l,{})})]})}function Hm(){const[e,t]=w.useState(!1);return e?o.jsx(Bm,{}):o.jsx($p,{onReady:()=>t(!0)})}fs.createRoot(document.getElementById("root")).render(o.jsx(eu.StrictMode,{children:o.jsx(Hm,{})}));
|