diff --git a/agent/cmd/mc-agent/uidist/index.html b/agent/cmd/mc-agent/uidist/index.html index 06e74aaa..4438b2eb 100644 --- a/agent/cmd/mc-agent/uidist/index.html +++ b/agent/cmd/mc-agent/uidist/index.html @@ -22,7 +22,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var df;function Zp(){if(df)return pe;df=1;var s=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),w=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),k=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),M=Symbol.iterator;function L(y){return y===null||typeof y!="object"?null:(y=M&&y[M]||y["@@iterator"],typeof y=="function"?y:null)}var te={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,$={};function se(y,I,ue){this.props=y,this.context=I,this.refs=$,this.updater=ue||te}se.prototype.isReactComponent={},se.prototype.setState=function(y,I){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,I,"setState")},se.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Q(){}Q.prototype=se.prototype;function W(y,I,ue){this.props=y,this.context=I,this.refs=$,this.updater=ue||te}var X=W.prototype=new Q;X.constructor=W,K(X,se.prototype),X.isPureReactComponent=!0;var ie=Array.isArray,fe=Object.prototype.hasOwnProperty,de={current:null},Te={key:!0,ref:!0,__self:!0,__source:!0};function Ge(y,I,ue){var ce,he={},me=null,Se=null;if(I!=null)for(ce in I.ref!==void 0&&(Se=I.ref),I.key!==void 0&&(me=""+I.key),I)fe.call(I,ce)&&!Te.hasOwnProperty(ce)&&(he[ce]=I[ce]);var ge=arguments.length-2;if(ge===1)he.children=ue;else if(1>>1,I=b[y];if(0>>1;yf(he,B))mef(Se,he)?(b[y]=Se,b[me]=B,y=me):(b[y]=he,b[ce]=B,y=ce);else if(mef(Se,B))b[y]=Se,b[me]=B,y=me;else break e}}return ee}function f(b,ee){var B=b.sortIndex-ee.sortIndex;return B!==0?B:b.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var w=Date,v=w.now();s.unstable_now=function(){return w.now()-v}}var _=[],k=[],A=1,M=null,L=3,te=!1,K=!1,$=!1,se=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function X(b){for(var ee=a(k);ee!==null;){if(ee.callback===null)c(k);else if(ee.startTime<=b)c(k),ee.sortIndex=ee.expirationTime,i(_,ee);else break;ee=a(k)}}function ie(b){if($=!1,X(b),!K)if(a(_)!==null)K=!0,Ve(fe);else{var ee=a(k);ee!==null&&ve(ie,ee.startTime-b)}}function fe(b,ee){K=!1,$&&($=!1,Q(Ge),Ge=-1),te=!0;var B=L;try{for(X(ee),M=a(_);M!==null&&(!(M.expirationTime>ee)||b&&!$t());){var y=M.callback;if(typeof y=="function"){M.callback=null,L=M.priorityLevel;var I=y(M.expirationTime<=ee);ee=s.unstable_now(),typeof I=="function"?M.callback=I:M===a(_)&&c(_),X(ee)}else c(_);M=a(_)}if(M!==null)var ue=!0;else{var ce=a(k);ce!==null&&ve(ie,ce.startTime-ee),ue=!1}return ue}finally{M=null,L=B,te=!1}}var de=!1,Te=null,Ge=-1,vt=5,Fe=-1;function $t(){return!(s.unstable_now()-Feb||125y?(b.sortIndex=B,i(k,b),a(_)===null&&b===a(k)&&($?(Q(Ge),Ge=-1):$=!0,ve(ie,B-y))):(b.sortIndex=I,i(_,b),K||te||(K=!0,Ve(fe))),b},s.unstable_shouldYield=$t,s.unstable_wrapCallback=function(b){var ee=L;return function(){var B=L;L=ee;try{return b.apply(this,arguments)}finally{L=B}}}})(wa)),wa}var vf;function nh(){return vf||(vf=1,xa.exports=th()),xa.exports}/** + */var gf;function th(){return gf||(gf=1,(function(s){function i(b,te){var B=b.length;b.push(te);e:for(;0>>1,I=b[y];if(0>>1;yf(he,B))mef(Se,he)?(b[y]=Se,b[me]=B,y=me):(b[y]=he,b[ce]=B,y=ce);else if(mef(Se,B))b[y]=Se,b[me]=B,y=me;else break e}}return te}function f(b,te){var B=b.sortIndex-te.sortIndex;return B!==0?B:b.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var w=Date,v=w.now();s.unstable_now=function(){return w.now()-v}}var _=[],k=[],A=1,F=null,N=3,ee=!1,W=!1,q=!1,ie=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function J(b){for(var te=a(k);te!==null;){if(te.callback===null)c(k);else if(te.startTime<=b)c(k),te.sortIndex=te.expirationTime,i(_,te);else break;te=a(k)}}function oe(b){if(q=!1,J(b),!W)if(a(_)!==null)W=!0,Ve(fe);else{var te=a(k);te!==null&&ve(oe,te.startTime-b)}}function fe(b,te){W=!1,q&&(q=!1,Y(Ge),Ge=-1),ee=!0;var B=N;try{for(J(te),F=a(_);F!==null&&(!(F.expirationTime>te)||b&&!$t());){var y=F.callback;if(typeof y=="function"){F.callback=null,N=F.priorityLevel;var I=y(F.expirationTime<=te);te=s.unstable_now(),typeof I=="function"?F.callback=I:F===a(_)&&c(_),J(te)}else c(_);F=a(_)}if(F!==null)var ue=!0;else{var ce=a(k);ce!==null&&ve(oe,ce.startTime-te),ue=!1}return ue}finally{F=null,N=B,ee=!1}}var de=!1,Te=null,Ge=-1,vt=5,Fe=-1;function $t(){return!(s.unstable_now()-Feb||125y?(b.sortIndex=B,i(k,b),a(_)===null&&b===a(k)&&(q?(Y(Ge),Ge=-1):q=!0,ve(oe,B-y))):(b.sortIndex=I,i(_,b),W||ee||(W=!0,Ve(fe))),b},s.unstable_shouldYield=$t,s.unstable_wrapCallback=function(b){var te=N;return function(){var B=N;N=te;try{return b.apply(this,arguments)}finally{N=B}}}})(wa)),wa}var vf;function nh(){return vf||(vf=1,xa.exports=th()),xa.exports}/** * @license React * react-dom.production.min.js * @@ -46,16 +46,16 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yf;function rh(){if(yf)return Ut;yf=1;var s=Da(),i=nh();function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,k=/^[: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]*$/,A={},M={};function L(e){return _.call(M,e)?!0:_.call(A,e)?!1:k.test(e)?M[e]=!0:(A[e]=!0,!1)}function te(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 K(e,t,n,r){if(t===null||typeof t>"u"||te(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 $(e,t,n,r,l,o,u){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=o,this.removeEmptyString=u}var se={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){se[e]=new $(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];se[t]=new $(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){se[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){se[e]=new $(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){se[e]=new $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){se[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){se[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){se[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){se[e]=new $(e,5,!1,e.toLowerCase(),null,!1,!1)});var Q=/[\-:]([a-z])/g;function W(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(Q,W);se[t]=new $(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(Q,W);se[t]=new $(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(Q,W);se[t]=new $(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){se[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),se.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){se[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function X(e,t,n,r){var l=se.hasOwnProperty(t)?se[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,k=/^[: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]*$/,A={},F={};function N(e){return _.call(F,e)?!0:_.call(A,e)?!1:k.test(e)?F[e]=!0:(A[e]=!0,!1)}function ee(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 W(e,t,n,r){if(t===null||typeof t>"u"||ee(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 q(e,t,n,r,l,o,u){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=o,this.removeEmptyString=u}var ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ie[e]=new q(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ie[t]=new q(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ie[e]=new q(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ie[e]=new q(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){ie[e]=new q(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ie[e]=new q(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ie[e]=new q(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ie[e]=new q(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ie[e]=new q(e,5,!1,e.toLowerCase(),null,!1,!1)});var Y=/[\-:]([a-z])/g;function H(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(Y,H);ie[t]=new q(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(Y,H);ie[t]=new q(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(Y,H);ie[t]=new q(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ie[e]=new q(e,1,!1,e.toLowerCase(),null,!1,!1)}),ie.xlinkHref=new q("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ie[e]=new q(e,1,!1,e.toLowerCase(),null,!0,!0)});function J(e,t,n,r){var l=ie.hasOwnProperty(t)?ie[t]:null;(l!==null?l.type!==0:r||!(2m||l[u]!==o[m]){var g=` -`+l[u].replace(" at new "," at ");return e.displayName&&g.includes("")&&(g=g.replace("",e.displayName)),g}while(1<=u&&0<=m);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function he(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function me(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 Te:return"Fragment";case de:return"Portal";case vt:return"Profiler";case Ge:return"StrictMode";case Xe:return"Suspense";case Ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $t:return(e.displayName||"Context")+".Consumer";case Fe:return(e._context.displayName||"Context")+".Provider";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case He:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}function Se(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 me(t);case 8:return t===Ge?"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 ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lt(e){var t=Ee(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){r=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(u){r=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function we(e){e._valueTracker||(e._valueTracker=lt(e))}function rr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ce(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 Pn(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Le(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ge(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 dn(e,t){t=t.checked,t!=null&&X(e,"checked",t,!1)}function lr(e,t){dn(e,t);var n=ge(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")?ir(e,t.type,n):t.hasOwnProperty("defaultValue")&&ir(e,t.type,ge(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(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 ir(e,t,n){(t!=="number"||Ce(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ne=Array.isArray;function Ht(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _t={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},Dn=["Webkit","ms","Moz","O"];Object.keys(_t).forEach(function(e){Dn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_t[t]=_t[e]})});function Fn(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_t.hasOwnProperty(e)&&_t[e]?(""+t).trim():t+"px"}function Lr(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Fn(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Nr=B({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 hn(e,t){if(t){if(Nr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function bn(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 Vt=null;function ft(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,Qt=null,mn=null;function Yt(e){if(e=ql(e)){if(typeof Bn!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Wi(t),Bn(e.stateNode,e.type,t))}}function Un(e){Qt?mn?mn.push(e):mn=[e]:Qt=e}function Wn(){if(Qt){var e=Qt,t=mn;if(mn=Qt=null,Yt(e),t)for(e=0;e>>=0,e===0?32:31-(ar(e)/zr|0)|0}var Zr=64,$r=4194304;function ur(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 Pr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,u=n&268435455;if(u!==0){var m=u&~l;m!==0?r=ur(m):(o&=u,o!==0&&(r=ur(o)))}else u=n&~l,u!==0?r=ur(u):o!==0&&(r=ur(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Rn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function jl(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=Bl),lu=" ",iu=!1;function ou(e,t){switch(e){case"keyup":return Qd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rl=!1;function Gd(e,t){switch(e){case"compositionend":return su(t);case"keypress":return t.which!==32?null:(iu=!0,lu);case"textInput":return e=t.data,e===lu&&iu?null:e;default:return null}}function Kd(e,t){if(rl)return e==="compositionend"||!Xo&&ou(e,t)?(e=Za(),Ii=Vo=fr=null,rl=!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)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=hu(n)}}function gu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vu(){for(var e=window,t=Ce();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ce(e.document)}return t}function $o(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 rp(e){var t=vu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gu(n.ownerDocument.documentElement,n)){if(r!==null&&$o(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,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=mu(n,o);var u=mu(n,r);l&&u&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.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=document.documentMode,ll=null,es=null,Vl=null,ts=!1;function yu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ts||ll==null||ll!==Ce(r)||(r=ll,"selectionStart"in r&&$o(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}),Vl&&Hl(Vl,r)||(Vl=r,r=bi(es,"onSelect"),0ul||(e.current=ps[ul],ps[ul]=null,ul--)}function je(e,t){ul++,ps[ul]=e.current,e.current=t}var mr={},wt=hr(mr),Mt=hr(!1),Mr=mr;function cl(e,t){var n=e.type.contextTypes;if(!n)return mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Dt(e){return e=e.childContextTypes,e!=null}function Hi(){Oe(Mt),Oe(wt)}function zu(e,t,n){if(wt.current!==mr)throw Error(a(168));je(wt,t),je(Mt,n)}function Pu(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(a(108,Se(e)||"Unknown",l));return B({},n,r)}function Vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Mr=wt.current,je(wt,e),je(Mt,Mt.current),!0}function Ou(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Pu(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,Oe(Mt),Oe(wt),je(wt,e)):Oe(Mt),je(Mt,n)}var Gn=null,Qi=!1,hs=!1;function Mu(e){Gn===null?Gn=[e]:Gn.push(e)}function mp(e){Qi=!0,Mu(e)}function gr(){if(!hs&&Gn!==null){hs=!0;var e=0,t=d;try{var n=Gn;for(d=1;e>=u,l-=u,Kn=1<<32-yt(t)+l|n<ae?(st=le,le=null):st=le.sibling;var ke=z(E,le,T[ae],F);if(ke===null){le===null&&(le=st);break}e&&le&&ke.alternate===null&&t(E,le),x=o(ke,x,ae),re===null?Z=ke:re.sibling=ke,re=ke,le=st}if(ae===T.length)return n(E,le),De&&Fr(E,ae),Z;if(le===null){for(;aeae?(st=le,le=null):st=le.sibling;var Cr=z(E,le,ke.value,F);if(Cr===null){le===null&&(le=st);break}e&&le&&Cr.alternate===null&&t(E,le),x=o(Cr,x,ae),re===null?Z=Cr:re.sibling=Cr,re=Cr,le=st}if(ke.done)return n(E,le),De&&Fr(E,ae),Z;if(le===null){for(;!ke.done;ae++,ke=T.next())ke=O(E,ke.value,F),ke!==null&&(x=o(ke,x,ae),re===null?Z=ke:re.sibling=ke,re=ke);return De&&Fr(E,ae),Z}for(le=r(E,le);!ke.done;ae++,ke=T.next())ke=U(le,E,ae,ke.value,F),ke!==null&&(e&&ke.alternate!==null&&le.delete(ke.key===null?ae:ke.key),x=o(ke,x,ae),re===null?Z=ke:re.sibling=ke,re=ke);return e&&le.forEach(function(qp){return t(E,qp)}),De&&Fr(E,ae),Z}function qe(E,x,T,F){if(typeof T=="object"&&T!==null&&T.type===Te&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case fe:e:{for(var Z=T.key,re=x;re!==null;){if(re.key===Z){if(Z=T.type,Z===Te){if(re.tag===7){n(E,re.sibling),x=l(re,T.props.children),x.return=E,E=x;break e}}else if(re.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===Ve&&Wu(Z)===re.type){n(E,re.sibling),x=l(re,T.props),x.ref=Xl(E,re,T),x.return=E,E=x;break e}n(E,re);break}else t(E,re);re=re.sibling}T.type===Te?(x=Yr(T.props.children,E.mode,F,T.key),x.return=E,E=x):(F=wo(T.type,T.key,T.props,null,E.mode,F),F.ref=Xl(E,x,T),F.return=E,E=F)}return u(E);case de:e:{for(re=T.key;x!==null;){if(x.key===re)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){n(E,x.sibling),x=l(x,T.children||[]),x.return=E,E=x;break e}else{n(E,x);break}else t(E,x);x=x.sibling}x=fa(T,E.mode,F),x.return=E,E=x}return u(E);case Ve:return re=T._init,qe(E,x,re(T._payload),F)}if(Ne(T))return Y(E,x,T,F);if(ee(T))return q(E,x,T,F);qi(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,x!==null&&x.tag===6?(n(E,x.sibling),x=l(x,T),x.return=E,E=x):(n(E,x),x=ca(T,E.mode,F),x.return=E,E=x),u(E)):n(E,x)}return qe}var hl=Hu(!0),Vu=Hu(!1),Xi=hr(null),Ji=null,ml=null,ws=null;function ks(){ws=ml=Ji=null}function Ss(e){var t=Xi.current;Oe(Xi),e._currentValue=t}function Es(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 gl(e,t){Ji=e,ws=ml=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ft=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(ws!==e)if(e={context:e,memoizedValue:t,next:null},ml===null){if(Ji===null)throw Error(a(308));ml=e,Ji.dependencies={lanes:0,firstContext:e}}else ml=ml.next=e;return t}var br=null;function Ts(e){br===null?br=[e]:br.push(e)}function Qu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ts(t)):(n.next=l.next,l.next=n),t.interleaved=n,Xn(e,r)}function Xn(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 vr=!1;function Cs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yu(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 Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Xn(e,n)}return l=r.interleaved,l===null?(t.next=t,Ts(r)):(t.next=l.next,l.next=t),r.interleaved=t,Xn(e,n)}function Zi(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,D(e,n)}}function Gu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var u={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=u:o=o.next=u,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,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 $i(e,t,n,r){var l=e.updateQueue;vr=!1;var o=l.firstBaseUpdate,u=l.lastBaseUpdate,m=l.shared.pending;if(m!==null){l.shared.pending=null;var g=m,R=g.next;g.next=null,u===null?o=R:u.next=R,u=g;var P=e.alternate;P!==null&&(P=P.updateQueue,m=P.lastBaseUpdate,m!==u&&(m===null?P.firstBaseUpdate=R:m.next=R,P.lastBaseUpdate=g))}if(o!==null){var O=l.baseState;u=0,P=R=g=null,m=o;do{var z=m.lane,U=m.eventTime;if((r&z)===z){P!==null&&(P=P.next={eventTime:U,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var Y=e,q=m;switch(z=t,U=n,q.tag){case 1:if(Y=q.payload,typeof Y=="function"){O=Y.call(U,O,z);break e}O=Y;break e;case 3:Y.flags=Y.flags&-65537|128;case 0:if(Y=q.payload,z=typeof Y=="function"?Y.call(U,O,z):Y,z==null)break e;O=B({},O,z);break e;case 2:vr=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,z=l.effects,z===null?l.effects=[m]:z.push(m))}else U={eventTime:U,lane:z,tag:m.tag,payload:m.payload,callback:m.callback,next:null},P===null?(R=P=U,g=O):P=P.next=U,u|=z;if(m=m.next,m===null){if(m=l.shared.pending,m===null)break;z=m,m=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);if(P===null&&(g=O),l.baseState=g,l.firstBaseUpdate=R,l.lastBaseUpdate=P,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Wr|=u,e.lanes=u,e.memoizedState=O}}function Ku(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ns.transition;Ns.transition={};try{e(!1),t()}finally{d=n,Ns.transition=r}}function pc(){return un().memoizedState}function xp(e,t,n){var r=Sr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hc(e))mc(t,n);else if(n=Qu(e,t,n,r),n!==null){var l=Lt();Tn(n,e,r,l),gc(n,t,r)}}function wp(e,t,n){var r=Sr(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hc(e))mc(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,m=o(u,n);if(l.hasEagerState=!0,l.eagerState=m,xn(m,u)){var g=t.interleaved;g===null?(l.next=l,Ts(t)):(l.next=g.next,g.next=l),t.interleaved=l;return}}catch{}finally{}n=Qu(e,t,l,r),n!==null&&(l=Lt(),Tn(n,e,r,l),gc(n,t,r))}}function hc(e){var t=e.alternate;return e===We||t!==null&&t===We}function mc(e,t){ei=no=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,D(e,n)}}var io={readContext:an,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},kp={readContext:an,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:ic,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ro(4194308,4,ac.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nn();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=xp.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:rc,useDebugValue:Ds,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=rc(!1),t=e[0];return e=yp.bind(null,e[1]),Nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,l=Nn();if(De){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ot===null)throw Error(a(349));(Ur&30)!==0||Zu(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,ic(ec.bind(null,r,o,e),[e]),r.flags|=2048,ri(9,$u.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Nn(),t=ot.identifierPrefix;if(De){var n=qn,r=Kn;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ti++,0")&&(g=g.replace("",e.displayName)),g}while(1<=u&&0<=m);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?I(e):""}function he(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function me(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 Te:return"Fragment";case de:return"Portal";case vt:return"Profiler";case Ge:return"StrictMode";case Xe:return"Suspense";case Ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $t:return(e.displayName||"Context")+".Consumer";case Fe:return(e._context.displayName||"Context")+".Provider";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case He:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}function Se(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 me(t);case 8:return t===Ge?"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 ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lt(e){var t=Ee(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){r=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(u){r=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function we(e){e._valueTracker||(e._valueTracker=lt(e))}function rr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ce(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 Pn(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Le(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ge(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 dn(e,t){t=t.checked,t!=null&&J(e,"checked",t,!1)}function lr(e,t){dn(e,t);var n=ge(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")?ir(e,t.type,n):t.hasOwnProperty("defaultValue")&&ir(e,t.type,ge(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wt(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 ir(e,t,n){(t!=="number"||Ce(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ne=Array.isArray;function Ht(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _t={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},Dn=["Webkit","ms","Moz","O"];Object.keys(_t).forEach(function(e){Dn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_t[t]=_t[e]})});function Fn(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_t.hasOwnProperty(e)&&_t[e]?(""+t).trim():t+"px"}function Lr(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Fn(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Nr=B({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 hn(e,t){if(t){if(Nr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(a(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(a(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(t.style!=null&&typeof t.style!="object")throw Error(a(62))}}function bn(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 Vt=null;function ft(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,Qt=null,mn=null;function Yt(e){if(e=ql(e)){if(typeof Bn!="function")throw Error(a(280));var t=e.stateNode;t&&(t=Wi(t),Bn(e.stateNode,e.type,t))}}function Un(e){Qt?mn?mn.push(e):mn=[e]:Qt=e}function Wn(){if(Qt){var e=Qt,t=mn;if(mn=Qt=null,Yt(e),t)for(e=0;e>>=0,e===0?32:31-(ar(e)/zr|0)|0}var Zr=64,$r=4194304;function ur(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 Pr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,u=n&268435455;if(u!==0){var m=u&~l;m!==0?r=ur(m):(o&=u,o!==0&&(r=ur(o)))}else u=n&~l,u!==0?r=ur(u):o!==0&&(r=ur(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Rn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function jl(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=Bl),lu=" ",iu=!1;function ou(e,t){switch(e){case"keyup":return Qd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rl=!1;function Gd(e,t){switch(e){case"compositionend":return su(t);case"keypress":return t.which!==32?null:(iu=!0,lu);case"textInput":return e=t.data,e===lu&&iu?null:e;default:return null}}function Kd(e,t){if(rl)return e==="compositionend"||!Xo&&ou(e,t)?(e=Za(),Ii=Vo=fr=null,rl=!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)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=hu(n)}}function gu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vu(){for(var e=window,t=Ce();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ce(e.document)}return t}function $o(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 rp(e){var t=vu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gu(n.ownerDocument.documentElement,n)){if(r!==null&&$o(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,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=mu(n,o);var u=mu(n,r);l&&u&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.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=document.documentMode,ll=null,es=null,Vl=null,ts=!1;function yu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ts||ll==null||ll!==Ce(r)||(r=ll,"selectionStart"in r&&$o(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}),Vl&&Hl(Vl,r)||(Vl=r,r=bi(es,"onSelect"),0ul||(e.current=ps[ul],ps[ul]=null,ul--)}function je(e,t){ul++,ps[ul]=e.current,e.current=t}var mr={},wt=hr(mr),Mt=hr(!1),Mr=mr;function cl(e,t){var n=e.type.contextTypes;if(!n)return mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Dt(e){return e=e.childContextTypes,e!=null}function Hi(){Oe(Mt),Oe(wt)}function zu(e,t,n){if(wt.current!==mr)throw Error(a(168));je(wt,t),je(Mt,n)}function Pu(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(a(108,Se(e)||"Unknown",l));return B({},n,r)}function Vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Mr=wt.current,je(wt,e),je(Mt,Mt.current),!0}function Ou(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Pu(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,Oe(Mt),Oe(wt),je(wt,e)):Oe(Mt),je(Mt,n)}var Gn=null,Qi=!1,hs=!1;function Mu(e){Gn===null?Gn=[e]:Gn.push(e)}function mp(e){Qi=!0,Mu(e)}function gr(){if(!hs&&Gn!==null){hs=!0;var e=0,t=d;try{var n=Gn;for(d=1;e>=u,l-=u,Kn=1<<32-yt(t)+l|n<ae?(st=le,le=null):st=le.sibling;var ke=z(E,le,T[ae],D);if(ke===null){le===null&&(le=st);break}e&&le&&ke.alternate===null&&t(E,le),x=o(ke,x,ae),re===null?$=ke:re.sibling=ke,re=ke,le=st}if(ae===T.length)return n(E,le),De&&Fr(E,ae),$;if(le===null){for(;aeae?(st=le,le=null):st=le.sibling;var Cr=z(E,le,ke.value,D);if(Cr===null){le===null&&(le=st);break}e&&le&&Cr.alternate===null&&t(E,le),x=o(Cr,x,ae),re===null?$=Cr:re.sibling=Cr,re=Cr,le=st}if(ke.done)return n(E,le),De&&Fr(E,ae),$;if(le===null){for(;!ke.done;ae++,ke=T.next())ke=O(E,ke.value,D),ke!==null&&(x=o(ke,x,ae),re===null?$=ke:re.sibling=ke,re=ke);return De&&Fr(E,ae),$}for(le=r(E,le);!ke.done;ae++,ke=T.next())ke=U(le,E,ae,ke.value,D),ke!==null&&(e&&ke.alternate!==null&&le.delete(ke.key===null?ae:ke.key),x=o(ke,x,ae),re===null?$=ke:re.sibling=ke,re=ke);return e&&le.forEach(function(qp){return t(E,qp)}),De&&Fr(E,ae),$}function qe(E,x,T,D){if(typeof T=="object"&&T!==null&&T.type===Te&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case fe:e:{for(var $=T.key,re=x;re!==null;){if(re.key===$){if($=T.type,$===Te){if(re.tag===7){n(E,re.sibling),x=l(re,T.props.children),x.return=E,E=x;break e}}else if(re.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===Ve&&Wu($)===re.type){n(E,re.sibling),x=l(re,T.props),x.ref=Xl(E,re,T),x.return=E,E=x;break e}n(E,re);break}else t(E,re);re=re.sibling}T.type===Te?(x=Yr(T.props.children,E.mode,D,T.key),x.return=E,E=x):(D=wo(T.type,T.key,T.props,null,E.mode,D),D.ref=Xl(E,x,T),D.return=E,E=D)}return u(E);case de:e:{for(re=T.key;x!==null;){if(x.key===re)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){n(E,x.sibling),x=l(x,T.children||[]),x.return=E,E=x;break e}else{n(E,x);break}else t(E,x);x=x.sibling}x=fa(T,E.mode,D),x.return=E,E=x}return u(E);case Ve:return re=T._init,qe(E,x,re(T._payload),D)}if(Ne(T))return K(E,x,T,D);if(te(T))return X(E,x,T,D);qi(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,x!==null&&x.tag===6?(n(E,x.sibling),x=l(x,T),x.return=E,E=x):(n(E,x),x=ca(T,E.mode,D),x.return=E,E=x),u(E)):n(E,x)}return qe}var hl=Hu(!0),Vu=Hu(!1),Xi=hr(null),Ji=null,ml=null,ws=null;function ks(){ws=ml=Ji=null}function Ss(e){var t=Xi.current;Oe(Xi),e._currentValue=t}function Es(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 gl(e,t){Ji=e,ws=ml=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ft=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(ws!==e)if(e={context:e,memoizedValue:t,next:null},ml===null){if(Ji===null)throw Error(a(308));ml=e,Ji.dependencies={lanes:0,firstContext:e}}else ml=ml.next=e;return t}var br=null;function Ts(e){br===null?br=[e]:br.push(e)}function Qu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ts(t)):(n.next=l.next,l.next=n),t.interleaved=n,Xn(e,r)}function Xn(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 vr=!1;function Cs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yu(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 Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Xn(e,n)}return l=r.interleaved,l===null?(t.next=t,Ts(r)):(t.next=l.next,l.next=t),r.interleaved=t,Xn(e,n)}function Zi(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,M(e,n)}}function Gu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var u={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=u:o=o.next=u,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,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 $i(e,t,n,r){var l=e.updateQueue;vr=!1;var o=l.firstBaseUpdate,u=l.lastBaseUpdate,m=l.shared.pending;if(m!==null){l.shared.pending=null;var g=m,R=g.next;g.next=null,u===null?o=R:u.next=R,u=g;var P=e.alternate;P!==null&&(P=P.updateQueue,m=P.lastBaseUpdate,m!==u&&(m===null?P.firstBaseUpdate=R:m.next=R,P.lastBaseUpdate=g))}if(o!==null){var O=l.baseState;u=0,P=R=g=null,m=o;do{var z=m.lane,U=m.eventTime;if((r&z)===z){P!==null&&(P=P.next={eventTime:U,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var K=e,X=m;switch(z=t,U=n,X.tag){case 1:if(K=X.payload,typeof K=="function"){O=K.call(U,O,z);break e}O=K;break e;case 3:K.flags=K.flags&-65537|128;case 0:if(K=X.payload,z=typeof K=="function"?K.call(U,O,z):K,z==null)break e;O=B({},O,z);break e;case 2:vr=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,z=l.effects,z===null?l.effects=[m]:z.push(m))}else U={eventTime:U,lane:z,tag:m.tag,payload:m.payload,callback:m.callback,next:null},P===null?(R=P=U,g=O):P=P.next=U,u|=z;if(m=m.next,m===null){if(m=l.shared.pending,m===null)break;z=m,m=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);if(P===null&&(g=O),l.baseState=g,l.firstBaseUpdate=R,l.lastBaseUpdate=P,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Wr|=u,e.lanes=u,e.memoizedState=O}}function Ku(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ns.transition;Ns.transition={};try{e(!1),t()}finally{d=n,Ns.transition=r}}function pc(){return un().memoizedState}function xp(e,t,n){var r=Sr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hc(e))mc(t,n);else if(n=Qu(e,t,n,r),n!==null){var l=Lt();Tn(n,e,r,l),gc(n,t,r)}}function wp(e,t,n){var r=Sr(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hc(e))mc(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,m=o(u,n);if(l.hasEagerState=!0,l.eagerState=m,xn(m,u)){var g=t.interleaved;g===null?(l.next=l,Ts(t)):(l.next=g.next,g.next=l),t.interleaved=l;return}}catch{}finally{}n=Qu(e,t,l,r),n!==null&&(l=Lt(),Tn(n,e,r,l),gc(n,t,r))}}function hc(e){var t=e.alternate;return e===We||t!==null&&t===We}function mc(e,t){ei=no=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,M(e,n)}}var io={readContext:an,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},kp={readContext:an,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:ic,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ro(4194308,4,ac.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nn();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=xp.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:rc,useDebugValue:Ds,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=rc(!1),t=e[0];return e=yp.bind(null,e[1]),Nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,l=Nn();if(De){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ot===null)throw Error(a(349));(Ur&30)!==0||Zu(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,ic(ec.bind(null,r,o,e),[e]),r.flags|=2048,ri(9,$u.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Nn(),t=ot.identifierPrefix;if(De){var n=qn,r=Kn;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ti++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),n==="select"&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[An]=t,e[Kl]=r,Mc(e,t,!1,!1),t.stateNode=e;e:{switch(u=bn(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),l=r;break;case"iframe":case"object":case"embed":Pe("load",e),l=r;break;case"video":case"audio":for(l=0;lkl&&(t.flags|=128,r=!0,li(o,!1),t.lanes=4194304)}else{if(!r)if(e=eo(u),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),li(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!De)return St(t),null}else 2*_e()-o.renderingStartTime>kl&&n!==1073741824&&(t.flags|=128,r=!0,li(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(n=o.last,n!==null?n.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=Ue.current,je(Ue,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return sa(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Jt&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Lp(e,t){switch(gs(t),t.tag){case 1:return Dt(t.type)&&Hi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vl(),Oe(Mt),Oe(wt),Ls(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Rs(t),null;case 13:if(Oe(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Ue),null;case 4:return vl(),null;case 10:return Ss(t.type._context),null;case 22:case 23:return sa(),null;case 24:return null;default:return null}}var uo=!1,Et=!1,Np=typeof WeakSet=="function"?WeakSet:Set,V=null;function xl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ye(e,t,r)}else n.current=null}function qs(e,t,n){try{n()}catch(r){Ye(e,t,r)}}var bc=!1;function Ip(e,t){if(ss=Li,e=vu(),$o(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,m=-1,g=-1,R=0,P=0,O=e,z=null;t:for(;;){for(var U;O!==n||l!==0&&O.nodeType!==3||(m=u+l),O!==o||r!==0&&O.nodeType!==3||(g=u+r),O.nodeType===3&&(u+=O.nodeValue.length),(U=O.firstChild)!==null;)z=O,O=U;for(;;){if(O===e)break t;if(z===n&&++R===l&&(m=u),z===o&&++P===r&&(g=u),(U=O.nextSibling)!==null)break;O=z,z=O.parentNode}O=U}n=m===-1||g===-1?null:{start:m,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(as={focusedElem:e,selectionRange:n},Li=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var Y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Y!==null){var q=Y.memoizedProps,qe=Y.memoizedState,E=t.stateNode,x=E.getSnapshotBeforeUpdate(t.elementType===t.type?q:kn(t.type,q),qe);E.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(F){Ye(t,t.return,F)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return Y=bc,bc=!1,Y}function ii(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 o=l.destroy;l.destroy=void 0,o!==void 0&&qs(t,n,o)}l=l.next}while(l!==r)}}function co(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 Xs(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 Bc(e){var t=e.alternate;t!==null&&(e.alternate=null,Bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[An],delete t[Kl],delete t[ds],delete t[pp],delete t[hp])),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 Uc(e){return e.tag===5||e.tag===3||e.tag===4}function Wc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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 Js(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=Ui));else if(r!==4&&(e=e.child,e!==null))for(Js(e,t,n),e=e.sibling;e!==null;)Js(e,t,n),e=e.sibling}function Zs(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(Zs(e,t,n),e=e.sibling;e!==null;)Zs(e,t,n),e=e.sibling}var pt=null,Sn=!1;function xr(e,t,n){for(n=n.child;n!==null;)Hc(e,t,n),n=n.sibling}function Hc(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(jr,n)}catch{}switch(n.tag){case 5:Et||xl(n,t);case 6:var r=pt,l=Sn;pt=null,xr(e,t,n),pt=r,Sn=l,pt!==null&&(Sn?(e=pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Sn?(e=pt,n=n.stateNode,e.nodeType===8?fs(e.parentNode,n):e.nodeType===1&&fs(e,n),Dl(e)):fs(pt,n.stateNode));break;case 4:r=pt,l=Sn,pt=n.stateNode.containerInfo,Sn=!0,xr(e,t,n),pt=r,Sn=l;break;case 0:case 11:case 14:case 15:if(!Et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,u=o.destroy;o=o.tag,u!==void 0&&((o&2)!==0||(o&4)!==0)&&qs(n,t,u),l=l.next}while(l!==r)}xr(e,t,n);break;case 1:if(!Et&&(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(m){Ye(n,t,m)}xr(e,t,n);break;case 21:xr(e,t,n);break;case 22:n.mode&1?(Et=(r=Et)||n.memoizedState!==null,xr(e,t,n),Et=r):xr(e,t,n);break;default:xr(e,t,n)}}function Vc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Np),t.forEach(function(r){var l=Bp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=u),r&=~o}if(r=l,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zp(r/1960))-r,10e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,go=0,(xe&6)!==0)throw Error(a(331));var l=xe;for(xe|=4,V=e.current;V!==null;){var o=V,u=o.child;if((V.flags&16)!==0){var m=o.deletions;if(m!==null){for(var g=0;g_e()-ta?Vr(e,0):ea|=n),Bt(e,t)}function rf(e,t){t===0&&((e.mode&1)===0?t=1:(t=$r,$r<<=1,($r&130023424)===0&&($r=4194304)));var n=Lt();e=Xn(e,t),e!==null&&(Rn(e,t,n),Bt(e,n))}function bp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rf(e,n)}function Bp(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(a(314))}r!==null&&r.delete(t),rf(e,n)}var lf;lf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)Ft=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Ft=!1,Rp(e,t,n);Ft=(e.flags&131072)!==0}else Ft=!1,De&&(t.flags&1048576)!==0&&Du(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ao(e,t),e=t.pendingProps;var l=cl(t,wt.current);gl(t,n),l=js(null,t,r,e,l,n);var o=zs();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,Dt(r)?(o=!0,Vi(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Cs(t),l.updater=oo,t.stateNode=l,l._reactInternals=t,bs(t,r,e,n),t=Hs(null,t,r,!0,o,n)):(t.tag=0,De&&o&&ms(t),At(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ao(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Wp(r),e=kn(r,e),l){case 0:t=Ws(null,t,r,e,n);break e;case 1:t=Nc(null,t,r,e,n);break e;case 11:t=Cc(null,t,r,e,n);break e;case 14:t=_c(null,t,r,kn(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Ws(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Nc(e,t,r,l,n);case 3:e:{if(Ic(t),e===null)throw Error(a(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Yu(e,t),$i(t,r,null,n);var u=t.memoizedState;if(r=u.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=yl(Error(a(423)),t),t=jc(e,t,r,n,l);break e}else if(r!==l){l=yl(Error(a(424)),t),t=jc(e,t,r,n,l);break e}else for(Xt=pr(t.stateNode.containerInfo.firstChild),qt=t,De=!0,wn=null,n=Vu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pl(),r===l){t=Zn(e,t,n);break e}At(e,t,r,n)}t=t.child}return t;case 5:return qu(t),e===null&&ys(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,u=l.children,us(r,l)?u=null:o!==null&&us(r,o)&&(t.flags|=32),Lc(e,t),At(e,t,u,n),t.child;case 6:return e===null&&ys(t),null;case 13:return zc(e,t,n);case 4:return _s(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hl(t,null,r,n):At(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Cc(e,t,r,l,n);case 7:return At(e,t,t.pendingProps,n),t.child;case 8:return At(e,t,t.pendingProps.children,n),t.child;case 12:return At(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,u=l.value,je(Xi,r._currentValue),r._currentValue=u,o!==null)if(xn(o.value,u)){if(o.children===l.children&&!Mt.current){t=Zn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var m=o.dependencies;if(m!==null){u=o.child;for(var g=m.firstContext;g!==null;){if(g.context===r){if(o.tag===1){g=Jn(-1,n&-n),g.tag=2;var R=o.updateQueue;if(R!==null){R=R.shared;var P=R.pending;P===null?g.next=g:(g.next=P.next,P.next=g),R.pending=g}}o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),Es(o.return,n,t),m.lanes|=n;break}g=g.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(a(341));u.lanes|=n,m=u.alternate,m!==null&&(m.lanes|=n),Es(u,n,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}At(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,gl(t,n),l=an(l),r=r(l),t.flags|=1,At(e,t,r,n),t.child;case 14:return r=t.type,l=kn(r,t.pendingProps),l=kn(r.type,l),_c(e,t,r,l,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),ao(e,t),t.tag=1,Dt(r)?(e=!0,Vi(t)):e=!1,gl(t,n),yc(t,r,l),bs(t,r,l,n),Hs(null,t,r,!0,e,n);case 19:return Oc(e,t,n);case 22:return Ac(e,t,n)}throw Error(a(156,t.tag))};function of(e,t){return Ei(e,t)}function Up(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 fn(e,t,n,r){return new Up(e,t,n,r)}function ua(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wp(e){if(typeof e=="function")return ua(e)?1:0;if(e!=null){if(e=e.$$typeof,e===be)return 11;if(e===He)return 14}return 2}function Tr(e,t){var n=e.alternate;return n===null?(n=fn(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 wo(e,t,n,r,l,o){var u=2;if(r=e,typeof e=="function")ua(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Te:return Yr(n.children,l,o,t);case Ge:u=8,l|=8;break;case vt:return e=fn(12,n,t,l|2),e.elementType=vt,e.lanes=o,e;case Xe:return e=fn(13,n,t,l),e.elementType=Xe,e.lanes=o,e;case Ke:return e=fn(19,n,t,l),e.elementType=Ke,e.lanes=o,e;case ve:return ko(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fe:u=10;break e;case $t:u=9;break e;case be:u=11;break e;case He:u=14;break e;case Ve:u=16,r=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=fn(u,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Yr(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function ko(e,t,n,r){return e=fn(22,e,r,t),e.elementType=ve,e.lanes=n,e.stateNode={isHidden:!1},e}function ca(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hp(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=el(0),this.expirationTimes=el(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=el(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function da(e,t,n,r,l,o,u,m,g){return e=new Hp(e,t,n,m,g),t===1?(t=1,o===!0&&(t|=8)):t=0,o=fn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cs(o),e}function Vp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),ya.exports=rh(),ya.exports}var wf;function ih(){if(wf)return Ao;wf=1;var s=lh();return Ao.createRoot=s.createRoot,Ao.hydrateRoot=s.hydrateRoot,Ao}var oh=ih();const $f=location.hash.slice(1)||window.prompt("访问令牌(serve 启动时打印)")||"";function Fa(s){return new TextDecoder().decode(Uint8Array.from(atob(s),i=>i.charCodeAt(0)))}function xi(s){let i="";for(const a of new TextEncoder().encode(s))i+=String.fromCharCode(a);return btoa(i)}function fi(s){if(!s.data)return null;try{return JSON.parse(Fa(s.data))}catch{return null}}async function ki(s,i={}){const a=await fetch(s,{...i,headers:{Authorization:"Bearer "+$f,"Content-Type":"application/json",...i.headers||{}}});if(!a.ok){let c="HTTP "+a.status;try{const f=await a.json();f!=null&&f.error&&(c=f.error)}catch{}throw new Error(c)}return a.json()}const sh=()=>ki("/api/sessions"),ah=()=>ki("/api/models"),uh=(s,i,a=!1)=>ki("/api/sessions",{method:"POST",body:JSON.stringify({workdir:s,model:i,create_dir:a})}),ch=s=>ki(`/api/sessions/${s}`,{method:"DELETE"}),fh=(s,i)=>ki(`/api/sessions/${s}`,{method:"PATCH",body:JSON.stringify({archived:i})});async function dh(){var i;const s=window.__TAURI__;if(!((i=s==null?void 0:s.core)!=null&&i.invoke))return null;try{const a=await s.core.invoke("plugin:dialog|open",{options:{directory:!0,multiple:!1,title:"选择工作区目录"}});return typeof a=="string"?a:null}catch{return null}}function Ia(){var s,i;return!!((i=(s=window.__TAURI__)==null?void 0:s.core)!=null&&i.invoke)}async function ph(){var i;const s=window.__TAURI__;return(i=s==null?void 0:s.core)!=null&&i.invoke?await s.core.invoke("get_config"):null}async function hh(s){var a;const i=window.__TAURI__;if(!((a=i==null?void 0:i.core)!=null&&a.invoke))throw new Error("浏览器模式下配置只读,请在桌面应用中修改");await i.core.invoke("save_config",{config:s})}function mh(s){var a;const i=window.__TAURI__;(a=i==null?void 0:i.core)!=null&&a.invoke?i.core.invoke("plugin:opener|open_url",{url:s}).catch(c=>{console.error("opener 调用失败,退回导航守卫路径:",c),location.href=s}):window.open(s,"_blank","noopener,noreferrer")}function gh(s,i){var h;const a=window.__TAURI__,c=(h=a==null?void 0:a.event)==null?void 0:h.listen;if(!c)return()=>{};const f=c(s,i);return()=>{f.then(w=>w()).catch(()=>{})}}const vh=15e3,yh=2e3;function ed(s,i){let a=null,c=!1,f=[],h=!1,w=null;const v=new Map;function _(){h=!1;const M=f;f=[],M.length&&i.onFrames(M),f.length&&k()}function k(){h||(h=!0,requestAnimationFrame(_))}function A(){if(c)return;i.onStatus("连接中…",!1);const M=new WebSocket(`ws://${location.host}/ws?session=${s}&token=${$f}`);a=M,M.onopen=()=>i.onStatus("已连接",!0),M.onclose=()=>{a!==M||c||(i.onStatus("⚠ 连接断开,2 秒后自动重连…",!1),w=setTimeout(A,yh))},M.onmessage=L=>{let te;try{te=JSON.parse(L.data)}catch{return}if(te.type==="call-response"&&te.kind){const K=v.get(te.kind);if(K){v.delete(te.kind),clearTimeout(K.timer),K.resolve(te.data?JSON.parse(Fa(te.data)):{});return}}f.push(te),k()}}return A(),{send(M,L){return!a||a.readyState!==WebSocket.OPEN?(i.onStatus("⚠ 连接已断开,操作未发送;重连后请重试",!1),!1):(a.send(JSON.stringify({type:M,data:xi(JSON.stringify(L)),timestamp:Date.now()})),!0)},call(M,L={}){return new Promise((te,K)=>{if(!a||a.readyState!==WebSocket.OPEN){K(new Error("未连接"));return}const $=setTimeout(()=>{v.delete(M),K(new Error("call 超时"))},vh);v.set(M,{resolve:te,timer:$}),a.send(JSON.stringify({type:"call",kind:M,data:xi(JSON.stringify(L)),timestamp:Date.now()}))})},close(){c=!0,w&&clearTimeout(w);for(const[,M]of v)clearTimeout(M.timer);v.clear(),a&&(a.onclose=null,a.close())}}}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function kf(s,i){(i==null||i>s.length)&&(i=s.length);for(var a=0,c=Array(i);a2?c-2:0),h=2;h1?a-1:0),f=1;f"u"?null:et(BigInt.prototype.toString),Rf=typeof Symbol>"u"?null:et(Symbol.prototype.toString),ut=et(Object.prototype.hasOwnProperty),pi=et(Object.prototype.toString),at=et(RegExp.prototype.test),Gr=jh(TypeError);function et(s){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var a=arguments.length,c=new Array(a>1?a-1:0),f=1;f2&&arguments[2]!==void 0?arguments[2]:yi;if(Sf&&Sf(s,null),!Ar(i))return s;let c=i.length;for(;c--;){let f=i[c];if(typeof f=="string"){const h=a(f);h!==f&&(Th(i)||(i[c]=h),f=h)}s[f]=!0}return s}function zh(s){for(let i=0;i/g),Bh=gt(/\${[\w\W]*/g),Uh=gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wh=gt(/^aria-[\-\w]+$/),jf=gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hh=gt(/^(?:\w+script|data):/i),Vh=gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qh=gt(/^html$/i),Yh=gt(/^[a-z][.\w]*(-[.\w]+)+$/i),zf=gt(/<[/\w!]/g),Pf=gt(/<[/\w]/g),Gh=gt(/<\/no(script|embed|frames)/i),Kh=gt(/\/>/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qh=function(){return typeof window>"u"?null:window},Xh=function(i,a){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";a&&a.hasAttribute(f)&&(c=a.getAttribute(f));const h="dompurify"+(c?"#"+c:"");try{return i.createPolicy(h,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Of=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_r=function(i,a,c,f){return ut(i,a)&&Ar(i[a])?ye(f.base?Nt(f.base):{},i[a],f.transform):c};function rd(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qh();const i=D=>rd(D);if(i.version="3.4.12",i.removed=[],!s||!s.document||s.document.nodeType!==Zt.document||!s.Element)return i.isSupported=!1,i;let a=s.document;const c=a,f=c.currentScript;s.DocumentFragment;const h=s.HTMLTemplateElement,w=s.Node,v=s.Element,_=s.NodeFilter,k=s.NamedNodeMap;k===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const A=s.DOMParser,M=s.trustedTypes,L=v.prototype,te=jn(L,"cloneNode"),K=jn(L,"remove"),$=jn(L,"nextSibling"),se=jn(L,"childNodes"),Q=jn(L,"parentNode"),W=jn(L,"shadowRoot"),X=jn(L,"attributes"),ie=w&&w.prototype?jn(w.prototype,"nodeType"):null,fe=w&&w.prototype?jn(w.prototype,"nodeName"):null;if(typeof h=="function"){const D=a.createElement("template");D.content&&D.content.ownerDocument&&(a=D.content.ownerDocument)}let de,Te="",Ge,vt=!1,Fe=0;const $t=function(){if(Fe>0)throw Gr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},be=function(d){$t(),Fe++;try{return de.createHTML(d)}finally{Fe--}},Xe=function(d){$t(),Fe++;try{return de.createScriptURL(d)}finally{Fe--}},Ke=function(){return vt||(Ge=Xh(M,f),vt=!0),Ge},He=a,Ve=He.implementation,ve=He.createNodeIterator,b=He.createDocumentFragment,ee=He.getElementsByTagName,B=c.importNode;let y=Of();i.isSupported=typeof td=="function"&&typeof Q=="function"&&Ve&&Ve.createHTMLDocument!==void 0;const I=Fh,ue=bh,ce=Bh,he=Uh,me=Wh,Se=Hh,ge=Vh,Ee=Yh;let lt=jf,we=null;const rr=ye({},[...Af,...Sa,...Ea,...Ta,...Lf]);let Ce=null;const Pn=ye({},[...Nf,...Ca,...If,...Lo]);let Le=Object.seal(Rl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),dn=null,lr=null;const Wt=Object.seal(Rl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ir=!0,Ne=!0,Ht=!1,On=!0,jt=!1,zt=!0,Pt=!1,pn=!1,ct=null,Ot=null,Mn=!1,Ct=!1,_t=!1,Dn=!1,Fn=!0,Lr=!1;const Nr="user-content-";let hn=!0,bn=!1,Vt={},ft=null;const Bn=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Qt=null;const mn=ye({},["audio","video","img","source","image","track"]);let Yt=null;const Un=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wn="http://www.w3.org/1998/Math/MathML",Gt="http://www.w3.org/2000/svg",tt="http://www.w3.org/1999/xhtml";let en=tt,or=!1,gn=null;const Hn=ye({},[Wn,Gt,tt],ka),tn=mt(["mi","mo","mn","ms","mtext"]);let Ir=ye({},tn);const nn=mt(["annotation-xml"]);let vn=ye({},nn);const Vn=ye({},["title","style","font","a","script"]);let rn=null;const Xr=["application/xhtml+xml","text/html"],S="text/html";let N=null,J=null;const Qe=a.createElement("form"),dt=function(d){return d instanceof RegExp||d instanceof Function},_n=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(J&&J===d)return;(!d||typeof d!="object")&&(d={}),d=Nt(d),rn=Xr.indexOf(d.PARSER_MEDIA_TYPE)===-1?S:d.PARSER_MEDIA_TYPE,N=rn==="application/xhtml+xml"?ka:yi,we=_r(d,"ALLOWED_TAGS",rr,{transform:N}),Ce=_r(d,"ALLOWED_ATTR",Pn,{transform:N}),gn=_r(d,"ALLOWED_NAMESPACES",Hn,{transform:ka}),Yt=_r(d,"ADD_URI_SAFE_ATTR",Un,{transform:N,base:Un}),Qt=_r(d,"ADD_DATA_URI_TAGS",mn,{transform:N,base:mn}),ft=_r(d,"FORBID_CONTENTS",Bn,{transform:N}),dn=_r(d,"FORBID_TAGS",Nt({}),{transform:N}),lr=_r(d,"FORBID_ATTR",Nt({}),{transform:N}),Vt=ut(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?Nt(d.USE_PROFILES):d.USE_PROFILES:!1,ir=d.ALLOW_ARIA_ATTR!==!1,Ne=d.ALLOW_DATA_ATTR!==!1,Ht=d.ALLOW_UNKNOWN_PROTOCOLS||!1,On=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,jt=d.SAFE_FOR_TEMPLATES||!1,zt=d.SAFE_FOR_XML!==!1,Pt=d.WHOLE_DOCUMENT||!1,Ct=d.RETURN_DOM||!1,_t=d.RETURN_DOM_FRAGMENT||!1,Dn=d.RETURN_TRUSTED_TYPE||!1,Mn=d.FORCE_BODY||!1,Fn=d.SANITIZE_DOM!==!1,Lr=d.SANITIZE_NAMED_PROPS||!1,hn=d.KEEP_CONTENT!==!1,bn=d.IN_PLACE||!1,lt=Oh(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:jf,en=typeof d.NAMESPACE=="string"?d.NAMESPACE:tt,Ir=ut(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nt(d.MATHML_TEXT_INTEGRATION_POINTS):ye({},tn),vn=ut(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?Nt(d.HTML_INTEGRATION_POINTS):ye({},nn);const C=ut(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?Nt(d.CUSTOM_ELEMENT_HANDLING):Rl(null);if(Le=Rl(null),ut(C,"tagNameCheck")&&dt(C.tagNameCheck)&&(Le.tagNameCheck=C.tagNameCheck),ut(C,"attributeNameCheck")&&dt(C.attributeNameCheck)&&(Le.attributeNameCheck=C.attributeNameCheck),ut(C,"allowCustomizedBuiltInElements")&&typeof C.allowCustomizedBuiltInElements=="boolean"&&(Le.allowCustomizedBuiltInElements=C.allowCustomizedBuiltInElements),gt(Le),jt&&(Ne=!1),_t&&(Ct=!0),Vt&&(we=ye({},Lf),Ce=Rl(null),Vt.html===!0&&(ye(we,Af),ye(Ce,Nf)),Vt.svg===!0&&(ye(we,Sa),ye(Ce,Ca),ye(Ce,Lo)),Vt.svgFilters===!0&&(ye(we,Ea),ye(Ce,Ca),ye(Ce,Lo)),Vt.mathMl===!0&&(ye(we,Ta),ye(Ce,If),ye(Ce,Lo))),Wt.tagCheck=null,Wt.attributeCheck=null,ut(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?Wt.tagCheck=d.ADD_TAGS:Ar(d.ADD_TAGS)&&(we===rr&&(we=Nt(we)),ye(we,d.ADD_TAGS,N))),ut(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?Wt.attributeCheck=d.ADD_ATTR:Ar(d.ADD_ATTR)&&(Ce===Pn&&(Ce=Nt(Ce)),ye(Ce,d.ADD_ATTR,N))),ut(d,"ADD_URI_SAFE_ATTR")&&Ar(d.ADD_URI_SAFE_ATTR)&&ye(Yt,d.ADD_URI_SAFE_ATTR,N),ut(d,"FORBID_CONTENTS")&&Ar(d.FORBID_CONTENTS)&&(ft===Bn&&(ft=Nt(ft)),ye(ft,d.FORBID_CONTENTS,N)),ut(d,"ADD_FORBID_CONTENTS")&&Ar(d.ADD_FORBID_CONTENTS)&&(ft===Bn&&(ft=Nt(ft)),ye(ft,d.ADD_FORBID_CONTENTS,N)),hn&&(we["#text"]=!0),Pt&&ye(we,["html","head","body"]),we.table&&(ye(we,["tbody"]),delete dn.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const j=de;de=d.TRUSTED_TYPES_POLICY;try{Te=be("")}catch(H){throw de=j,H}}else d.TRUSTED_TYPES_POLICY===null?(de=void 0,Te=""):(de===void 0&&(de=Ke()),de&&typeof Te=="string"&&(Te=be("")));mt&&mt(d),J=d},Qn=ye({},[...Sa,...Ea,...Mh]),Al=ye({},[...Ta,...Dh]),Ei=function(d,C,j){return C.namespaceURI===tt?d==="svg":C.namespaceURI===Wn?d==="svg"&&(j==="annotation-xml"||Ir[j]):!!Qn[d]},Ti=function(d,C,j){return C.namespaceURI===tt?d==="math":C.namespaceURI===Gt?d==="math"&&vn[j]:!!Al[d]},Fo=function(d,C,j){return C.namespaceURI===Gt&&!vn[j]||C.namespaceURI===Wn&&!Ir[j]?!1:!Al[d]&&(Vn[d]||!Qn[d])},bo=function(d){let C=Q(d);(!C||!C.tagName)&&(C={namespaceURI:en,tagName:"template"});const j=yi(d.tagName),H=yi(C.tagName);return gn[d.namespaceURI]?d.namespaceURI===Gt?Ei(j,C,H):d.namespaceURI===Wn?Ti(j,C,H):d.namespaceURI===tt?Fo(j,C,H):!!(rn==="application/xhtml+xml"&&gn[d.namespaceURI]):!1},_e=function(d){Tl(i.removed,{element:d});try{Q(d).removeChild(d)}catch{if(K(d),!Q(d))throw Gr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Jr=function(d){sr(d);const C=se(d);if(C){const H=[];El(C,ne=>{Tl(H,ne)}),El(H,ne=>{try{K(ne)}catch{}})}const j=X(d);if(j)for(let H=j.length-1;H>=0;--H){const ne=j[H],oe=ne&&ne.name;if(typeof oe=="string")try{d.removeAttribute(oe)}catch{}}},yn=function(d,C){try{Tl(i.removed,{attribute:C.getAttributeNode(d),from:C})}catch{Tl(i.removed,{attribute:null,from:C})}if(C.removeAttribute(d),d==="is")if(Ct||_t)try{_e(C)}catch{}else try{C.setAttribute(d,"")}catch{}},Ci=function(d){const C=X(d);if(C)for(let j=C.length-1;j>=0;--j){const H=C[j],ne=H&&H.name;if(!(typeof ne!="string"||Ce[N(ne)]))try{d.removeAttribute(ne)}catch{}}},sr=function(d){const C=[d];for(;C.length>0;){const j=C.pop();(ie?ie(j):j.nodeType)===Zt.element&&Ci(j);const ne=se(j);if(ne)for(let oe=ne.length-1;oe>=0;--oe)C.push(ne[oe])}},Bo=function(d){if(!zt)return;const C=[d];for(;C.length>0;){const j=C.pop(),H=ie?ie(j):j.nodeType;if(H===Zt.processingInstruction||H===Zt.comment&&at(Pf,j.data)){try{K(j)}catch{}continue}if(H===Zt.element){const oe=j,ze=N(fe?fe(j):j.nodeName);try{oe.hasAttribute&&oe.hasAttribute("patchsrc")&&oe.removeAttribute("patchsrc"),oe.hasAttribute&&oe.hasAttribute("for")&&ze!=="label"&&ze!=="output"&&oe.removeAttribute("for")}catch{}}const ne=se(j);if(ne)for(let oe=ne.length-1;oe>=0;--oe)C.push(ne[oe])}},Ll=function(d){let C=null,j=null;if(Mn)d=""+d;else{const oe=Tf(d,/^[\r\n\t ]+/);j=oe&&oe[0]}rn==="application/xhtml+xml"&&en===tt&&(d=''+d+"");const H=de?be(d):d;if(en===tt)try{C=new A().parseFromString(H,rn)}catch{}if(!C||!C.documentElement){C=Ve.createDocument(en,"template",null);try{C.documentElement.innerHTML=or?Te:H}catch{}}const ne=C.body||C.documentElement;return d&&j&&ne.insertBefore(a.createTextNode(j),ne.childNodes[0]||null),en===tt?ee.call(C,Pt?"html":"body")[0]:Pt?C.documentElement:ne},jr=function(d){return ve.call(d.ownerDocument||d,d,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},Rt=function(d){return d=di(d,I," "),d=di(d,ue," "),d=di(d,ce," "),d},Nl=function(d){var C;d.normalize();const j=ve.call(d.ownerDocument||d,d,_.SHOW_TEXT|_.SHOW_COMMENT|_.SHOW_CDATA_SECTION|_.SHOW_PROCESSING_INSTRUCTION,null);let H=j.nextNode();for(;H;)H.data=Rt(H.data),H=j.nextNode();const ne=(C=d.querySelectorAll)===null||C===void 0?void 0:C.call(d,"template");ne&&El(ne,oe=>{ar(oe.content)&&Nl(oe.content)})},yt=function(d){const C=fe?fe(d):null;return typeof C!="string"||N(C)!=="form"?!1:typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||d.attributes!==X(d)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function"||d.nodeType!==ie(d)||d.childNodes!==se(d)},ar=function(d){if(!ie||typeof d!="object"||d===null)return!1;try{return ie(d)===Zt.documentFragment}catch{return!1}},zr=function(d){if(!ie||typeof d!="object"||d===null)return!1;try{return typeof ie(d)=="number"}catch{return!1}};function ln(D,d,C){D.length!==0&&El(D,j=>{j.call(i,d,C,J)})}const Zr=function(d,C){return!!(zt&&d.hasChildNodes()&&!zr(d.firstElementChild)&&at(zf,d.textContent)&&at(zf,d.innerHTML)||zt&&d.namespaceURI===tt&&C==="style"&&zr(d.firstElementChild)||d.nodeType===Zt.processingInstruction||zt&&d.nodeType===Zt.comment&&at(Pf,d.data))},$r=function(d,C){if(!dn[C]&&_i(C)&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,C)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(C)))return!1;if(hn&&!ft[C]){const j=Q(d),H=se(d);if(H&&j){const ne=H.length;for(let oe=ne-1;oe>=0;--oe){const ze=bn?H[oe]:te(H[oe],!0);j.insertBefore(ze,$(d))}}}return _e(d),!0},ur=function(d,C){if(ln(y.beforeSanitizeElements,d,null),d!==C&&Q(d)===null)return!0;if(yt(d))return _e(d),!0;const j=N(fe?fe(d):d.nodeName);if(ln(y.uponSanitizeElement,d,{tagName:j,allowedTags:we}),d!==C&&Q(d)===null)return!0;if(Zr(d,j))return _e(d),!0;if(dn[j]||!(Wt.tagCheck instanceof Function&&Wt.tagCheck(j))&&!we[j]){const ne=$r(d,j);return ne===!1&&ln(y.afterSanitizeElements,d,null),ne}if((ie?ie(d):d.nodeType)===Zt.element&&!bo(d)||(j==="noscript"||j==="noembed"||j==="noframes")&&at(Gh,d.innerHTML))return _e(d),!0;if(jt&&d.nodeType===Zt.text){const ne=Rt(d.textContent);d.textContent!==ne&&(Tl(i.removed,{element:d.cloneNode()}),d.textContent=ne)}return ln(y.afterSanitizeElements,d,null),!1},Pr=function(d,C,j){if(lr[C]||zt&&C==="patchsrc"||zt&&C==="for"&&d!=="label"&&d!=="output"||Fn&&(C==="id"||C==="name")&&(j in a||j in Qe))return!1;const H=Ce[C]||Wt.attributeCheck instanceof Function&&Wt.attributeCheck(C,d);if(!(Ne&&at(he,C))){if(!(ir&&at(me,C))){if(H){if(!Yt[C]){if(!at(lt,di(j,ge,""))){if(!((C==="src"||C==="xlink:href"||C==="href")&&d!=="script"&&Cf(j,"data:")===0&&Qt[d])){if(!(Ht&&!at(Se,di(j,ge,"")))){if(j)return!1}}}}}else if(!(_i(d)&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,d)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(d))&&(Le.attributeNameCheck instanceof RegExp&&at(Le.attributeNameCheck,C)||Le.attributeNameCheck instanceof Function&&Le.attributeNameCheck(C,d))||C==="is"&&Le.allowCustomizedBuiltInElements&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,j)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(j))))return!1}}return!0},Uo=ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_i=function(d){return!Uo[yi(d)]&&at(Ee,d)},Il=function(d,C,j,H){if(de&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!j)switch(M.getAttributeType(d,C)){case"TrustedHTML":return be(H);case"TrustedScriptURL":return Xe(H)}return H},Ri=function(d,C,j,H){try{j?d.setAttributeNS(j,C,H):d.setAttribute(C,H),yt(d)?_e(d):Ef(i.removed)}catch{yn(C,d)}},el=function(d){ln(y.beforeSanitizeAttributes,d,null);const C=d.attributes;if(!C||yt(d))return;const j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0};let H=C.length;const ne=N(d.nodeName);for(;H--;){const oe=C[H],ze=oe.name,Je=oe.namespaceURI,xt=oe.value,Be=N(ze),Ze=xt;let Me=ze==="value"?Ze:Lh(Ze);if(j.attrName=Be,j.attrValue=Me,j.keepAttr=!0,j.forceKeepAttr=void 0,ln(y.uponSanitizeAttribute,d,j),Me=j.attrValue,Lr&&(Be==="id"||Be==="name")&&Cf(Me,Nr)!==0&&(yn(ze,d),Me=Nr+Me),zt&&at(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){yn(ze,d);continue}if(Be==="attributename"&&Tf(Me,"href")){yn(ze,d);continue}if(!j.forceKeepAttr){if(!j.keepAttr){yn(ze,d);continue}if(!On&&at(Kh,Me)){yn(ze,d);continue}if(jt&&(Me=Rt(Me)),!Pr(ne,Be,Me)){yn(ze,d);continue}Me=Il(ne,Be,Je,Me),Me!==Ze&&Ri(d,ze,Je,Me)}}ln(y.afterSanitizeAttributes,d,null)},Rn=function(d){let C=null;const j=jr(d);for(ln(y.beforeSanitizeShadowDOM,d,null);C=j.nextNode();)if(ln(y.uponSanitizeShadowNode,C,null),ur(C,d),el(C),ar(C.content)&&Rn(C.content),(ie?ie(C):C.nodeType)===Zt.element){const ne=W(C);ar(ne)&&(jl(ne),Rn(ne))}ln(y.afterSanitizeShadowDOM,d,null)},jl=function(d){const C=[{node:d,shadow:null}];for(;C.length>0;){const j=C.pop();if(j.shadow){Rn(j.shadow);continue}const H=j.node,oe=(ie?ie(H):H.nodeType)===Zt.element,ze=se(H);if(ze)for(let Je=ze.length-1;Je>=0;--Je)C.push({node:ze[Je],shadow:null});if(oe){const Je=fe?fe(H):null;if(typeof Je=="string"&&N(Je)==="template"){const xt=H.content;ar(xt)&&C.push({node:xt,shadow:null})}}if(oe){const Je=W(H);ar(Je)&&C.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return i.sanitize=function(D){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,j=null,H=null,ne=null;if(or=!D,or&&(D="\x3C!-->"),typeof D!="string"&&!zr(D)&&(D=Ph(D),typeof D!="string"))throw Gr("dirty is not a string, aborting");if(!i.isSupported)return D;pn?(we=ct,Ce=Ot):_n(d),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(we=Nt(we)),y.uponSanitizeAttribute.length>0&&(Ce=Nt(Ce)),i.removed=[];const oe=bn&&typeof D!="string"&&zr(D);if(oe){Bo(D);const Be=fe?fe(D):D.nodeName;if(typeof Be=="string"){const Ze=N(Be);if(!we[Ze]||dn[Ze])throw Jr(D),Gr("root node is forbidden and cannot be sanitized in-place")}if(yt(D))throw Jr(D),Gr("root node is clobbered and cannot be sanitized in-place");try{jl(D)}catch(Ze){throw Jr(D),Ze}}else if(zr(D))C=Ll("\x3C!---->"),j=C.ownerDocument.importNode(D,!0),j.nodeType===Zt.element&&j.nodeName==="BODY"||j.nodeName==="HTML"?C=j:C.appendChild(j),jl(j);else{if(!Ct&&!jt&&!Pt&&D.indexOf("<")===-1)return de&&Dn?be(D):D;if(C=Ll(D),!C)return Ct?null:Dn?Te:""}C&&Mn&&_e(C.firstChild);const ze=oe?D:C,Je=jr(ze);try{for(;H=Je.nextNode();)ur(H,ze),el(H),ar(H.content)&&Rn(H.content)}catch(Be){throw oe&&(Jr(D),El(i.removed,Ze=>{Ze.element&&sr(Ze.element)})),Be}if(oe)return El(i.removed,Be=>{Be.element&&sr(Be.element)}),jt&&Nl(D),D;if(Ct){if(jt&&Nl(C),_t)for(ne=b.call(C.ownerDocument);C.firstChild;)ne.appendChild(C.firstChild);else ne=C;return(Ce.shadowroot||Ce.shadowrootmode)&&(ne=B.call(c,ne,!0)),ne}let xt=Pt?C.outerHTML:C.innerHTML;return Pt&&we["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&at(Qh,C.ownerDocument.doctype.name)&&(xt=" -`+xt),jt&&(xt=Rt(xt)),de&&Dn?be(xt):xt},i.setConfig=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(D),pn=!0,ct=we,Ot=Ce},i.clearConfig=function(){J=null,pn=!1,ct=null,Ot=null,de=Ge,Te=""},i.isValidAttribute=function(D,d,C){J||_n({});const j=N(D),H=N(d);return Pr(j,H,C)},i.addHook=function(D,d){typeof d=="function"&&ut(y,D)&&Tl(y[D],d)},i.removeHook=function(D,d){if(ut(y,D)){if(d!==void 0){const C=Rh(y[D],d);return C===-1?void 0:Ah(y[D],C,1)[0]}return Ef(y[D])}},i.removeHooks=function(D){ut(y,D)&&(y[D]=[])},i.removeAllHooks=function(){y=Of()},i}var Jh=rd();function ba(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qr=ba();function ld(s){qr=s}var wi={exec:()=>null};function Ae(s,i=""){let a=typeof s=="string"?s:s.source;const c={replace:(f,h)=>{let w=typeof h=="string"?h:h.source;return w=w.replace(It.caret,"$1"),a=a.replace(f,w),c},getRegex:()=>new RegExp(a,i)};return c}var It={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},Zh=/^(?:[ \t]*(?:\n|$))+/,$h=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,em=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Si=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ba=/(?:[*+-]|\d{1,9}[.)])/,id=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,od=Ae(id).replace(/bull/g,Ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nm=Ae(id).replace(/bull/g,Ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ua=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rm=/^[^\n]+/,Wa=/(?!\s*\])(?:\\.|[^\[\]\\])+/,lm=Ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),im=Ae(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ba).getRegex(),Mo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ha=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,om=Ae("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ha).replace("tag",Mo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sd=Ae(Ua).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex(),sm=Ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sd).getRegex(),Va={blockquote:sm,code:$h,def:lm,fences:em,heading:tm,hr:Si,html:om,lheading:od,list:im,newline:Zh,paragraph:sd,table:wi,text:rm},Mf=Ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex(),am={...Va,lheading:nm,table:Mf,paragraph:Ae(Ua).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex()},um={...Va,html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ha).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ae(Ua).replace("hr",Si).replace("heading",` *#{1,6} *[^ +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function Bs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Us(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Tp=typeof WeakMap=="function"?WeakMap:Map;function wc(e,t,n){n=Jn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ho||(ho=!0,na=r),Us(e,t)},n}function kc(e,t,n){n=Jn(-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(){Us(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Us(e,t),typeof r!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),n}function Sc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Tp;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=Fp.bind(null,e,t,n),t.then(e,e))}function Ec(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 Tc(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jn(-1,1),t.tag=2,yr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Cp=oe.ReactCurrentOwner,Ft=!1;function At(e,t,n,r){t.child=e===null?Vu(t,null,n,r):hl(t,e.child,n,r)}function Cc(e,t,n,r,l){n=n.render;var o=t.ref;return gl(t,l),r=js(e,t,n,r,o,l),n=zs(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zn(e,t,l)):(De&&n&&ms(t),t.flags|=1,At(e,t,r,l),t.child)}function _c(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!ua(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Rc(e,t,o,r,l)):(e=wo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&l)===0){var u=o.memoizedProps;if(n=n.compare,n=n!==null?n:Hl,n(u,r)&&e.ref===t.ref)return Zn(e,t,l)}return t.flags|=1,e=Tr(o,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(Hl(o,r)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=r=o,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Ft=!0);else return t.lanes=e.lanes,Zn(e,t,l)}return Ws(e,t,n,r,l)}function Ac(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(wl,Jt),Jt|=n;else{if((n&1073741824)===0)return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,je(wl,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,je(wl,Jt),Jt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,je(wl,Jt),Jt|=r;return At(e,t,l,n),t.child}function Lc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ws(e,t,n,r,l){var o=Dt(n)?Mr:wt.current;return o=cl(t,o),gl(t,l),n=js(e,t,n,r,o,l),r=zs(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Zn(e,t,l)):(De&&r&&ms(t),t.flags|=1,At(e,t,n,l),t.child)}function Nc(e,t,n,r,l){if(Dt(n)){var o=!0;Vi(t)}else o=!1;if(gl(t,l),t.stateNode===null)ao(e,t),yc(t,n,r),bs(t,n,r,l),r=!0;else if(e===null){var u=t.stateNode,m=t.memoizedProps;u.props=m;var g=u.context,R=n.contextType;typeof R=="object"&&R!==null?R=an(R):(R=Dt(n)?Mr:wt.current,R=cl(t,R));var P=n.getDerivedStateFromProps,O=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function";O||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==r||g!==R)&&xc(t,u,r,R),vr=!1;var z=t.memoizedState;u.state=z,$i(t,r,u,l),g=t.memoizedState,m!==r||z!==g||Mt.current||vr?(typeof P=="function"&&(Fs(t,n,P,r),g=t.memoizedState),(m=vr||vc(t,n,m,r,z,g,R))?(O||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=g),u.props=r,u.state=g,u.context=R,r=m):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,Yu(e,t),m=t.memoizedProps,R=t.type===t.elementType?m:kn(t.type,m),u.props=R,O=t.pendingProps,z=u.context,g=n.contextType,typeof g=="object"&&g!==null?g=an(g):(g=Dt(n)?Mr:wt.current,g=cl(t,g));var U=n.getDerivedStateFromProps;(P=typeof U=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==O||z!==g)&&xc(t,u,r,g),vr=!1,z=t.memoizedState,u.state=z,$i(t,r,u,l);var K=t.memoizedState;m!==O||z!==K||Mt.current||vr?(typeof U=="function"&&(Fs(t,n,U,r),K=t.memoizedState),(R=vr||vc(t,n,R,r,z,K,g)||!1)?(P||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,K,g),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,K,g)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=K),u.props=r,u.state=K,u.context=g,r=R):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),r=!1)}return Hs(e,t,n,r,o,l)}function Hs(e,t,n,r,l,o){Lc(e,t);var u=(t.flags&128)!==0;if(!r&&!u)return l&&Ou(t,n,!1),Zn(e,t,o);r=t.stateNode,Cp.current=t;var m=u&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&u?(t.child=hl(t,e.child,null,o),t.child=hl(t,null,m,o)):At(e,t,m,o),t.memoizedState=r.state,l&&Ou(t,n,!0),t.child}function Ic(e){var t=e.stateNode;t.pendingContext?zu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zu(e,t.context,!1),_s(e,t.containerInfo)}function jc(e,t,n,r,l){return pl(),xs(l),t.flags|=256,At(e,t,n,r),t.child}var Vs={dehydrated:null,treeContext:null,retryLane:0};function Qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function zc(e,t,n){var r=t.pendingProps,l=Ue.current,o=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(l&2)!==0),m?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),je(Ue,l&1),e===null)return ys(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(u=r.children,e=r.fallback,o?(r=t.mode,o=t.child,u={mode:"hidden",children:u},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=u):o=ko(u,r,0,null),e=Yr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Qs(n),t.memoizedState=Vs,e):Ys(t,u));if(l=e.memoizedState,l!==null&&(m=l.dehydrated,m!==null))return _p(e,t,u,r,m,l,n);if(o){o=r.fallback,u=t.mode,l=e.child,m=l.sibling;var g={mode:"hidden",children:r.children};return(u&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=g,t.deletions=null):(r=Tr(l,g),r.subtreeFlags=l.subtreeFlags&14680064),m!==null?o=Tr(m,o):(o=Yr(o,u,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,u=e.child.memoizedState,u=u===null?Qs(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},o.memoizedState=u,o.childLanes=e.childLanes&~n,t.memoizedState=Vs,r}return o=e.child,e=o.sibling,r=Tr(o,{mode:"visible",children:r.children}),(t.mode&1)===0&&(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 Ys(e,t){return t=ko({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function so(e,t,n,r){return r!==null&&xs(r),hl(t,e.child,null,n),e=Ys(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _p(e,t,n,r,l,o,u){if(n)return t.flags&256?(t.flags&=-257,r=Bs(Error(a(422))),so(e,t,u,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=ko({mode:"visible",children:r.children},l,0,null),o=Yr(o,l,u,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,(t.mode&1)!==0&&hl(t,e.child,null,u),t.child.memoizedState=Qs(u),t.memoizedState=Vs,o);if((t.mode&1)===0)return so(e,t,u,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var m=r.dgst;return r=m,o=Error(a(419)),r=Bs(o,r,void 0),so(e,t,u,r)}if(m=(u&e.childLanes)!==0,Ft||m){if(r=ot,r!==null){switch(u&-u){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|u))!==0?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,Xn(e,l),Tn(r,e,l,-1))}return aa(),r=Bs(Error(a(421))),so(e,t,u,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=bp.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,Xt=pr(l.nextSibling),qt=t,De=!0,wn=null,e!==null&&(on[sn++]=Kn,on[sn++]=qn,on[sn++]=Dr,Kn=e.id,qn=e.overflow,Dr=t),t=Ys(t,r.children),t.flags|=4096,t)}function Pc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Es(e.return,t,n)}function Gs(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function Oc(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(At(e,t,r.children,n),r=Ue.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pc(e,n,t);else if(e.tag===19)Pc(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(je(Ue,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Gs(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&eo(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Gs(t,!0,n,null,o);break;case"together":Gs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ao(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wr|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rp(e,t,n){switch(t.tag){case 3:Ic(t),pl();break;case 5:qu(t);break;case 1:Dt(t.type)&&Vi(t);break;case 4:_s(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;je(Xi,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(je(Ue,Ue.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?zc(e,t,n):(je(Ue,Ue.current&1),e=Zn(e,t,n),e!==null?e.sibling:null);je(Ue,Ue.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){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),je(Ue,Ue.current),r)break;return null;case 22:case 23:return t.lanes=0,Ac(e,t,n)}return Zn(e,t,n)}var Mc,Ks,Dc,Fc;Mc=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}},Ks=function(){},Dc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Br(Ln.current);var o=null;switch(n){case"input":l=Pn(e,l),r=Pn(e,r),o=[];break;case"select":l=B({},l,{value:void 0}),r=B({},r,{value:void 0}),o=[];break;case"textarea":l=On(e,l),r=On(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ui)}hn(n,r);var u;n=null;for(R in l)if(!r.hasOwnProperty(R)&&l.hasOwnProperty(R)&&l[R]!=null)if(R==="style"){var m=l[R];for(u in m)m.hasOwnProperty(u)&&(n||(n={}),n[u]="")}else R!=="dangerouslySetInnerHTML"&&R!=="children"&&R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&R!=="autoFocus"&&(f.hasOwnProperty(R)?o||(o=[]):(o=o||[]).push(R,null));for(R in r){var g=r[R];if(m=l!=null?l[R]:void 0,r.hasOwnProperty(R)&&g!==m&&(g!=null||m!=null))if(R==="style")if(m){for(u in m)!m.hasOwnProperty(u)||g&&g.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in g)g.hasOwnProperty(u)&&m[u]!==g[u]&&(n||(n={}),n[u]=g[u])}else n||(o||(o=[]),o.push(R,n)),n=g;else R==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,m=m?m.__html:void 0,g!=null&&m!==g&&(o=o||[]).push(R,g)):R==="children"?typeof g!="string"&&typeof g!="number"||(o=o||[]).push(R,""+g):R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&(f.hasOwnProperty(R)?(g!=null&&R==="onScroll"&&Pe("scroll",e),o||m===g||(o=[])):(o=o||[]).push(R,g))}n&&(o=o||[]).push("style",n);var R=o;(t.updateQueue=R)&&(t.flags|=4)}},Fc=function(e,t,n,r){n!==r&&(t.flags|=4)};function li(e,t){if(!De)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 St(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 Ap(e,t,n){var r=t.pendingProps;switch(gs(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return Dt(t.type)&&Hi(),St(t),null;case 3:return r=t.stateNode,vl(),Oe(Mt),Oe(wt),Ls(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wn!==null&&(ia(wn),wn=null))),Ks(e,t),St(t),null;case 5:Rs(t);var l=Br($l.current);if(n=t.type,e!==null&&t.stateNode!=null)Dc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(a(166));return St(t),null}if(e=Br(Ln.current),Ki(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[An]=t,r[Kl]=o,e=(t.mode&1)!==0,n){case"dialog":Pe("cancel",r),Pe("close",r);break;case"iframe":case"object":case"embed":Pe("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),n==="select"&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[An]=t,e[Kl]=r,Mc(e,t,!1,!1),t.stateNode=e;e:{switch(u=bn(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),l=r;break;case"iframe":case"object":case"embed":Pe("load",e),l=r;break;case"video":case"audio":for(l=0;lkl&&(t.flags|=128,r=!0,li(o,!1),t.lanes=4194304)}else{if(!r)if(e=eo(u),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),li(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!De)return St(t),null}else 2*_e()-o.renderingStartTime>kl&&n!==1073741824&&(t.flags|=128,r=!0,li(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(n=o.last,n!==null?n.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_e(),t.sibling=null,n=Ue.current,je(Ue,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return sa(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Jt&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Lp(e,t){switch(gs(t),t.tag){case 1:return Dt(t.type)&&Hi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vl(),Oe(Mt),Oe(wt),Ls(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Rs(t),null;case 13:if(Oe(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Ue),null;case 4:return vl(),null;case 10:return Ss(t.type._context),null;case 22:case 23:return sa(),null;case 24:return null;default:return null}}var uo=!1,Et=!1,Np=typeof WeakSet=="function"?WeakSet:Set,Q=null;function xl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ye(e,t,r)}else n.current=null}function qs(e,t,n){try{n()}catch(r){Ye(e,t,r)}}var bc=!1;function Ip(e,t){if(ss=Li,e=vu(),$o(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,m=-1,g=-1,R=0,P=0,O=e,z=null;t:for(;;){for(var U;O!==n||l!==0&&O.nodeType!==3||(m=u+l),O!==o||r!==0&&O.nodeType!==3||(g=u+r),O.nodeType===3&&(u+=O.nodeValue.length),(U=O.firstChild)!==null;)z=O,O=U;for(;;){if(O===e)break t;if(z===n&&++R===l&&(m=u),z===o&&++P===r&&(g=u),(U=O.nextSibling)!==null)break;O=z,z=O.parentNode}O=U}n=m===-1||g===-1?null:{start:m,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(as={focusedElem:e,selectionRange:n},Li=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var K=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(K!==null){var X=K.memoizedProps,qe=K.memoizedState,E=t.stateNode,x=E.getSnapshotBeforeUpdate(t.elementType===t.type?X:kn(t.type,X),qe);E.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(D){Ye(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return K=bc,bc=!1,K}function ii(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 o=l.destroy;l.destroy=void 0,o!==void 0&&qs(t,n,o)}l=l.next}while(l!==r)}}function co(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 Xs(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 Bc(e){var t=e.alternate;t!==null&&(e.alternate=null,Bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[An],delete t[Kl],delete t[ds],delete t[pp],delete t[hp])),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 Uc(e){return e.tag===5||e.tag===3||e.tag===4}function Wc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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 Js(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=Ui));else if(r!==4&&(e=e.child,e!==null))for(Js(e,t,n),e=e.sibling;e!==null;)Js(e,t,n),e=e.sibling}function Zs(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(Zs(e,t,n),e=e.sibling;e!==null;)Zs(e,t,n),e=e.sibling}var pt=null,Sn=!1;function xr(e,t,n){for(n=n.child;n!==null;)Hc(e,t,n),n=n.sibling}function Hc(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(jr,n)}catch{}switch(n.tag){case 5:Et||xl(n,t);case 6:var r=pt,l=Sn;pt=null,xr(e,t,n),pt=r,Sn=l,pt!==null&&(Sn?(e=pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Sn?(e=pt,n=n.stateNode,e.nodeType===8?fs(e.parentNode,n):e.nodeType===1&&fs(e,n),Dl(e)):fs(pt,n.stateNode));break;case 4:r=pt,l=Sn,pt=n.stateNode.containerInfo,Sn=!0,xr(e,t,n),pt=r,Sn=l;break;case 0:case 11:case 14:case 15:if(!Et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,u=o.destroy;o=o.tag,u!==void 0&&((o&2)!==0||(o&4)!==0)&&qs(n,t,u),l=l.next}while(l!==r)}xr(e,t,n);break;case 1:if(!Et&&(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(m){Ye(n,t,m)}xr(e,t,n);break;case 21:xr(e,t,n);break;case 22:n.mode&1?(Et=(r=Et)||n.memoizedState!==null,xr(e,t,n),Et=r):xr(e,t,n);break;default:xr(e,t,n)}}function Vc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Np),t.forEach(function(r){var l=Bp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=u),r&=~o}if(r=l,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zp(r/1960))-r,10e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,go=0,(xe&6)!==0)throw Error(a(331));var l=xe;for(xe|=4,Q=e.current;Q!==null;){var o=Q,u=o.child;if((Q.flags&16)!==0){var m=o.deletions;if(m!==null){for(var g=0;g_e()-ta?Vr(e,0):ea|=n),Bt(e,t)}function rf(e,t){t===0&&((e.mode&1)===0?t=1:(t=$r,$r<<=1,($r&130023424)===0&&($r=4194304)));var n=Lt();e=Xn(e,t),e!==null&&(Rn(e,t,n),Bt(e,n))}function bp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rf(e,n)}function Bp(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(a(314))}r!==null&&r.delete(t),rf(e,n)}var lf;lf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)Ft=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Ft=!1,Rp(e,t,n);Ft=(e.flags&131072)!==0}else Ft=!1,De&&(t.flags&1048576)!==0&&Du(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ao(e,t),e=t.pendingProps;var l=cl(t,wt.current);gl(t,n),l=js(null,t,r,e,l,n);var o=zs();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,Dt(r)?(o=!0,Vi(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Cs(t),l.updater=oo,t.stateNode=l,l._reactInternals=t,bs(t,r,e,n),t=Hs(null,t,r,!0,o,n)):(t.tag=0,De&&o&&ms(t),At(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ao(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Wp(r),e=kn(r,e),l){case 0:t=Ws(null,t,r,e,n);break e;case 1:t=Nc(null,t,r,e,n);break e;case 11:t=Cc(null,t,r,e,n);break e;case 14:t=_c(null,t,r,kn(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Ws(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Nc(e,t,r,l,n);case 3:e:{if(Ic(t),e===null)throw Error(a(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Yu(e,t),$i(t,r,null,n);var u=t.memoizedState;if(r=u.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=yl(Error(a(423)),t),t=jc(e,t,r,n,l);break e}else if(r!==l){l=yl(Error(a(424)),t),t=jc(e,t,r,n,l);break e}else for(Xt=pr(t.stateNode.containerInfo.firstChild),qt=t,De=!0,wn=null,n=Vu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pl(),r===l){t=Zn(e,t,n);break e}At(e,t,r,n)}t=t.child}return t;case 5:return qu(t),e===null&&ys(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,u=l.children,us(r,l)?u=null:o!==null&&us(r,o)&&(t.flags|=32),Lc(e,t),At(e,t,u,n),t.child;case 6:return e===null&&ys(t),null;case 13:return zc(e,t,n);case 4:return _s(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hl(t,null,r,n):At(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),Cc(e,t,r,l,n);case 7:return At(e,t,t.pendingProps,n),t.child;case 8:return At(e,t,t.pendingProps.children,n),t.child;case 12:return At(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,u=l.value,je(Xi,r._currentValue),r._currentValue=u,o!==null)if(xn(o.value,u)){if(o.children===l.children&&!Mt.current){t=Zn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var m=o.dependencies;if(m!==null){u=o.child;for(var g=m.firstContext;g!==null;){if(g.context===r){if(o.tag===1){g=Jn(-1,n&-n),g.tag=2;var R=o.updateQueue;if(R!==null){R=R.shared;var P=R.pending;P===null?g.next=g:(g.next=P.next,P.next=g),R.pending=g}}o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),Es(o.return,n,t),m.lanes|=n;break}g=g.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(a(341));u.lanes|=n,m=u.alternate,m!==null&&(m.lanes|=n),Es(u,n,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}At(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,gl(t,n),l=an(l),r=r(l),t.flags|=1,At(e,t,r,n),t.child;case 14:return r=t.type,l=kn(r,t.pendingProps),l=kn(r.type,l),_c(e,t,r,l,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kn(r,l),ao(e,t),t.tag=1,Dt(r)?(e=!0,Vi(t)):e=!1,gl(t,n),yc(t,r,l),bs(t,r,l,n),Hs(null,t,r,!0,e,n);case 19:return Oc(e,t,n);case 22:return Ac(e,t,n)}throw Error(a(156,t.tag))};function of(e,t){return Ei(e,t)}function Up(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 fn(e,t,n,r){return new Up(e,t,n,r)}function ua(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wp(e){if(typeof e=="function")return ua(e)?1:0;if(e!=null){if(e=e.$$typeof,e===be)return 11;if(e===He)return 14}return 2}function Tr(e,t){var n=e.alternate;return n===null?(n=fn(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 wo(e,t,n,r,l,o){var u=2;if(r=e,typeof e=="function")ua(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Te:return Yr(n.children,l,o,t);case Ge:u=8,l|=8;break;case vt:return e=fn(12,n,t,l|2),e.elementType=vt,e.lanes=o,e;case Xe:return e=fn(13,n,t,l),e.elementType=Xe,e.lanes=o,e;case Ke:return e=fn(19,n,t,l),e.elementType=Ke,e.lanes=o,e;case ve:return ko(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fe:u=10;break e;case $t:u=9;break e;case be:u=11;break e;case He:u=14;break e;case Ve:u=16,r=null;break e}throw Error(a(130,e==null?e:typeof e,""))}return t=fn(u,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Yr(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function ko(e,t,n,r){return e=fn(22,e,r,t),e.elementType=ve,e.lanes=n,e.stateNode={isHidden:!1},e}function ca(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hp(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=el(0),this.expirationTimes=el(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=el(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function da(e,t,n,r,l,o,u,m,g){return e=new Hp(e,t,n,m,g),t===1?(t=1,o===!0&&(t|=8)):t=0,o=fn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cs(o),e}function Vp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),ya.exports=rh(),ya.exports}var wf;function ih(){if(wf)return Ao;wf=1;var s=lh();return Ao.createRoot=s.createRoot,Ao.hydrateRoot=s.hydrateRoot,Ao}var oh=ih();const $f=location.hash.slice(1)||window.prompt("访问令牌(serve 启动时打印)")||"";function Fa(s){return new TextDecoder().decode(Uint8Array.from(atob(s),i=>i.charCodeAt(0)))}function xi(s){let i="";for(const a of new TextEncoder().encode(s))i+=String.fromCharCode(a);return btoa(i)}function fi(s){if(!s.data)return null;try{return JSON.parse(Fa(s.data))}catch{return null}}async function ki(s,i={}){const a=await fetch(s,{...i,headers:{Authorization:"Bearer "+$f,"Content-Type":"application/json",...i.headers||{}}});if(!a.ok){let c="HTTP "+a.status;try{const f=await a.json();f!=null&&f.error&&(c=f.error)}catch{}throw new Error(c)}return a.json()}const sh=()=>ki("/api/sessions"),ah=()=>ki("/api/models"),uh=(s,i,a=!1)=>ki("/api/sessions",{method:"POST",body:JSON.stringify({workdir:s,model:i,create_dir:a})}),ch=s=>ki(`/api/sessions/${s}`,{method:"DELETE"}),fh=(s,i)=>ki(`/api/sessions/${s}`,{method:"PATCH",body:JSON.stringify({archived:i})});async function dh(){var i;const s=window.__TAURI__;if(!((i=s==null?void 0:s.core)!=null&&i.invoke))return null;try{const a=await s.core.invoke("plugin:dialog|open",{options:{directory:!0,multiple:!1,title:"选择工作区目录"}});return typeof a=="string"?a:null}catch{return null}}function Ia(){var s,i;return!!((i=(s=window.__TAURI__)==null?void 0:s.core)!=null&&i.invoke)}async function ph(){var i;const s=window.__TAURI__;return(i=s==null?void 0:s.core)!=null&&i.invoke?await s.core.invoke("get_config"):null}async function hh(s){var a;const i=window.__TAURI__;if(!((a=i==null?void 0:i.core)!=null&&a.invoke))throw new Error("浏览器模式下配置只读,请在桌面应用中修改");await i.core.invoke("save_config",{config:s})}function mh(s){var a;const i=window.__TAURI__;(a=i==null?void 0:i.core)!=null&&a.invoke?i.core.invoke("plugin:opener|open_url",{url:s}).catch(c=>{console.error("opener 调用失败,退回导航守卫路径:",c),location.href=s}):window.open(s,"_blank","noopener,noreferrer")}function gh(s,i){var h;const a=window.__TAURI__,c=(h=a==null?void 0:a.event)==null?void 0:h.listen;if(!c)return()=>{};const f=c(s,i);return()=>{f.then(w=>w()).catch(()=>{})}}const vh=15e3,yh=2e3;function ed(s,i){let a=null,c=!1,f=[],h=!1,w=null;const v=new Map;function _(){h=!1;const F=f;f=[],F.length&&i.onFrames(F),f.length&&k()}function k(){h||(h=!0,requestAnimationFrame(_))}function A(){if(c)return;i.onStatus("连接中…",!1);const F=new WebSocket(`ws://${location.host}/ws?session=${s}&token=${$f}`);a=F,F.onopen=()=>i.onStatus("已连接",!0),F.onclose=()=>{a!==F||c||(i.onStatus("⚠ 连接断开,2 秒后自动重连…",!1),w=setTimeout(A,yh))},F.onmessage=N=>{let ee;try{ee=JSON.parse(N.data)}catch{return}if(ee.type==="call-response"&&ee.kind){const W=v.get(ee.kind);if(W){v.delete(ee.kind),clearTimeout(W.timer),W.resolve(ee.data?JSON.parse(Fa(ee.data)):{});return}}f.push(ee),k()}}return A(),{send(F,N){return!a||a.readyState!==WebSocket.OPEN?(i.onStatus("⚠ 连接已断开,操作未发送;重连后请重试",!1),!1):(a.send(JSON.stringify({type:F,data:xi(JSON.stringify(N)),timestamp:Date.now()})),!0)},call(F,N={}){return new Promise((ee,W)=>{if(!a||a.readyState!==WebSocket.OPEN){W(new Error("未连接"));return}const q=setTimeout(()=>{v.delete(F),W(new Error("call 超时"))},vh);v.set(F,{resolve:ee,timer:q}),a.send(JSON.stringify({type:"call",kind:F,data:xi(JSON.stringify(N)),timestamp:Date.now()}))})},close(){c=!0,w&&clearTimeout(w);for(const[,F]of v)clearTimeout(F.timer);v.clear(),a&&(a.onclose=null,a.close())}}}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function kf(s,i){(i==null||i>s.length)&&(i=s.length);for(var a=0,c=Array(i);a2?c-2:0),h=2;h1?a-1:0),f=1;f"u"?null:et(BigInt.prototype.toString),Rf=typeof Symbol>"u"?null:et(Symbol.prototype.toString),ut=et(Object.prototype.hasOwnProperty),pi=et(Object.prototype.toString),at=et(RegExp.prototype.test),Gr=jh(TypeError);function et(s){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var a=arguments.length,c=new Array(a>1?a-1:0),f=1;f2&&arguments[2]!==void 0?arguments[2]:yi;if(Sf&&Sf(s,null),!Ar(i))return s;let c=i.length;for(;c--;){let f=i[c];if(typeof f=="string"){const h=a(f);h!==f&&(Th(i)||(i[c]=h),f=h)}s[f]=!0}return s}function zh(s){for(let i=0;i/g),Bh=gt(/\${[\w\W]*/g),Uh=gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wh=gt(/^aria-[\-\w]+$/),jf=gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hh=gt(/^(?:\w+script|data):/i),Vh=gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qh=gt(/^html$/i),Yh=gt(/^[a-z][.\w]*(-[.\w]+)+$/i),zf=gt(/<[/\w!]/g),Pf=gt(/<[/\w]/g),Gh=gt(/<\/no(script|embed|frames)/i),Kh=gt(/\/>/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qh=function(){return typeof window>"u"?null:window},Xh=function(i,a){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";a&&a.hasAttribute(f)&&(c=a.getAttribute(f));const h="dompurify"+(c?"#"+c:"");try{return i.createPolicy(h,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Of=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_r=function(i,a,c,f){return ut(i,a)&&Ar(i[a])?ye(f.base?Nt(f.base):{},i[a],f.transform):c};function rd(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qh();const i=M=>rd(M);if(i.version="3.4.12",i.removed=[],!s||!s.document||s.document.nodeType!==Zt.document||!s.Element)return i.isSupported=!1,i;let a=s.document;const c=a,f=c.currentScript;s.DocumentFragment;const h=s.HTMLTemplateElement,w=s.Node,v=s.Element,_=s.NodeFilter,k=s.NamedNodeMap;k===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const A=s.DOMParser,F=s.trustedTypes,N=v.prototype,ee=jn(N,"cloneNode"),W=jn(N,"remove"),q=jn(N,"nextSibling"),ie=jn(N,"childNodes"),Y=jn(N,"parentNode"),H=jn(N,"shadowRoot"),J=jn(N,"attributes"),oe=w&&w.prototype?jn(w.prototype,"nodeType"):null,fe=w&&w.prototype?jn(w.prototype,"nodeName"):null;if(typeof h=="function"){const M=a.createElement("template");M.content&&M.content.ownerDocument&&(a=M.content.ownerDocument)}let de,Te="",Ge,vt=!1,Fe=0;const $t=function(){if(Fe>0)throw Gr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},be=function(d){$t(),Fe++;try{return de.createHTML(d)}finally{Fe--}},Xe=function(d){$t(),Fe++;try{return de.createScriptURL(d)}finally{Fe--}},Ke=function(){return vt||(Ge=Xh(F,f),vt=!0),Ge},He=a,Ve=He.implementation,ve=He.createNodeIterator,b=He.createDocumentFragment,te=He.getElementsByTagName,B=c.importNode;let y=Of();i.isSupported=typeof td=="function"&&typeof Y=="function"&&Ve&&Ve.createHTMLDocument!==void 0;const I=Fh,ue=bh,ce=Bh,he=Uh,me=Wh,Se=Hh,ge=Vh,Ee=Yh;let lt=jf,we=null;const rr=ye({},[...Af,...Sa,...Ea,...Ta,...Lf]);let Ce=null;const Pn=ye({},[...Nf,...Ca,...If,...Lo]);let Le=Object.seal(Rl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),dn=null,lr=null;const Wt=Object.seal(Rl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ir=!0,Ne=!0,Ht=!1,On=!0,jt=!1,zt=!0,Pt=!1,pn=!1,ct=null,Ot=null,Mn=!1,Ct=!1,_t=!1,Dn=!1,Fn=!0,Lr=!1;const Nr="user-content-";let hn=!0,bn=!1,Vt={},ft=null;const Bn=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Qt=null;const mn=ye({},["audio","video","img","source","image","track"]);let Yt=null;const Un=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wn="http://www.w3.org/1998/Math/MathML",Gt="http://www.w3.org/2000/svg",tt="http://www.w3.org/1999/xhtml";let en=tt,or=!1,gn=null;const Hn=ye({},[Wn,Gt,tt],ka),tn=mt(["mi","mo","mn","ms","mtext"]);let Ir=ye({},tn);const nn=mt(["annotation-xml"]);let vn=ye({},nn);const Vn=ye({},["title","style","font","a","script"]);let rn=null;const Xr=["application/xhtml+xml","text/html"],S="text/html";let L=null,Z=null;const Qe=a.createElement("form"),dt=function(d){return d instanceof RegExp||d instanceof Function},_n=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Z&&Z===d)return;(!d||typeof d!="object")&&(d={}),d=Nt(d),rn=Xr.indexOf(d.PARSER_MEDIA_TYPE)===-1?S:d.PARSER_MEDIA_TYPE,L=rn==="application/xhtml+xml"?ka:yi,we=_r(d,"ALLOWED_TAGS",rr,{transform:L}),Ce=_r(d,"ALLOWED_ATTR",Pn,{transform:L}),gn=_r(d,"ALLOWED_NAMESPACES",Hn,{transform:ka}),Yt=_r(d,"ADD_URI_SAFE_ATTR",Un,{transform:L,base:Un}),Qt=_r(d,"ADD_DATA_URI_TAGS",mn,{transform:L,base:mn}),ft=_r(d,"FORBID_CONTENTS",Bn,{transform:L}),dn=_r(d,"FORBID_TAGS",Nt({}),{transform:L}),lr=_r(d,"FORBID_ATTR",Nt({}),{transform:L}),Vt=ut(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?Nt(d.USE_PROFILES):d.USE_PROFILES:!1,ir=d.ALLOW_ARIA_ATTR!==!1,Ne=d.ALLOW_DATA_ATTR!==!1,Ht=d.ALLOW_UNKNOWN_PROTOCOLS||!1,On=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,jt=d.SAFE_FOR_TEMPLATES||!1,zt=d.SAFE_FOR_XML!==!1,Pt=d.WHOLE_DOCUMENT||!1,Ct=d.RETURN_DOM||!1,_t=d.RETURN_DOM_FRAGMENT||!1,Dn=d.RETURN_TRUSTED_TYPE||!1,Mn=d.FORCE_BODY||!1,Fn=d.SANITIZE_DOM!==!1,Lr=d.SANITIZE_NAMED_PROPS||!1,hn=d.KEEP_CONTENT!==!1,bn=d.IN_PLACE||!1,lt=Oh(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:jf,en=typeof d.NAMESPACE=="string"?d.NAMESPACE:tt,Ir=ut(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nt(d.MATHML_TEXT_INTEGRATION_POINTS):ye({},tn),vn=ut(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?Nt(d.HTML_INTEGRATION_POINTS):ye({},nn);const C=ut(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?Nt(d.CUSTOM_ELEMENT_HANDLING):Rl(null);if(Le=Rl(null),ut(C,"tagNameCheck")&&dt(C.tagNameCheck)&&(Le.tagNameCheck=C.tagNameCheck),ut(C,"attributeNameCheck")&&dt(C.attributeNameCheck)&&(Le.attributeNameCheck=C.attributeNameCheck),ut(C,"allowCustomizedBuiltInElements")&&typeof C.allowCustomizedBuiltInElements=="boolean"&&(Le.allowCustomizedBuiltInElements=C.allowCustomizedBuiltInElements),gt(Le),jt&&(Ne=!1),_t&&(Ct=!0),Vt&&(we=ye({},Lf),Ce=Rl(null),Vt.html===!0&&(ye(we,Af),ye(Ce,Nf)),Vt.svg===!0&&(ye(we,Sa),ye(Ce,Ca),ye(Ce,Lo)),Vt.svgFilters===!0&&(ye(we,Ea),ye(Ce,Ca),ye(Ce,Lo)),Vt.mathMl===!0&&(ye(we,Ta),ye(Ce,If),ye(Ce,Lo))),Wt.tagCheck=null,Wt.attributeCheck=null,ut(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?Wt.tagCheck=d.ADD_TAGS:Ar(d.ADD_TAGS)&&(we===rr&&(we=Nt(we)),ye(we,d.ADD_TAGS,L))),ut(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?Wt.attributeCheck=d.ADD_ATTR:Ar(d.ADD_ATTR)&&(Ce===Pn&&(Ce=Nt(Ce)),ye(Ce,d.ADD_ATTR,L))),ut(d,"ADD_URI_SAFE_ATTR")&&Ar(d.ADD_URI_SAFE_ATTR)&&ye(Yt,d.ADD_URI_SAFE_ATTR,L),ut(d,"FORBID_CONTENTS")&&Ar(d.FORBID_CONTENTS)&&(ft===Bn&&(ft=Nt(ft)),ye(ft,d.FORBID_CONTENTS,L)),ut(d,"ADD_FORBID_CONTENTS")&&Ar(d.ADD_FORBID_CONTENTS)&&(ft===Bn&&(ft=Nt(ft)),ye(ft,d.ADD_FORBID_CONTENTS,L)),hn&&(we["#text"]=!0),Pt&&ye(we,["html","head","body"]),we.table&&(ye(we,["tbody"]),delete dn.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const j=de;de=d.TRUSTED_TYPES_POLICY;try{Te=be("")}catch(V){throw de=j,V}}else d.TRUSTED_TYPES_POLICY===null?(de=void 0,Te=""):(de===void 0&&(de=Ke()),de&&typeof Te=="string"&&(Te=be("")));mt&&mt(d),Z=d},Qn=ye({},[...Sa,...Ea,...Mh]),Al=ye({},[...Ta,...Dh]),Ei=function(d,C,j){return C.namespaceURI===tt?d==="svg":C.namespaceURI===Wn?d==="svg"&&(j==="annotation-xml"||Ir[j]):!!Qn[d]},Ti=function(d,C,j){return C.namespaceURI===tt?d==="math":C.namespaceURI===Gt?d==="math"&&vn[j]:!!Al[d]},Fo=function(d,C,j){return C.namespaceURI===Gt&&!vn[j]||C.namespaceURI===Wn&&!Ir[j]?!1:!Al[d]&&(Vn[d]||!Qn[d])},bo=function(d){let C=Y(d);(!C||!C.tagName)&&(C={namespaceURI:en,tagName:"template"});const j=yi(d.tagName),V=yi(C.tagName);return gn[d.namespaceURI]?d.namespaceURI===Gt?Ei(j,C,V):d.namespaceURI===Wn?Ti(j,C,V):d.namespaceURI===tt?Fo(j,C,V):!!(rn==="application/xhtml+xml"&&gn[d.namespaceURI]):!1},_e=function(d){Tl(i.removed,{element:d});try{Y(d).removeChild(d)}catch{if(W(d),!Y(d))throw Gr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Jr=function(d){sr(d);const C=ie(d);if(C){const V=[];El(C,ne=>{Tl(V,ne)}),El(V,ne=>{try{W(ne)}catch{}})}const j=J(d);if(j)for(let V=j.length-1;V>=0;--V){const ne=j[V],se=ne&&ne.name;if(typeof se=="string")try{d.removeAttribute(se)}catch{}}},yn=function(d,C){try{Tl(i.removed,{attribute:C.getAttributeNode(d),from:C})}catch{Tl(i.removed,{attribute:null,from:C})}if(C.removeAttribute(d),d==="is")if(Ct||_t)try{_e(C)}catch{}else try{C.setAttribute(d,"")}catch{}},Ci=function(d){const C=J(d);if(C)for(let j=C.length-1;j>=0;--j){const V=C[j],ne=V&&V.name;if(!(typeof ne!="string"||Ce[L(ne)]))try{d.removeAttribute(ne)}catch{}}},sr=function(d){const C=[d];for(;C.length>0;){const j=C.pop();(oe?oe(j):j.nodeType)===Zt.element&&Ci(j);const ne=ie(j);if(ne)for(let se=ne.length-1;se>=0;--se)C.push(ne[se])}},Bo=function(d){if(!zt)return;const C=[d];for(;C.length>0;){const j=C.pop(),V=oe?oe(j):j.nodeType;if(V===Zt.processingInstruction||V===Zt.comment&&at(Pf,j.data)){try{W(j)}catch{}continue}if(V===Zt.element){const se=j,ze=L(fe?fe(j):j.nodeName);try{se.hasAttribute&&se.hasAttribute("patchsrc")&&se.removeAttribute("patchsrc"),se.hasAttribute&&se.hasAttribute("for")&&ze!=="label"&&ze!=="output"&&se.removeAttribute("for")}catch{}}const ne=ie(j);if(ne)for(let se=ne.length-1;se>=0;--se)C.push(ne[se])}},Ll=function(d){let C=null,j=null;if(Mn)d=""+d;else{const se=Tf(d,/^[\r\n\t ]+/);j=se&&se[0]}rn==="application/xhtml+xml"&&en===tt&&(d=''+d+"");const V=de?be(d):d;if(en===tt)try{C=new A().parseFromString(V,rn)}catch{}if(!C||!C.documentElement){C=Ve.createDocument(en,"template",null);try{C.documentElement.innerHTML=or?Te:V}catch{}}const ne=C.body||C.documentElement;return d&&j&&ne.insertBefore(a.createTextNode(j),ne.childNodes[0]||null),en===tt?te.call(C,Pt?"html":"body")[0]:Pt?C.documentElement:ne},jr=function(d){return ve.call(d.ownerDocument||d,d,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},Rt=function(d){return d=di(d,I," "),d=di(d,ue," "),d=di(d,ce," "),d},Nl=function(d){var C;d.normalize();const j=ve.call(d.ownerDocument||d,d,_.SHOW_TEXT|_.SHOW_COMMENT|_.SHOW_CDATA_SECTION|_.SHOW_PROCESSING_INSTRUCTION,null);let V=j.nextNode();for(;V;)V.data=Rt(V.data),V=j.nextNode();const ne=(C=d.querySelectorAll)===null||C===void 0?void 0:C.call(d,"template");ne&&El(ne,se=>{ar(se.content)&&Nl(se.content)})},yt=function(d){const C=fe?fe(d):null;return typeof C!="string"||L(C)!=="form"?!1:typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||d.attributes!==J(d)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function"||d.nodeType!==oe(d)||d.childNodes!==ie(d)},ar=function(d){if(!oe||typeof d!="object"||d===null)return!1;try{return oe(d)===Zt.documentFragment}catch{return!1}},zr=function(d){if(!oe||typeof d!="object"||d===null)return!1;try{return typeof oe(d)=="number"}catch{return!1}};function ln(M,d,C){M.length!==0&&El(M,j=>{j.call(i,d,C,Z)})}const Zr=function(d,C){return!!(zt&&d.hasChildNodes()&&!zr(d.firstElementChild)&&at(zf,d.textContent)&&at(zf,d.innerHTML)||zt&&d.namespaceURI===tt&&C==="style"&&zr(d.firstElementChild)||d.nodeType===Zt.processingInstruction||zt&&d.nodeType===Zt.comment&&at(Pf,d.data))},$r=function(d,C){if(!dn[C]&&_i(C)&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,C)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(C)))return!1;if(hn&&!ft[C]){const j=Y(d),V=ie(d);if(V&&j){const ne=V.length;for(let se=ne-1;se>=0;--se){const ze=bn?V[se]:ee(V[se],!0);j.insertBefore(ze,q(d))}}}return _e(d),!0},ur=function(d,C){if(ln(y.beforeSanitizeElements,d,null),d!==C&&Y(d)===null)return!0;if(yt(d))return _e(d),!0;const j=L(fe?fe(d):d.nodeName);if(ln(y.uponSanitizeElement,d,{tagName:j,allowedTags:we}),d!==C&&Y(d)===null)return!0;if(Zr(d,j))return _e(d),!0;if(dn[j]||!(Wt.tagCheck instanceof Function&&Wt.tagCheck(j))&&!we[j]){const ne=$r(d,j);return ne===!1&&ln(y.afterSanitizeElements,d,null),ne}if((oe?oe(d):d.nodeType)===Zt.element&&!bo(d)||(j==="noscript"||j==="noembed"||j==="noframes")&&at(Gh,d.innerHTML))return _e(d),!0;if(jt&&d.nodeType===Zt.text){const ne=Rt(d.textContent);d.textContent!==ne&&(Tl(i.removed,{element:d.cloneNode()}),d.textContent=ne)}return ln(y.afterSanitizeElements,d,null),!1},Pr=function(d,C,j){if(lr[C]||zt&&C==="patchsrc"||zt&&C==="for"&&d!=="label"&&d!=="output"||Fn&&(C==="id"||C==="name")&&(j in a||j in Qe))return!1;const V=Ce[C]||Wt.attributeCheck instanceof Function&&Wt.attributeCheck(C,d);if(!(Ne&&at(he,C))){if(!(ir&&at(me,C))){if(V){if(!Yt[C]){if(!at(lt,di(j,ge,""))){if(!((C==="src"||C==="xlink:href"||C==="href")&&d!=="script"&&Cf(j,"data:")===0&&Qt[d])){if(!(Ht&&!at(Se,di(j,ge,"")))){if(j)return!1}}}}}else if(!(_i(d)&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,d)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(d))&&(Le.attributeNameCheck instanceof RegExp&&at(Le.attributeNameCheck,C)||Le.attributeNameCheck instanceof Function&&Le.attributeNameCheck(C,d))||C==="is"&&Le.allowCustomizedBuiltInElements&&(Le.tagNameCheck instanceof RegExp&&at(Le.tagNameCheck,j)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(j))))return!1}}return!0},Uo=ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_i=function(d){return!Uo[yi(d)]&&at(Ee,d)},Il=function(d,C,j,V){if(de&&typeof F=="object"&&typeof F.getAttributeType=="function"&&!j)switch(F.getAttributeType(d,C)){case"TrustedHTML":return be(V);case"TrustedScriptURL":return Xe(V)}return V},Ri=function(d,C,j,V){try{j?d.setAttributeNS(j,C,V):d.setAttribute(C,V),yt(d)?_e(d):Ef(i.removed)}catch{yn(C,d)}},el=function(d){ln(y.beforeSanitizeAttributes,d,null);const C=d.attributes;if(!C||yt(d))return;const j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0};let V=C.length;const ne=L(d.nodeName);for(;V--;){const se=C[V],ze=se.name,Je=se.namespaceURI,xt=se.value,Be=L(ze),Ze=xt;let Me=ze==="value"?Ze:Lh(Ze);if(j.attrName=Be,j.attrValue=Me,j.keepAttr=!0,j.forceKeepAttr=void 0,ln(y.uponSanitizeAttribute,d,j),Me=j.attrValue,Lr&&(Be==="id"||Be==="name")&&Cf(Me,Nr)!==0&&(yn(ze,d),Me=Nr+Me),zt&&at(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){yn(ze,d);continue}if(Be==="attributename"&&Tf(Me,"href")){yn(ze,d);continue}if(!j.forceKeepAttr){if(!j.keepAttr){yn(ze,d);continue}if(!On&&at(Kh,Me)){yn(ze,d);continue}if(jt&&(Me=Rt(Me)),!Pr(ne,Be,Me)){yn(ze,d);continue}Me=Il(ne,Be,Je,Me),Me!==Ze&&Ri(d,ze,Je,Me)}}ln(y.afterSanitizeAttributes,d,null)},Rn=function(d){let C=null;const j=jr(d);for(ln(y.beforeSanitizeShadowDOM,d,null);C=j.nextNode();)if(ln(y.uponSanitizeShadowNode,C,null),ur(C,d),el(C),ar(C.content)&&Rn(C.content),(oe?oe(C):C.nodeType)===Zt.element){const ne=H(C);ar(ne)&&(jl(ne),Rn(ne))}ln(y.afterSanitizeShadowDOM,d,null)},jl=function(d){const C=[{node:d,shadow:null}];for(;C.length>0;){const j=C.pop();if(j.shadow){Rn(j.shadow);continue}const V=j.node,se=(oe?oe(V):V.nodeType)===Zt.element,ze=ie(V);if(ze)for(let Je=ze.length-1;Je>=0;--Je)C.push({node:ze[Je],shadow:null});if(se){const Je=fe?fe(V):null;if(typeof Je=="string"&&L(Je)==="template"){const xt=V.content;ar(xt)&&C.push({node:xt,shadow:null})}}if(se){const Je=H(V);ar(Je)&&C.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return i.sanitize=function(M){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,j=null,V=null,ne=null;if(or=!M,or&&(M="\x3C!-->"),typeof M!="string"&&!zr(M)&&(M=Ph(M),typeof M!="string"))throw Gr("dirty is not a string, aborting");if(!i.isSupported)return M;pn?(we=ct,Ce=Ot):_n(d),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(we=Nt(we)),y.uponSanitizeAttribute.length>0&&(Ce=Nt(Ce)),i.removed=[];const se=bn&&typeof M!="string"&&zr(M);if(se){Bo(M);const Be=fe?fe(M):M.nodeName;if(typeof Be=="string"){const Ze=L(Be);if(!we[Ze]||dn[Ze])throw Jr(M),Gr("root node is forbidden and cannot be sanitized in-place")}if(yt(M))throw Jr(M),Gr("root node is clobbered and cannot be sanitized in-place");try{jl(M)}catch(Ze){throw Jr(M),Ze}}else if(zr(M))C=Ll("\x3C!---->"),j=C.ownerDocument.importNode(M,!0),j.nodeType===Zt.element&&j.nodeName==="BODY"||j.nodeName==="HTML"?C=j:C.appendChild(j),jl(j);else{if(!Ct&&!jt&&!Pt&&M.indexOf("<")===-1)return de&&Dn?be(M):M;if(C=Ll(M),!C)return Ct?null:Dn?Te:""}C&&Mn&&_e(C.firstChild);const ze=se?M:C,Je=jr(ze);try{for(;V=Je.nextNode();)ur(V,ze),el(V),ar(V.content)&&Rn(V.content)}catch(Be){throw se&&(Jr(M),El(i.removed,Ze=>{Ze.element&&sr(Ze.element)})),Be}if(se)return El(i.removed,Be=>{Be.element&&sr(Be.element)}),jt&&Nl(M),M;if(Ct){if(jt&&Nl(C),_t)for(ne=b.call(C.ownerDocument);C.firstChild;)ne.appendChild(C.firstChild);else ne=C;return(Ce.shadowroot||Ce.shadowrootmode)&&(ne=B.call(c,ne,!0)),ne}let xt=Pt?C.outerHTML:C.innerHTML;return Pt&&we["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&at(Qh,C.ownerDocument.doctype.name)&&(xt=" +`+xt),jt&&(xt=Rt(xt)),de&&Dn?be(xt):xt},i.setConfig=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(M),pn=!0,ct=we,Ot=Ce},i.clearConfig=function(){Z=null,pn=!1,ct=null,Ot=null,de=Ge,Te=""},i.isValidAttribute=function(M,d,C){Z||_n({});const j=L(M),V=L(d);return Pr(j,V,C)},i.addHook=function(M,d){typeof d=="function"&&ut(y,M)&&Tl(y[M],d)},i.removeHook=function(M,d){if(ut(y,M)){if(d!==void 0){const C=Rh(y[M],d);return C===-1?void 0:Ah(y[M],C,1)[0]}return Ef(y[M])}},i.removeHooks=function(M){ut(y,M)&&(y[M]=[])},i.removeAllHooks=function(){y=Of()},i}var Jh=rd();function ba(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qr=ba();function ld(s){qr=s}var wi={exec:()=>null};function Ae(s,i=""){let a=typeof s=="string"?s:s.source;const c={replace:(f,h)=>{let w=typeof h=="string"?h:h.source;return w=w.replace(It.caret,"$1"),a=a.replace(f,w),c},getRegex:()=>new RegExp(a,i)};return c}var It={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},Zh=/^(?:[ \t]*(?:\n|$))+/,$h=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,em=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Si=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ba=/(?:[*+-]|\d{1,9}[.)])/,id=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,od=Ae(id).replace(/bull/g,Ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nm=Ae(id).replace(/bull/g,Ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ua=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rm=/^[^\n]+/,Wa=/(?!\s*\])(?:\\.|[^\[\]\\])+/,lm=Ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),im=Ae(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ba).getRegex(),Mo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ha=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,om=Ae("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ha).replace("tag",Mo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sd=Ae(Ua).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex(),sm=Ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sd).getRegex(),Va={blockquote:sm,code:$h,def:lm,fences:em,heading:tm,hr:Si,html:om,lheading:od,list:im,newline:Zh,paragraph:sd,table:wi,text:rm},Mf=Ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex(),am={...Va,lheading:nm,table:Mf,paragraph:Ae(Ua).replace("hr",Si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mo).getRegex()},um={...Va,html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ha).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ae(Ua).replace("hr",Si).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",od).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ad=/^( {2,}|\\)\n(?!\s*$)/,dm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,fd=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vm=Ae(fd,"u").replace(/punct/g,Do).getRegex(),ym=Ae(fd,"u").replace(/punct/g,cd).getRegex(),dd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xm=Ae(dd,"gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,Qa).replace(/punct/g,Do).getRegex(),wm=Ae(dd,"gu").replace(/notPunctSpace/g,mm).replace(/punctSpace/g,hm).replace(/punct/g,cd).getRegex(),km=Ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,Qa).replace(/punct/g,Do).getRegex(),Sm=Ae(/\\(punct)/,"gu").replace(/punct/g,Do).getRegex(),Em=Ae(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tm=Ae(Ha).replace("(?:-->|$)","-->").getRegex(),Cm=Ae("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Tm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_m=Ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pd=Ae(/^!?\[(label)\]\[(ref)\]/).replace("label",zo).replace("ref",Wa).getRegex(),hd=Ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wa).getRegex(),Rm=Ae("reflink|nolink(?!\\()","g").replace("reflink",pd).replace("nolink",hd).getRegex(),Ya={_backpedal:wi,anyPunctuation:Sm,autolink:Em,blockSkip:gm,br:ad,code:fm,del:wi,emStrongLDelim:vm,emStrongRDelimAst:xm,emStrongRDelimUnd:km,escape:cm,link:_m,nolink:hd,punctuation:pm,reflink:pd,reflinkSearch:Rm,tag:Cm,text:dm,url:wi},Am={...Ya,link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",zo).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zo).getRegex()},Pa={...Ya,emStrongRDelimAst:wm,emStrongLDelim:ym,url:Ae(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Df=s=>Nm[s];function zn(s,i){if(i){if(It.escapeTest.test(s))return s.replace(It.escapeReplace,Df)}else if(It.escapeTestNoEncode.test(s))return s.replace(It.escapeReplaceNoEncode,Df);return s}function Ff(s){try{s=encodeURI(s).replace(It.percentDecode,"%")}catch{return null}return s}function bf(s,i){var h;const a=s.replace(It.findPipe,(w,v,_)=>{let k=!1,A=v;for(;--A>=0&&_[A]==="\\";)k=!k;return k?"|":" |"}),c=a.split(It.splitPipe);let f=0;if(c[0].trim()||c.shift(),c.length>0&&!((h=c.at(-1))!=null&&h.trim())&&c.pop(),i)if(c.length>i)c.splice(i);else for(;c.length0?-2:-1}function Bf(s,i,a,c,f){const h=i.href,w=i.title||null,v=s[1].replace(f.other.outputLinkReplace,"$1");c.state.inLink=!0;const _={type:s[0].charAt(0)==="!"?"image":"link",raw:a,href:h,title:w,text:v,tokens:c.inlineTokens(v)};return c.state.inLink=!1,_}function jm(s,i,a){const c=s.match(a.other.indentCodeCompensation);if(c===null)return i;const f=c[1];return i.split(` `).map(h=>{const w=h.match(a.other.beginningSpace);if(w===null)return h;const[v]=w;return v.length>=f.length?h.slice(f.length):h}).join(` `)}var Po=class{constructor(s){Ie(this,"options");Ie(this,"rules");Ie(this,"lexer");this.options=s||qr}space(s){const i=this.rules.block.newline.exec(s);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(s){const i=this.rules.block.code.exec(s);if(i){const a=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?a:mi(a,` @@ -66,31 +66,31 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),A=k.replace(this.rules.other.blockquoteSetextReplace,` $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c} ${k}`:k,f=f?`${f} -${A}`:A;const M=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(A,h,!0),this.lexer.state.top=M,a.length===0)break;const L=h.at(-1);if((L==null?void 0:L.type)==="code")break;if((L==null?void 0:L.type)==="blockquote"){const te=L,K=te.raw+` +${A}`:A;const F=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(A,h,!0),this.lexer.state.top=F,a.length===0)break;const N=h.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){const ee=N,W=ee.raw+` `+a.join(` -`),$=this.blockquote(K);h[h.length-1]=$,c=c.substring(0,c.length-te.raw.length)+$.raw,f=f.substring(0,f.length-te.text.length)+$.text;break}else if((L==null?void 0:L.type)==="list"){const te=L,K=te.raw+` +`),q=this.blockquote(W);h[h.length-1]=q,c=c.substring(0,c.length-ee.raw.length)+q.raw,f=f.substring(0,f.length-ee.text.length)+q.text;break}else if((N==null?void 0:N.type)==="list"){const ee=N,W=ee.raw+` `+a.join(` -`),$=this.list(K);h[h.length-1]=$,c=c.substring(0,c.length-L.raw.length)+$.raw,f=f.substring(0,f.length-te.raw.length)+$.raw,a=K.substring(h.at(-1).raw.length).split(` -`);continue}}return{type:"blockquote",raw:c,tokens:h,text:f}}}list(s){let i=this.rules.block.list.exec(s);if(i){let a=i[1].trim();const c=a.length>1,f={type:"list",raw:"",ordered:c,start:c?+a.slice(0,-1):"",loose:!1,items:[]};a=c?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=c?a:"[*+-]");const h=this.rules.other.listItemRegex(a);let w=!1;for(;s;){let _=!1,k="",A="";if(!(i=h.exec(s))||this.rules.block.hr.test(s))break;k=i[0],s=s.substring(k.length);let M=i[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,Q=>" ".repeat(3*Q.length)),L=s.split(` -`,1)[0],te=!M.trim(),K=0;if(this.options.pedantic?(K=2,A=M.trimStart()):te?K=i[1].length+1:(K=i[2].search(this.rules.other.nonSpaceChar),K=K>4?1:K,A=M.slice(K),K+=i[1].length),te&&this.rules.other.blankLine.test(L)&&(k+=L+` -`,s=s.substring(L.length+1),_=!0),!_){const Q=this.rules.other.nextBulletRegex(K),W=this.rules.other.hrRegex(K),X=this.rules.other.fencesBeginRegex(K),ie=this.rules.other.headingBeginRegex(K),fe=this.rules.other.htmlBeginRegex(K);for(;s;){const de=s.split(` -`,1)[0];let Te;if(L=de,this.options.pedantic?(L=L.replace(this.rules.other.listReplaceNesting," "),Te=L):Te=L.replace(this.rules.other.tabCharGlobal," "),X.test(L)||ie.test(L)||fe.test(L)||Q.test(L)||W.test(L))break;if(Te.search(this.rules.other.nonSpaceChar)>=K||!L.trim())A+=` -`+Te.slice(K);else{if(te||M.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(M)||ie.test(M)||W.test(M))break;A+=` -`+L}!te&&!L.trim()&&(te=!0),k+=de+` -`,s=s.substring(de.length+1),M=Te.slice(K)}}f.loose||(w?f.loose=!0:this.rules.other.doubleBlankLine.test(k)&&(w=!0));let $=null,se;this.options.gfm&&($=this.rules.other.listIsTask.exec(A),$&&(se=$[0]!=="[ ] ",A=A.replace(this.rules.other.listReplaceTask,""))),f.items.push({type:"list_item",raw:k,task:!!$,checked:se,loose:!1,text:A,tokens:[]}),f.raw+=k}const v=f.items.at(-1);if(v)v.raw=v.raw.trimEnd(),v.text=v.text.trimEnd();else return;f.raw=f.raw.trimEnd();for(let _=0;_M.type==="space"),A=k.length>0&&k.some(M=>this.rules.other.anyLine.test(M.raw));f.loose=A}if(f.loose)for(let _=0;_1,f={type:"list",raw:"",ordered:c,start:c?+a.slice(0,-1):"",loose:!1,items:[]};a=c?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=c?a:"[*+-]");const h=this.rules.other.listItemRegex(a);let w=!1;for(;s;){let _=!1,k="",A="";if(!(i=h.exec(s))||this.rules.block.hr.test(s))break;k=i[0],s=s.substring(k.length);let F=i[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,Y=>" ".repeat(3*Y.length)),N=s.split(` +`,1)[0],ee=!F.trim(),W=0;if(this.options.pedantic?(W=2,A=F.trimStart()):ee?W=i[1].length+1:(W=i[2].search(this.rules.other.nonSpaceChar),W=W>4?1:W,A=F.slice(W),W+=i[1].length),ee&&this.rules.other.blankLine.test(N)&&(k+=N+` +`,s=s.substring(N.length+1),_=!0),!_){const Y=this.rules.other.nextBulletRegex(W),H=this.rules.other.hrRegex(W),J=this.rules.other.fencesBeginRegex(W),oe=this.rules.other.headingBeginRegex(W),fe=this.rules.other.htmlBeginRegex(W);for(;s;){const de=s.split(` +`,1)[0];let Te;if(N=de,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),Te=N):Te=N.replace(this.rules.other.tabCharGlobal," "),J.test(N)||oe.test(N)||fe.test(N)||Y.test(N)||H.test(N))break;if(Te.search(this.rules.other.nonSpaceChar)>=W||!N.trim())A+=` +`+Te.slice(W);else{if(ee||F.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(F)||oe.test(F)||H.test(F))break;A+=` +`+N}!ee&&!N.trim()&&(ee=!0),k+=de+` +`,s=s.substring(de.length+1),F=Te.slice(W)}}f.loose||(w?f.loose=!0:this.rules.other.doubleBlankLine.test(k)&&(w=!0));let q=null,ie;this.options.gfm&&(q=this.rules.other.listIsTask.exec(A),q&&(ie=q[0]!=="[ ] ",A=A.replace(this.rules.other.listReplaceTask,""))),f.items.push({type:"list_item",raw:k,task:!!q,checked:ie,loose:!1,text:A,tokens:[]}),f.raw+=k}const v=f.items.at(-1);if(v)v.raw=v.raw.trimEnd(),v.text=v.text.trimEnd();else return;f.raw=f.raw.trimEnd();for(let _=0;_F.type==="space"),A=k.length>0&&k.some(F=>this.rules.other.anyLine.test(F.raw));f.loose=A}if(f.loose)for(let _=0;_({text:_,tokens:this.lexer.inline(_),header:!1,align:h.align[k]})));return h}}lheading(s){const i=this.rules.block.lheading.exec(s);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(s){const i=this.rules.block.paragraph.exec(s);if(i){const a=i[1].charAt(i[1].length-1)===` -`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:a,tokens:this.lexer.inline(a)}}}text(s){const i=this.rules.block.text.exec(s);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(s){const i=this.rules.inline.escape.exec(s);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(s){const i=this.rules.inline.tag.exec(s);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(s){const i=this.rules.inline.link.exec(s);if(i){const a=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const h=mi(a.slice(0,-1),"\\");if((a.length-h.length)%2===0)return}else{const h=Im(i[2],"()");if(h===-2)return;if(h>-1){const v=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,v).trim(),i[3]=""}}let c=i[2],f="";if(this.options.pedantic){const h=this.rules.other.pedanticHrefTitle.exec(c);h&&(c=h[1],f=h[3])}else f=i[3]?i[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?c=c.slice(1):c=c.slice(1,-1)),Bf(i,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(s,i){let a;if((a=this.rules.inline.reflink.exec(s))||(a=this.rules.inline.nolink.exec(s))){const c=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=i[c.toLowerCase()];if(!f){const h=a[0].charAt(0);return{type:"text",raw:h,text:h}}return Bf(a,f,a[0],this.lexer,this.rules)}}emStrong(s,i,a=""){let c=this.rules.inline.emStrongLDelim.exec(s);if(!c||c[3]&&a.match(this.rules.other.unicodeAlphaNumeric))return;if(!(c[1]||c[2]||"")||!a||this.rules.inline.punctuation.exec(a)){const h=[...c[0]].length-1;let w,v,_=h,k=0;const A=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(A.lastIndex=0,i=i.slice(-1*s.length+h);(c=A.exec(i))!=null;){if(w=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!w)continue;if(v=[...w].length,c[3]||c[4]){_+=v;continue}else if((c[5]||c[6])&&h%3&&!((h+v)%3)){k+=v;continue}if(_-=v,_>0)continue;v=Math.min(v,v+_+k);const M=[...c[0]][0].length,L=s.slice(0,h+c.index+M+v);if(Math.min(h,v)%2){const K=L.slice(1,-1);return{type:"em",raw:L,text:K,tokens:this.lexer.inlineTokens(K)}}const te=L.slice(2,-2);return{type:"strong",raw:L,text:te,tokens:this.lexer.inlineTokens(te)}}}}codespan(s){const i=this.rules.inline.code.exec(s);if(i){let a=i[2].replace(this.rules.other.newLineCharGlobal," ");const c=this.rules.other.nonSpaceChar.test(a),f=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return c&&f&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:i[0],text:a}}}br(s){const i=this.rules.inline.br.exec(s);if(i)return{type:"br",raw:i[0]}}del(s){const i=this.rules.inline.del.exec(s);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(s){const i=this.rules.inline.autolink.exec(s);if(i){let a,c;return i[2]==="@"?(a=i[1],c="mailto:"+a):(a=i[1],c=a),{type:"link",raw:i[0],text:a,href:c,tokens:[{type:"text",raw:a,text:a}]}}}url(s){var a;let i;if(i=this.rules.inline.url.exec(s)){let c,f;if(i[2]==="@")c=i[0],f="mailto:"+c;else{let h;do h=i[0],i[0]=((a=this.rules.inline._backpedal.exec(i[0]))==null?void 0:a[0])??"";while(h!==i[0]);c=i[0],i[1]==="www."?f="http://"+i[0]:f=i[0]}return{type:"link",raw:i[0],text:c,href:f,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(s){const i=this.rules.inline.text.exec(s);if(i){const a=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:a}}}},tr=class Oa{constructor(i){Ie(this,"tokens");Ie(this,"options");Ie(this,"state");Ie(this,"tokenizer");Ie(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||qr,this.options.tokenizer=this.options.tokenizer||new Po,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const a={other:It,block:No.normal,inline:hi.normal};this.options.pedantic?(a.block=No.pedantic,a.inline=hi.pedantic):this.options.gfm&&(a.block=No.gfm,this.options.breaks?a.inline=hi.breaks:a.inline=hi.gfm),this.tokenizer.rules=a}static get rules(){return{block:No,inline:hi}}static lex(i,a){return new Oa(a).lex(i)}static lexInline(i,a){return new Oa(a).inlineTokens(i)}lex(i){i=i.replace(It.carriageReturn,` +`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:a,tokens:this.lexer.inline(a)}}}text(s){const i=this.rules.block.text.exec(s);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(s){const i=this.rules.inline.escape.exec(s);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(s){const i=this.rules.inline.tag.exec(s);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(s){const i=this.rules.inline.link.exec(s);if(i){const a=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const h=mi(a.slice(0,-1),"\\");if((a.length-h.length)%2===0)return}else{const h=Im(i[2],"()");if(h===-2)return;if(h>-1){const v=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,v).trim(),i[3]=""}}let c=i[2],f="";if(this.options.pedantic){const h=this.rules.other.pedanticHrefTitle.exec(c);h&&(c=h[1],f=h[3])}else f=i[3]?i[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?c=c.slice(1):c=c.slice(1,-1)),Bf(i,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(s,i){let a;if((a=this.rules.inline.reflink.exec(s))||(a=this.rules.inline.nolink.exec(s))){const c=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=i[c.toLowerCase()];if(!f){const h=a[0].charAt(0);return{type:"text",raw:h,text:h}}return Bf(a,f,a[0],this.lexer,this.rules)}}emStrong(s,i,a=""){let c=this.rules.inline.emStrongLDelim.exec(s);if(!c||c[3]&&a.match(this.rules.other.unicodeAlphaNumeric))return;if(!(c[1]||c[2]||"")||!a||this.rules.inline.punctuation.exec(a)){const h=[...c[0]].length-1;let w,v,_=h,k=0;const A=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(A.lastIndex=0,i=i.slice(-1*s.length+h);(c=A.exec(i))!=null;){if(w=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!w)continue;if(v=[...w].length,c[3]||c[4]){_+=v;continue}else if((c[5]||c[6])&&h%3&&!((h+v)%3)){k+=v;continue}if(_-=v,_>0)continue;v=Math.min(v,v+_+k);const F=[...c[0]][0].length,N=s.slice(0,h+c.index+F+v);if(Math.min(h,v)%2){const W=N.slice(1,-1);return{type:"em",raw:N,text:W,tokens:this.lexer.inlineTokens(W)}}const ee=N.slice(2,-2);return{type:"strong",raw:N,text:ee,tokens:this.lexer.inlineTokens(ee)}}}}codespan(s){const i=this.rules.inline.code.exec(s);if(i){let a=i[2].replace(this.rules.other.newLineCharGlobal," ");const c=this.rules.other.nonSpaceChar.test(a),f=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return c&&f&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:i[0],text:a}}}br(s){const i=this.rules.inline.br.exec(s);if(i)return{type:"br",raw:i[0]}}del(s){const i=this.rules.inline.del.exec(s);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(s){const i=this.rules.inline.autolink.exec(s);if(i){let a,c;return i[2]==="@"?(a=i[1],c="mailto:"+a):(a=i[1],c=a),{type:"link",raw:i[0],text:a,href:c,tokens:[{type:"text",raw:a,text:a}]}}}url(s){var a;let i;if(i=this.rules.inline.url.exec(s)){let c,f;if(i[2]==="@")c=i[0],f="mailto:"+c;else{let h;do h=i[0],i[0]=((a=this.rules.inline._backpedal.exec(i[0]))==null?void 0:a[0])??"";while(h!==i[0]);c=i[0],i[1]==="www."?f="http://"+i[0]:f=i[0]}return{type:"link",raw:i[0],text:c,href:f,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(s){const i=this.rules.inline.text.exec(s);if(i){const a=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:a}}}},tr=class Oa{constructor(i){Ie(this,"tokens");Ie(this,"options");Ie(this,"state");Ie(this,"tokenizer");Ie(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||qr,this.options.tokenizer=this.options.tokenizer||new Po,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const a={other:It,block:No.normal,inline:hi.normal};this.options.pedantic?(a.block=No.pedantic,a.inline=hi.pedantic):this.options.gfm&&(a.block=No.gfm,this.options.breaks?a.inline=hi.breaks:a.inline=hi.gfm),this.tokenizer.rules=a}static get rules(){return{block:No,inline:hi}}static lex(i,a){return new Oa(a).lex(i)}static lexInline(i,a){return new Oa(a).inlineTokens(i)}lex(i){i=i.replace(It.carriageReturn,` `),this.blockTokens(i,this.tokens);for(let a=0;a(v=k.call({lexer:this},i,a))?(i=i.substring(v.raw.length),a.push(v),!0):!1))continue;if(v=this.tokenizer.space(i)){i=i.substring(v.raw.length);const k=a.at(-1);v.raw.length===1&&k!==void 0?k.raw+=` `:a.push(v);continue}if(v=this.tokenizer.code(i)){i=i.substring(v.raw.length);const k=a.at(-1);(k==null?void 0:k.type)==="paragraph"||(k==null?void 0:k.type)==="text"?(k.raw+=` `+v.raw,k.text+=` `+v.text,this.inlineQueue.at(-1).src=k.text):a.push(v);continue}if(v=this.tokenizer.fences(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.heading(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.hr(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.blockquote(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.list(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.html(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.def(i)){i=i.substring(v.raw.length);const k=a.at(-1);(k==null?void 0:k.type)==="paragraph"||(k==null?void 0:k.type)==="text"?(k.raw+=` `+v.raw,k.text+=` -`+v.raw,this.inlineQueue.at(-1).src=k.text):this.tokens.links[v.tag]||(this.tokens.links[v.tag]={href:v.href,title:v.title});continue}if(v=this.tokenizer.table(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.lheading(i)){i=i.substring(v.raw.length),a.push(v);continue}let _=i;if((w=this.options.extensions)!=null&&w.startBlock){let k=1/0;const A=i.slice(1);let M;this.options.extensions.startBlock.forEach(L=>{M=L.call({lexer:this},A),typeof M=="number"&&M>=0&&(k=Math.min(k,M))}),k<1/0&&k>=0&&(_=i.substring(0,k+1))}if(this.state.top&&(v=this.tokenizer.paragraph(_))){const k=a.at(-1);c&&(k==null?void 0:k.type)==="paragraph"?(k.raw+=` +`+v.raw,this.inlineQueue.at(-1).src=k.text):this.tokens.links[v.tag]||(this.tokens.links[v.tag]={href:v.href,title:v.title});continue}if(v=this.tokenizer.table(i)){i=i.substring(v.raw.length),a.push(v);continue}if(v=this.tokenizer.lheading(i)){i=i.substring(v.raw.length),a.push(v);continue}let _=i;if((w=this.options.extensions)!=null&&w.startBlock){let k=1/0;const A=i.slice(1);let F;this.options.extensions.startBlock.forEach(N=>{F=N.call({lexer:this},A),typeof F=="number"&&F>=0&&(k=Math.min(k,F))}),k<1/0&&k>=0&&(_=i.substring(0,k+1))}if(this.state.top&&(v=this.tokenizer.paragraph(_))){const k=a.at(-1);c&&(k==null?void 0:k.type)==="paragraph"?(k.raw+=` `+v.raw,k.text+=` `+v.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=k.text):a.push(v),c=_.length!==i.length,i=i.substring(v.raw.length);continue}if(v=this.tokenizer.text(i)){i=i.substring(v.raw.length);const k=a.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=` `+v.raw,k.text+=` -`+v.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=k.text):a.push(v);continue}if(i){const k="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(k);break}else throw new Error(k)}}return this.state.top=!0,a}inline(i,a=[]){return this.inlineQueue.push({src:i,tokens:a}),a}inlineTokens(i,a=[]){var v,_,k;let c=i,f=null;if(this.tokens.links){const A=Object.keys(this.tokens.links);if(A.length>0)for(;(f=this.tokenizer.rules.inline.reflinkSearch.exec(c))!=null;)A.includes(f[0].slice(f[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(f=this.tokenizer.rules.inline.anyPunctuation.exec(c))!=null;)c=c.slice(0,f.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(f=this.tokenizer.rules.inline.blockSkip.exec(c))!=null;)c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let h=!1,w="";for(;i;){h||(w=""),h=!1;let A;if((_=(v=this.options.extensions)==null?void 0:v.inline)!=null&&_.some(L=>(A=L.call({lexer:this},i,a))?(i=i.substring(A.raw.length),a.push(A),!0):!1))continue;if(A=this.tokenizer.escape(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.tag(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.link(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(A.raw.length);const L=a.at(-1);A.type==="text"&&(L==null?void 0:L.type)==="text"?(L.raw+=A.raw,L.text+=A.text):a.push(A);continue}if(A=this.tokenizer.emStrong(i,c,w)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.codespan(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.br(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.del(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.autolink(i)){i=i.substring(A.raw.length),a.push(A);continue}if(!this.state.inLink&&(A=this.tokenizer.url(i))){i=i.substring(A.raw.length),a.push(A);continue}let M=i;if((k=this.options.extensions)!=null&&k.startInline){let L=1/0;const te=i.slice(1);let K;this.options.extensions.startInline.forEach($=>{K=$.call({lexer:this},te),typeof K=="number"&&K>=0&&(L=Math.min(L,K))}),L<1/0&&L>=0&&(M=i.substring(0,L+1))}if(A=this.tokenizer.inlineText(M)){i=i.substring(A.raw.length),A.raw.slice(-1)!=="_"&&(w=A.raw.slice(-1)),h=!0;const L=a.at(-1);(L==null?void 0:L.type)==="text"?(L.raw+=A.raw,L.text+=A.text):a.push(A);continue}if(i){const L="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(L);break}else throw new Error(L)}}return a}},Oo=class{constructor(s){Ie(this,"options");Ie(this,"parser");this.options=s||qr}space(s){return""}code({text:s,lang:i,escaped:a}){var h;const c=(h=(i||"").match(It.notSpaceStart))==null?void 0:h[0],f=s.replace(It.endingNewline,"")+` +`+v.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=k.text):a.push(v);continue}if(i){const k="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(k);break}else throw new Error(k)}}return this.state.top=!0,a}inline(i,a=[]){return this.inlineQueue.push({src:i,tokens:a}),a}inlineTokens(i,a=[]){var v,_,k;let c=i,f=null;if(this.tokens.links){const A=Object.keys(this.tokens.links);if(A.length>0)for(;(f=this.tokenizer.rules.inline.reflinkSearch.exec(c))!=null;)A.includes(f[0].slice(f[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(f=this.tokenizer.rules.inline.anyPunctuation.exec(c))!=null;)c=c.slice(0,f.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(f=this.tokenizer.rules.inline.blockSkip.exec(c))!=null;)c=c.slice(0,f.index)+"["+"a".repeat(f[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let h=!1,w="";for(;i;){h||(w=""),h=!1;let A;if((_=(v=this.options.extensions)==null?void 0:v.inline)!=null&&_.some(N=>(A=N.call({lexer:this},i,a))?(i=i.substring(A.raw.length),a.push(A),!0):!1))continue;if(A=this.tokenizer.escape(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.tag(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.link(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(A.raw.length);const N=a.at(-1);A.type==="text"&&(N==null?void 0:N.type)==="text"?(N.raw+=A.raw,N.text+=A.text):a.push(A);continue}if(A=this.tokenizer.emStrong(i,c,w)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.codespan(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.br(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.del(i)){i=i.substring(A.raw.length),a.push(A);continue}if(A=this.tokenizer.autolink(i)){i=i.substring(A.raw.length),a.push(A);continue}if(!this.state.inLink&&(A=this.tokenizer.url(i))){i=i.substring(A.raw.length),a.push(A);continue}let F=i;if((k=this.options.extensions)!=null&&k.startInline){let N=1/0;const ee=i.slice(1);let W;this.options.extensions.startInline.forEach(q=>{W=q.call({lexer:this},ee),typeof W=="number"&&W>=0&&(N=Math.min(N,W))}),N<1/0&&N>=0&&(F=i.substring(0,N+1))}if(A=this.tokenizer.inlineText(F)){i=i.substring(A.raw.length),A.raw.slice(-1)!=="_"&&(w=A.raw.slice(-1)),h=!0;const N=a.at(-1);(N==null?void 0:N.type)==="text"?(N.raw+=A.raw,N.text+=A.text):a.push(A);continue}if(i){const N="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(N);break}else throw new Error(N)}}return a}},Oo=class{constructor(s){Ie(this,"options");Ie(this,"parser");this.options=s||qr}space(s){return""}code({text:s,lang:i,escaped:a}){var h;const c=(h=(i||"").match(It.notSpaceStart))==null?void 0:h[0],f=s.replace(It.endingNewline,"")+` `;return c?'
'+(a?f:zn(f,!0))+`
`:"
"+(a?f:zn(f,!0))+`
`}blockquote({tokens:s}){return`
@@ -109,13 +109,13 @@ ${this.parser.parse(s)}
${s} `}tablecell(s){const i=this.parser.parseInline(s.tokens),a=s.header?"th":"td";return(s.align?`<${a} align="${s.align}">`:`<${a}>`)+i+` `}strong({tokens:s}){return`${this.parser.parseInline(s)}`}em({tokens:s}){return`${this.parser.parseInline(s)}`}codespan({text:s}){return`${zn(s,!0)}`}br(s){return"
"}del({tokens:s}){return`${this.parser.parseInline(s)}`}link({href:s,title:i,tokens:a}){const c=this.parser.parseInline(a),f=Ff(s);if(f===null)return c;s=f;let h='
",h}image({href:s,title:i,text:a,tokens:c}){c&&(a=this.parser.parseInline(c,this.parser.textRenderer));const f=Ff(s);if(f===null)return zn(a);s=f;let h=`${a}{const _=w[v].flat(1/0);a=a.concat(this.walkTokens(_,i))}):w.tokens&&(a=a.concat(this.walkTokens(w.tokens,i)))}}return a}use(...s){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(a=>{const c={...a};if(c.async=this.defaults.async||c.async||!1,a.extensions&&(a.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const h=i.renderers[f.name];h?i.renderers[f.name]=function(...w){let v=f.renderer.apply(this,w);return v===!1&&(v=h.apply(this,w)),v}:i.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const h=i[f.level];h?h.unshift(f.tokenizer):i[f.level]=[f.tokenizer],f.start&&(f.level==="block"?i.startBlock?i.startBlock.push(f.start):i.startBlock=[f.start]:f.level==="inline"&&(i.startInline?i.startInline.push(f.start):i.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(i.childTokens[f.name]=f.childTokens)}),c.extensions=i),a.renderer){const f=this.defaults.renderer||new Oo(this.defaults);for(const h in a.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;const w=h,v=a.renderer[w],_=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A||""}}c.renderer=f}if(a.tokenizer){const f=this.defaults.tokenizer||new Po(this.defaults);for(const h in a.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;const w=h,v=a.tokenizer[w],_=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A}}c.tokenizer=f}if(a.hooks){const f=this.defaults.hooks||new Io;for(const h in a.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;const w=h,v=a.hooks[w],_=f[w];Io.passThroughHooks.has(h)?f[w]=k=>{if(this.defaults.async)return Promise.resolve(v.call(f,k)).then(M=>_.call(f,M));const A=v.call(f,k);return _.call(f,A)}:f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A}}c.hooks=f}if(a.walkTokens){const f=this.defaults.walkTokens,h=a.walkTokens;c.walkTokens=function(w){let v=[];return v.push(h.call(this,w)),f&&(v=v.concat(f.call(this,w))),v}}this.defaults={...this.defaults,...c}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,i){return tr.lex(s,i??this.defaults)}parser(s,i){return nr.parse(s,i??this.defaults)}parseMarkdown(s){return(a,c)=>{const f={...c},h={...this.defaults,...f},w=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&f.async===!1)return w(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return w(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return w(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));h.hooks&&(h.hooks.options=h,h.hooks.block=s);const v=h.hooks?h.hooks.provideLexer():s?tr.lex:tr.lexInline,_=h.hooks?h.hooks.provideParser():s?nr.parse:nr.parseInline;if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(a):a).then(k=>v(k,h)).then(k=>h.hooks?h.hooks.processAllTokens(k):k).then(k=>h.walkTokens?Promise.all(this.walkTokens(k,h.walkTokens)).then(()=>k):k).then(k=>_(k,h)).then(k=>h.hooks?h.hooks.postprocess(k):k).catch(w);try{h.hooks&&(a=h.hooks.preprocess(a));let k=v(a,h);h.hooks&&(k=h.hooks.processAllTokens(k)),h.walkTokens&&this.walkTokens(k,h.walkTokens);let A=_(k,h);return h.hooks&&(A=h.hooks.postprocess(A)),A}catch(k){return w(k)}}}onError(s,i){return a=>{if(a.message+=` +`+this.renderer.text(k);a?c+=this.renderer.paragraph({type:"paragraph",raw:A,text:A,tokens:[{type:"text",raw:A,text:A,escaped:!0}]}):c+=A;continue}default:{const k='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(k),"";throw new Error(k)}}}return c}parseInline(i,a=this.renderer){var f,h;let c="";for(let w=0;w{const _=w[v].flat(1/0);a=a.concat(this.walkTokens(_,i))}):w.tokens&&(a=a.concat(this.walkTokens(w.tokens,i)))}}return a}use(...s){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(a=>{const c={...a};if(c.async=this.defaults.async||c.async||!1,a.extensions&&(a.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const h=i.renderers[f.name];h?i.renderers[f.name]=function(...w){let v=f.renderer.apply(this,w);return v===!1&&(v=h.apply(this,w)),v}:i.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const h=i[f.level];h?h.unshift(f.tokenizer):i[f.level]=[f.tokenizer],f.start&&(f.level==="block"?i.startBlock?i.startBlock.push(f.start):i.startBlock=[f.start]:f.level==="inline"&&(i.startInline?i.startInline.push(f.start):i.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(i.childTokens[f.name]=f.childTokens)}),c.extensions=i),a.renderer){const f=this.defaults.renderer||new Oo(this.defaults);for(const h in a.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;const w=h,v=a.renderer[w],_=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A||""}}c.renderer=f}if(a.tokenizer){const f=this.defaults.tokenizer||new Po(this.defaults);for(const h in a.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;const w=h,v=a.tokenizer[w],_=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A}}c.tokenizer=f}if(a.hooks){const f=this.defaults.hooks||new Io;for(const h in a.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;const w=h,v=a.hooks[w],_=f[w];Io.passThroughHooks.has(h)?f[w]=k=>{if(this.defaults.async)return Promise.resolve(v.call(f,k)).then(F=>_.call(f,F));const A=v.call(f,k);return _.call(f,A)}:f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=_.apply(f,k)),A}}c.hooks=f}if(a.walkTokens){const f=this.defaults.walkTokens,h=a.walkTokens;c.walkTokens=function(w){let v=[];return v.push(h.call(this,w)),f&&(v=v.concat(f.call(this,w))),v}}this.defaults={...this.defaults,...c}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,i){return tr.lex(s,i??this.defaults)}parser(s,i){return nr.parse(s,i??this.defaults)}parseMarkdown(s){return(a,c)=>{const f={...c},h={...this.defaults,...f},w=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&f.async===!1)return w(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return w(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return w(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));h.hooks&&(h.hooks.options=h,h.hooks.block=s);const v=h.hooks?h.hooks.provideLexer():s?tr.lex:tr.lexInline,_=h.hooks?h.hooks.provideParser():s?nr.parse:nr.parseInline;if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(a):a).then(k=>v(k,h)).then(k=>h.hooks?h.hooks.processAllTokens(k):k).then(k=>h.walkTokens?Promise.all(this.walkTokens(k,h.walkTokens)).then(()=>k):k).then(k=>_(k,h)).then(k=>h.hooks?h.hooks.postprocess(k):k).catch(w);try{h.hooks&&(a=h.hooks.preprocess(a));let k=v(a,h);h.hooks&&(k=h.hooks.processAllTokens(k)),h.walkTokens&&this.walkTokens(k,h.walkTokens);let A=_(k,h);return h.hooks&&(A=h.hooks.postprocess(A)),A}catch(k){return w(k)}}}onError(s,i){return a=>{if(a.message+=` Please report this to https://github.com/markedjs/marked.`,s){const c="

An error occurred:

"+zn(a.message+"",!0)+"
";return i?Promise.resolve(c):c}if(i)return Promise.reject(a);throw a}}},Kr=new zm;function Re(s,i){return Kr.parse(s,i)}Re.options=Re.setOptions=function(s){return Kr.setOptions(s),Re.defaults=Kr.defaults,ld(Re.defaults),Re};Re.getDefaults=ba;Re.defaults=qr;Re.use=function(...s){return Kr.use(...s),Re.defaults=Kr.defaults,ld(Re.defaults),Re};Re.walkTokens=function(s,i){return Kr.walkTokens(s,i)};Re.parseInline=Kr.parseInline;Re.Parser=nr;Re.parser=nr.parse;Re.Renderer=Oo;Re.TextRenderer=Ga;Re.Lexer=tr;Re.lexer=tr.lex;Re.Tokenizer=Po;Re.Hooks=Io;Re.parse=Re;Re.options;Re.setOptions;Re.use;Re.walkTokens;Re.parseInline;nr.parse;tr.lex;const jo={items:[],running:!1,usage:null,streamKind:"",turnEnded:!1,model:"",permMode:""},Pm={approved:"已允许",denied:"已拒绝",timeout:"已超时(按拒绝处理)",cancelled:"已取消"};function Uf(s){switch(s){case"allowed":return"已允许";case"rejected":return"已拒绝";case"expired":return"(已过期)";default:return Pm[s]??s}}function Wf(s,i,a){const c=s.items.slice(),f=c[c.length-1];return s.streamKind===i&&f&&f.kind===i?c[c.length-1]={...f,text:f.text+a}:c.push({kind:i,text:a}),{...s,items:c,streamKind:i}}function Rr(s,i){return{...s,items:[...s.items,i],streamKind:""}}function Hf(s){return s.map(i=>i.kind==="perm"&&i.state==="open"?{...i,state:"expired"}:i)}function Om(s,i,a){const c=s.items.slice();for(let f=c.length-1;f>=0;f--){const h=c[f];if(!(h.kind!=="tool"||h.tcId!==i)){switch(a.kind){case"subagent_tool":{const w=(h.subItems??[]).slice(),v=w.findIndex(k=>k.id===a.id),_={id:a.id??String(w.length),title:a.title??"",status:a.status??"run"};v>=0?w[v]={..._,title:_.title||w[v].title}:w.push(_),c[f]={...h,subItems:w};break}case"output":c[f]={...h,lastLine:a.line};break;case"child_session":c[f]={...h,childSessionId:a.childSessionId};break}return{...s,items:c}}}return s}function Mm(s,i){var a,c;switch(i.sessionUpdate){case"agent_message_chunk":return Wf(s,"agent",((a=i.content)==null?void 0:a.text)??"");case"agent_thought_chunk":return Wf(s,"thought",((c=i.content)==null?void 0:c.text)??"");case"tool_call":return Rr(s,{kind:"tool",tcId:i.toolCallId??"",title:i.title||i.kind||"工具调用",status:"run",out:""});case"tool_call_update":{if(i.status==="in_progress")return i.progress?Om(s,i.toolCallId??"",i.progress):s;const f=s.items.slice();for(let h=f.length-1;h>=0;h--){const w=f[h];if(w.kind==="tool"&&w.tcId===i.toolCallId){const v=typeof i.rawOutput=="string"?i.rawOutput.split(` -`)[0].slice(0,160):"";f[h]={...w,status:i.status==="completed"?"ok":"fail",out:v,lastLine:void 0};break}}return{...s,items:f}}case"plan":{const f=s.items.slice();for(let h=f.length-1;h>=0;h--)if(f[h].kind==="plan")return f[h]={kind:"plan",entries:i.entries??[]},{...s,items:f,streamKind:""};return Rr(s,{kind:"plan",entries:i.entries??[]})}case"llm_call_retry":return Rr(s,{kind:"sys",text:`模型调用重试 #${i.attempt??"?"}: ${i.message??""}`});case"usage_update":return{...s,usage:{used:i.used??0,size:i.size??0}};case"compact_status":return Rr(s,{kind:"sys",text:i.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const f=i.model??"";return{...Rr(s,{kind:"sys",text:`模型已切换为 ${f}`}),model:f}}case"permission_mode_update":{const f=i.mode??"default";return{...Rr(s,{kind:"sys",text:f==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:f}}default:return s}}function Dm(s,i){switch(i.type){case"task-started":return{...s,running:!0};case"task-ended":return{...s,running:!1,streamKind:"",turnEnded:!0,items:[...Hf(s.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const a=fi(i);return{...s,running:!1,streamKind:"",items:[...Hf(s.items),{kind:"sys",text:"✗ "+((a==null?void 0:a.error)||"未知错误"),error:!0}]}}case"user-input":{const a=fi(i);let c="";try{c=a!=null&&a.content?Fa(a.content):""}catch{c=(a==null?void 0:a.content)??""}return Rr(s,{kind:"user",text:c})}case"permission-req":{const a=fi(i);return a!=null&&a.id?Rr(s,{kind:"perm",id:a.id,title:a.title??"",tool:a.tool??"",state:"open"}):s}case"permission-resolved":{const a=fi(i);return a!=null&&a.id?{...s,items:s.items.map(c=>c.kind==="perm"&&c.id===a.id&&c.state==="open"?{...c,state:a.outcome??"expired"}:c)}:s}case"task-running":if(i.kind==="acp_event"){const a=fi(i);if(a!=null&&a.update)return Mm(s,a.update)}return s;default:return s}}function md(s,i){let a=s;for(const c of i)a=Dm(a,c);return a}function Fm(s,i,a){return{...s,items:s.items.map(c=>c.kind==="perm"&&c.id===i&&c.state==="open"?{...c,state:a?"allowed":"rejected"}:c)}}Re.setOptions({gfm:!0,breaks:!0});const Tt="ui-monospace,Menlo,monospace";function bm(s){const i=s.target.closest("a");if(!i)return;s.preventDefault();const a=i.getAttribute("href")||"";/^https?:/i.test(a)&&mh(a)}function Bm({text:s}){const i=G.useMemo(()=>Jh.sanitize(Re.parse(s,{async:!1})),[s]);return p.jsx("div",{className:"md",onClick:bm,dangerouslySetInnerHTML:{__html:i}})}const gi={padding:"8px 12px",fontSize:12.5,cursor:"pointer",whiteSpace:"nowrap",borderRadius:8,userSelect:"none"};function Vf({meta:s,active:i,onClick:a,onArchive:c,onDelete:f}){const[h,w]=G.useState(!1),[v,_]=G.useState("closed"),k=s.status==="running",A=k?{text:"运行中",color:"var(--amberT)"}:s.status==="error"?{text:"出错",color:"var(--err)"}:s.status==="interrupted"?{text:"已中断",color:"var(--t5)"}:{text:s.turns>0?s.turns+" 轮":"",color:"var(--t5)"},M=()=>_("closed");return p.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[p.jsx("div",{className:"hv-cardh",title:s.workdir,onClick:a,style:{background:i?"var(--card2)":"transparent",borderRadius:10,padding:"9px 13px",cursor:"pointer"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,fontWeight:i?600:400,color:i?"var(--t1)":"var(--t3)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:s.title||"(未命名)"}),s.worktree&&p.jsx("span",{title:"隔离 worktree 会话",style:{flex:"none",fontSize:10,fontWeight:600,color:"var(--amberT)",background:"var(--amberBg)",borderRadius:5,padding:"1px 6px"},children:"隔离"}),h||v!=="closed"?p.jsx("span",{className:"hv-t1",title:"会话操作",onClick:L=>{L.stopPropagation(),_(v==="closed"?"open":"closed")},style:{marginLeft:"auto",flex:"none",fontSize:14,fontWeight:700,color:"var(--t4)",padding:"0 3px",cursor:"pointer"},children:"⋯"}):p.jsx("span",{style:{marginLeft:"auto",fontSize:11,fontWeight:400,color:A.color},children:A.text})]})}),v!=="closed"&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:L=>{L.stopPropagation(),M()}}),p.jsx("div",{style:{position:"absolute",right:6,top:"85%",zIndex:30,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:10,boxShadow:"var(--shadow)",padding:4,minWidth:150,animation:"mcin .15s ease"},onClick:L=>L.stopPropagation(),children:v==="open"?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"hv-card",style:gi,onClick:()=>{M(),c()},children:s.archived?"取消归档":"归档"}),k?p.jsx("div",{style:{...gi,cursor:"default",color:"var(--t5)"},title:"运行中,请先停止",children:"删除"}):p.jsx("div",{className:"hv-card",style:{...gi,color:"var(--err)"},onClick:()=>_("confirm"),children:"删除"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{padding:"8px 12px 4px",fontSize:11.5,color:"var(--t4)",lineHeight:1.6,maxWidth:200,whiteSpace:"normal"},children:["删除后不可恢复。",s.worktree?"隔离工作区及未应用改动将一并删除。":""]}),p.jsxs("div",{style:{display:"flex",gap:4},children:[p.jsx("div",{className:"hv-card",style:{...gi,color:"var(--err)",fontWeight:600},onClick:()=>{M(),f()},children:"确认删除"}),p.jsx("div",{className:"hv-card",style:gi,onClick:M,children:"取消"})]})]})})]})]})}function Um({text:s}){const[i,a]=G.useState(!1),c=s.trim().split(` +`)[0].slice(0,160):"";f[h]={...w,status:i.status==="completed"?"ok":"fail",out:v,lastLine:void 0};break}}return{...s,items:f}}case"plan":{const f=s.items.slice();for(let h=f.length-1;h>=0;h--)if(f[h].kind==="plan")return f[h]={kind:"plan",entries:i.entries??[]},{...s,items:f,streamKind:""};return Rr(s,{kind:"plan",entries:i.entries??[]})}case"llm_call_retry":return Rr(s,{kind:"sys",text:`模型调用重试 #${i.attempt??"?"}: ${i.message??""}`});case"usage_update":return{...s,usage:{used:i.used??0,size:i.size??0}};case"compact_status":return Rr(s,{kind:"sys",text:i.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const f=i.model??"";return{...Rr(s,{kind:"sys",text:`模型已切换为 ${f}`}),model:f}}case"permission_mode_update":{const f=i.mode??"default";return{...Rr(s,{kind:"sys",text:f==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:f}}default:return s}}function Dm(s,i){switch(i.type){case"task-started":return{...s,running:!0};case"task-ended":return{...s,running:!1,streamKind:"",turnEnded:!0,items:[...Hf(s.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const a=fi(i);return{...s,running:!1,streamKind:"",items:[...Hf(s.items),{kind:"sys",text:"✗ "+((a==null?void 0:a.error)||"未知错误"),error:!0}]}}case"user-input":{const a=fi(i);let c="";try{c=a!=null&&a.content?Fa(a.content):""}catch{c=(a==null?void 0:a.content)??""}return Rr(s,{kind:"user",text:c})}case"permission-req":{const a=fi(i);return a!=null&&a.id?Rr(s,{kind:"perm",id:a.id,title:a.title??"",tool:a.tool??"",state:"open"}):s}case"permission-resolved":{const a=fi(i);return a!=null&&a.id?{...s,items:s.items.map(c=>c.kind==="perm"&&c.id===a.id&&c.state==="open"?{...c,state:a.outcome??"expired"}:c)}:s}case"task-running":if(i.kind==="acp_event"){const a=fi(i);if(a!=null&&a.update)return Mm(s,a.update)}return s;default:return s}}function md(s,i){let a=s;for(const c of i)a=Dm(a,c);return a}function Fm(s,i,a){return{...s,items:s.items.map(c=>c.kind==="perm"&&c.id===i&&c.state==="open"?{...c,state:a?"allowed":"rejected"}:c)}}Re.setOptions({gfm:!0,breaks:!0});const Tt="ui-monospace,Menlo,monospace";function bm(s){const i=s.target.closest("a");if(!i)return;s.preventDefault();const a=i.getAttribute("href")||"";/^https?:/i.test(a)&&mh(a)}function Bm({text:s}){const i=G.useMemo(()=>Jh.sanitize(Re.parse(s,{async:!1})),[s]);return p.jsx("div",{className:"md",onClick:bm,dangerouslySetInnerHTML:{__html:i}})}const gi={padding:"8px 12px",fontSize:12.5,cursor:"pointer",whiteSpace:"nowrap",borderRadius:8,userSelect:"none"};function Vf({meta:s,active:i,onClick:a,onArchive:c,onDelete:f}){const[h,w]=G.useState(!1),[v,_]=G.useState("closed"),[k,A]=G.useState({right:0}),F=s.status==="running",N=F?{text:"运行中",color:"var(--amberT)"}:s.status==="error"?{text:"出错",color:"var(--err)"}:s.status==="interrupted"?{text:"已中断",color:"var(--t5)"}:{text:s.turns>0?s.turns+" 轮":"",color:"var(--t5)"},ee=()=>_("closed");return p.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[p.jsx("div",{className:"hv-cardh",title:s.workdir,onClick:a,style:{background:i?"var(--card2)":"transparent",borderRadius:10,padding:"9px 13px",cursor:"pointer"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,fontWeight:i?600:400,color:i?"var(--t1)":"var(--t3)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:s.title||"(未命名)"}),s.worktree&&p.jsx("span",{title:"隔离 worktree 会话",style:{flex:"none",fontSize:10,fontWeight:600,color:"var(--amberT)",background:"var(--amberBg)",borderRadius:5,padding:"1px 6px"},children:"隔离"}),h||v!=="closed"?p.jsx("span",{className:"hv-t1",title:"会话操作",onClick:W=>{if(W.stopPropagation(),v!=="closed")return _("closed");const q=W.currentTarget.getBoundingClientRect(),ie=q.bottom+150>window.innerHeight;A({right:Math.max(8,window.innerWidth-q.right),...ie?{bottom:window.innerHeight-q.top+4}:{top:q.bottom+4}}),_("open")},style:{marginLeft:"auto",flex:"none",fontSize:14,fontWeight:700,color:"var(--t4)",padding:"0 3px",cursor:"pointer"},children:"⋯"}):p.jsx("span",{style:{marginLeft:"auto",fontSize:11,fontWeight:400,color:N.color},children:N.text})]})}),v!=="closed"&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:W=>{W.stopPropagation(),ee()}}),p.jsx("div",{style:{position:"fixed",right:k.right,top:k.top,bottom:k.bottom,zIndex:30,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:10,boxShadow:"var(--shadow)",padding:4,minWidth:150,animation:"mcin .15s ease"},onClick:W=>W.stopPropagation(),children:v==="open"?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"hv-card",style:gi,onClick:()=>{ee(),c()},children:s.archived?"取消归档":"归档"}),F?p.jsx("div",{style:{...gi,cursor:"default",color:"var(--t5)"},title:"运行中,请先停止",children:"删除"}):p.jsx("div",{className:"hv-card",style:{...gi,color:"var(--err)"},onClick:()=>_("confirm"),children:"删除"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{padding:"8px 12px 4px",fontSize:11.5,color:"var(--t4)",lineHeight:1.6,maxWidth:200,whiteSpace:"normal"},children:["删除后不可恢复。",s.worktree?"隔离工作区及未应用改动将一并删除。":""]}),p.jsxs("div",{style:{display:"flex",gap:4},children:[p.jsx("div",{className:"hv-card",style:{...gi,color:"var(--err)",fontWeight:600},onClick:()=>{ee(),f()},children:"确认删除"}),p.jsx("div",{className:"hv-card",style:gi,onClick:ee,children:"取消"})]})]})})]})]})}function Um({text:s}){const[i,a]=G.useState(!1),c=s.trim().split(` `)[0]||"…";return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[p.jsxs("div",{className:"hv-t3",onClick:()=>a(!i),style:{display:"flex",alignItems:"center",gap:9,fontSize:12,color:"var(--t4)",cursor:"pointer",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{flex:"none"},children:"✦ 思考"}),p.jsxs("span",{style:{color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["— ",c]}),p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:i?"▾":"▸"})]}),i&&p.jsx("div",{style:{borderLeft:"2px solid var(--line)",padding:"2px 0 2px 14px",fontSize:12.5,color:"var(--t4)",lineHeight:1.8,whiteSpace:"pre-wrap",animation:"mcin .2s ease"},children:s})]})}function Wm({entries:s}){const i=a=>a==="completed"?"☑":a==="in_progress"?"◐":"☐";return p.jsx("div",{style:{border:"1px solid var(--line)",borderRadius:14,background:"var(--card)",padding:"13px 16px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:s.map((a,c)=>p.jsxs("div",{style:{color:a.status==="completed"?"var(--t5)":a.status==="in_progress"?"var(--amberT)":"var(--t3)",textDecoration:a.status==="completed"?"line-through":"none"},children:[p.jsx("span",{style:{display:"inline-block",width:18},children:i(a.status)})," ",a.content]},c))})}function Qf(s){return s==="run"?"◌":s==="ok"?"✓":"✗"}const Yf=5;function Hm({item:s,radius:i,onOpenChild:a}){const c=s.subItems??[],f=c.length-Yf,h=s.title.indexOf(" "),w=h>0?s.title.slice(0,h):"",v=h>0?s.title.slice(h+1):s.title,_={display:"flex",gap:8,alignItems:"baseline",padding:"0 14px 7px 35px",font:"11.5px/1.7 "+Tt,color:"var(--t4)",whiteSpace:"nowrap",minWidth:0};return p.jsxs("div",{style:{background:"var(--card)",borderRadius:i,overflow:"hidden"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"9px 14px",fontSize:12.5,whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:s.status==="run"?"var(--t4)":s.status==="ok"?"var(--ok)":"var(--err)",fontSize:11,flex:"none",display:"inline-block",animation:s.status==="run"?"mcspin 1s linear infinite":"none"},children:Qf(s.status)}),w&&p.jsx("span",{style:{color:"var(--t3)",flex:"none"},children:w}),p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:v}),s.childSessionId&&a&&p.jsx("span",{className:"hv-t1",onClick:()=>a(s.childSessionId),style:{font:"11.5px "+Tt,color:"var(--amberT)",cursor:"pointer",flex:"none"},children:"查看子会话"}),s.out&&p.jsx("span",{style:{marginLeft:"auto",color:"var(--t5)",fontSize:11,flex:"none",maxWidth:"45%",overflow:"hidden",textOverflow:"ellipsis"},children:s.out})]}),f>0&&p.jsxs("div",{style:{..._,color:"var(--t5)"},children:[p.jsx("span",{style:{flex:"none"},children:"↳"}),"… 已省略前 ",f," 步"]}),c.slice(-Yf).map(k=>p.jsxs("div",{style:_,children:[p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:"↳"}),p.jsx("span",{style:{color:k.status==="run"?"var(--t4)":k.status==="ok"?"var(--ok)":"var(--err)",fontSize:10,flex:"none"},children:Qf(k.status)}),p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:k.title})]},k.id)),s.status==="run"&&s.lastLine&&p.jsxs("div",{style:{..._,display:"block",color:"var(--t5)",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",animation:"mcpulse 1.2s infinite"},children:["↳ ",s.lastLine]})]})}function Gf(s){switch(s){case"allowed":case"approved":return{text:"✓ 已允许",color:"var(--ok)"};case"rejected":case"denied":return{text:"✕ 已拒绝",color:"var(--err)"};case"timeout":return{text:"✕ "+Uf(s),color:"var(--err)"};default:return{text:Uf(s),color:"var(--t5)"}}}function Vm({item:s,onAnswer:i}){const a={padding:"7px 18px",background:"var(--card2)",color:"var(--t2)",borderRadius:9,cursor:"pointer"};return p.jsxs("div",{style:{border:"1px solid var(--amberBd)",borderRadius:14,background:"var(--amberBg)",padding:"15px 17px",maxWidth:540,animation:"mcin .25s ease"},children:[p.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--amberT)",whiteSpace:"nowrap"},children:["需要确认 · ",s.tool||"执行操作"]}),p.jsx("div",{style:{margin:"10px 0 12px",padding:"9px 13px",background:"var(--codeBg)",borderRadius:9,font:"12.5px "+Tt,color:"var(--t1)",wordBreak:"break-all"},children:s.title}),s.state==="open"?p.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12.5,fontWeight:600,flexWrap:"wrap"},children:[p.jsx("div",{className:"hv-op",onClick:()=>i(s.id,"allow"),style:{...a,background:"var(--amber)",color:"var(--onAmber)"},children:"允许"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(s.id,"always"),style:a,children:"本会话始终"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(s.id,"persist"),style:a,children:"此项目永久"}),p.jsx("div",{className:"hv-err",onClick:()=>i(s.id,"deny"),style:{padding:"7px 14px",color:"var(--t4)",borderRadius:9,cursor:"pointer"},children:"拒绝"}),p.jsx("span",{style:{marginLeft:"auto",fontWeight:400,fontSize:11,color:"var(--t5)"},children:"⏎ 允许 · esc 拒绝"})]}):p.jsx("div",{style:{fontSize:12,color:Gf(s.state).color},children:Gf(s.state).text})]})}function Qm({item:s,onPermAnswer:i}){switch(s.kind){case"user":return p.jsx("div",{style:{alignSelf:"flex-end",maxWidth:"70%",background:"var(--card2)",borderRadius:"16px 16px 5px 16px",padding:"10px 16px",color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:s.text});case"agent":return p.jsx("div",{style:{maxWidth:"90%",color:"var(--t2)",wordBreak:"break-word",animation:"mcin .25s ease"},children:p.jsx(Bm,{text:s.text})});case"thought":return p.jsx(Um,{text:s.text});case"plan":return p.jsx(Wm,{entries:s.entries});case"sys":return p.jsx("div",{style:{color:s.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:s.text});case"perm":return p.jsx(Vm,{item:s,onAnswer:i})}}function gd({items:s,onPermAnswer:i,onOpenChild:a}){const c=[];for(let f=0;fp.jsx(Hm,{item:k,onOpenChild:a,radius:_===1?"11px":A===0?"11px 11px 4px 4px":A===_-1?"4px 4px 11px 11px":"4px"},k.tcId||A))},"g"+w))}else c.push(p.jsx(Qm,{item:h,onPermAnswer:i},f)),f++}return p.jsx(p.Fragment,{children:c})}function Ym(s){const i=[];let a=0,c=0;for(const f of s.split(` `)){const h=f.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(h){a=+h[1],c=+h[2],i.push({no:"",text:f,kind:"h"});continue}f.startsWith("diff ")||f.startsWith("index ")||f.startsWith("+++")||f.startsWith("---")||f.startsWith("new file")||f.startsWith("deleted file")||f.startsWith("similarity")||f.startsWith("rename")||f.startsWith("old mode")||f.startsWith("new mode")||(f.startsWith("+")?i.push({no:String(c++),text:f,kind:"add"}):f.startsWith("-")?i.push({no:String(a++),text:f,kind:"del"}):(i.push({no:String(c),text:f,kind:"ctx"}),a++,c++))}return i}function Gm({text:s}){const i=G.useMemo(()=>Ym(s),[s]);return i.some(a=>a.kind==="h")?p.jsx("div",{style:{font:"12px/1.9 "+Tt},children:i.map((a,c)=>a.kind==="h"?p.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--card)",color:"var(--t4)",fontSize:11},children:[p.jsx("span",{style:{width:36,flex:"none"}}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:a.text})]},c):p.jsxs("div",{style:{display:"flex",padding:"0 24px",background:a.kind==="add"?"var(--addBg)":a.kind==="del"?"var(--delBg)":"transparent",color:a.kind==="add"?"var(--addT)":a.kind==="del"?"var(--delT)":"var(--t3)"},children:[p.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:a.no}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:a.text||" "})]},c))}):p.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:s})}const Kf="data:image/png;base64,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";function qf(s){const i={};let a=0;for(const c of s.split(` `)){const f=c.indexOf("=");if(f<=0)continue;const h=c.slice(0,f).trim();h&&(i[h]=c.slice(f+1).trim(),a++)}return a?i:void 0}const Km=s=>s&&typeof s=="object"?Object.entries(s).map(([i,a])=>`${i}=${String(a)}`).join(` -`):"";function qm(s){const i={};for(const a of s){const c=a.name.trim();if(c)if(a.type==="stdio"){if(!a.command.trim())continue;const f=a.args.trim()?a.args.trim().split(/\s+/):void 0;i[c]={command:a.command.trim(),args:f,env:qf(a.kv)}}else{if(!a.url.trim())continue;i[c]={url:a.url.trim(),headers:qf(a.kv)}}}return i}function Xm(s){return Object.entries(s).map(([i,a])=>{const c=a??{},f=typeof c.command=="string"&&c.command!=="";return{name:i,type:f?"stdio":"http",url:typeof c.url=="string"?c.url:"",command:typeof c.command=="string"?c.command:"",args:Array.isArray(c.args)?c.args.map(String).join(" "):"",kv:Km(f?c.env:c.headers)}})}const Cl={width:588,maxWidth:"100%",background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:18,boxSizing:"border-box"},er={width:"100%",background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 11px",font:"11.5px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"},Xf={background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 8px",fontSize:12,color:"var(--t1)",outline:"none",cursor:"pointer"},_a={padding:"7px 14px",background:"var(--card2)",borderRadius:9,cursor:"pointer",fontSize:12,fontWeight:600,color:"var(--t2)",whiteSpace:"nowrap",userSelect:"none"};function Cn({label:s,children:i}){return p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:11,color:"var(--t4)",marginBottom:4},children:s}),i]})}function Jm(){try{return localStorage.getItem("mc.theme")==="light"?"light":"dark"}catch{return"dark"}}function Zm(s){document.documentElement.classList.toggle("light",s==="light");try{localStorage.setItem("mc.theme",s)}catch{}}function $m(){const[s,i]=G.useState(Jm()),a=f=>{Zm(f),i(f)},c=(f,h)=>p.jsx("div",{onClick:()=>a(f),style:{padding:"6px 18px",fontSize:12.5,fontWeight:600,borderRadius:8,cursor:"pointer",userSelect:"none",background:s===f?"var(--amber)":"transparent",color:s===f?"var(--onAmber)":"var(--t3)"},children:h});return p.jsxs("div",{style:{display:"inline-flex",background:"var(--card)",borderRadius:10,padding:3,gap:2},children:[c("dark","深色"),c("light","浅色")]})}const Jf=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),eg=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function tg({onClose:s}){const i=Ia(),[a,c]=G.useState([]),[f,h]=G.useState(0),[w,v]=G.useState([]),[_,k]=G.useState(!1),[A,M]=G.useState(""),[L,te]=G.useState(!1);G.useEffect(()=>{i&&ph().then(Q=>{const W=(Q==null?void 0:Q.models)??[];c(W.length?W:[Jf()]),h(Math.max(0,W.findIndex(X=>X.default))),v(Xm((Q==null?void 0:Q.mcp_servers)??{})),k(!0)}).catch(Q=>M("读取配置失败: "+(Q instanceof Error?Q.message:String(Q))))},[i]);const K=(Q,W)=>c(X=>X.map((ie,fe)=>fe===Q?{...ie,...W}:ie)),$=(Q,W)=>v(X=>X.map((ie,fe)=>fe===Q?{...ie,...W}:ie)),se=async()=>{for(const W of a)if(!W.name.trim()||!W.base_url.trim()||!W.api_key.trim()||!W.model.trim()){M(`模型「${W.name.trim()||"未命名"}」信息不完整(需名称/接口地址/API Key/模型标识)`);return}const Q=new Set;for(const W of a){if(Q.has(W.name.trim())){M(`模型名称重复: ${W.name.trim()}`);return}Q.add(W.name.trim())}M(""),te(!0);try{await hh({models:a.map((W,X)=>({...W,name:W.name.trim(),default:X===f})),mcp_servers:qm(w)})}catch(W){M(W instanceof Error?W.message:String(W)),te(!1)}};return p.jsx("div",{style:{flex:1,overflowY:"auto",animation:"mcin .25s ease"},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:14,padding:"40px 24px 60px"},children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center"},children:[p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"设置"}),p.jsx("div",{className:"hv-cardh",onClick:s,style:{..._a,marginLeft:"auto"},children:"返回"})]}),p.jsx("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"外观"})}),p.jsxs("div",{style:{...Cl,display:"flex",alignItems:"center",gap:12},children:[p.jsx($m,{}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"跟随本机保存,重启后保持。"})]}),!i&&p.jsx("div",{style:{...Cl,color:"var(--t4)",fontSize:12.5,lineHeight:1.7},children:"浏览器模式下配置只读:模型与 MCP 由启动 mc-agent 的宿主(桌面应用或环境变量)管理。"}),i&&!_&&!A&&p.jsx("div",{style:{fontSize:12.5,color:"var(--t5)"},children:"读取配置中…"}),i&&_&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"模型"}),p.jsx("div",{className:"hv-cardh",onClick:()=>c(Q=>[...Q,Jf()]),style:{..._a,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加模型"})]}),a.length===0&&p.jsx("div",{style:{...Cl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"还没有模型。保存后应用可运行,但需要添加模型才能开始任务。"}),a.map((Q,W)=>p.jsxs("div",{style:Cl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Cn,{label:"名称",children:p.jsx("input",{style:er,value:Q.name,placeholder:"如: 主力模型",onChange:X=>K(W,{name:X.target.value})})}),p.jsx(Cn,{label:"协议",children:p.jsxs("select",{style:{...Xf,width:"100%"},value:Q.provider||"anthropic",onChange:X=>K(W,{provider:X.target.value}),children:[p.jsx("option",{value:"anthropic",children:"anthropic"}),p.jsx("option",{value:"openai",children:"openai(Chat Completions)"}),p.jsx("option",{value:"openai_responses",children:"openai_responses(Responses)"})]})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:"接口地址",children:p.jsx("input",{style:er,value:Q.base_url,placeholder:"https://api.example.com",onChange:X=>K(W,{base_url:X.target.value})})})}),p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Cn,{label:"API Key",children:p.jsx("input",{style:er,type:"password",value:Q.api_key,placeholder:"sk-...",onChange:X=>K(W,{api_key:X.target.value})})}),p.jsx(Cn,{label:"模型标识",children:p.jsx("input",{style:er,value:Q.model,placeholder:"请求中的 model 字段",onChange:X=>K(W,{model:X.target.value})})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:12,fontSize:12},children:[W===f?p.jsx("span",{style:{color:"var(--amberT)",fontWeight:600},children:"✓ 默认模型"}):p.jsx("span",{className:"hv-t1",style:{color:"var(--t4)",cursor:"pointer"},onClick:()=>h(W),children:"设为默认"}),p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>{c(X=>X.filter((ie,fe)=>fe!==W)),h(X=>Wv(Q=>[...Q,eg()]),style:{..._a,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加 MCP"})]}),w.length===0&&p.jsx("div",{style:{...Cl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"未配置 MCP 服务器(可选)。项目级 .mc-agent/mcp.json 仍随仓库生效。"}),w.map((Q,W)=>p.jsxs("div",{style:Cl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Cn,{label:"名称",children:p.jsx("input",{style:er,value:Q.name,placeholder:"如: context7",onChange:X=>$(W,{name:X.target.value})})}),p.jsx(Cn,{label:"类型",children:p.jsxs("select",{style:{...Xf,width:"100%"},value:Q.type,onChange:X=>$(W,{type:X.target.value}),children:[p.jsx("option",{value:"http",children:"HTTP(URL)"}),p.jsx("option",{value:"stdio",children:"stdio(本地命令)"})]})})]}),Q.type==="http"?p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:"URL",children:p.jsx("input",{style:er,value:Q.url,placeholder:"https://mcp.example.com/mcp",onChange:X=>$(W,{url:X.target.value})})})}):p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Cn,{label:"命令",children:p.jsx("input",{style:er,value:Q.command,placeholder:"npx",onChange:X=>$(W,{command:X.target.value})})}),p.jsx(Cn,{label:"参数(空格分隔)",children:p.jsx("input",{style:er,value:Q.args,placeholder:"@playwright/mcp",onChange:X=>$(W,{args:X.target.value})})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:Q.type==="http"?"Headers(每行 KEY=VALUE)":"环境变量(每行 KEY=VALUE)",children:p.jsx("textarea",{style:{...er,resize:"vertical"},rows:2,value:Q.kv,onChange:X=>$(W,{kv:X.target.value})})})}),p.jsx("div",{style:{display:"flex",marginTop:12,fontSize:12},children:p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>v(X=>X.filter((ie,fe)=>fe!==W)),children:"删除"})})]},W)),p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",gap:12,marginTop:16},children:[p.jsx("div",{className:"hv-op",onClick:()=>!L&&void se(),style:{padding:"9px 22px",borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",fontWeight:700,fontSize:13,cursor:"pointer",opacity:L?.5:1,userSelect:"none"},children:L?"保存并重启内核中…":"保存"}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"保存后内核自动重启,会话在磁盘不丢失。"})]})]}),A&&p.jsx("div",{style:{width:588,maxWidth:"100%",fontSize:12.5,color:"var(--err)"},children:A})]})})}let vd=-1/0;const Ra=s=>{vd=s.timeStamp},Aa=s=>s.nativeEvent.isComposing||s.timeStamp-vd<100,La=s=>s>=1e3?Math.round(s/100)/10+"k":String(s),Zf=s=>s.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||s,vi="~/MonkeyCode";function ng(s){var c;const i=new Map;for(const f of s){const h=((c=f.worktree)==null?void 0:c.repo)||f.workdir,w=i.get(h);w?w.push(f):i.set(h,[f])}const a=[...i.entries()].map(([f,h])=>{var w;return h.sort((v,_)=>(_.updated_at??"").localeCompare(v.updated_at??"")),{dir:f,name:f.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||f,latest:((w=h[0])==null?void 0:w.updated_at)??"",items:h}});return a.sort((f,h)=>h.latest.localeCompare(f.latest)),a}const _l={width:720,maxWidth:"100%"};function rg(){var Vn,rn,Xr;const[s,i]=G.useState([]),[a,c]=G.useState(null),[f,h]=G.useState("new"),[w,v]=G.useState(jo),[_,k]=G.useState("未连接"),[A,M]=G.useState(null),[L,te]=G.useState(""),[K,$]=G.useState(!1),[se,Q]=G.useState(null),[W,X]=G.useState(""),[ie,fe]=G.useState(null),[de,Te]=G.useState(""),[Ge,vt]=G.useState(null),[Fe,$t]=G.useState([]),[be,Xe]=G.useState(""),[Ke,He]=G.useState(!1),[Ve,ve]=G.useState(!1),[b,ee]=G.useState(null),[B,y]=G.useState(vi),[I,ue]=G.useState(!1),[ce,he]=G.useState(""),[me,Se]=G.useState(""),[ge,Ee]=G.useState(""),[lt,we]=G.useState(!1),[rr,Ce]=G.useState(!1),[Pn,Le]=G.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("mc.collapsedGroups")||"[]"))}catch{return new Set}}),[dn,lr]=G.useState(()=>localStorage.getItem("mc.archivedOpen")==="1"),Wt=()=>{lr(S=>(localStorage.setItem("mc.archivedOpen",S?"0":"1"),!S))},ir=S=>{Le(N=>{const J=new Set(N);return J.has(S)?J.delete(S):J.add(S),localStorage.setItem("mc.collapsedGroups",JSON.stringify([...J])),J})},Ne=G.useRef(null),Ht=G.useRef(null),On=G.useRef(null),jt=G.useRef(null),zt=G.useRef(!0),Pt=G.useRef(null),pn=G.useRef(!1),ct=G.useCallback(async()=>{const S=await sh();return i(S),S},[]),Ot=G.useCallback(async()=>{const S=Ne.current;if(!S)return[];try{const N=await S.call("repo_file_changes");if(N.error)return te(N.error),M([]),[];te("");const J=N.result??[];return M(J),J}catch(N){return te(N instanceof Error?N.message:String(N)),M([]),[]}},[]),Mn=async S=>{try{await fh(S.id,!S.archived),await ct()}catch(N){k("⚠ 归档失败: "+(N instanceof Error?N.message:String(N)))}},Ct=async S=>{var N;try{await ch(S.id)}catch(J){k("⚠ 删除失败: "+(J instanceof Error?J.message:String(J)));return}S.id===a&&((N=Ne.current)==null||N.close(),Ne.current=null,c(null),h("new"),v(jo),M(null),te(""),$(!1),Q(null),ve(!1),fe(null),Xe(""),He(!1),k("未连接"),localStorage.removeItem("mc.lastSession")),ct()},_t=G.useCallback((S,N,J)=>{var Qe;(Qe=Ne.current)==null||Qe.close(),c(S),h("session"),v(jo),M(null),te(""),$(!1),Q(null),ve(!1),fe(null),Xe(N??""),He(J==="yolo"),localStorage.setItem("mc.lastSession",S),Ne.current=ed(S,{onFrames:dt=>v(_n=>md(_n,dt)),onStatus:dt=>k(dt)}),ct()},[ct]);G.useEffect(()=>{const S=gh("open-settings",()=>h("settings"));return Promise.all([ah().catch(()=>[]),ct()]).then(([N,J])=>{var _n;$t(N),he(((_n=N.find(Qn=>Qn.default))==null?void 0:_n.name)??"");const Qe=localStorage.getItem("mc.lastSession"),dt=J.find(Qn=>Qn.id===Qe);dt&&_t(dt.id,dt.model,dt.mode),N.length===0&&Ia()&&h("settings")}).catch(N=>k("无法连接服务: "+(N instanceof Error?N.message:N))),()=>{var N;S(),(N=Ne.current)==null||N.close()}},[]),G.useEffect(()=>{w.model&&Xe(w.model)},[w.model]),G.useEffect(()=>{w.permMode&&He(w.permMode==="yolo")},[w.permMode]);const Dn=((Vn=[...s].sort((S,N)=>(N.updated_at??"").localeCompare(S.updated_at??""))[0])==null?void 0:Vn.workdir)??"";G.useEffect(()=>{pn.current||y(Dn||vi)},[Dn]);const Fn=_.startsWith("已连接");G.useEffect(()=>{var N;if(!Fn)return;Ot();const S=Pt.current;S&&((N=Ne.current)!=null&&N.send("user-input",{content:xi(S)}))&&(Pt.current=null)},[Fn,Ot]),G.useEffect(()=>{w.turnEnded&&(v(S=>({...S,turnEnded:!1})),Ot(),ct())},[w.turnEnded,Ot,ct]),G.useEffect(()=>{var S;w.running||!ie||(S=Ne.current)!=null&&S.send("user-input",{content:xi(ie)})&&fe(null)},[w.running,ie]),G.useEffect(()=>{const S=Ht.current;S&&zt.current&&(S.scrollTop=S.scrollHeight)},[w.items,w.running]),G.useEffect(()=>{const S=On.current;S&&(S.style.height="auto",S.style.height=Math.min(S.scrollHeight,160)+"px")},[W]);const Lr=()=>{const S=Ht.current;S&&(zt.current=S.scrollHeight-S.scrollTop-S.clientHeight<40)},Nr=()=>{const S=W.trim();if(!(!S||!Ne.current)){if(w.running){fe(S),X("");return}Ne.current.send("user-input",{content:xi(S)})&&X("")}},hn=(S,N)=>{var Qe;const J=N!=="deny";(Qe=Ne.current)!=null&&Qe.send("permission-resp",{id:S,approved:J,remember:N==="always"||N==="persist",persist:N==="persist"})&&v(dt=>Fm(dt,S,J))},bn=async S=>{if(ve(!1),!(!Ne.current||!S||S===be))try{const N=await Ne.current.call("session_set_model",{model:S});if(N.error){k("⚠ 切换模型失败: "+N.error);return}Xe(S),ct()}catch(N){k("⚠ 切换模型失败: "+(N instanceof Error?N.message:N))}},Vt=async()=>{if(!Ne.current)return;const S=Ke,N=S?"default":"yolo";He(!S);try{const J=await Ne.current.call("session_set_mode",{mode:N});J.error&&(He(S),k("⚠ 切换权限模式失败: "+J.error))}catch(J){He(S),k("⚠ 切换权限模式失败: "+(J instanceof Error?J.message:J))}},ft=async S=>{var N;Q({path:S,text:"加载中…"});try{const J=await Ne.current.call("repo_file_diff",{path:S});Q({path:S,text:J.error?"✗ "+J.error:((N=J.result)==null?void 0:N.diff)||"(无差异)"})}catch(J){Q({path:S,text:"✗ "+(J instanceof Error?J.message:J)})}},Bn=()=>{$(!0),Ot().then(S=>{S.length?ft(S[0].path):Q(null)})},Qt=async(S=!1)=>{const N=B.trim();if(!(!N||rr)){Ce(!0),Ee(""),we(!1);try{const J=await uh(N,ce,S||N===vi),Qe=me.trim();Qe&&(Pt.current=Qe),Se(""),await ct(),_t(J.id,J.model,J.mode)}catch(J){const Qe=J instanceof Error?J.message:String(J);Ee("创建失败: "+Qe),Qe.includes("目录不存在")&&we(!0)}finally{Ce(!1)}}},mn=async()=>{const S=await dh();S&&(pn.current=!0,y(S),Ee(""),we(!1))},Yt=s.find(S=>S.id===a),Un=be||((rn=Fe.find(S=>S.default))==null?void 0:rn.name)||"",Wn=be&&!Fe.some(S=>S.name===be)?[...Fe,{name:be,default:!1}]:Fe,Gt=w.usage,tt=[...w.items].reverse().find(S=>S.kind==="perm"&&S.state==="open"),en=w.items.some(S=>S.kind==="tool"&&S.status==="run"),or=tt?"等待权限确认":en?"执行中":"思考中",gn=Math.max(1,w.items.filter(S=>S.kind==="user").length),Hn=de.trim().toLowerCase(),tn=(Hn?s.filter(S=>(S.title||"").toLowerCase().includes(Hn)||S.workdir.toLowerCase().includes(Hn)):s).slice().sort((S,N)=>(N.updated_at??"").localeCompare(S.updated_at??"")),Ir=tn.filter(S=>!S.archived),nn=tn.filter(S=>S.archived),vn=f==="new"||a===null;return G.useEffect(()=>{const S=N=>{var J;if((N.metaKey||N.ctrlKey)&&N.key.toLowerCase()==="k"){N.preventDefault(),(J=jt.current)==null||J.focus();return}if(N.key==="Tab"&&N.shiftKey&&f==="session"&&a){N.preventDefault(),Vt();return}if(N.key==="Escape"){if(Ve)return ve(!1);if(Ge)return vt(null);if(K)return $(!1);if(f==="settings")return h(a?"session":"new");tt&&hn(tt.id,"deny");return}if(N.key==="Enter"&&!N.isComposing&&tt&&!vn){const Qe=N.target;if(Qe&&(Qe.tagName==="TEXTAREA"||Qe.tagName==="INPUT")&&W.trim())return;N.preventDefault(),hn(tt.id,"allow")}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)}),p.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",background:"var(--bg)",color:"var(--t2)",fontSize:13.5,overflow:"hidden",position:"relative"},children:[p.jsxs("div",{style:{width:292,flex:"none",display:"flex",flexDirection:"column",background:"var(--side)",borderRight:"1px solid var(--line)",minWidth:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"20px 18px 14px"},children:[p.jsx("img",{src:Kf,alt:"",draggable:!1,style:{width:28,height:28,borderRadius:9,flex:"none"}}),p.jsx("div",{style:{fontWeight:700,fontSize:14.5,color:"var(--t1)",letterSpacing:"-.01em"},children:"MonkeyCode"})]}),p.jsx("div",{style:{padding:"0 14px 12px"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:"var(--card)",borderRadius:9,padding:"0 11px"},children:[p.jsx("span",{style:{color:"var(--t4)",fontSize:12},children:"⌕"}),p.jsx("input",{ref:jt,value:de,onChange:S=>Te(S.target.value),placeholder:"搜索会话",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:12.5,padding:"8px 0",minWidth:0}}),p.jsx("span",{style:{font:"10px "+Tt,color:"var(--t5)"},children:"⌘K"})]})}),p.jsxs("div",{style:{padding:"0 14px",flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 8px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"云端任务"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"跑在服务器"})]}),p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有云端任务。长任务可以派发到服务器上跑,关掉客户端也会继续。"})]}),p.jsx("div",{style:{padding:"16px 14px 0",flex:"none"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 6px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"本地会话"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"这台电脑"}),p.jsx("span",{className:"hv-cardh",title:"新建任务",onClick:()=>{h("new"),ve(!1)},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",userSelect:"none"},children:"+"})]})}),p.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 14px"},children:[s.length===0&&p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有会话。在右侧输入第一个任务开始。"}),s.length>0&&tn.length===0&&p.jsxs("div",{style:{padding:"2px 4px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:["没有匹配「",de.trim(),"」的会话。"]}),ng(Ir).map(S=>p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{title:S.dir,onClick:()=>ir(S.dir),onMouseEnter:()=>ee(S.dir),onMouseLeave:()=>ee(null),style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:Pn.has(S.dir)?"▶":"▼"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:S.items.length}),p.jsx("span",{className:"hv-t1",title:"在 "+S.dir+" 新建会话",onClick:N=>{N.stopPropagation(),pn.current=!0,y(S.dir),ue(!1),h("new")},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",visibility:b===S.dir?"visible":"hidden"},children:"+"})]}),!Pn.has(S.dir)&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:S.items.map(N=>p.jsx(Vf,{meta:N,active:N.id===a&&f==="session",onClick:()=>_t(N.id,N.model,N.mode),onArchive:()=>void Mn(N),onDelete:()=>void Ct(N)},N.id))})]},S.dir)),nn.length>0&&p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{onClick:Wt,style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:dn?"▼":"▶"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t5)"},children:"已归档"}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:nn.length})]}),dn&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:nn.map(S=>p.jsx(Vf,{meta:S,active:S.id===a&&f==="session",onClick:()=>_t(S.id,S.model,S.mode),onArchive:()=>void Mn(S),onDelete:()=>void Ct(S)},S.id))})]})]}),p.jsxs("div",{style:{padding:"14px 18px",display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",borderTop:"1px solid var(--line)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Fn?"var(--ok)":"var(--t5)",flex:"none"}}),p.jsx("span",{title:_,style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:_}),p.jsx("span",{className:"hv-t1",title:"设置",onClick:()=>{ve(!1),h("settings")},style:{marginLeft:"auto",cursor:"pointer",fontSize:15},children:"⚙"})]})]}),p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:f==="settings"?p.jsx(tg,{onClose:()=>h(a?"session":"new")}):vn?p.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,animation:"mcin .25s ease",padding:"0 24px"},children:[s.length===0?p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,marginBottom:2},children:[p.jsx("img",{src:Kf,alt:"",draggable:!1,style:{width:52,height:52,borderRadius:16}}),p.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"把第一个任务交给 MonkeyCode"}),p.jsxs("div",{style:{fontSize:13,color:"var(--t4)",maxWidth:460,textAlign:"center",lineHeight:1.7},children:["描述你想做的事。工作目录"," ",p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t3)"},children:B||vi})," ","已自动准备好,也可以换成你的项目目录。"]})]}):p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"开始一个新任务"}),p.jsxs("div",{style:{display:"flex",gap:12,maxWidth:"100%",flexWrap:"wrap",justifyContent:"center"},children:[p.jsxs("div",{style:{width:288,border:"1px solid var(--amberBd)",borderRadius:16,background:"var(--amberBg)",padding:20,boxSizing:"border-box"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--amberT)",whiteSpace:"nowrap"},children:["⌂ 本地",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--amberBg)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"默认 ⏎"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在这台电脑上,直接读写本地文件;每步权限逐一确认。"}),I?p.jsx("input",{value:B,autoFocus:!0,onChange:S=>{pn.current=!0,y(S.target.value),Ee(""),we(!1)},onCompositionEnd:Ra,onKeyDown:S=>S.key==="Enter"&&!Aa(S)&&ue(!1),onBlur:()=>ue(!1),placeholder:"/home/you/dev/project",style:{width:"100%",marginTop:12,background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"7px 10px",font:"11px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"}}):p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:12,font:"11px "+Tt,color:"var(--t5)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:B}),B===vi&&p.jsx("span",{style:{flex:"none"},children:"· 自动创建"}),p.jsx("span",{className:"hv-t1",onClick:()=>ue(!0),style:{marginLeft:"auto",cursor:"pointer",flex:"none",font:"12px system-ui"},children:"更改"}),Ia()&&p.jsx("span",{className:"hv-t1",onClick:()=>void mn(),style:{cursor:"pointer",flex:"none",font:"12px system-ui"},children:"浏览…"})]})]}),p.jsxs("div",{style:{width:288,border:"1px solid var(--line)",borderRadius:16,background:"var(--card)",padding:20,boxSizing:"border-box",opacity:.7},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--t1)",whiteSpace:"nowrap"},children:["☁ 云端",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--card2)",color:"var(--t4)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"即将上线"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在云上服务器,关掉客户端也继续;完成后打包改动回来审查。"}),p.jsxs("div",{style:{display:"flex",font:"11px "+Tt,color:"var(--t5)",marginTop:12,whiteSpace:"nowrap"},children:["需要连接平台",p.jsx("span",{style:{marginLeft:"auto"},children:"长任务推荐"})]})]})]}),ge&&p.jsxs("div",{style:{..._l,width:588,fontSize:12,color:"var(--err)"},children:[ge,lt&&p.jsx("span",{className:"hv-op",onClick:()=>void Qt(!0),style:{cursor:"pointer",color:"var(--amberT)",marginLeft:8},children:"创建该目录并继续 →"})]}),p.jsxs("div",{style:{..._l,width:588,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("input",{value:me,autoFocus:!0,onChange:S=>Se(S.target.value),onCompositionEnd:Ra,onKeyDown:S=>S.key==="Enter"&&!Aa(S)&&void Qt(),placeholder:"描述任务…(可留空,先建会话)",style:{width:"100%",background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:13.5,boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:12,fontSize:12,color:"var(--t5)"},children:[Fe.length>1?p.jsx("select",{value:ce,onChange:S=>he(S.target.value),style:{background:"transparent",border:"none",outline:"none",color:"var(--t4)",fontSize:12,cursor:"pointer"},children:Fe.map(S=>p.jsxs("option",{value:S.name,children:[S.name,S.default?"(默认)":""]},S.name))}):p.jsx("span",{children:((Xr=Fe[0])==null?void 0:Xr.name)??""}),p.jsx("div",{className:"hv-op",onClick:()=>void Qt(),style:{marginLeft:"auto",width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:rr?.5:1},children:"↑"})]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 24px",height:56,flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,fontWeight:600,color:"var(--t1)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:(Yt==null?void 0:Yt.title)||"(未命名)"}),p.jsxs("span",{style:{font:"400 11px "+Tt,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["⌂ ",(Yt==null?void 0:Yt.workdir)??""]})]}),p.jsxs("div",{className:"hv-card",title:"查看本轮文件改动",onClick:Bn,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:8,cursor:"pointer",whiteSpace:"nowrap",fontSize:12,color:"var(--t3)",flex:"none",userSelect:"none"},children:[p.jsx("span",{style:{color:"var(--amberT)"},children:"⇄"})," 改动",A&&A.length>0?` · ${A.length}`:""]})]}),p.jsx("div",{style:{height:1,background:"var(--line)",margin:"0 24px",flex:"none"}}),p.jsx("div",{ref:Ht,onScroll:Lr,style:{flex:1,overflowY:"auto",display:"flex",justifyContent:"center"},children:p.jsx("div",{style:{..._l,maxWidth:"calc(100% - 48px)",padding:"28px 0 16px",display:"flex",flexDirection:"column",gap:18,lineHeight:1.8,height:"fit-content"},children:p.jsx(gd,{items:w.items,onPermAnswer:hn,onOpenChild:vt})})}),w.running&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{..._l,display:"flex",alignItems:"center",gap:10,fontSize:12.5,color:"var(--t3)",padding:"2px 0",boxSizing:"border-box"},children:[p.jsx("span",{style:{width:12,height:12,border:"2px solid var(--amber)",borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .8s linear infinite",flex:"none"}}),or,p.jsxs("span",{style:{color:"var(--t5)"},children:["· 第 ",gn," 轮",Gt?` · 已用 ${La(Gt.used)} tokens`:""]}),p.jsx("span",{className:"hv-cardh",onClick:()=>{var S;return(S=Ne.current)==null?void 0:S.send("user-cancel",{})},style:{marginLeft:"auto",padding:"5px 13px",background:"var(--card2)",borderRadius:8,color:"var(--err)",cursor:"pointer",fontWeight:600,whiteSpace:"nowrap"},children:"■ 停止"})]})}),ie&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{..._l,display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",background:"var(--card)",borderRadius:10,padding:"7px 13px",boxSizing:"border-box"},children:[p.jsx("span",{style:{animation:"mcpulse 1.2s infinite"},children:"⏳"}),"已排队:",p.jsx("span",{style:{color:"var(--t2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ie}),p.jsx("span",{style:{marginLeft:"auto",whiteSpace:"nowrap"},children:"运行结束后自动发送"}),p.jsx("span",{className:"hv-err",onClick:()=>fe(null),style:{cursor:"pointer",color:"var(--t5)"},children:"✕"})]})}),p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 20px",flex:"none"},children:p.jsxs("div",{style:{..._l,background:"var(--card)",border:`1px solid ${Ke?"var(--err)":"var(--line)"}`,borderRadius:16,padding:"13px 16px"},children:[p.jsx("textarea",{ref:On,rows:1,value:W,placeholder:w.running?"补充说明…运行中发送会排队":"输入任务…",onChange:S=>X(S.target.value),onCompositionEnd:Ra,onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&!Aa(S)&&(S.preventDefault(),Nr())},style:{width:"100%",background:"none",border:"none",outline:"none",resize:"none",color:"var(--t1)",fontSize:13.5,lineHeight:1.6,maxHeight:160,padding:0,display:"block",boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12,fontSize:12,color:"var(--t5)"},children:[p.jsx("span",{children:"⏎ 发送 · ⇧⏎ 换行 · ⇧⇥ YOLO"}),Ke&&p.jsx("span",{style:{color:"var(--err)",whiteSpace:"nowrap"},children:"所有操作不经确认直接执行"}),p.jsx("div",{className:Ke?void 0:"hv-card2",title:"切换 YOLO 模式(⇧Tab):开启后所有操作不再询问,直接执行",onClick:()=>void Vt(),style:{marginLeft:"auto",padding:"4px 9px",borderRadius:7,cursor:"pointer",whiteSpace:"nowrap",fontSize:11.5,userSelect:"none",flex:"none",color:Ke?"var(--err)":"var(--t4)",background:Ke?"var(--delBg)":void 0},children:Ke?"⚡ YOLO":"默认权限"}),p.jsxs("div",{style:{position:"relative",flex:"none"},children:[p.jsxs("div",{className:w.running?void 0:"hv-card2",title:w.running?"轮次执行中,结束后可切换":"切换本会话模型(下一轮生效)",onClick:()=>!w.running&&ve(!Ve),style:{padding:"4px 9px",borderRadius:7,cursor:w.running?"default":"pointer",whiteSpace:"nowrap",fontSize:11.5,color:w.running?"var(--t5)":"var(--t4)",userSelect:"none"},children:[Un||"模型"," ▾"]}),Ve&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:()=>ve(!1)}),p.jsx("div",{style:{position:"absolute",bottom:32,right:0,width:220,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:12,boxShadow:"var(--shadow)",padding:6,zIndex:30,animation:"mcin .15s ease"},children:Wn.map(S=>p.jsxs("div",{className:"hv-card",onClick:()=>void bn(S.name),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 11px",borderRadius:8,cursor:"pointer",fontSize:12.5,color:S.name===Un?"var(--amberT)":"var(--t2)",fontWeight:S.name===Un?600:400,whiteSpace:"nowrap"},children:[S.name,p.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)",fontWeight:400},children:S.default?"默认":""})]},S.name))})]})]}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)"},children:Gt?`${La(Gt.used)} / ${La(Gt.size)}`:""}),p.jsx("div",{className:"hv-op",onClick:Nr,title:"发送",style:{width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:W.trim()?1:.4},children:"↑"})]})]})})]})}),K&&p.jsxs(p.Fragment,{children:[p.jsx("div",{onClick:()=>$(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,.3)",zIndex:35}}),p.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,width:600,maxWidth:"80vw",background:"var(--pop)",borderLeft:"1px solid var(--line)",boxShadow:"var(--shadow)",zIndex:36,display:"flex",flexDirection:"column",animation:"mcslide .22s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 20px 12px",flex:"none",whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:13.5,fontWeight:700,color:"var(--t1)"},children:["改动",A&&A.length>0?` · ${A.length} 个文件`:""]}),p.jsx("span",{className:"hv-t1",onClick:()=>$(!1),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),L&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--err)"},children:L}),A&&A.length===0&&!L&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--t5)"},children:"无改动(或非 git 仓库)"}),A&&A.length>0&&p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5,padding:"0 20px 12px",flex:"none"},children:A.map(S=>{const N=(se==null?void 0:se.path)===S.path;return p.jsxs("div",{className:"hv-cardh",onClick:()=>void ft(S.path),style:{display:"flex",alignItems:"center",gap:7,background:N?"var(--card2)":"transparent",border:"1px solid var(--line)",borderRadius:9,padding:"6px 11px",cursor:"pointer",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"700 11px "+Tt,color:S.status==="A"?"var(--ok)":S.status==="D"?"var(--err)":"var(--amberT)"},children:S.status}),p.jsx("span",{style:{font:"11.5px "+Tt,color:N?"var(--t1)":"var(--t3)"},children:Zf(S.path)})]},S.path)})}),se&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",borderTop:"1px solid var(--line)",flex:"none",whiteSpace:"nowrap",overflow:"hidden"},children:[p.jsx("span",{style:{font:"12.5px "+Tt,color:"var(--t1)"},children:Zf(se.path)}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:se.path})]}),p.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 0 20px"},children:p.jsx(Gm,{text:se.text})})]})]})]}),Ge&&p.jsx("div",{onClick:()=>vt(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:40,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsxs("div",{onClick:S=>S.stopPropagation(),style:{width:"min(860px, 92vw)",maxHeight:"84vh",background:"var(--pop)",border:"1px solid var(--line)",borderRadius:20,boxShadow:"var(--shadow)",padding:"22px 24px",display:"flex",flexDirection:"column",overflow:"hidden",animation:"mcin .2s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12,whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:15,fontWeight:700,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:["子代理会话 ",Ge]}),p.jsx("span",{className:"hv-t1",onClick:()=>vt(null),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),p.jsx(lg,{id:Ge})]})})]})}function lg({id:s}){const[i,a]=G.useState(jo),[c,f]=G.useState("连接中…");return G.useEffect(()=>{const h=ed(s,{onFrames:w=>a(v=>md(v,w)),onStatus:w=>f(w)});return()=>h.close()},[s]),p.jsxs("div",{style:{overflowY:"auto",flex:1,paddingRight:6,display:"flex",flexDirection:"column",gap:14,lineHeight:1.8},children:[p.jsx("div",{style:{color:"var(--t4)",fontSize:12},children:c}),p.jsx(gd,{items:i.items,onPermAnswer:()=>{}})]})}oh.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(rg,{})})); +`):"";function qm(s){const i={};for(const a of s){const c=a.name.trim();if(c)if(a.type==="stdio"){if(!a.command.trim())continue;const f=a.args.trim()?a.args.trim().split(/\s+/):void 0;i[c]={command:a.command.trim(),args:f,env:qf(a.kv)}}else{if(!a.url.trim())continue;i[c]={url:a.url.trim(),headers:qf(a.kv)}}}return i}function Xm(s){return Object.entries(s).map(([i,a])=>{const c=a??{},f=typeof c.command=="string"&&c.command!=="";return{name:i,type:f?"stdio":"http",url:typeof c.url=="string"?c.url:"",command:typeof c.command=="string"?c.command:"",args:Array.isArray(c.args)?c.args.map(String).join(" "):"",kv:Km(f?c.env:c.headers)}})}const Cl={width:588,maxWidth:"100%",background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:18,boxSizing:"border-box"},er={width:"100%",background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 11px",font:"11.5px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"},Xf={background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 8px",fontSize:12,color:"var(--t1)",outline:"none",cursor:"pointer"},_a={padding:"7px 14px",background:"var(--card2)",borderRadius:9,cursor:"pointer",fontSize:12,fontWeight:600,color:"var(--t2)",whiteSpace:"nowrap",userSelect:"none"};function Cn({label:s,children:i}){return p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:11,color:"var(--t4)",marginBottom:4},children:s}),i]})}function Jm(){try{return localStorage.getItem("mc.theme")==="light"?"light":"dark"}catch{return"dark"}}function Zm(s){document.documentElement.classList.toggle("light",s==="light");try{localStorage.setItem("mc.theme",s)}catch{}}function $m(){const[s,i]=G.useState(Jm()),a=f=>{Zm(f),i(f)},c=(f,h)=>p.jsx("div",{onClick:()=>a(f),style:{padding:"6px 18px",fontSize:12.5,fontWeight:600,borderRadius:8,cursor:"pointer",userSelect:"none",background:s===f?"var(--amber)":"transparent",color:s===f?"var(--onAmber)":"var(--t3)"},children:h});return p.jsxs("div",{style:{display:"inline-flex",background:"var(--card)",borderRadius:10,padding:3,gap:2},children:[c("dark","深色"),c("light","浅色")]})}const Jf=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),eg=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function tg({onClose:s}){const i=Ia(),[a,c]=G.useState([]),[f,h]=G.useState(0),[w,v]=G.useState([]),[_,k]=G.useState(!1),[A,F]=G.useState(""),[N,ee]=G.useState(!1);G.useEffect(()=>{i&&ph().then(Y=>{const H=(Y==null?void 0:Y.models)??[];c(H.length?H:[Jf()]),h(Math.max(0,H.findIndex(J=>J.default))),v(Xm((Y==null?void 0:Y.mcp_servers)??{})),k(!0)}).catch(Y=>F("读取配置失败: "+(Y instanceof Error?Y.message:String(Y))))},[i]);const W=(Y,H)=>c(J=>J.map((oe,fe)=>fe===Y?{...oe,...H}:oe)),q=(Y,H)=>v(J=>J.map((oe,fe)=>fe===Y?{...oe,...H}:oe)),ie=async()=>{for(const H of a)if(!H.name.trim()||!H.base_url.trim()||!H.api_key.trim()||!H.model.trim()){F(`模型「${H.name.trim()||"未命名"}」信息不完整(需名称/接口地址/API Key/模型标识)`);return}const Y=new Set;for(const H of a){if(Y.has(H.name.trim())){F(`模型名称重复: ${H.name.trim()}`);return}Y.add(H.name.trim())}F(""),ee(!0);try{await hh({models:a.map((H,J)=>({...H,name:H.name.trim(),default:J===f})),mcp_servers:qm(w)})}catch(H){F(H instanceof Error?H.message:String(H)),ee(!1)}};return p.jsx("div",{style:{flex:1,overflowY:"auto",animation:"mcin .25s ease"},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:14,padding:"40px 24px 60px"},children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center"},children:[p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"设置"}),p.jsx("div",{className:"hv-cardh",onClick:s,style:{..._a,marginLeft:"auto"},children:"返回"})]}),p.jsx("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"外观"})}),p.jsxs("div",{style:{...Cl,display:"flex",alignItems:"center",gap:12},children:[p.jsx($m,{}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"跟随本机保存,重启后保持。"})]}),!i&&p.jsx("div",{style:{...Cl,color:"var(--t4)",fontSize:12.5,lineHeight:1.7},children:"浏览器模式下配置只读:模型与 MCP 由启动 mc-agent 的宿主(桌面应用或环境变量)管理。"}),i&&!_&&!A&&p.jsx("div",{style:{fontSize:12.5,color:"var(--t5)"},children:"读取配置中…"}),i&&_&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"模型"}),p.jsx("div",{className:"hv-cardh",onClick:()=>c(Y=>[...Y,Jf()]),style:{..._a,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加模型"})]}),a.length===0&&p.jsx("div",{style:{...Cl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"还没有模型。保存后应用可运行,但需要添加模型才能开始任务。"}),a.map((Y,H)=>p.jsxs("div",{style:Cl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Cn,{label:"名称",children:p.jsx("input",{style:er,value:Y.name,placeholder:"如: 主力模型",onChange:J=>W(H,{name:J.target.value})})}),p.jsx(Cn,{label:"协议",children:p.jsxs("select",{style:{...Xf,width:"100%"},value:Y.provider||"anthropic",onChange:J=>W(H,{provider:J.target.value}),children:[p.jsx("option",{value:"anthropic",children:"anthropic"}),p.jsx("option",{value:"openai",children:"openai(Chat Completions)"}),p.jsx("option",{value:"openai_responses",children:"openai_responses(Responses)"})]})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:"接口地址",children:p.jsx("input",{style:er,value:Y.base_url,placeholder:"https://api.example.com",onChange:J=>W(H,{base_url:J.target.value})})})}),p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Cn,{label:"API Key",children:p.jsx("input",{style:er,type:"password",value:Y.api_key,placeholder:"sk-...",onChange:J=>W(H,{api_key:J.target.value})})}),p.jsx(Cn,{label:"模型标识",children:p.jsx("input",{style:er,value:Y.model,placeholder:"请求中的 model 字段",onChange:J=>W(H,{model:J.target.value})})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:12,fontSize:12},children:[H===f?p.jsx("span",{style:{color:"var(--amberT)",fontWeight:600},children:"✓ 默认模型"}):p.jsx("span",{className:"hv-t1",style:{color:"var(--t4)",cursor:"pointer"},onClick:()=>h(H),children:"设为默认"}),p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>{c(J=>J.filter((oe,fe)=>fe!==H)),h(J=>Hv(Y=>[...Y,eg()]),style:{..._a,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加 MCP"})]}),w.length===0&&p.jsx("div",{style:{...Cl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"未配置 MCP 服务器(可选)。项目级 .mc-agent/mcp.json 仍随仓库生效。"}),w.map((Y,H)=>p.jsxs("div",{style:Cl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Cn,{label:"名称",children:p.jsx("input",{style:er,value:Y.name,placeholder:"如: context7",onChange:J=>q(H,{name:J.target.value})})}),p.jsx(Cn,{label:"类型",children:p.jsxs("select",{style:{...Xf,width:"100%"},value:Y.type,onChange:J=>q(H,{type:J.target.value}),children:[p.jsx("option",{value:"http",children:"HTTP(URL)"}),p.jsx("option",{value:"stdio",children:"stdio(本地命令)"})]})})]}),Y.type==="http"?p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:"URL",children:p.jsx("input",{style:er,value:Y.url,placeholder:"https://mcp.example.com/mcp",onChange:J=>q(H,{url:J.target.value})})})}):p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Cn,{label:"命令",children:p.jsx("input",{style:er,value:Y.command,placeholder:"npx",onChange:J=>q(H,{command:J.target.value})})}),p.jsx(Cn,{label:"参数(空格分隔)",children:p.jsx("input",{style:er,value:Y.args,placeholder:"@playwright/mcp",onChange:J=>q(H,{args:J.target.value})})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Cn,{label:Y.type==="http"?"Headers(每行 KEY=VALUE)":"环境变量(每行 KEY=VALUE)",children:p.jsx("textarea",{style:{...er,resize:"vertical"},rows:2,value:Y.kv,onChange:J=>q(H,{kv:J.target.value})})})}),p.jsx("div",{style:{display:"flex",marginTop:12,fontSize:12},children:p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>v(J=>J.filter((oe,fe)=>fe!==H)),children:"删除"})})]},H)),p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",gap:12,marginTop:16},children:[p.jsx("div",{className:"hv-op",onClick:()=>!N&&void ie(),style:{padding:"9px 22px",borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",fontWeight:700,fontSize:13,cursor:"pointer",opacity:N?.5:1,userSelect:"none"},children:N?"保存并重启内核中…":"保存"}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"保存后内核自动重启,会话在磁盘不丢失。"})]})]}),A&&p.jsx("div",{style:{width:588,maxWidth:"100%",fontSize:12.5,color:"var(--err)"},children:A})]})})}let vd=-1/0;const Ra=s=>{vd=s.timeStamp},Aa=s=>s.nativeEvent.isComposing||s.timeStamp-vd<100,La=s=>s>=1e3?Math.round(s/100)/10+"k":String(s),Zf=s=>s.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||s,vi="~/MonkeyCode";function ng(s){var c;const i=new Map;for(const f of s){const h=((c=f.worktree)==null?void 0:c.repo)||f.workdir,w=i.get(h);w?w.push(f):i.set(h,[f])}const a=[...i.entries()].map(([f,h])=>{var w;return h.sort((v,_)=>(_.updated_at??"").localeCompare(v.updated_at??"")),{dir:f,name:f.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||f,latest:((w=h[0])==null?void 0:w.updated_at)??"",items:h}});return a.sort((f,h)=>h.latest.localeCompare(f.latest)),a}const _l={width:720,maxWidth:"100%"};function rg(){var Vn,rn,Xr;const[s,i]=G.useState([]),[a,c]=G.useState(null),[f,h]=G.useState("new"),[w,v]=G.useState(jo),[_,k]=G.useState("未连接"),[A,F]=G.useState(null),[N,ee]=G.useState(""),[W,q]=G.useState(!1),[ie,Y]=G.useState(null),[H,J]=G.useState(""),[oe,fe]=G.useState(null),[de,Te]=G.useState(""),[Ge,vt]=G.useState(null),[Fe,$t]=G.useState([]),[be,Xe]=G.useState(""),[Ke,He]=G.useState(!1),[Ve,ve]=G.useState(!1),[b,te]=G.useState(null),[B,y]=G.useState(vi),[I,ue]=G.useState(!1),[ce,he]=G.useState(""),[me,Se]=G.useState(""),[ge,Ee]=G.useState(""),[lt,we]=G.useState(!1),[rr,Ce]=G.useState(!1),[Pn,Le]=G.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("mc.collapsedGroups")||"[]"))}catch{return new Set}}),[dn,lr]=G.useState(()=>localStorage.getItem("mc.archivedOpen")==="1"),Wt=()=>{lr(S=>(localStorage.setItem("mc.archivedOpen",S?"0":"1"),!S))},ir=S=>{Le(L=>{const Z=new Set(L);return Z.has(S)?Z.delete(S):Z.add(S),localStorage.setItem("mc.collapsedGroups",JSON.stringify([...Z])),Z})},Ne=G.useRef(null),Ht=G.useRef(null),On=G.useRef(null),jt=G.useRef(null),zt=G.useRef(!0),Pt=G.useRef(null),pn=G.useRef(!1),ct=G.useCallback(async()=>{const S=await sh();return i(S),S},[]),Ot=G.useCallback(async()=>{const S=Ne.current;if(!S)return[];try{const L=await S.call("repo_file_changes");if(L.error)return ee(L.error),F([]),[];ee("");const Z=L.result??[];return F(Z),Z}catch(L){return ee(L instanceof Error?L.message:String(L)),F([]),[]}},[]),Mn=async S=>{try{await fh(S.id,!S.archived),await ct()}catch(L){k("⚠ 归档失败: "+(L instanceof Error?L.message:String(L)))}},Ct=async S=>{var L;try{await ch(S.id)}catch(Z){k("⚠ 删除失败: "+(Z instanceof Error?Z.message:String(Z)));return}S.id===a&&((L=Ne.current)==null||L.close(),Ne.current=null,c(null),h("new"),v(jo),F(null),ee(""),q(!1),Y(null),ve(!1),fe(null),Xe(""),He(!1),k("未连接"),localStorage.removeItem("mc.lastSession")),ct()},_t=G.useCallback((S,L,Z)=>{var Qe;(Qe=Ne.current)==null||Qe.close(),c(S),h("session"),v(jo),F(null),ee(""),q(!1),Y(null),ve(!1),fe(null),Xe(L??""),He(Z==="yolo"),localStorage.setItem("mc.lastSession",S),Ne.current=ed(S,{onFrames:dt=>v(_n=>md(_n,dt)),onStatus:dt=>k(dt)}),ct()},[ct]);G.useEffect(()=>{const S=gh("open-settings",()=>h("settings"));return Promise.all([ah().catch(()=>[]),ct()]).then(([L,Z])=>{var _n;$t(L),he(((_n=L.find(Qn=>Qn.default))==null?void 0:_n.name)??"");const Qe=localStorage.getItem("mc.lastSession"),dt=Z.find(Qn=>Qn.id===Qe);dt&&_t(dt.id,dt.model,dt.mode),L.length===0&&Ia()&&h("settings")}).catch(L=>k("无法连接服务: "+(L instanceof Error?L.message:L))),()=>{var L;S(),(L=Ne.current)==null||L.close()}},[]),G.useEffect(()=>{w.model&&Xe(w.model)},[w.model]),G.useEffect(()=>{w.permMode&&He(w.permMode==="yolo")},[w.permMode]);const Dn=((Vn=[...s].sort((S,L)=>(L.updated_at??"").localeCompare(S.updated_at??""))[0])==null?void 0:Vn.workdir)??"";G.useEffect(()=>{pn.current||y(Dn||vi)},[Dn]);const Fn=_.startsWith("已连接");G.useEffect(()=>{var L;if(!Fn)return;Ot();const S=Pt.current;S&&((L=Ne.current)!=null&&L.send("user-input",{content:xi(S)}))&&(Pt.current=null)},[Fn,Ot]),G.useEffect(()=>{w.turnEnded&&(v(S=>({...S,turnEnded:!1})),Ot(),ct())},[w.turnEnded,Ot,ct]),G.useEffect(()=>{var S;w.running||!oe||(S=Ne.current)!=null&&S.send("user-input",{content:xi(oe)})&&fe(null)},[w.running,oe]),G.useEffect(()=>{const S=Ht.current;S&&zt.current&&(S.scrollTop=S.scrollHeight)},[w.items,w.running]),G.useEffect(()=>{const S=On.current;S&&(S.style.height="auto",S.style.height=Math.min(S.scrollHeight,160)+"px")},[H]);const Lr=()=>{const S=Ht.current;S&&(zt.current=S.scrollHeight-S.scrollTop-S.clientHeight<40)},Nr=()=>{const S=H.trim();if(!(!S||!Ne.current)){if(w.running){fe(S),J("");return}Ne.current.send("user-input",{content:xi(S)})&&J("")}},hn=(S,L)=>{var Qe;const Z=L!=="deny";(Qe=Ne.current)!=null&&Qe.send("permission-resp",{id:S,approved:Z,remember:L==="always"||L==="persist",persist:L==="persist"})&&v(dt=>Fm(dt,S,Z))},bn=async S=>{if(ve(!1),!(!Ne.current||!S||S===be))try{const L=await Ne.current.call("session_set_model",{model:S});if(L.error){k("⚠ 切换模型失败: "+L.error);return}Xe(S),ct()}catch(L){k("⚠ 切换模型失败: "+(L instanceof Error?L.message:L))}},Vt=async()=>{if(!Ne.current)return;const S=Ke,L=S?"default":"yolo";He(!S);try{const Z=await Ne.current.call("session_set_mode",{mode:L});Z.error&&(He(S),k("⚠ 切换权限模式失败: "+Z.error))}catch(Z){He(S),k("⚠ 切换权限模式失败: "+(Z instanceof Error?Z.message:Z))}},ft=async S=>{var L;Y({path:S,text:"加载中…"});try{const Z=await Ne.current.call("repo_file_diff",{path:S});Y({path:S,text:Z.error?"✗ "+Z.error:((L=Z.result)==null?void 0:L.diff)||"(无差异)"})}catch(Z){Y({path:S,text:"✗ "+(Z instanceof Error?Z.message:Z)})}},Bn=()=>{q(!0),Ot().then(S=>{S.length?ft(S[0].path):Y(null)})},Qt=async(S=!1)=>{const L=B.trim();if(!(!L||rr)){Ce(!0),Ee(""),we(!1);try{const Z=await uh(L,ce,S||L===vi),Qe=me.trim();Qe&&(Pt.current=Qe),Se(""),await ct(),_t(Z.id,Z.model,Z.mode)}catch(Z){const Qe=Z instanceof Error?Z.message:String(Z);Ee("创建失败: "+Qe),Qe.includes("目录不存在")&&we(!0)}finally{Ce(!1)}}},mn=async()=>{const S=await dh();S&&(pn.current=!0,y(S),Ee(""),we(!1))},Yt=s.find(S=>S.id===a),Un=be||((rn=Fe.find(S=>S.default))==null?void 0:rn.name)||"",Wn=be&&!Fe.some(S=>S.name===be)?[...Fe,{name:be,default:!1}]:Fe,Gt=w.usage,tt=[...w.items].reverse().find(S=>S.kind==="perm"&&S.state==="open"),en=w.items.some(S=>S.kind==="tool"&&S.status==="run"),or=tt?"等待权限确认":en?"执行中":"思考中",gn=Math.max(1,w.items.filter(S=>S.kind==="user").length),Hn=de.trim().toLowerCase(),tn=(Hn?s.filter(S=>(S.title||"").toLowerCase().includes(Hn)||S.workdir.toLowerCase().includes(Hn)):s).slice().sort((S,L)=>(L.updated_at??"").localeCompare(S.updated_at??"")),Ir=tn.filter(S=>!S.archived),nn=tn.filter(S=>S.archived),vn=f==="new"||a===null;return G.useEffect(()=>{const S=L=>{var Z;if((L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"){L.preventDefault(),(Z=jt.current)==null||Z.focus();return}if(L.key==="Tab"&&L.shiftKey&&f==="session"&&a){L.preventDefault(),Vt();return}if(L.key==="Escape"){if(Ve)return ve(!1);if(Ge)return vt(null);if(W)return q(!1);if(f==="settings")return h(a?"session":"new");tt&&hn(tt.id,"deny");return}if(L.key==="Enter"&&!L.isComposing&&tt&&!vn){const Qe=L.target;if(Qe&&(Qe.tagName==="TEXTAREA"||Qe.tagName==="INPUT")&&H.trim())return;L.preventDefault(),hn(tt.id,"allow")}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)}),p.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",background:"var(--bg)",color:"var(--t2)",fontSize:13.5,overflow:"hidden",position:"relative"},children:[p.jsxs("div",{style:{width:292,flex:"none",display:"flex",flexDirection:"column",background:"var(--side)",borderRight:"1px solid var(--line)",minWidth:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"20px 18px 14px"},children:[p.jsx("img",{src:Kf,alt:"",draggable:!1,style:{width:28,height:28,borderRadius:9,flex:"none"}}),p.jsx("div",{style:{fontWeight:700,fontSize:14.5,color:"var(--t1)",letterSpacing:"-.01em"},children:"MonkeyCode"})]}),p.jsx("div",{style:{padding:"0 14px 12px"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:"var(--card)",borderRadius:9,padding:"0 11px"},children:[p.jsx("span",{style:{color:"var(--t4)",fontSize:12},children:"⌕"}),p.jsx("input",{ref:jt,value:de,onChange:S=>Te(S.target.value),placeholder:"搜索会话",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:12.5,padding:"8px 0",minWidth:0}}),p.jsx("span",{style:{font:"10px "+Tt,color:"var(--t5)"},children:"⌘K"})]})}),p.jsxs("div",{style:{padding:"0 14px",flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 8px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"云端任务"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"跑在服务器"})]}),p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有云端任务。长任务可以派发到服务器上跑,关掉客户端也会继续。"})]}),p.jsx("div",{style:{padding:"16px 14px 0",flex:"none"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 6px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"本地会话"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"这台电脑"}),p.jsx("span",{className:"hv-cardh",title:"新建任务",onClick:()=>{h("new"),ve(!1)},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",userSelect:"none"},children:"+"})]})}),p.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 14px"},children:[s.length===0&&p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有会话。在右侧输入第一个任务开始。"}),s.length>0&&tn.length===0&&p.jsxs("div",{style:{padding:"2px 4px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:["没有匹配「",de.trim(),"」的会话。"]}),ng(Ir).map(S=>p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{title:S.dir,onClick:()=>ir(S.dir),onMouseEnter:()=>te(S.dir),onMouseLeave:()=>te(null),style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:Pn.has(S.dir)?"▶":"▼"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:S.items.length}),p.jsx("span",{className:"hv-t1",title:"在 "+S.dir+" 新建会话",onClick:L=>{L.stopPropagation(),pn.current=!0,y(S.dir),ue(!1),h("new")},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",visibility:b===S.dir?"visible":"hidden"},children:"+"})]}),!Pn.has(S.dir)&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:S.items.map(L=>p.jsx(Vf,{meta:L,active:L.id===a&&f==="session",onClick:()=>_t(L.id,L.model,L.mode),onArchive:()=>void Mn(L),onDelete:()=>void Ct(L)},L.id))})]},S.dir)),nn.length>0&&p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{onClick:Wt,style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:dn?"▼":"▶"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t5)"},children:"已归档"}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:nn.length})]}),dn&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:nn.map(S=>p.jsx(Vf,{meta:S,active:S.id===a&&f==="session",onClick:()=>_t(S.id,S.model,S.mode),onArchive:()=>void Mn(S),onDelete:()=>void Ct(S)},S.id))})]})]}),p.jsxs("div",{style:{padding:"14px 18px",display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",borderTop:"1px solid var(--line)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Fn?"var(--ok)":"var(--t5)",flex:"none"}}),p.jsx("span",{title:_,style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:_}),p.jsx("span",{className:"hv-t1",title:"设置",onClick:()=>{ve(!1),h("settings")},style:{marginLeft:"auto",cursor:"pointer",fontSize:15},children:"⚙"})]})]}),p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:f==="settings"?p.jsx(tg,{onClose:()=>h(a?"session":"new")}):vn?p.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,animation:"mcin .25s ease",padding:"0 24px"},children:[s.length===0?p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,marginBottom:2},children:[p.jsx("img",{src:Kf,alt:"",draggable:!1,style:{width:52,height:52,borderRadius:16}}),p.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"把第一个任务交给 MonkeyCode"}),p.jsxs("div",{style:{fontSize:13,color:"var(--t4)",maxWidth:460,textAlign:"center",lineHeight:1.7},children:["描述你想做的事。工作目录"," ",p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t3)"},children:B||vi})," ","已自动准备好,也可以换成你的项目目录。"]})]}):p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"开始一个新任务"}),p.jsxs("div",{style:{display:"flex",gap:12,maxWidth:"100%",flexWrap:"wrap",justifyContent:"center"},children:[p.jsxs("div",{style:{width:288,border:"1px solid var(--amberBd)",borderRadius:16,background:"var(--amberBg)",padding:20,boxSizing:"border-box"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--amberT)",whiteSpace:"nowrap"},children:["⌂ 本地",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--amberBg)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"默认 ⏎"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在这台电脑上,直接读写本地文件;每步权限逐一确认。"}),I?p.jsx("input",{value:B,autoFocus:!0,onChange:S=>{pn.current=!0,y(S.target.value),Ee(""),we(!1)},onCompositionEnd:Ra,onKeyDown:S=>S.key==="Enter"&&!Aa(S)&&ue(!1),onBlur:()=>ue(!1),placeholder:"/home/you/dev/project",style:{width:"100%",marginTop:12,background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"7px 10px",font:"11px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"}}):p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:12,font:"11px "+Tt,color:"var(--t5)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:B}),B===vi&&p.jsx("span",{style:{flex:"none"},children:"· 自动创建"}),p.jsx("span",{className:"hv-t1",onClick:()=>ue(!0),style:{marginLeft:"auto",cursor:"pointer",flex:"none",font:"12px system-ui"},children:"更改"}),Ia()&&p.jsx("span",{className:"hv-t1",onClick:()=>void mn(),style:{cursor:"pointer",flex:"none",font:"12px system-ui"},children:"浏览…"})]})]}),p.jsxs("div",{style:{width:288,border:"1px solid var(--line)",borderRadius:16,background:"var(--card)",padding:20,boxSizing:"border-box",opacity:.7},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--t1)",whiteSpace:"nowrap"},children:["☁ 云端",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--card2)",color:"var(--t4)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"即将上线"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在云上服务器,关掉客户端也继续;完成后打包改动回来审查。"}),p.jsxs("div",{style:{display:"flex",font:"11px "+Tt,color:"var(--t5)",marginTop:12,whiteSpace:"nowrap"},children:["需要连接平台",p.jsx("span",{style:{marginLeft:"auto"},children:"长任务推荐"})]})]})]}),ge&&p.jsxs("div",{style:{..._l,width:588,fontSize:12,color:"var(--err)"},children:[ge,lt&&p.jsx("span",{className:"hv-op",onClick:()=>void Qt(!0),style:{cursor:"pointer",color:"var(--amberT)",marginLeft:8},children:"创建该目录并继续 →"})]}),p.jsxs("div",{style:{..._l,width:588,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("input",{value:me,autoFocus:!0,onChange:S=>Se(S.target.value),onCompositionEnd:Ra,onKeyDown:S=>S.key==="Enter"&&!Aa(S)&&void Qt(),placeholder:"描述任务…(可留空,先建会话)",style:{width:"100%",background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:13.5,boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:12,fontSize:12,color:"var(--t5)"},children:[Fe.length>1?p.jsx("select",{value:ce,onChange:S=>he(S.target.value),style:{background:"transparent",border:"none",outline:"none",color:"var(--t4)",fontSize:12,cursor:"pointer"},children:Fe.map(S=>p.jsxs("option",{value:S.name,children:[S.name,S.default?"(默认)":""]},S.name))}):p.jsx("span",{children:((Xr=Fe[0])==null?void 0:Xr.name)??""}),p.jsx("div",{className:"hv-op",onClick:()=>void Qt(),style:{marginLeft:"auto",width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:rr?.5:1},children:"↑"})]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 24px",height:56,flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,fontWeight:600,color:"var(--t1)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:(Yt==null?void 0:Yt.title)||"(未命名)"}),p.jsxs("span",{style:{font:"400 11px "+Tt,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["⌂ ",(Yt==null?void 0:Yt.workdir)??""]})]}),p.jsxs("div",{className:"hv-card",title:"查看本轮文件改动",onClick:Bn,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:8,cursor:"pointer",whiteSpace:"nowrap",fontSize:12,color:"var(--t3)",flex:"none",userSelect:"none"},children:[p.jsx("span",{style:{color:"var(--amberT)"},children:"⇄"})," 改动",A&&A.length>0?` · ${A.length}`:""]})]}),p.jsx("div",{style:{height:1,background:"var(--line)",margin:"0 24px",flex:"none"}}),p.jsx("div",{ref:Ht,onScroll:Lr,style:{flex:1,overflowY:"auto",display:"flex",justifyContent:"center"},children:p.jsx("div",{style:{..._l,maxWidth:"calc(100% - 48px)",padding:"28px 0 16px",display:"flex",flexDirection:"column",gap:18,lineHeight:1.8,height:"fit-content"},children:p.jsx(gd,{items:w.items,onPermAnswer:hn,onOpenChild:vt})})}),w.running&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{..._l,display:"flex",alignItems:"center",gap:10,fontSize:12.5,color:"var(--t3)",padding:"2px 0",boxSizing:"border-box"},children:[p.jsx("span",{style:{width:12,height:12,border:"2px solid var(--amber)",borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .8s linear infinite",flex:"none"}}),or,p.jsxs("span",{style:{color:"var(--t5)"},children:["· 第 ",gn," 轮",Gt?` · 已用 ${La(Gt.used)} tokens`:""]}),p.jsx("span",{className:"hv-cardh",onClick:()=>{var S;return(S=Ne.current)==null?void 0:S.send("user-cancel",{})},style:{marginLeft:"auto",padding:"5px 13px",background:"var(--card2)",borderRadius:8,color:"var(--err)",cursor:"pointer",fontWeight:600,whiteSpace:"nowrap"},children:"■ 停止"})]})}),oe&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{..._l,display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",background:"var(--card)",borderRadius:10,padding:"7px 13px",boxSizing:"border-box"},children:[p.jsx("span",{style:{animation:"mcpulse 1.2s infinite"},children:"⏳"}),"已排队:",p.jsx("span",{style:{color:"var(--t2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oe}),p.jsx("span",{style:{marginLeft:"auto",whiteSpace:"nowrap"},children:"运行结束后自动发送"}),p.jsx("span",{className:"hv-err",onClick:()=>fe(null),style:{cursor:"pointer",color:"var(--t5)"},children:"✕"})]})}),p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 20px",flex:"none"},children:p.jsxs("div",{style:{..._l,background:"var(--card)",border:`1px solid ${Ke?"var(--err)":"var(--line)"}`,borderRadius:16,padding:"13px 16px"},children:[p.jsx("textarea",{ref:On,rows:1,value:H,placeholder:w.running?"补充说明…运行中发送会排队":"输入任务…",onChange:S=>J(S.target.value),onCompositionEnd:Ra,onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&!Aa(S)&&(S.preventDefault(),Nr())},style:{width:"100%",background:"none",border:"none",outline:"none",resize:"none",color:"var(--t1)",fontSize:13.5,lineHeight:1.6,maxHeight:160,padding:0,display:"block",boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12,fontSize:12,color:"var(--t5)"},children:[p.jsx("span",{children:"⏎ 发送 · ⇧⏎ 换行 · ⇧⇥ YOLO"}),Ke&&p.jsx("span",{style:{color:"var(--err)",whiteSpace:"nowrap"},children:"所有操作不经确认直接执行"}),p.jsx("div",{className:Ke?void 0:"hv-card2",title:"切换 YOLO 模式(⇧Tab):开启后所有操作不再询问,直接执行",onClick:()=>void Vt(),style:{marginLeft:"auto",padding:"4px 9px",borderRadius:7,cursor:"pointer",whiteSpace:"nowrap",fontSize:11.5,userSelect:"none",flex:"none",color:Ke?"var(--err)":"var(--t4)",background:Ke?"var(--delBg)":void 0},children:Ke?"⚡ YOLO":"默认权限"}),p.jsxs("div",{style:{position:"relative",flex:"none"},children:[p.jsxs("div",{className:w.running?void 0:"hv-card2",title:w.running?"轮次执行中,结束后可切换":"切换本会话模型(下一轮生效)",onClick:()=>!w.running&&ve(!Ve),style:{padding:"4px 9px",borderRadius:7,cursor:w.running?"default":"pointer",whiteSpace:"nowrap",fontSize:11.5,color:w.running?"var(--t5)":"var(--t4)",userSelect:"none"},children:[Un||"模型"," ▾"]}),Ve&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:()=>ve(!1)}),p.jsx("div",{style:{position:"absolute",bottom:32,right:0,width:220,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:12,boxShadow:"var(--shadow)",padding:6,zIndex:30,animation:"mcin .15s ease"},children:Wn.map(S=>p.jsxs("div",{className:"hv-card",onClick:()=>void bn(S.name),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 11px",borderRadius:8,cursor:"pointer",fontSize:12.5,color:S.name===Un?"var(--amberT)":"var(--t2)",fontWeight:S.name===Un?600:400,whiteSpace:"nowrap"},children:[S.name,p.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)",fontWeight:400},children:S.default?"默认":""})]},S.name))})]})]}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)"},children:Gt?`${La(Gt.used)} / ${La(Gt.size)}`:""}),p.jsx("div",{className:"hv-op",onClick:Nr,title:"发送",style:{width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:H.trim()?1:.4},children:"↑"})]})]})})]})}),W&&p.jsxs(p.Fragment,{children:[p.jsx("div",{onClick:()=>q(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,.3)",zIndex:35}}),p.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,width:600,maxWidth:"80vw",background:"var(--pop)",borderLeft:"1px solid var(--line)",boxShadow:"var(--shadow)",zIndex:36,display:"flex",flexDirection:"column",animation:"mcslide .22s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 20px 12px",flex:"none",whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:13.5,fontWeight:700,color:"var(--t1)"},children:["改动",A&&A.length>0?` · ${A.length} 个文件`:""]}),p.jsx("span",{className:"hv-t1",onClick:()=>q(!1),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--err)"},children:N}),A&&A.length===0&&!N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--t5)"},children:"无改动(或非 git 仓库)"}),A&&A.length>0&&p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5,padding:"0 20px 12px",flex:"none"},children:A.map(S=>{const L=(ie==null?void 0:ie.path)===S.path;return p.jsxs("div",{className:"hv-cardh",onClick:()=>void ft(S.path),style:{display:"flex",alignItems:"center",gap:7,background:L?"var(--card2)":"transparent",border:"1px solid var(--line)",borderRadius:9,padding:"6px 11px",cursor:"pointer",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"700 11px "+Tt,color:S.status==="A"?"var(--ok)":S.status==="D"?"var(--err)":"var(--amberT)"},children:S.status}),p.jsx("span",{style:{font:"11.5px "+Tt,color:L?"var(--t1)":"var(--t3)"},children:Zf(S.path)})]},S.path)})}),ie&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",borderTop:"1px solid var(--line)",flex:"none",whiteSpace:"nowrap",overflow:"hidden"},children:[p.jsx("span",{style:{font:"12.5px "+Tt,color:"var(--t1)"},children:Zf(ie.path)}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:ie.path})]}),p.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 0 20px"},children:p.jsx(Gm,{text:ie.text})})]})]})]}),Ge&&p.jsx("div",{onClick:()=>vt(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:40,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsxs("div",{onClick:S=>S.stopPropagation(),style:{width:"min(860px, 92vw)",maxHeight:"84vh",background:"var(--pop)",border:"1px solid var(--line)",borderRadius:20,boxShadow:"var(--shadow)",padding:"22px 24px",display:"flex",flexDirection:"column",overflow:"hidden",animation:"mcin .2s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12,whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:15,fontWeight:700,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:["子代理会话 ",Ge]}),p.jsx("span",{className:"hv-t1",onClick:()=>vt(null),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),p.jsx(lg,{id:Ge})]})})]})}function lg({id:s}){const[i,a]=G.useState(jo),[c,f]=G.useState("连接中…");return G.useEffect(()=>{const h=ed(s,{onFrames:w=>a(v=>md(v,w)),onStatus:w=>f(w)});return()=>h.close()},[s]),p.jsxs("div",{style:{overflowY:"auto",flex:1,paddingRight:6,display:"flex",flexDirection:"column",gap:14,lineHeight:1.8},children:[p.jsx("div",{style:{color:"var(--t4)",fontSize:12},children:c}),p.jsx(gd,{items:i.items,onPermAnswer:()=>{}})]})}oh.createRoot(document.getElementById("root")).render(p.jsx(G.StrictMode,{children:p.jsx(rg,{})})); diff --git a/agent/ui/src/components.tsx b/agent/ui/src/components.tsx index 0393c876..92012311 100644 --- a/agent/ui/src/components.tsx +++ b/agent/ui/src/components.tsx @@ -60,6 +60,9 @@ export function SessionRow({ }) { const [hover, setHover] = useState(false); // WKWebView 的 CSS :hover 不可靠,用状态控制 const [menu, setMenu] = useState<"closed" | "open" | "confirm">("closed"); + // 菜单以 fixed 定位(脱离侧栏滚动容器的裁剪),按 ⋯ 的视口位置计算; + // 底部空间不足(列表末尾几行)时向上弹,避免被视口/状态栏遮住 + const [pos, setPos] = useState<{ right: number; top?: number; bottom?: number }>({ right: 0 }); const running = meta.status === "running"; const m = running ? { text: "运行中", color: "var(--amberT)" } @@ -120,7 +123,14 @@ export function SessionRow({ title="会话操作" onClick={(e) => { e.stopPropagation(); - setMenu(menu === "closed" ? "open" : "closed"); + if (menu !== "closed") return setMenu("closed"); + const r = (e.currentTarget as HTMLElement).getBoundingClientRect(); + const up = r.bottom + 150 > window.innerHeight; // 预估菜单高度(确认态更高) + setPos({ + right: Math.max(8, window.innerWidth - r.right), + ...(up ? { bottom: window.innerHeight - r.top + 4 } : { top: r.bottom + 4 }), + }); + setMenu("open"); }} style={{ marginLeft: "auto", @@ -150,9 +160,10 @@ export function SessionRow({ />